Reaktoro  v2.11.0
A unified framework for modeling chemically reactive systems
Phreeqc Class Reference

Public Member Functions

 Phreeqc ()
 Construct a default Phreeqc instance.
 
 Phreeqc (String database)
 Construct a Phreeqc instance with given PHREEQC database. More...
 
virtual ~Phreeqc ()
 Destroy this Phreeqc instance.
 
virtual auto temperature () const -> double
 Return the temperature (in units of K)
 
virtual auto pressure () const -> double
 Return the pressure (in units of Pa)
 
virtual auto speciesAmounts () const -> ArrayXd
 Return the amounts of the species (in units of mol)
 
virtual auto numElements () const -> unsigned
 Return the number of elements.
 
virtual auto numSpecies () const -> unsigned
 Return the number of species.
 
virtual auto numPhases () const -> unsigned
 Return the number of phases.
 
virtual auto numSpeciesInPhase (Index iphase) const -> unsigned
 Return the number of species in a phase.
 
virtual auto elementName (Index ielement) const -> String
 Return the name of an element.
 
virtual auto elementMolarMass (Index ielement) const -> double
 Return the molar mass of an element (in units of kg/mol)
 
virtual auto elementStoichiometry (Index ispecies, Index ielement) const -> double
 Return the stoichiometry of an element in a species.
 
virtual auto speciesName (Index ispecies) const -> String
 Return the name of a species.
 
virtual auto phaseName (Index iphase) const -> String
 Return the name of a phase.
 
auto set (double T, double P) -> void
 Set the temperature and pressure of the interfaced code. More...
 
auto set (double T, double P, ArrayXdConstRef n) -> void
 Set the temperature, pressure and species composition of the interfaced code. More...
 
auto load (String database) -> void
 Load a PHREEQC database. More...
 
auto execute (String input, String output) -> void
 Execute a PHREEQC input script either provided as a file or input string. More...
 
auto execute (String input) -> void
 Execute a PHREEQC input script either provided as a file or input string. More...
 
auto reset () -> void
 Reset this Phreeqc instance to a clean state. More...
 
auto reactions () const -> const Vec< Pairs< String, double >> &
 Return the system of reactions.
 
auto stoichiometricMatrix () const -> MatrixXd
 Return the stoichiometric matrix of the system of reactions.
 
auto standardMolarGibbsEnergies () const -> ArrayXd
 Return the standard molar Gibbs free energies of the species (in units of J/mol)
 
auto standardMolarEnthalpies () const -> ArrayXd
 Return the standard molar enthalpies of the species (in units of J/mol)
 
auto standardMolarVolumes () const -> ArrayXd
 Return the standard molar volumes of the species (in units of m3/mol)
 
auto standardMolarHeatCapacitiesConstP () const -> ArrayXd
 Return the standard molar isobaric heat capacities of the species (in units of J/(mol*K))
 
auto standardMolarHeatCapacitiesConstV () const -> ArrayXd
 Return the standard molar isochoric heat capacities of the species (in units of J/(mol*K))
 
auto lnActivityCoefficients () const -> ArrayXd
 Return the ln activity coefficients of the species.
 
auto lnActivityConstants () const -> ArrayXd
 Return the ln activity contants of the species.
 
auto lnActivities () const -> ArrayXd
 Return the ln activities of the species.
 
auto lnEquilibriumConstants () const -> ArrayXd
 Return the ln equilibrium constants of the reactions.
 
auto phaseMolarVolumes () const -> ArrayXd
 Return the molar volumes of the phases.
 
auto phreeqc () -> PHREEQC &
 Return a reference to the low-level Phreeqc instance.
 
auto phreeqc () const -> const PHREEQC &
 Return a const reference to the low-level Phreeqc instance.
 

Constructor & Destructor Documentation

◆ Phreeqc()

Phreeqc ( String  database)

Construct a Phreeqc instance with given PHREEQC database.

Parameters
databaseThe name of the database file

Member Function Documentation

◆ set() [1/2]

auto set ( double  T,
double  P 
) -> void

Set the temperature and pressure of the interfaced code.

This method should be used to update all thermodynamic properties that depend only on temperature and pressure, such as standard thermodynamic properties of the species.

Parameters
TThe temperature (in units of K)
PThe pressure (in units of Pa)

◆ set() [2/2]

auto set ( double  T,
double  P,
ArrayXdConstRef  n 
) -> void

Set the temperature, pressure and species composition of the interfaced code.

This method should be used to update all thermodynamic properties that depend only on temperature and pressure, such as standard thermodynamic properties of the species, as well as chemical properties that depend on the composition of the species.

Parameters
TThe temperature (in units of K)
PThe pressure (in units of Pa)
nThe composition of the species (in units of mol)

◆ load()

auto load ( String  database) -> void

Load a PHREEQC database.

This method will initialize the Phreeqc instance with all species and reactions found in the given database. To execute a Phreeqc script file, check the execute method.

See also
execute
Parameters
databaseThe path to the database file.

◆ execute() [1/2]

auto execute ( String  input,
String  output 
) -> void

Execute a PHREEQC input script either provided as a file or input string.

This method will execute the given PHREEQC input script and put this Phreeqc instance in a state with active species and phases from the last PHREEQC calculation specified in the script file. This can then be used to initialize a ChemicalSystem instance with such configuration.

Parameters
inputThe input either as a filename or as an input script coded in a string.
outputThe name of the file where the result should be output

◆ execute() [2/2]

auto execute ( String  input) -> void

Execute a PHREEQC input script either provided as a file or input string.

Parameters
inputThe input either as a filename or as an input script coded in a string.

◆ reset()

auto reset ( ) -> void

Reset this Phreeqc instance to a clean state.

After this Phreeqc instance is reset, one must again load a new database and execute a new input script file.

See also
load, execute

The documentation for this class was generated from the following file: