32 MineralEQ3::MineralEQ3():
47 "Couldn't find phase name in file:" + id_);
51 std::string model = th[
"model"];
52 if (model !=
"StoichSubstance" && model !=
"MineralEQ3") {
54 "thermo model attribute must be StoichSubstance");
63 std::string idxml = xmlphase[
"id"];
70 std::string model = th[
"model"];
71 if (model !=
"StoichSubstance" && model !=
"MineralEQ3") {
73 "thermo model attribute must be StoichSubstance");
114 return cStoichSubstance;
164 for (
int i = 0; i < 6; i++) {
185 hrt[0] += presCorrect / RT;
238 doublereal rho = c[0];
255 if (!phaseNode.
hasChild(
"thermo")) {
257 "no thermo XML node");
260 std::vector<const XML_Node*> xspecies =
speciesData();
264 if (xsp->
hasChild(
"standardState")) {
265 aStandardState = &xsp->
child(
"standardState");
268 "no standard state mode");
270 doublereal volVal = 0.0;
271 string smodel = (*aStandardState)[
"model"];
272 if (smodel !=
"constantVolume") {
274 "wrong standard state mode");
276 if (aStandardState->
hasChild(
"V0_Pr_Tr")) {
279 double Afactor =
toSI(
"cm3/gmol");
281 Aunits = aV.
attrib(
"units");
282 Afactor =
toSI(Aunits);
290 "wrong standard state mode");
308 convertDGFormation();
313 std::string model = eosdata[
"model"];
314 if (model !=
"MineralEQ3") {
316 "thermo model attribute must be MineralEQ3");
320 doublereal MineralEQ3::LookupGe(
const std::string& elemName)
324 throw CanteraError(
"PDSS_HKFT::LookupGe",
"element " + elemName +
" not found");
328 throw CanteraError(
"PDSS_HKFT::LookupGe",
329 "element " + elemName +
" does not have a supplied entropy298");
331 geValue *= (-298.15);
335 void MineralEQ3::convertDGFormation()
344 doublereal totalSum = 0.0;
345 for (
size_t m = 0; m <
nElements(); m++) {
349 ge = LookupGe(ename);
doublereal m_Entrop_pr_tr
Input value of S_j at Tr and Pr (cal gmol-1 K-1)
doublereal nAtoms(size_t k, size_t m) const
Number of atoms of element m in species k.
doublereal molecularWeight(size_t k) const
Molecular weight of species k.
doublereal m_deltaH_formation_pr_tr
Input Value of deltaH of Formation at Tr and Pr (cal gmol-1)
virtual doublereal density() const
Density (kg/m^3).
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized concentrations.
XML_Node * get_XML_File(const std::string &file, int debug)
Return a pointer to the XML tree for a Cantera input file.
virtual void initThermo()
Internal initialization required after all species have been added.
size_t nElements() const
Number of elements.
virtual doublereal logStandardConc(size_t k=0) const
Natural logarithm of the standard concentration of the kth species.
std::string attrib(const std::string &attr) const
Function returns the value of an attribute.
doublereal toSI(const std::string &unit)
Return the conversion factor to convert unit std::string 'unit' to SI units.
const size_t npos
index returned by functions to indicate "no position"
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
virtual void getGibbs_RT(doublereal *grt) const
Get the nondimensional Gibbs functions for the species in their standard states at the current T and ...
virtual void getEnthalpy_RT_ref(doublereal *hrt) const
StoichSubstanceSSTP & operator=(const StoichSubstanceSSTP &right)
Assignment operator.
Class XML_Node is a tree-based representation of the contents of an XML file.
This file contains definitions of terms that are used in internal routines and are unlikely to need m...
virtual void getParameters(int &n, doublereal *const c) const
Get the equation of state parameters in a vector.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Virtual base class for the calculation of multiple-species thermodynamic reference-state property man...
vector_fp m_speciesSize
Vector of species sizes.
doublereal getFloat(const Cantera::XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
virtual void getEntropy_R_ref(doublereal *er) const
doublereal m_deltaG_formation_pr_tr
Input Value of deltaG of Formation at Tr and Pr (cal gmol-1)
virtual void setPressure(doublereal p)
Set the pressure at constant temperature. Units: Pa.
doublereal molarDensity() const
Molar density (kmol/m^3).
virtual void getUnitsStandardConc(doublereal *uA, int k=0, int sizeUA=6) const
Returns the units of the standard and generalized concentrations.
ThermoPhase * duplMyselfAsThermoPhase() const
Duplication function.
void _updateThermo() const
XML_Node & child(const size_t n) const
Return a changeable reference to the n'th child of the current node.
virtual void getStandardChemPotentials(doublereal *mu0) const
Get the array of chemical potentials at unit activity for the species at their standard states at the...
vector_fp m_s0_R
Dimensionless entropy at the (mtlast, m_p0)
doublereal entropyElement298(size_t m) const
Entropy of the element in its standard state at 298 K and 1 bar.
Base class for a phase with thermodynamic properties.
Class StoichSubstanceSSTP represents a stoichiometric (fixed composition) incompressible substance...
virtual doublereal standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
doublereal m_c
c coefficient (cal K gmol-1 K) x 10^-5
MineralEQ3()
Default constructor for the StoichSubstanceSSTP class.
bool importPhase(XML_Node &phase, ThermoPhase *th, SpeciesThermoFactory *spfactory)
Import a phase information into an empty thermophase object.
virtual void setParameters(int n, doublereal *const c)
Set the equation of state parameters.
doublereal m_a
a coefficient (cal gmol-1 K-1)
virtual int eosType() const
Equation of state flag.
virtual void initThermo()
virtual void getCp_R(doublereal *cpr) const
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
MineralEQ3 & operator=(const MineralEQ3 &right)
Assignment operator.
Base class for exceptions thrown by Cantera classes.
vector_fp m_h0_RT
Dimensionless enthalpy at the (mtlast, m_p0)
vector_fp m_cp0_R
Dimensionless heat capacity at the (mtlast, m_p0)
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
#define ENTROPY298_UNKNOWN
Number indicating we don't know the entropy of the element in its most stable state at 298...
doublereal m_V0_pr_tr
Input Value of the molar volume at T_r and P_r.
doublereal m_b
b coefficient (cal gmol-1 K-2) x 10^3
doublereal temperature() const
Temperature (K).
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
virtual void setParametersFromXML(const XML_Node &eosdata)
Set equation of state parameter values from XML entries.
doublereal getFloatDefaultUnits(const Cantera::XML_Node &parent, const std::string &name, const std::string &defaultUnits, const std::string &type)
Get a floating-point value from a child element with a defined units field.
size_t elementIndex(const std::string &name) const
Return the index of element named 'name'.
Header file for the MineralEQ3 class, which represents a fixed-composition incompressible substance b...
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
const std::vector< const XML_Node * > & speciesData() const
Return a pointer to the vector of XML nodes containing the species data for this phase.
doublereal m_press
The current pressure of the solution (Pa)
std::string elementName(size_t m) const
Name of the element with index m.
virtual doublereal pressure() const
Report the Pressure. Units: Pa.
virtual doublereal thermalExpansionCoeff() const
Return the volumetric thermal expansion coefficient. Units: 1/K.
Class MineralEQ3 represents a stoichiometric (fixed composition) incompressible substance based on EQ...
virtual doublereal isothermalCompressibility() const
Returns the isothermal compressibility. Units: 1/Pa.
virtual void getIntEnergy_RT(doublereal *urt) const
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
XML_Node * get_XML_NameID(const std::string &nameTarget, const std::string &file_ID, XML_Node *root)
This routine will locate an XML node in either the input XML tree or in another input file specified ...
virtual void setDensity(const doublereal density_)
Set the internally stored density (kg/m^3) of the phase Note the density of a phase is an independent...
bool hasAttrib(const std::string &a) const
Tests whether the current node has an attribute with a particular name.
virtual void getIntEnergy_RT_ref(doublereal *urt) const
Returns the vector of nondimensional internal Energies of the reference state at the current temperat...
doublereal m_Mu0_pr_tr
Value of the Absolute Gibbs Free Energy NIST scale at T_r and P_r.
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Initialize the phase parameters from an XML file.