43 "Couldn't find phase name in file:" + id_);
47 std::string model = th[
"model"];
48 if (model !=
"StoichSubstance" && model !=
"StoichSubstanceSSTP" && model !=
"FixedChemPot") {
50 "thermo model attribute must be FixedChemPot or StoichSubstance");
59 std::string idxml = xmlphase[
"id"];
66 std::string model = th[
"model"];
67 if (model !=
"StoichSubstance" && model !=
"StoichSubstanceSSTP" && model !=
"FixedChemPotSSTP") {
69 "thermo model attribute must be StoichSubstance or FixedChemPot");
73 if (model ==
"StoichSubstance" || model ==
"StoichSubstanceSSTP") {
84 std::string pname = Ename +
"Fixed";
111 std::string aaS = Ename +
":1";
112 s->addChild(
"atomArray", aaS);
113 XML_Node& tt = s->addChild(
"thermo");
114 XML_Node& ss = tt.addChild(
"Simple");
118 ss.addChild(
"t0",
"298.15");
119 ss.addChild(
"cp0",
"0.0");
120 std::string sval =
fp2str(val);
121 ss.addChild(
"h", sval);
122 ss.addChild(
"s",
"0.0");
137 if (&right !=
this) {
205 for (
int i = 0; i < 6; i++) {
313 if (!phaseNode.
hasChild(
"thermo")) {
314 throw CanteraError(
"FixedChemPotSSTP::initThermoXML",
"no thermo XML node");
317 std::string model = tnode[
"model"];
318 if (model !=
"StoichSubstance" && model !=
"FixedChemPot" && model !=
"StoichSubstanceSSTP") {
320 "thermo model attribute must be FixedChemPot or StoichSubstance or StoichSubstanceSSTP");
322 if (model ==
"FixedChemPot") {
344 std::string model = eosdata[
"model"];
345 if (model !=
"StoichSubstance" && model !=
"FixedChemPot" && model !=
"StoichSubstanceSSTP") {
346 throw CanteraError(
"FixedChemPotSSTP::setParametersFromXML",
347 "thermo model attribute must be FixedChemPot or StoichSubstance or StoichSubstanceSSTP");
349 if (model ==
"FixedChemPotSSTP") {
XML_Node * get_XML_File(const std::string &file, int debug)
Return a pointer to the XML tree for a Cantera input file.
size_t nElements() const
Number of elements.
const doublereal OneAtm
One atmosphere [Pa].
virtual void getGibbs_RT_ref(doublereal *grt) const
virtual void getEntropy_R_ref(doublereal *er) const
doublereal chemPot_
Value of the chemical potential of the bath species.
virtual void getGibbs_ref(doublereal *g) const
doublereal _RT() const
Return the Gas Constant multiplied by the current temperature.
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
Header for the SimpleThermo (constant heat capacity) species reference-state model for multiple speci...
virtual void getGibbs_RT(doublereal *grt) const
Get the nondimensional Gibbs functions for the species in their standard states at the current T and ...
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
virtual void install(const std::string &name, size_t index, int type, const doublereal *c, doublereal minTemp, doublereal maxTemp, doublereal refPressure)=0
Install a new species thermodynamic property parameterization for one species.
virtual void setParametersFromXML(const XML_Node &eosdata)
Set equation of state parameter values from XML entries.
Class XML_Node is a tree-based representation of the contents of an XML file.
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
This file contains definitions of terms that are used in internal routines and are unlikely to need m...
virtual doublereal logStandardConc(size_t k=0) const
Natural logarithm of the standard concentration of the kth species.
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...
virtual void setPressure(doublereal p)
Set the pressure at constant temperature. Units: Pa.
Class FixedChemPotSSTP represents a stoichiometric (fixed composition) incompressible substance...
void saveSpeciesData(const size_t k, const XML_Node *const data)
Store a reference pointer to the XML tree containing the species data for this phase.
virtual void getStandardChemPotentials(doublereal *mu0) const
Get the array of chemical potentials at unit activity for the species at their standard states at the...
Pure Virtual base class for the species thermo manager classes.
void _updateThermo() const
ThermoPhase * duplMyselfAsThermoPhase() const
Duplication function.
XML_Node & child(const size_t n) const
Return a changeable reference to the n'th child of the current node.
vector_fp m_s0_R
Dimensionless entropy at the (mtlast, m_p0)
Base class for a phase with thermodynamic properties.
void setName(const std::string &nm)
Sets the string name for the phase.
virtual doublereal standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
const int cFixedChemPot
Stoichiometric compound with a constant chemical potential.
bool importPhase(XML_Node &phase, ThermoPhase *th, SpeciesThermoFactory *spfactory)
Import a phase information into an empty thermophase object.
FixedChemPotSSTP & operator=(const FixedChemPotSSTP &right)
Assignment operator.
void addUniqueElement(const std::string &symbol, doublereal weight=-12345.0, int atomicNumber=0, doublereal entropy298=ENTROPY298_UNKNOWN, int elem_type=CT_ELEM_TYPE_ABSPOS)
Add an element, checking for uniqueness The uniqueness is checked by comparing the string symbol...
virtual void getCp_R(doublereal *cpr) const
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
std::string fp2str(const double x, const std::string &fmt)
Convert a double into a c++ string.
virtual void initThermo()
SingleSpeciesTP & operator=(const SingleSpeciesTP &right)
Assignment operator.
virtual void getIntEnergy_RT(doublereal *urt) const
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
virtual int eosType() const
Equation of state flag.
FixedChemPotSSTP()
Default constructor for the FixedChemPotSSTP class.
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized concentrations.
virtual void getParameters(int &n, doublereal *const c) const
Get the equation of state parameters in a vector.
Base class for exceptions thrown by Cantera classes.
virtual void getEnthalpy_RT_ref(doublereal *hrt) const
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
vector_fp m_h0_RT
Dimensionless enthalpy at the (mtlast, m_p0)
#define SIMPLE
Constant Cp thermo.
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
virtual void initThermo()
void addAttribute(const std::string &attrib, const std::string &value)
Add or modify an attribute of the current node.
virtual void freezeSpecies()
Call when finished adding species.
void setChemicalPotential(doublereal chemPot)
Function to set the chemical potential directly.
void setNDim(size_t ndim)
Set the number of spatial dimensions (1, 2, or 3).
virtual void getCp_R_ref(doublereal *cprt) const
doublereal temperature() const
Temperature (K).
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.
void freezeElements()
Prohibit addition of more elements, and prepare to add species.
virtual void getIntEnergy_RT_ref(doublereal *urt) const
Returns the vector of nondimensional internal Energies of the reference state at the current temperat...
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
void getPartialMolarVolumes(doublereal *vbar) const
Get the species partial molar volumes. Units: m^3/kmol.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
virtual doublereal thermalExpansionCoeff() const
Return the volumetric thermal expansion coefficient. Units: 1/K.
virtual doublereal pressure() const
Report the Pressure. Units: Pa.
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
Header file for the FixedChemPotSSTP class, which represents a fixed-composition incompressible subst...
virtual void setParameters(int n, doublereal *const c)
Set the equation of state parameters.
doublereal m_press
The current pressure of the solution (Pa)
doublereal m_tlast
Last temperature used to evaluate the thermodynamic polynomial.
virtual doublereal isothermalCompressibility() const
Returns the isothermal compressibility. Units: 1/Pa.
void setID(const std::string &id)
Set the string id for the phase.
void setSpeciesThermo(SpeciesThermo *spthermo)
Install a species thermodynamic property manager.
virtual void getStandardVolumes(doublereal *vbar) const
Get the molar volumes of each species in their standard states at the current T and P of the solution...
SpeciesThermo * m_spthermo
Pointer to the calculation manager for species reference-state thermodynamic properties.
void addUniqueSpecies(const std::string &name, const doublereal *comp, doublereal charge=0.0, doublereal size=1.0)
Add a species to the phase, checking for uniqueness of the name This routine checks for uniqueness of...
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 ...
The SingleSpeciesTP class is a filter class for ThermoPhase.
virtual void getUnitsStandardConc(doublereal *uA, int k=0, int sizeUA=6) const
Returns the units of the standard and generalized concentrations.