Skip to content

Low-level wrapper around the VIPhreeqc library. Most users should go through PhreeqPython instead.

viphreeqc.VIPhreeqc

Bases: object

Wrapper for the VIPhreeqc DLL.

Methods:

Attributes:

Attributes

column_count property

Get number of columns in selected output.

component_count property

Return the number of components.

debug = False instance-attribute

dll = phreeqc instance-attribute

id_ = self.create_iphreeqc() instance-attribute

phc_database_error_count = 0 instance-attribute

phc_error_count = 0 instance-attribute

phc_warning_count = 0 instance-attribute

row_count property

Get number of rows in selected output.

var = VAR() instance-attribute

Methods:

__init__(dll_path=None)

Connect to DLL and create IPhreeqc.

The optional dll_path takes a path to the IPhreeqc shared library. If not provided it tries to select an appropriate library. Make sure you have the right library for your operating system. You may download one from here: ftp://brrftp.cr.usgs.gov/pub/charlton/iphreeqc/

See the PhreeqPy documentation for help on compiling a IPhreeqc shared library.

accumulate_line(line)

Put line in input buffer.

add_error(phc_error_msg)

Add an error message to Phreeqc.

add_warning(phc_warn_msg)

Add an warning message to Phreeqc.

clear_accumlated_lines()

Clear the input buffer.

create_iphreeqc()

Create a IPhreeqc object.

destroy_iphreeqc()

Delete the current instance of IPhreeqc.

get_activity(solution, species)

get_component(index)

Get one component.

get_component_list()

Return all component names.

get_density(solution)

get_dump_string()

get_elements(solution)

get_elements_totals(solution)

Returns a list of elements and their totals

get_equilibrium_phase_component_moles(phase, component)

get_equilibrium_phase_components(phase)

get_equilibrium_phase_components_moles(phase)

get_error_string()

Retrieves the error messages.

get_gas_component_moles(gas, component)

get_gas_components(gas)

get_gas_components_fractions(gas)

get_gas_components_moles(gas)

get_gas_components_pressures(gas)

get_gas_pressure(gas)

get_gas_total_moles(gas)

get_gas_volume(gas)

get_mass(solution)

get_masters_species(solution)

get_molality(solution, species)

get_moles(solution, species)

get_mu(solution)

get_pe(solution)

get_ph(solution)

get_phases(solution)

get_phases_si(solution)

Returns a list of phases and their solubility index

get_sc(solution)

get_selected_output_array()

Get all values from selected output.

get_selected_output_column(col)

Get all values for one column from selected output.

get_selected_output_row(row)

Get all values for one from selected output.

get_selected_output_value(row, col)

Get one value from selected output at given row and column.

get_si(solution, phase)

get_solution_list()

get_species(solution)

get_species_activities(solution)

Returns a list of species and their molality

get_species_masters(solution)

Returns a dict of species and their masters

get_species_molalities(solution)

Returns a list of species and their molality

get_species_moles(solution)

Returns a list of species and their molarity

get_temperature(solution)

get_thickness(surface)

get_total(solution, element)

get_total_element(solution, element)

get_total_ion(solution, ion)

get_volume(solution)

load_database(database_name)

Load a database with given file_name.

load_database_string(input_string)

Load a datbase from a string.

raise_ipq_error(error_code) staticmethod

There was an error, raise an exception.

raise_string_error(errors)

Raise an exception with message from IPhreeqc error.

run_string(cmd_string)

Run PHREEQC input from string.

set_dump_string_off()

set_dump_string_on()

set_selected_output_file_off()

Turn on writing to selected output file.

set_selected_output_file_on()

Turn on writing to selected output file.

viphreeqc.PhreeqcException

Bases: Exception

Error in Phreeqc call.