12 #include "nlohmann/json.h" 99 std::vector<Real>
chi;
174 std::vector<Real>
adh;
202 :
a(coeffs[0]),
b(coeffs[1]),
c(coeffs[2]),
d(coeffs[3]){};
229 const bool reexpress_free_electron =
true,
230 const bool use_piecewise_interpolation =
false,
231 const bool remove_all_extrapolated_secondary_species =
false);
312 std::map<std::string, GeochemistryBasisSpecies>
320 std::map<std::string, GeochemistryEquilibriumSpecies>
328 std::map<std::string, GeochemistryMineralSpecies>
335 std::map<std::string, GeochemistryElements>
getElements();
342 std::map<std::string, GeochemistryGasSpecies>
350 std::map<std::string, GeochemistryRedoxSpecies>
358 std::map<std::string, GeochemistryOxideSpecies>
366 std::map<std::string, GeochemistrySurfaceSpecies>
373 const std::map<std::string, GeochemistryNeutralSpeciesActivity> &
389 std::vector<std::string>
mineralReactions(
const std::vector<std::string> & names)
const;
396 std::vector<std::string>
gasReactions(
const std::vector<std::string> & names)
const;
403 std::vector<std::string>
redoxReactions(
const std::vector<std::string> & names)
const;
410 std::vector<std::string>
oxideReactions(
const std::vector<std::string> & names)
const;
526 std::vector<std::string>
528 const std::vector<std::map<std::string, Real>> & basis_species)
const;
std::map< std::string, GeochemistrySurfaceSpecies > getSurfaceSpecies(const std::vector< std::string > &names)
Get the surface sorbing species information.
std::map< std::string, GeochemistryEquilibriumSpecies > getEquilibriumSpecies(const std::vector< std::string > &names)
Get the secondary equilibrium species information.
std::vector< Real > getPressures()
Get the pressure points that the equilibrium constant is defined at.
GeochemistrySurfaceSpecies()
std::string getActivityModel() const
Get the activity model type.
GeochemistryDebyeHuckel()
Data structure for elements.
Data structure for basis (primary) species.
std::map< std::string, Real > basis_species
GeochemistryMineralSpecies()
const GeochemistryDebyeHuckel & getDebyeHuckel() const
Get the Debye-Huckel activity coefficients.
std::vector< std::string > _es_names
List of secondary equilibrium species to read from database.
GeochemistryOxideSpecies()
Data structure for mineral species.
std::vector< std::string > redoxCoupleNames() const
Returns a list of all the names of the "redox couples" in the database.
std::map< std::string, GeochemistryMineralSpecies > getMineralSpecies(const std::vector< std::string > &names)
Get the mineral species information.
std::map< std::string, GeochemistryGasSpecies > getGasSpecies(const std::vector< std::string > &names)
Get the gas species information.
void validate(const FileName filename, const nlohmann::json &db)
Validate the thermodynamic database.
std::vector< std::string > getBasisSpeciesNames() const
Get the list of basis (primary) species read from database.
std::vector< std::string > getMineralSpeciesNames() const
Get the list of secondary mineral species read from database.
GeochemistryRedoxSpecies()
std::map< std::string, GeochemistryRedoxSpecies > _redox_species
Redox species (couples) data read from the database.
Data structure for redox species.
Data structure for oxide species.
std::vector< std::string > redoxReactions(const std::vector< std::string > &names) const
Generates a formatted vector of strings representing all redox reactions.
const FileName & filename() const
Filename of database.
std::string getLogKModel() const
Get the equilibrium constant model type.
std::vector< Real > equilibrium_const
nlohmann::json _root
JSON data.
Data structure for sorbing surface species.
std::vector< Real > equilibrium_const
std::string getFugacityModel() const
Get the fugacity model type.
std::map< std::string, GeochemistryGasSpecies > _gas_species
Gas species data read from the database.
std::map< std::string, Real > basis_species
std::string getSpeciesData(const std::string name) const
String representation of JSON species object contents.
bool isSorbingMineral(const std::string &name) const
returns True iff name is the name of a sorbing mineral
std::map< std::string, GeochemistryNeutralSpeciesActivity > _neutral_species_activity
Neutral species activity coefficients.
std::vector< std::string > mineralSpeciesNames() const
Returns a list of all the names of the "mineral species" in the database.
Data structure for Debye-Huckel activity coefficients.
const FileName _filename
Database filename.
bool isOxideSpecies(const std::string &name) const
std::vector< std::string > _bs_names
List of basis (primary) species names read from database.
const std::vector< Real > & getTemperatures() const
Get the temperature points that the equilibrium constant is defined at.
GeochemistryDebyeHuckel _debye_huckel
Debye-Huckel activity coefficients.
std::vector< std::string > surfaceSpeciesNames() const
Returns a list of all the names of the "surface species" in the database.
Data structure for mineral species.
const GeochemicalDatabaseReader db("database/moose_testdb.json", true, true, false)
std::map< std::string, GeochemistryMineralSpecies > _mineral_species
Mineral species data read from the database.
std::map< std::string, Real > basis_species
void removeExtrapolatedSecondarySpecies()
After parsing the database file, remove any secondary species that have extrapolated equilibrium cons...
GeochemistryNeutralSpeciesActivity(std::vector< std::vector< Real >> coeffs)
GeochemicalDatabaseReader(const FileName filename, const bool reexpress_free_electron=true, const bool use_piecewise_interpolation=false, const bool remove_all_extrapolated_secondary_species=false)
Parse the file.
Data structure for neutral species activity coefficients.
std::map< std::string, GeochemistryBasisSpecies > getBasisSpecies(const std::vector< std::string > &names)
Get the basis (primary) species information.
void setDebyeHuckel()
Copy the Debye-Huckel parameters (if any) found in the database into _debye_huckel.
GeochemistryBasisSpecies()
std::map< std::string, GeochemistryOxideSpecies > _oxide_species
Oxide species data read from the database.
void read(const FileName filename)
Parse the thermodynamic database.
bool isGasSpecies(const std::string &name) const
static Real getReal(const nlohmann::json &node)
void setTemperatures()
Copy the temperature points (if any) found in the database into _temperature_points.
void reexpressFreeElectron()
Sometimes the free electron's equilibrium reaction is defined in terms of O2(g) which is not a basis ...
std::vector< Real > _temperature_points
Temperature points in database.
std::map< std::string, GeochemistryElements > getElements()
Get all the elements.
std::map< std::string, Real > basis_species
std::vector< std::string > equilibriumReactions(const std::vector< std::string > &names) const
Generates a formatted vector of strings representing all aqueous equilibrium reactions.
std::map< std::string, GeochemistryEquilibriumSpecies > _equilibrium_species
Secondary equilibrium species and free electron data read from the database.
std::vector< Real > equilibrium_const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< std::string > getEquilibriumSpeciesNames() const
Get the list of secondary equilibrium species read from database.
std::map< std::string, Real > sorption_sites
bool isSecondarySpecies(const std::string &name) const
Returns true if name is a "secondary species" or "free electron" in the database. ...
Data structure for secondary equilibrium species.
std::map< std::string, GeochemistrySurfaceSpecies > _surface_species
Surface sorbing species data read from the database.
std::vector< std::string > secondarySpeciesNames() const
Returns a list of all the names of the "secondary species" and "free electron" in the database...
bool isSurfaceSpecies(const std::string &name) const
std::vector< std::string > oxideReactions(const std::vector< std::string > &names) const
Generates a formatted vector of strings representing all oxide reactions.
std::map< std::string, Real > basis_species
std::map< std::string, GeochemistryOxideSpecies > getOxideSpecies(const std::vector< std::string > &names)
Get the oxide species information.
bool isMineralSpecies(const std::string &name) const
std::map< std::string, Real > elements
const std::map< std::string, GeochemistryNeutralSpeciesActivity > & getNeutralSpeciesActivity() const
Get the neutral species activity coefficients.
std::map< std::string, GeochemistryBasisSpecies > _basis_species
Basis species data read from the database.
std::vector< Real > equilibrium_const
std::map< std::string, Real > basis_species
std::map< std::string, GeochemistryRedoxSpecies > getRedoxSpecies(const std::vector< std::string > &names)
Get the redox species (couples) information.
std::vector< Real > _pressure_points
Pressure points in database.
std::vector< std::string > printReactions(const std::vector< std::string > &names, const std::vector< std::map< std::string, Real >> &basis_species) const
Generates a formatted vector of strings representing all reactions.
GeochemistryNeutralSpeciesActivity()
GeochemistryEquilibriumSpecies()
void setNeutralSpeciesActivity()
Copy the Debye-Huckel parameters for computing neutral species activity (if any) found in the databas...
std::vector< std::string > gasReactions(const std::vector< std::string > &names) const
Generates a formatted vector of strings representing all gas reactions.
std::map< std::string, GeochemistryElements > _elements
Elements and their molecular weight read from the database.
Class for reading geochemical reactions from a MOOSE geochemical database.
bool isRedoxSpecies(const std::string &name) const
std::vector< std::string > mineralReactions(const std::vector< std::string > &names) const
Generates a formatted vector of strings representing all mineral reactions.
std::vector< std::string > _ms_names
List of secondary mineral species to read from database.
bool isBasisSpecies(const std::string &name) const
Checks if species is of given type.