Reaktoro 
A unified framework for modeling chemically reactive systems
Reaktoro::Phreeqc Class Reference
Inheritance diagram for Reaktoro::Phreeqc:
Collaboration diagram for Reaktoro::Phreeqc:

Public Member Functions

 Phreeqc ()
 Construct a default Phreeqc instance.
 
 Phreeqc (std::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 -> Vector
 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 -> std::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 -> std::string
 Return the name of a species.
 
virtual auto phaseName (Index iphase) const -> std::string
 Return the name of a phase.
 
virtual auto properties (Index iphase, double T, double P) -> PhaseThermoModelResult
 Return the thermodynamic properties of a phase. More...
 
virtual auto properties (Index iphase, double T, double P, const Vector &nphase) -> PhaseChemicalModelResult
 Return the chemical properties of a phase. More...
 
virtual auto clone () const -> std::shared_ptr< Interface >
 Return a clone of this Phreeqc instance.
 
auto set (double T, double P) -> void
 Set the temperature and pressure of the interfaced code. More...
 
auto set (double T, double P, const Vector &n) -> void
 Set the temperature, pressure and species composition of the interfaced code. More...
 
auto load (std::string database) -> void
 Load a PHREEQC database. More...
 
auto execute (std::string input, std::string output) -> void
 Execute a PHREEQC input script either provided as a file or input string. More...
 
auto execute (std::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 -> std::vector< ReactionEquation >
 Return the system of reactions.
 
auto stoichiometricMatrix () const -> Matrix
 Return the stoichiometric matrix of the system of reactions.
 
auto standardMolarGibbsEnergies () const -> Vector
 Return the standard molar Gibbs free energies of the species (in units of J/mol)
 
auto standardMolarEnthalpies () const -> Vector
 Return the standard molar enthalpies of the species (in units of J/mol)
 
auto standardMolarVolumes () const -> Vector
 Return the standard molar volumes of the species (in units of m3/mol)
 
auto standardMolarHeatCapacitiesConstP () const -> Vector
 Return the standard molar isobaric heat capacities of the species (in units of J/(mol*K))
 
auto standardMolarHeatCapacitiesConstV () const -> Vector
 Return the standard molar isochoric heat capacities of the species (in units of J/(mol*K))
 
auto lnActivityCoefficients () const -> Vector
 Return the ln activity coefficients of the species.
 
auto lnActivityConstants () const -> Vector
 Return the ln activity contants of the species.
 
auto lnActivities () const -> Vector
 Return the ln activities of the species.
 
auto lnEquilibriumConstants () const -> Vector
 Return the ln equilibrium constants of the reactions.
 
auto phaseMolarVolumes () const -> Vector
 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.
 
- Public Member Functions inherited from Reaktoro::Interface
virtual ~Interface ()=0
 Virtual destructor.
 
auto formulaMatrix () const -> Matrix
 Return the formula matrix of the species.
 
auto indexElement (std::string element) const -> Index
 Return the index of an element.
 
auto indexSpecies (std::string species) const -> Index
 Return the index of a species.
 
auto indexPhase (std::string phase) const -> Index
 Return the index of a phase.
 
auto indexPhaseWithSpecies (Index ispecies) const -> Index
 Return the index of the phase with a species.
 
auto indexFirstSpeciesInPhase (Index iphase) const -> Index
 Return the index of the first species in a phase.
 
auto system () const -> ChemicalSystem
 Return a ChemicalSystem instance created from an instance of a class derived from Interface.
 
auto state (const ChemicalSystem &system) const -> ChemicalState
 Return a ChemicalState instance created from an instance of a class derived from Interface. More...
 
 operator ChemicalSystem () const
 Convert the classes derived from Interface into a ChemicalSystem instance.
 

Constructor & Destructor Documentation

Reaktoro::Phreeqc::Phreeqc ( std::string  database)

Construct a Phreeqc instance with given PHREEQC database.

Parameters
databaseThe name of the database file

Member Function Documentation

virtual auto Reaktoro::Phreeqc::properties ( Index  iphase,
double  T,
double  P 
) -> PhaseThermoModelResult
virtual

Return the thermodynamic properties of a phase.

Parameters
iphaseThe index of the phase
TThe temperature (in units of K)
PThe pressure (in units of Pa)

Implements Reaktoro::Interface.

virtual auto Reaktoro::Phreeqc::properties ( Index  iphase,
double  T,
double  P,
const Vector nphase 
) -> PhaseChemicalModelResult
virtual

Return the chemical properties of a phase.

Parameters
iphaseThe index of the phase
TThe temperature (in units of K)
PThe pressure (in units of Pa)
nphaseThe amounts of the species in the phase (in units of mol)

Implements Reaktoro::Interface.

auto Reaktoro::Phreeqc::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)
auto Reaktoro::Phreeqc::set ( double  T,
double  P,
const Vector 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)
auto Reaktoro::Phreeqc::load ( std::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.
auto Reaktoro::Phreeqc::execute ( std::string  input,
std::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
auto Reaktoro::Phreeqc::execute ( std::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.
auto Reaktoro::Phreeqc::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 files:
  • Reaktoro/Interfaces/Phreeqc.hpp
  • Reaktoro/Interfaces/Phreeqc.cpp