Calculators to compute ionic strength and stoichiometric ionic strength. More...
#include <GeochemistryIonicStrength.h>
Public Member Functions | |
GeochemistryIonicStrength (Real max_ionic_strength, Real max_stoichiometric_ionic_strength, bool use_only_basis_molality, bool use_only_Cl_molality) | |
bool | operator== (const GeochemistryIonicStrength &rhs) const |
Real | ionicStrength (const ModelGeochemicalDatabase &mgd, const std::vector< Real > &basis_species_molality, const std::vector< Real > &eqm_species_molality, const std::vector< Real > &kin_species_molality) const |
Compute ionic strength. More... | |
Real | stoichiometricIonicStrength (const ModelGeochemicalDatabase &mgd, const std::vector< Real > &basis_species_molality, const std::vector< Real > &eqm_species_molality, const std::vector< Real > &kin_species_molality) const |
Compute stoichiometric ionic strength. More... | |
void | setMaxIonicStrength (Real max_ionic_strength) |
Set the maximum ionic strength. More... | |
Real | getMaxIonicStrength () const |
Return the value of maximum ionic strength. More... | |
void | setMaxStoichiometricIonicStrength (Real max_stoichiometric_ionic_strength) |
Set the maximum stoichiometric ionic strength. More... | |
Real | getMaxStoichiometricIonicStrength () const |
Return the value of maximum stoichiometric ionic strength. More... | |
void | setUseOnlyBasisMolality (bool use_only_basis_molality) |
Set the value of use_only_basis_molality. More... | |
Real | getUseOnlyBasisMolality () const |
Return the value of use_only_basis_molality. More... | |
void | setUseOnlyClMolality (bool use_only_Cl_molality) |
Set the value of use_only_Cl_molality. More... | |
Real | getUseOnlyClMolality () const |
Return the value of use_only_Cl_molality. More... | |
Private Attributes | |
Real | _max_ionic_strength |
maximum ionic strength More... | |
Real | _max_stoichiometric_ionic_strength |
maximum stoichiometric ionic strength More... | |
bool | _use_only_basis_molality |
use only basis molality in the ionic strength calculations More... | |
bool | _use_only_Cl_molality |
set the stoichiometric ionic strength to the Cl- molality More... | |
Calculators to compute ionic strength and stoichiometric ionic strength.
Definition at line 17 of file GeochemistryIonicStrength.h.
GeochemistryIonicStrength::GeochemistryIonicStrength | ( | Real | max_ionic_strength, |
Real | max_stoichiometric_ionic_strength, | ||
bool | use_only_basis_molality, | ||
bool | use_only_Cl_molality | ||
) |
max_ionic_strength | maximum value of ionic strength ever returned by this class |
max_stoichiometric_ionic_strength | maximum value of stoichiometric ionic strength ever returned by this class |
use_only_basis_molality | If true, use only the basis molalities in the ionic strength and stoichiometric ionic strength calculations. Since basis molality is usually much greater than equilibrium molality, and the whole concept of activity coefficients depending on ionic strength is only approximate in practice, setting use_only_basis_molality=true is often a reasonable approximation, and it can help with convergence of geochemistry algorithms since it eliminates problems associated with unphysical huge equilibrium molalities that can occur during Newton-iteration to the equilibrium solution |
use_only_Cl_molality | If true, set the stoichiometric ionic strength to the Chlorine- molality. Note that this is the method used by the Geochemists Workbench |
Definition at line 13 of file GeochemistryIonicStrength.C.
Real GeochemistryIonicStrength::getMaxIonicStrength | ( | ) | const |
Return the value of maximum ionic strength.
Definition at line 129 of file GeochemistryIonicStrength.C.
Real GeochemistryIonicStrength::getMaxStoichiometricIonicStrength | ( | ) | const |
Return the value of maximum stoichiometric ionic strength.
Definition at line 141 of file GeochemistryIonicStrength.C.
Real GeochemistryIonicStrength::getUseOnlyBasisMolality | ( | ) | const |
Return the value of use_only_basis_molality.
Definition at line 153 of file GeochemistryIonicStrength.C.
Referenced by TEST().
Real GeochemistryIonicStrength::getUseOnlyClMolality | ( | ) | const |
Return the value of use_only_Cl_molality.
Definition at line 165 of file GeochemistryIonicStrength.C.
Referenced by TEST().
Real GeochemistryIonicStrength::ionicStrength | ( | const ModelGeochemicalDatabase & | mgd, |
const std::vector< Real > & | basis_species_molality, | ||
const std::vector< Real > & | eqm_species_molality, | ||
const std::vector< Real > & | kin_species_molality | ||
) | const |
Compute ionic strength.
mgd | the Model Geochemical database |
basis_species_molality | Molalities of the basis species in mgd |
eqm_species_molality | Molalities of the equilibrium species in mgd |
kin_species_molality | Molalities of the kinetic species |
Definition at line 25 of file GeochemistryIonicStrength.C.
Referenced by GeochemicalSystem::getIonicStrength(), GeochemistryActivityCoefficientsDebyeHuckel::setInternalParameters(), GeochemicalSystem::surfacePotPrefactor(), and TEST().
|
inline |
Definition at line 39 of file GeochemistryIonicStrength.h.
Set the maximum ionic strength.
Definition at line 123 of file GeochemistryIonicStrength.C.
Referenced by GeochemicalSolver::solveSystem().
void GeochemistryIonicStrength::setMaxStoichiometricIonicStrength | ( | Real | max_stoichiometric_ionic_strength | ) |
Set the maximum stoichiometric ionic strength.
Definition at line 135 of file GeochemistryIonicStrength.C.
Referenced by GeochemicalSolver::solveSystem().
void GeochemistryIonicStrength::setUseOnlyBasisMolality | ( | bool | use_only_basis_molality | ) |
Set the value of use_only_basis_molality.
Definition at line 147 of file GeochemistryIonicStrength.C.
void GeochemistryIonicStrength::setUseOnlyClMolality | ( | bool | use_only_Cl_molality | ) |
Set the value of use_only_Cl_molality.
Definition at line 159 of file GeochemistryIonicStrength.C.
Real GeochemistryIonicStrength::stoichiometricIonicStrength | ( | const ModelGeochemicalDatabase & | mgd, |
const std::vector< Real > & | basis_species_molality, | ||
const std::vector< Real > & | eqm_species_molality, | ||
const std::vector< Real > & | kin_species_molality | ||
) | const |
Compute stoichiometric ionic strength.
mgd | the Model Geochemical database |
basis_species_molality | Molalities of the basis species in mgd |
eqm_species_molality | Molalities of the equilibrium species in mgd |
kin_species_molality | Molalities of the kinetic species |
Definition at line 61 of file GeochemistryIonicStrength.C.
Referenced by GeochemicalSystem::getStoichiometricIonicStrength(), GeochemistryActivityCoefficientsDebyeHuckel::setInternalParameters(), and TEST().
|
private |
maximum ionic strength
Definition at line 99 of file GeochemistryIonicStrength.h.
Referenced by getMaxIonicStrength(), ionicStrength(), operator==(), and setMaxIonicStrength().
|
private |
maximum stoichiometric ionic strength
Definition at line 102 of file GeochemistryIonicStrength.h.
Referenced by getMaxStoichiometricIonicStrength(), operator==(), setMaxStoichiometricIonicStrength(), and stoichiometricIonicStrength().
|
private |
use only basis molality in the ionic strength calculations
Definition at line 105 of file GeochemistryIonicStrength.h.
Referenced by getUseOnlyBasisMolality(), ionicStrength(), operator==(), setUseOnlyBasisMolality(), and stoichiometricIonicStrength().
|
private |
set the stoichiometric ionic strength to the Cl- molality
Definition at line 108 of file GeochemistryIonicStrength.h.
Referenced by getUseOnlyClMolality(), operator==(), setUseOnlyClMolality(), and stoichiometricIonicStrength().