Data structure to hold all relevant information from the database file. More...
#include <PertinentGeochemicalSystem.h>
Public Member Functions | |
ModelGeochemicalDatabase (const GeochemicalDatabaseReader &db) | |
Constructor sets original_database. More... | |
bool | operator== (const ModelGeochemicalDatabase &rhs) const |
Public Attributes | |
const GeochemicalDatabaseReader * | original_database |
a pointer to the original database used to build this ModelGeochemicalDatabase More... | |
std::unordered_map< std::string, unsigned > | basis_species_index |
basis_species_index[name] = index of the basis species, within all ModelGeochemicalDatabase internal datastrcutres, with given name More... | |
std::vector< std::string > | basis_species_name |
basis_species_name[j] = name of the j^th basis species More... | |
std::vector< bool > | basis_species_mineral |
basis_species_mineral[j] = true iff the j^th basis species is a mineral More... | |
std::vector< bool > | basis_species_gas |
basis_species_gas[j] = true iff the j^th basis species is a gas More... | |
std::vector< bool > | basis_species_transported |
basis_species_transported[j] = true iff the j^th basis species is transported in reactive-transport sims More... | |
std::vector< Real > | basis_species_charge |
all quantities have a charge (mineral charge = 0, gas charge = 0, oxide charge = 0) More... | |
std::vector< Real > | basis_species_radius |
all quantities have an ionic radius (Angstrom) for computing activity (mineral radius = 0, gas radius = 0, surface species radius = 0) More... | |
std::vector< Real > | basis_species_molecular_weight |
all quantities have a molecular weight (g) More... | |
std::vector< Real > | basis_species_molecular_volume |
all quantities have a molecular volume (cm^3) (only nonzero for minerals, however) More... | |
std::unordered_map< std::string, unsigned > | eqm_species_index |
eqm_species_index[name] = index of the equilibrium species (secondary aqueous species, redox couples in equilibrium with the aqueous solution, minerals in equilibrium with the aqueous solution, gases in equilibrium with the aqueous solution) within all ModelGeochemicalDatabase internal datastrcutres, with given name More... | |
std::vector< std::string > | eqm_species_name |
eqm_species_name[i] = name of the i^th eqm species More... | |
std::vector< bool > | eqm_species_mineral |
eqm_species_mineral[i] = true iff the i^th equilibrium species is a mineral More... | |
std::vector< bool > | eqm_species_gas |
eqm_species_gas[i] = true iff the i^th equilibrium species is a gas More... | |
std::vector< bool > | eqm_species_transported |
eqm_species_transported[i] = true iff the i^th eqm species is transported in reactive-transport sims More... | |
std::vector< Real > | eqm_species_charge |
all quantities have a charge (mineral charge = 0, gas charge = 0, oxide charge = 0) More... | |
std::vector< Real > | eqm_species_radius |
all quantities have an ionic radius (Angstrom) for computing activity (mineral radius = 0, gas radius = 0, surface species radius = 0) More... | |
std::vector< Real > | eqm_species_molecular_weight |
all quantities have a molecular weight (g) More... | |
std::vector< Real > | eqm_species_molecular_volume |
all quantities have a molecular volume (cm^3) (only nonzero for minerals, however) More... | |
DenseMatrix< Real > | eqm_stoichiometry |
eqm_stoichiometry(i, j) = stoichiometric coefficient for equilibrium species "i" in terms of the basis species "j" More... | |
DenseMatrix< Real > | eqm_log10K |
eqm_log10K(i, j) = log10(equilibrium constant) for i^th equilibrium species at the j^th temperature point More... | |
std::vector< std::string > | surface_sorption_name |
surface_sorption_name[k] = name of the mineral involved in surface sorption. More... | |
std::vector< Real > | surface_sorption_area |
surface_sorption_area[k] = specific surface area [m^2/g] for the k^th mineral involved in surface sorption. More... | |
std::vector< bool > | surface_sorption_related |
surface_sorption_related[j] = true iff the j^th equilibrium species is involved in surface sorption More... | |
std::vector< unsigned > | surface_sorption_number |
surface_sorption_number[j] = the index of the surface potential that should be used to modify the equilibrium constant for the j^th equilibrium species. More... | |
std::string | redox_lhs |
the name of the species on the left-hand side of the redox equations. More... | |
DenseMatrix< Real > | redox_stoichiometry |
redox_stoichiometry(i, j) = stoichiometric coefficients for i^th redox species that is in disequilibrium in terms of the j basis species. More... | |
DenseMatrix< Real > | redox_log10K |
redox_log10K(i, j) = log10(equilibrium constant) for i^th redox species at the j^th temperature point More... | |
std::unordered_map< std::string, SurfaceComplexationInfo > | surface_complexation_info |
Holds info on surface complexation, if any, in the model. More... | |
std::unordered_map< std::string, std::vector< Real > > | gas_chi |
Holds info on gas fugacity "chi" parameters. More... | |
std::unordered_map< std::string, unsigned > | kin_species_index |
kin_species_index[name] = index of the kinetic species, within all ModelGeochemicalDatabase internal datastrcutres, with given name More... | |
std::vector< std::string > | kin_species_name |
kin_species_name[j] = name of the j^th kinetic species More... | |
std::vector< bool > | kin_species_mineral |
kin_species_mineral[j] = true iff the j^th kinetic species is a mineral More... | |
std::vector< bool > | kin_species_transported |
kin_species_transported[j] = true iff the j^th kinetic species is transported in reactive-transport sims More... | |
std::vector< Real > | kin_species_charge |
all kinetic quantities have a charge (mineral charge = 0) More... | |
std::vector< Real > | kin_species_molecular_weight |
all quantities have a molecular weight (g/mol) More... | |
std::vector< Real > | kin_species_molecular_volume |
all quantities have a molecular volume (cm^3/mol) (only nonzero for minerals, however) More... | |
DenseMatrix< Real > | kin_log10K |
kin_log10K(i, j) = log10(equilibrium constant for the i^th kinetic species at the j^th temperature point More... | |
DenseMatrix< Real > | kin_stoichiometry |
kin_stoichiometry(i, j) = stoichiometric coefficient for kinetic species "i" in terms of the basis species "j" More... | |
std::vector< KineticRateDefinition > | kin_rate |
rates given to kinetic species. More... | |
std::vector< unsigned > | have_swapped_out_of_basis |
Species that have been swapped out of the basis. More... | |
std::vector< unsigned > | have_swapped_into_basis |
Species that have been swapped into the basis. More... | |
DenseMatrix< Real > | swap_to_original_basis |
Swap matrix that allows expression in terms of the original basis. More... | |
Data structure to hold all relevant information from the database file.
Generally, the database file contains information on a lot more species than any numerical model considers. The ModelGeochemicalDatabase only holds the minimal information required for the numerical model. It also holds the information as std::vector and DenseMatrix data structures for numerical efficiency. This makes the ModelGeochemicalDatabase a little more obscure compared with the database file, but considering this information is used hundreds, maybe millions, of times per node during a single timestep, numerical efficiency is paramount.
Definition at line 99 of file PertinentGeochemicalSystem.h.
|
inline |
Constructor sets original_database.
Also initializes swap_to_original_basis to "nothing" in an attempt to reduce memory consumption
Definition at line 105 of file PertinentGeochemicalSystem.h.
|
inline |
Definition at line 108 of file PertinentGeochemicalSystem.h.
std::vector<Real> ModelGeochemicalDatabase::basis_species_charge |
all quantities have a charge (mineral charge = 0, gas charge = 0, oxide charge = 0)
Definition at line 173 of file PertinentGeochemicalSystem.h.
Referenced by GeochemicalSystem::alterChargeBalanceSpecies(), GeochemistrySpeciesSwapper::alterMGD(), GeochemistryActivityCoefficientsDebyeHuckel::buildActivityCoefficients(), GeochemicalSystem::checkAndInitialize(), GeochemicalSystem::computeJacobian(), PertinentGeochemicalSystem::createModel(), GeochemicalSystem::enforceChargeBalance(), GeochemicalSystem::enforceChargeBalanceIfSimple(), GeochemicalSystem::getResidualComponent(), GeochemicalSystem::getTotalChargeOld(), GeochemistryIonicStrength::ionicStrength(), operator==(), GeochemistryIonicStrength::stoichiometricIonicStrength(), and TEST().
std::vector<bool> ModelGeochemicalDatabase::basis_species_gas |
basis_species_gas[j] = true iff the j^th basis species is a gas
Definition at line 167 of file PertinentGeochemicalSystem.h.
Referenced by GeochemicalSystem::addKineticRates(), GeochemistrySpeciesSwapper::alterMGD(), GeochemistryActivityCoefficientsDebyeHuckel::buildActivityCoefficients(), GeochemicalSystem::buildAlgebraicInfo(), GeochemicalSystem::changeConstraintToBulk(), GeochemicalSystem::checkAndInitialize(), PertinentGeochemicalSystem::createModel(), operator==(), GeochemistryConsoleOutput::output(), GeochemicalSystem::performSwap(), GeochemicalSystem::performSwapNoCheck(), GeochemicalSystem::setSolventMassAndFreeMolalityAndMineralMolesAndSurfacePotsAndKineticMoles(), GeochemicalSolver::swapNeeded(), TEST(), and GeochemicalSystem::updateBasisMolalityForKnownActivity().
std::unordered_map<std::string, unsigned> ModelGeochemicalDatabase::basis_species_index |
basis_species_index[name] = index of the basis species, within all ModelGeochemicalDatabase internal datastrcutres, with given name
Definition at line 158 of file PertinentGeochemicalSystem.h.
Referenced by PertinentGeochemicalSystem::addKineticRate(), GeochemistrySpeciesSwapper::alterMGD(), GeochemicalSystem::buildAlgebraicInfo(), PertinentGeochemicalSystem::buildRedoxeInfo(), GeochemicalSystem::checkAndInitialize(), GeochemistrySpeciesSwapper::checkSwap(), GeochemicalSystem::computeSorbingSurfaceArea(), GeochemistryQuantityAux::computeValue(), GeochemistrySpeciesSwapper::constructInverseMatrix(), PertinentGeochemicalSystem::createModel(), GeochemistryTimeDependentReactor::execute(), GeochemistrySpatialReactor::execute(), GeochemistryUnitConverter::fromMoles(), GeochemistryQuantityAux::GeochemistryQuantityAux(), GeochemistrySpatialReactor::GeochemistrySpatialReactor(), GeochemistryTimeDependentReactor::GeochemistryTimeDependentReactor(), GeochemicalModelInterrogator::knownActivity(), operator==(), GeochemistryConsoleOutput::output(), GeochemicalModelInterrogator::outputActivity(), GeochemicalModelInterrogator::outputTemperature(), GeochemistrySpeciesSwapper::performSwap(), GeochemicalSystem::performSwapNoCheck(), GeochemicalSystem::revertToOriginalChargeBalanceSpecies(), GeochemistryActivityCoefficientsDebyeHuckel::setInternalParameters(), GeochemicalSystem::setMineralRelatedFreeMoles(), GeochemicalSystem::setSolventMassAndFreeMolalityAndMineralMolesAndSurfacePotsAndKineticMoles(), GeochemistryIonicStrength::stoichiometricIonicStrength(), TEST(), and TEST_F().
std::vector<bool> ModelGeochemicalDatabase::basis_species_mineral |
basis_species_mineral[j] = true iff the j^th basis species is a mineral
Definition at line 164 of file PertinentGeochemicalSystem.h.
Referenced by AddGeochemistrySolverAction::act(), GeochemistrySpeciesSwapper::alterMGD(), GeochemistryActivityCoefficientsDebyeHuckel::buildActivityCoefficients(), GeochemicalSystem::buildAlgebraicInfo(), GeochemicalSystem::buildKnownBasisActivities(), GeochemicalSystem::checkAndInitialize(), GeochemicalSystem::computeBulkFromMolalities(), GeochemicalSystem::computeFreeMineralMoles(), GeochemicalSystem::computeTransportedBulkFromMolalities(), PertinentGeochemicalSystem::createModel(), GeochemistryUnitConverter::fromMoles(), GeochemistryQuantityAux::GeochemistryQuantityAux(), GeochemistryTimeDependentReactor::GeochemistryTimeDependentReactor(), GeochemicalModelInterrogator::knownActivity(), operator==(), GeochemistryConsoleOutput::output(), GeochemicalSystem::performSwapNoCheck(), GeochemistryTimeDependentReactor::postSolveFlowThrough(), GeochemistryTimeDependentReactor::preSolveDump(), GeochemistryTimeDependentReactor::preSolveFlush(), GeochemicalSystem::setMineralRelatedFreeMoles(), GeochemicalSystem::setSolventMassAndFreeMolalityAndMineralMolesAndSurfacePotsAndKineticMoles(), GeochemicalSolver::swapNeeded(), TEST(), and GeochemicalSystem::updateBasisMolalityForKnownActivity().
std::vector<Real> ModelGeochemicalDatabase::basis_species_molecular_volume |
all quantities have a molecular volume (cm^3) (only nonzero for minerals, however)
Definition at line 182 of file PertinentGeochemicalSystem.h.
Referenced by GeochemistrySpeciesSwapper::alterMGD(), GeochemistryQuantityAux::computeValue(), PertinentGeochemicalSystem::createModel(), GeochemistryUnitConverter::fromMoles(), operator==(), and TEST().
std::vector<Real> ModelGeochemicalDatabase::basis_species_molecular_weight |
all quantities have a molecular weight (g)
Definition at line 179 of file PertinentGeochemicalSystem.h.
Referenced by GeochemistrySpeciesSwapper::alterMGD(), GeochemicalSystem::computeSorbingSurfaceArea(), GeochemistryQuantityAux::computeValue(), PertinentGeochemicalSystem::createModel(), GeochemistryUnitConverter::fromMoles(), GeochemistryTimeDependentReactor::newTemperature(), operator==(), GeochemistryConsoleOutput::output(), GeochemistryTimeDependentReactor::preSolveFlush(), and TEST().
std::vector<std::string> ModelGeochemicalDatabase::basis_species_name |
basis_species_name[j] = name of the j^th basis species
Definition at line 161 of file PertinentGeochemicalSystem.h.
Referenced by AddGeochemistrySolverAction::act(), PertinentGeochemicalSystem::addKineticRate(), GeochemicalSystem::addKineticRates(), GeochemistrySpeciesSwapper::alterMGD(), GeochemicalSystem::changeConstraintToBulk(), GeochemicalSystem::checkAndInitialize(), PertinentGeochemicalSystem::createModel(), GeochemistrySpeciesSwapper::findBestEqmSwap(), GeochemistryTimeDependentReactor::GeochemistryTimeDependentReactor(), operator==(), GeochemistryConsoleOutput::output(), GeochemicalModelInterrogator::outputActivity(), GeochemistryConsoleOutput::outputNernstInfo(), GeochemicalModelInterrogator::outputReaction(), GeochemicalModelInterrogator::outputTemperature(), GeochemistryTimeDependentReactor::postSolveFlowThrough(), GeochemistryTimeDependentReactor::preSolveDump(), GeochemicalSystem::setChargeBalanceSpecies(), GeochemicalSolver::solveSystem(), GeochemicalSolver::swapNeeded(), TEST(), and TEST_F().
std::vector<Real> ModelGeochemicalDatabase::basis_species_radius |
all quantities have an ionic radius (Angstrom) for computing activity (mineral radius = 0, gas radius = 0, surface species radius = 0)
Definition at line 176 of file PertinentGeochemicalSystem.h.
Referenced by GeochemistrySpeciesSwapper::alterMGD(), GeochemistryActivityCoefficientsDebyeHuckel::buildActivityCoefficients(), PertinentGeochemicalSystem::createModel(), operator==(), and TEST().
std::vector<bool> ModelGeochemicalDatabase::basis_species_transported |
basis_species_transported[j] = true iff the j^th basis species is transported in reactive-transport sims
Definition at line 170 of file PertinentGeochemicalSystem.h.
Referenced by GeochemistrySpeciesSwapper::alterMGD(), GeochemicalSystem::computeTransportedBulkFromMolalities(), PertinentGeochemicalSystem::createModel(), operator==(), and TEST().
DenseMatrix<Real> ModelGeochemicalDatabase::eqm_log10K |
eqm_log10K(i, j) = log10(equilibrium constant) for i^th equilibrium species at the j^th temperature point
Definition at line 226 of file PertinentGeochemicalSystem.h.
Referenced by GeochemistrySpeciesSwapper::alterMGD(), PertinentGeochemicalSystem::buildRedoxeInfo(), GeochemicalSystem::buildTemperatureDependentQuantities(), PertinentGeochemicalSystem::createModel(), operator==(), GeochemicalModelInterrogator::outputActivity(), GeochemicalModelInterrogator::outputReaction(), GeochemicalModelInterrogator::outputTemperature(), and TEST().
std::vector<Real> ModelGeochemicalDatabase::eqm_species_charge |
all quantities have a charge (mineral charge = 0, gas charge = 0, oxide charge = 0)
Definition at line 205 of file PertinentGeochemicalSystem.h.
Referenced by GeochemistrySpeciesSwapper::alterMGD(), GeochemistryActivityCoefficientsDebyeHuckel::buildActivityCoefficients(), GeochemicalSystem::computeJacobian(), PertinentGeochemicalSystem::createModel(), GeochemicalSystem::getResidualComponent(), GeochemistryIonicStrength::ionicStrength(), operator==(), GeochemistryIonicStrength::stoichiometricIonicStrength(), GeochemicalSystem::surfaceSorptionModifier(), and TEST().
std::vector<bool> ModelGeochemicalDatabase::eqm_species_gas |
eqm_species_gas[i] = true iff the i^th equilibrium species is a gas
Definition at line 199 of file PertinentGeochemicalSystem.h.
Referenced by GeochemicalSystem::addKineticRates(), GeochemistrySpeciesSwapper::alterMGD(), GeochemistryActivityCoefficientsDebyeHuckel::buildActivityCoefficients(), GeochemicalSystem::changeConstraintToBulk(), GeochemicalSystem::computeEqmMolalities(), PertinentGeochemicalSystem::createModel(), GeochemistrySpeciesSwapper::findBestEqmSwap(), GeochemicalSystem::getEquilibriumActivity(), operator==(), GeochemistryConsoleOutput::output(), GeochemicalSystem::performSwap(), GeochemicalSystem::setSolventMassAndFreeMolalityAndMineralMolesAndSurfacePotsAndKineticMoles(), and TEST().
std::unordered_map<std::string, unsigned> ModelGeochemicalDatabase::eqm_species_index |
eqm_species_index[name] = index of the equilibrium species (secondary aqueous species, redox couples in equilibrium with the aqueous solution, minerals in equilibrium with the aqueous solution, gases in equilibrium with the aqueous solution) within all ModelGeochemicalDatabase internal datastrcutres, with given name
Definition at line 190 of file PertinentGeochemicalSystem.h.
Referenced by PertinentGeochemicalSystem::addKineticRate(), GeochemistrySpeciesSwapper::alterMGD(), PertinentGeochemicalSystem::buildRedoxeInfo(), GeochemistrySpeciesSwapper::checkSwap(), GeochemistryQuantityAux::computeValue(), PertinentGeochemicalSystem::createModel(), GeochemicalModelInterrogator::eqmSpeciesOfInterest(), GeochemistryTimeDependentReactor::execute(), GeochemistrySpatialReactor::execute(), GeochemistryUnitConverter::fromMoles(), GeochemistryQuantityAux::GeochemistryQuantityAux(), GeochemistrySpatialReactor::GeochemistrySpatialReactor(), GeochemistryTimeDependentReactor::GeochemistryTimeDependentReactor(), GeochemicalModelInterrogator::knownActivity(), operator==(), GeochemistryConsoleOutput::output(), GeochemicalModelInterrogator::outputActivity(), GeochemicalModelInterrogator::outputReaction(), GeochemicalModelInterrogator::outputTemperature(), GeochemistrySpeciesSwapper::performSwap(), GeochemistryActivityCoefficientsDebyeHuckel::setInternalParameters(), GeochemicalSystem::setMineralRelatedFreeMoles(), GeochemicalSystem::setSolventMassAndFreeMolalityAndMineralMolesAndSurfacePotsAndKineticMoles(), GeochemistryIonicStrength::stoichiometricIonicStrength(), TEST(), and TEST_F().
std::vector<bool> ModelGeochemicalDatabase::eqm_species_mineral |
eqm_species_mineral[i] = true iff the i^th equilibrium species is a mineral
Definition at line 196 of file PertinentGeochemicalSystem.h.
Referenced by AddGeochemistrySolverAction::act(), GeochemistrySpeciesSwapper::alterMGD(), GeochemistryActivityCoefficientsDebyeHuckel::buildActivityCoefficients(), GeochemicalSystem::computeEqmMolalities(), PertinentGeochemicalSystem::createModel(), GeochemistrySpeciesSwapper::findBestEqmSwap(), GeochemistryUnitConverter::fromMoles(), GeochemistryQuantityAux::GeochemistryQuantityAux(), GeochemistryTimeDependentReactor::GeochemistryTimeDependentReactor(), GeochemicalSystem::getEquilibriumActivity(), GeochemicalSystem::getSaturationIndices(), GeochemicalModelInterrogator::knownActivity(), operator==(), GeochemistryConsoleOutput::output(), GeochemicalSystem::setMineralRelatedFreeMoles(), GeochemicalSystem::setSolventMassAndFreeMolalityAndMineralMolesAndSurfacePotsAndKineticMoles(), GeochemicalSolver::swapNeeded(), TEST(), and TEST_F().
std::vector<Real> ModelGeochemicalDatabase::eqm_species_molecular_volume |
all quantities have a molecular volume (cm^3) (only nonzero for minerals, however)
Definition at line 214 of file PertinentGeochemicalSystem.h.
Referenced by GeochemistrySpeciesSwapper::alterMGD(), GeochemistryQuantityAux::computeValue(), PertinentGeochemicalSystem::createModel(), GeochemistryUnitConverter::fromMoles(), operator==(), and TEST().
std::vector<Real> ModelGeochemicalDatabase::eqm_species_molecular_weight |
all quantities have a molecular weight (g)
Definition at line 211 of file PertinentGeochemicalSystem.h.
Referenced by GeochemistrySpeciesSwapper::alterMGD(), GeochemistryQuantityAux::computeValue(), PertinentGeochemicalSystem::createModel(), GeochemistryUnitConverter::fromMoles(), operator==(), GeochemistryConsoleOutput::output(), and TEST().
std::vector<std::string> ModelGeochemicalDatabase::eqm_species_name |
eqm_species_name[i] = name of the i^th eqm species
Definition at line 193 of file PertinentGeochemicalSystem.h.
Referenced by AddGeochemistrySolverAction::act(), PertinentGeochemicalSystem::addKineticRate(), GeochemicalSystem::addKineticRates(), GeochemistrySpeciesSwapper::alterMGD(), GeochemistrySpeciesSwapper::checkSwap(), PertinentGeochemicalSystem::createModel(), GeochemicalModelInterrogator::eqmSpeciesOfInterest(), GeochemistrySpeciesSwapper::findBestEqmSwap(), GeochemistryTimeDependentReactor::GeochemistryTimeDependentReactor(), operator==(), GeochemistryConsoleOutput::output(), GeochemistryConsoleOutput::outputNernstInfo(), GeochemicalSystem::performSwap(), GeochemicalSolver::swapNeeded(), TEST(), and TEST_F().
std::vector<Real> ModelGeochemicalDatabase::eqm_species_radius |
all quantities have an ionic radius (Angstrom) for computing activity (mineral radius = 0, gas radius = 0, surface species radius = 0)
Definition at line 208 of file PertinentGeochemicalSystem.h.
Referenced by GeochemistrySpeciesSwapper::alterMGD(), GeochemistryActivityCoefficientsDebyeHuckel::buildActivityCoefficients(), PertinentGeochemicalSystem::createModel(), operator==(), and TEST().
std::vector<bool> ModelGeochemicalDatabase::eqm_species_transported |
eqm_species_transported[i] = true iff the i^th eqm species is transported in reactive-transport sims
Definition at line 202 of file PertinentGeochemicalSystem.h.
Referenced by GeochemistrySpeciesSwapper::alterMGD(), GeochemicalSystem::computeTransportedBulkFromMolalities(), PertinentGeochemicalSystem::createModel(), operator==(), and TEST().
DenseMatrix<Real> ModelGeochemicalDatabase::eqm_stoichiometry |
eqm_stoichiometry(i, j) = stoichiometric coefficient for equilibrium species "i" in terms of the basis species "j"
Definition at line 220 of file PertinentGeochemicalSystem.h.
Referenced by GeochemicalSystem::addKineticRates(), GeochemistrySpeciesSwapper::alterMGD(), PertinentGeochemicalSystem::buildRedoxeInfo(), GeochemicalSystem::changeConstraintToBulk(), GeochemicalSystem::computeBulkFromMolalities(), GeochemicalSystem::computeFreeMineralMoles(), GeochemicalSystem::computeJacobian(), GeochemicalSystem::computeTransportedBulkFromMolalities(), GeochemistrySpeciesSwapper::constructInverseMatrix(), PertinentGeochemicalSystem::createModel(), GeochemistryTimeDependentReactor::execute(), GeochemistrySpatialReactor::execute(), GeochemistrySpeciesSwapper::findBestEqmSwap(), GeochemicalSystem::getEquilibriumActivity(), GeochemicalSystem::getResidualComponent(), GeochemicalSystem::log10ActivityProduct(), operator==(), GeochemistryConsoleOutput::output(), GeochemicalModelInterrogator::outputActivity(), GeochemicalModelInterrogator::outputReaction(), GeochemicalModelInterrogator::outputTemperature(), GeochemistryIonicStrength::stoichiometricIonicStrength(), GeochemicalSolver::swapNeeded(), TEST(), and TEST_F().
std::unordered_map<std::string, std::vector<Real> > ModelGeochemicalDatabase::gas_chi |
Holds info on gas fugacity "chi" parameters.
Note this is slow compared with storing info in a DenseMatrix, but it also saves memory over storing a lot of "zeroes" for non-gas species. I believe the slowness will not present a problem because fugacity parameters are typically only queried at the start of the simulation, or at most once per timestep. If the lookup becomes burdensome, change from unordered_map to DenseMatrix
Definition at line 294 of file PertinentGeochemicalSystem.h.
Referenced by PertinentGeochemicalSystem::createModel(), and operator==().
std::vector<unsigned> ModelGeochemicalDatabase::have_swapped_into_basis |
Species that have been swapped into the basis.
Every time a swap is performed on the ModelGeochemicalDatabase, the equilibrium-index of the species added to the basis is appended to this list
Definition at line 351 of file PertinentGeochemicalSystem.h.
Referenced by GeochemistrySpeciesSwapper::alterMGD(), operator==(), GeochemistryConsoleOutput::outputNernstInfo(), and TEST().
std::vector<unsigned> ModelGeochemicalDatabase::have_swapped_out_of_basis |
Species that have been swapped out of the basis.
Every time a swap is performed on the ModelGeochemicalDatabase, the basis-index of the species removed from the basis is appended to this list
Definition at line 344 of file PertinentGeochemicalSystem.h.
Referenced by GeochemistrySpeciesSwapper::alterMGD(), operator==(), GeochemistryConsoleOutput::outputNernstInfo(), and TEST().
DenseMatrix<Real> ModelGeochemicalDatabase::kin_log10K |
kin_log10K(i, j) = log10(equilibrium constant for the i^th kinetic species at the j^th temperature point
Definition at line 324 of file PertinentGeochemicalSystem.h.
Referenced by GeochemistrySpeciesSwapper::alterMGD(), GeochemicalSystem::buildTemperatureDependentQuantities(), PertinentGeochemicalSystem::createModel(), operator==(), and TEST().
std::vector<KineticRateDefinition> ModelGeochemicalDatabase::kin_rate |
rates given to kinetic species.
See the method addKineticRate for a detailed description. This quantity is organised in such a way that a solver can loop through kin_rate, calculting the rates and applying them to the kin_rate[i].kinetic_species_index species
Definition at line 337 of file PertinentGeochemicalSystem.h.
Referenced by PertinentGeochemicalSystem::addKineticRate(), GeochemicalSystem::addKineticRates(), GeochemistrySpeciesSwapper::alterMGD(), operator==(), and TEST().
std::vector<Real> ModelGeochemicalDatabase::kin_species_charge |
all kinetic quantities have a charge (mineral charge = 0)
Definition at line 312 of file PertinentGeochemicalSystem.h.
Referenced by PertinentGeochemicalSystem::createModel(), GeochemistryIonicStrength::ionicStrength(), operator==(), GeochemistryIonicStrength::stoichiometricIonicStrength(), and TEST().
std::unordered_map<std::string, unsigned> ModelGeochemicalDatabase::kin_species_index |
kin_species_index[name] = index of the kinetic species, within all ModelGeochemicalDatabase internal datastrcutres, with given name
Definition at line 300 of file PertinentGeochemicalSystem.h.
Referenced by PertinentGeochemicalSystem::addKineticRate(), GeochemicalSystem::checkAndInitialize(), GeochemistryQuantityAux::computeValue(), PertinentGeochemicalSystem::createModel(), GeochemistryTimeDependentReactor::execute(), GeochemistrySpatialReactor::execute(), GeochemistryUnitConverter::fromMoles(), GeochemistryQuantityAux::GeochemistryQuantityAux(), GeochemistrySpatialReactor::GeochemistrySpatialReactor(), GeochemistryTimeDependentReactor::GeochemistryTimeDependentReactor(), operator==(), GeochemicalSystem::setSolventMassAndFreeMolalityAndMineralMolesAndSurfacePotsAndKineticMoles(), GeochemistryIonicStrength::stoichiometricIonicStrength(), TEST(), and TEST_F().
std::vector<bool> ModelGeochemicalDatabase::kin_species_mineral |
kin_species_mineral[j] = true iff the j^th kinetic species is a mineral
Definition at line 306 of file PertinentGeochemicalSystem.h.
Referenced by AddGeochemistrySolverAction::act(), PertinentGeochemicalSystem::createModel(), GeochemistryUnitConverter::fromMoles(), GeochemistryQuantityAux::GeochemistryQuantityAux(), GeochemistryTimeDependentReactor::GeochemistryTimeDependentReactor(), operator==(), GeochemistryConsoleOutput::output(), GeochemistryTimeDependentReactor::postSolveFlowThrough(), GeochemistryTimeDependentReactor::preSolveFlush(), GeochemicalSystem::setMineralRelatedFreeMoles(), and TEST().
std::vector<Real> ModelGeochemicalDatabase::kin_species_molecular_volume |
all quantities have a molecular volume (cm^3/mol) (only nonzero for minerals, however)
Definition at line 318 of file PertinentGeochemicalSystem.h.
Referenced by GeochemistryQuantityAux::computeValue(), PertinentGeochemicalSystem::createModel(), GeochemistryUnitConverter::fromMoles(), operator==(), GeochemistryConsoleOutput::output(), and TEST().
std::vector<Real> ModelGeochemicalDatabase::kin_species_molecular_weight |
all quantities have a molecular weight (g/mol)
Definition at line 315 of file PertinentGeochemicalSystem.h.
Referenced by GeochemicalSystem::addKineticRates(), GeochemistryQuantityAux::computeValue(), PertinentGeochemicalSystem::createModel(), GeochemistryUnitConverter::fromMoles(), GeochemistryTimeDependentReactor::newTemperature(), operator==(), GeochemistryConsoleOutput::output(), GeochemistryTimeDependentReactor::preSolveFlush(), and TEST().
std::vector<std::string> ModelGeochemicalDatabase::kin_species_name |
kin_species_name[j] = name of the j^th kinetic species
Definition at line 303 of file PertinentGeochemicalSystem.h.
Referenced by AddGeochemistrySolverAction::act(), GeochemicalSystem::checkAndInitialize(), PertinentGeochemicalSystem::createModel(), GeochemistryTimeDependentReactor::GeochemistryTimeDependentReactor(), operator==(), GeochemistryConsoleOutput::output(), GeochemistryTimeDependentReactor::postSolveFlowThrough(), and TEST().
std::vector<bool> ModelGeochemicalDatabase::kin_species_transported |
kin_species_transported[j] = true iff the j^th kinetic species is transported in reactive-transport sims
Definition at line 309 of file PertinentGeochemicalSystem.h.
Referenced by PertinentGeochemicalSystem::createModel(), operator==(), and TEST().
DenseMatrix<Real> ModelGeochemicalDatabase::kin_stoichiometry |
kin_stoichiometry(i, j) = stoichiometric coefficient for kinetic species "i" in terms of the basis species "j"
Definition at line 330 of file PertinentGeochemicalSystem.h.
Referenced by GeochemicalSystem::addKineticRates(), GeochemistrySpeciesSwapper::alterMGD(), GeochemicalSystem::checkAndInitialize(), GeochemicalSystem::computeBulkFromMolalities(), GeochemicalSystem::computeFreeMineralMoles(), GeochemicalSystem::computeJacobian(), PertinentGeochemicalSystem::createModel(), GeochemicalSystem::getResidualComponent(), GeochemicalSystem::log10KineticActivityProduct(), operator==(), GeochemistryConsoleOutput::output(), GeochemistryTimeDependentReactor::postSolveFlowThrough(), GeochemistryTimeDependentReactor::preSolveFlush(), and TEST().
const GeochemicalDatabaseReader* ModelGeochemicalDatabase::original_database |
a pointer to the original database used to build this ModelGeochemicalDatabase
Definition at line 149 of file PertinentGeochemicalSystem.h.
Referenced by GeochemicalSystem::buildTemperatureDependentQuantities(), operator==(), GeochemicalModelInterrogator::outputActivity(), GeochemicalModelInterrogator::outputReaction(), GeochemicalModelInterrogator::outputTemperature(), GeochemicalModelInterrogator::solveForT(), and TEST().
std::string ModelGeochemicalDatabase::redox_lhs |
the name of the species on the left-hand side of the redox equations.
Upon creation of the model this is e-, but it may change due to swaps
Definition at line 257 of file PertinentGeochemicalSystem.h.
Referenced by GeochemistrySpeciesSwapper::alterMGD(), GeochemicalSystem::checkAndInitialize(), PertinentGeochemicalSystem::createModel(), operator==(), GeochemistryConsoleOutput::outputNernstInfo(), and TEST().
DenseMatrix<Real> ModelGeochemicalDatabase::redox_log10K |
redox_log10K(i, j) = log10(equilibrium constant) for i^th redox species at the j^th temperature point
Definition at line 278 of file PertinentGeochemicalSystem.h.
Referenced by GeochemistrySpeciesSwapper::alterMGD(), GeochemicalSystem::buildTemperatureDependentQuantities(), PertinentGeochemicalSystem::createModel(), operator==(), and TEST().
DenseMatrix<Real> ModelGeochemicalDatabase::redox_stoichiometry |
redox_stoichiometry(i, j) = stoichiometric coefficients for i^th redox species that is in disequilibrium in terms of the j basis species.
These equations are all written with their left-hand sides being e-. For instance, the database contains the reactions Fe+++ = -0.5H20 + Fe++ + H+ + 0.25*O2(aq) e- = 0.5H2O - 0.25O2(aq)- H+ The first is a redox reaction, and assume the user has specified it is in disquilibrium (by specifying it is in the basis). If Fe++, H+ and O2(aq) are also in the basis then the two equations yield the single redox equation e- = -Fe+++ + Fe++ Then redox_stoichiometry will be -1 for j = Fe+++, and +1 for j = Fe++.
Definition at line 272 of file PertinentGeochemicalSystem.h.
Referenced by GeochemistrySpeciesSwapper::alterMGD(), PertinentGeochemicalSystem::createModel(), GeochemicalSystem::log10RedoxActivityProduct(), operator==(), GeochemistryConsoleOutput::output(), GeochemistryConsoleOutput::outputNernstInfo(), and TEST().
std::unordered_map<std::string, SurfaceComplexationInfo> ModelGeochemicalDatabase::surface_complexation_info |
Holds info on surface complexation, if any, in the model.
Note this is slow compared with storing information in a std::vector or DenseMatrix, but it also saves memory over storing a lot of "zeroes" for all species not involved in surface complexation
Definition at line 285 of file PertinentGeochemicalSystem.h.
Referenced by PertinentGeochemicalSystem::createModel(), operator==(), GeochemistryConsoleOutput::output(), and GeochemicalSystem::setMineralRelatedFreeMoles().
std::vector<Real> ModelGeochemicalDatabase::surface_sorption_area |
surface_sorption_area[k] = specific surface area [m^2/g] for the k^th mineral involved in surface sorption.
Each mineral involved in surface sorption must have a surface_sorption_area prescribed it (in the database) and will be associated with a unique surface potential.
Definition at line 239 of file PertinentGeochemicalSystem.h.
Referenced by GeochemicalSystem::computeSorbingSurfaceArea(), PertinentGeochemicalSystem::createModel(), and operator==().
std::vector<std::string> ModelGeochemicalDatabase::surface_sorption_name |
surface_sorption_name[k] = name of the mineral involved in surface sorption.
Each of these will be associated with a unique surface potential.
Definition at line 232 of file PertinentGeochemicalSystem.h.
Referenced by AddGeochemistrySolverAction::act(), GeochemicalSystem::computeSorbingSurfaceArea(), PertinentGeochemicalSystem::createModel(), GeochemistryQuantityAux::GeochemistryQuantityAux(), operator==(), GeochemistryConsoleOutput::output(), and GeochemicalSystem::setSolventMassAndFreeMolalityAndMineralMolesAndSurfacePotsAndKineticMoles().
std::vector<unsigned> ModelGeochemicalDatabase::surface_sorption_number |
surface_sorption_number[j] = the index of the surface potential that should be used to modify the equilibrium constant for the j^th equilibrium species.
surface_sorption_number is only meaningful if surface_sorption_related[j] = true. 0 <= surface_sorption_number[:] < surface_sorption_name.size() = number of minerals involved in surface sorption = number of surface potentials in the simulation = surface_sorption_area.size().
Definition at line 251 of file PertinentGeochemicalSystem.h.
Referenced by GeochemicalSystem::computeJacobian(), PertinentGeochemicalSystem::createModel(), GeochemicalSystem::getResidualComponent(), operator==(), GeochemicalSystem::surfaceSorptionModifier(), and TEST().
std::vector<bool> ModelGeochemicalDatabase::surface_sorption_related |
surface_sorption_related[j] = true iff the j^th equilibrium species is involved in surface sorption
Definition at line 242 of file PertinentGeochemicalSystem.h.
Referenced by GeochemicalSystem::changeConstraintToBulk(), GeochemistrySpeciesSwapper::checkSwap(), GeochemicalSystem::computeJacobian(), PertinentGeochemicalSystem::createModel(), GeochemistrySpeciesSwapper::findBestEqmSwap(), GeochemicalSystem::getResidualComponent(), GeochemistryIonicStrength::ionicStrength(), operator==(), GeochemicalSystem::setMineralRelatedFreeMoles(), GeochemistryIonicStrength::stoichiometricIonicStrength(), GeochemicalSystem::surfaceSorptionModifier(), and TEST().
DenseMatrix<Real> ModelGeochemicalDatabase::swap_to_original_basis |
Swap matrix that allows expression in terms of the original basis.
When a swap is performed bulk_new = S^-1^T * bulk_old, where S is the swap matrix (and S^-1^T is the transposed inverse of S) Hence, upon multiple swaps (S_1 followed by S_2 followed by S_3, etc) bulk_new = S_n^-1^T * S_{n-1}^-1^T * ... * S_1^-1^T * bulk_original So bulk_original = (S_n * S_{n-1} * ... * S_1)^T * bulk_new swap_to_original_basis = S_n * S_{n-1} * ... * S_1 swap_to_original_basis is initialized to DenseMatrix<Real>(), ie, a zero-sized matrix, to reduce memory usage. The first time a swap is performed, it is set to the swap matrix generated in the GeochemistrySpeciesSwapper, and every time a swap is performed on the ModelGeochemicalDatabase this is updated
Definition at line 367 of file PertinentGeochemicalSystem.h.
Referenced by GeochemistrySpeciesSwapper::alterMGD(), GeochemicalSystem::getBulkOldInOriginalBasis(), GeochemicalSystem::getTransportedBulkInOriginalBasis(), operator==(), and TEST().