19 const std::string & species_name,
47 " is not a basis, equilibrium or kinetic species");
48 return moles * factor;
54 const std::string & species_name,
57 return quantity /
fromMoles(1.0, unit, species_name,
mgd);
63 const std::string &
name,
64 const std::vector<Real> & mol_weight,
65 const std::vector<Real> & mol_volume,
66 const std::vector<bool> & is_mineral)
78 factor = 1E-3 * mol_weight[ind];
82 factor = mol_weight[ind];
86 factor = 1.0E3 * mol_weight[ind];
90 factor = 1.0E6 * mol_weight[ind];
94 mooseError(
"GeochemistryUnitConverter: Cannot use CM3 units for species ",
96 " because it is not a mineral");
97 factor = mol_volume[ind];
const ModelGeochemicalDatabase mgd
void mooseError(Args &&... args)
Utilities to convert to and from mole units.
Real fromMoles(Real moles, const GeochemistryUnit unit, const std::string &species_name, const ModelGeochemicalDatabase &mgd)
Calculates the amount of "unit"s of species_name in 1 mole, OR in 1 molal, whichever is appropriate.
Real conversionFactor(const GeochemistryUnit unit, unsigned ind, const std::string &name, const std::vector< Real > &mol_weight, const std::vector< Real > &mol_volume, const std::vector< bool > &is_mineral)
Calculates the number of "unit" in 1 mole of substance, OR calculates the number of "unit" in 1 molal...
Real toMoles(Real quantity, const GeochemistryUnit unit, const std::string &species_name, const ModelGeochemicalDatabase &mgd)
Calculates the amount of moles corresponding to "quantity" "unit"s of species name,...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Data structure to hold all relevant information from the database file.
std::vector< bool > eqm_species_mineral
eqm_species_mineral[i] = true iff the i^th equilibrium species is a mineral
std::vector< Real > basis_species_molecular_weight
all quantities have a molecular weight (g)
std::vector< Real > eqm_species_molecular_volume
all quantities have a molecular volume (cm^3) (only nonzero for minerals, however)
std::vector< bool > kin_species_mineral
kin_species_mineral[j] = true iff the j^th kinetic species is a mineral
std::vector< Real > eqm_species_molecular_weight
all quantities have a molecular weight (g)
std::vector< bool > basis_species_mineral
basis_species_mineral[j] = true iff the j^th basis species is a mineral
std::vector< Real > kin_species_molecular_volume
all quantities have a molecular volume (cm^3/mol) (only nonzero for minerals, however)
std::vector< Real > basis_species_molecular_volume
all quantities have a molecular volume (cm^3) (only nonzero for minerals, however)
std::unordered_map< std::string, unsigned > eqm_species_index
eqm_species_index[name] = index of the equilibrium species (secondary aqueous species,...
std::unordered_map< std::string, unsigned > basis_species_index
basis_species_index[name] = index of the basis species, within all ModelGeochemicalDatabase internal ...
std::unordered_map< std::string, unsigned > kin_species_index
kin_species_index[name] = index of the kinetic species, within all ModelGeochemicalDatabase internal ...
std::vector< Real > kin_species_molecular_weight
all quantities have a molecular weight (g/mol)