26 warn_deprecated(
"class FixedChemPotSSTP",
"To be removed after Cantera 2.5. "
27 "Use class StoichSubstance with a constant-cp species thermo model, "
28 "with 'h0' set to the desired chemical potential and 's0' set to 0.");
34 warn_deprecated(
"class FixedChemPotSSTP",
"To be removed after Cantera 2.5. "
35 "Use class StoichSubstance with a constant-cp species thermo model, "
36 "with 'h0' set to the desired chemical potential and 's0' set to 0.");
42 warn_deprecated(
"class FixedChemPotSSTP",
"To be removed after Cantera 2.5. "
43 "Use class StoichSubstance with a constant-cp species thermo model, "
44 "with 'h0' set to the desired chemical potential and 's0' set to 0.");
51 warn_deprecated(
"class FixedChemPotSSTP",
"To be removed after Cantera 2.5. "
52 "Use class StoichSubstance with a constant-cp species thermo model, "
53 "with 'h0' set to the desired chemical potential and 's0' set to 0.");
54 std::string pname = Ename +
"Fixed";
59 double c[4] = {298.15, val, 0.0, 0.0};
60 shared_ptr<SpeciesThermoInterpType> stit(
72 std::string aaS = Ename +
":1";
73 s.addChild(
"atomArray", aaS);
75 XML_Node& ss = tt.addChild(
"Simple");
79 ss.addChild(
"t0",
"298.15");
80 ss.addChild(
"cp0",
"0.0");
81 ss.addChild(
"h", fmt::format(
"{}", val));
82 ss.addChild(
"s",
"0.0");
211 if (!phaseNode.
hasChild(
"thermo")) {
212 throw CanteraError(
"FixedChemPotSSTP::initThermoXML",
"no thermo XML node");
215 std::string model = tnode[
"model"];
216 if (model !=
"StoichSubstance" && model !=
"FixedChemPot" && model !=
"StoichSubstanceSSTP") {
218 "thermo model attribute must be FixedChemPot or StoichSubstance or StoichSubstanceSSTP");
222 if (model ==
"FixedChemPot") {
223 double val =
getFloat(tnode,
"chemicalPotential",
"toSI");
252 std::string model = eosdata[
"model"];
253 if (model !=
"StoichSubstance" && model !=
"FixedChemPot" && model !=
"StoichSubstanceSSTP") {
254 throw CanteraError(
"FixedChemPotSSTP::setParametersFromXML",
255 "thermo model attribute must be FixedChemPot or StoichSubstance or StoichSubstanceSSTP");
257 if (model ==
"FixedChemPotSSTP") {
258 doublereal val =
getFloat(eosdata,
"chemicalPotential",
"toSI");
Header file for the FixedChemPotSSTP class, which represents a fixed-composition incompressible subst...
Header for factory functions to build instances of classes that manage the standard-state thermodynam...
Pure Virtual Base class for individual species reference state thermodynamic managers and text for th...
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
double convert(const std::string &key, const std::string &units) const
Convert the item stored by the given key to the units specified in units.
bool hasKey(const std::string &key) const
Returns true if the map contains an item named key.
Base class for exceptions thrown by Cantera classes.
virtual void getGibbs_RT_ref(doublereal *grt) const
Returns the vector of nondimensional Gibbs Free Energies of the reference state at the current temper...
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 doublereal pressure() const
Report the Pressure. Units: Pa.
FixedChemPotSSTP()
Default constructor for the FixedChemPotSSTP class.
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
virtual doublereal logStandardConc(size_t k=0) const
Natural logarithm of the standard concentration of the kth species.
virtual void getPartialMolarVolumes(doublereal *vbar) const
Get the species partial molar volumes. Units: m^3/kmol.
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized concentrations.
virtual doublereal thermalExpansionCoeff() const
Return the volumetric thermal expansion coefficient. Units: 1/K.
virtual void getCp_R(doublereal *cpr) const
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
virtual void getStandardChemPotentials(doublereal *mu0) const
Get the array of chemical potentials at unit activity for the species at their standard states at the...
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
virtual void setPressure(doublereal p)
Set the pressure at constant temperature. Units: Pa.
void setChemicalPotential(doublereal chemPot)
Function to set the chemical potential directly.
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
virtual void getEntropy_R_ref(doublereal *er) const
Returns the vector of nondimensional entropies of the reference state at the current temperature of t...
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 getIntEnergy_RT(doublereal *urt) const
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
virtual void getCp_R_ref(doublereal *cprt) const
Returns the vector of nondimensional constant pressure heat capacities of the reference state at the ...
virtual Units standardConcentrationUnits() const
Returns the units of the "standard concentration" for this phase.
virtual void setParametersFromXML(const XML_Node &eosdata)
Set equation of state parameter values from XML entries.
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...
virtual void setParameters(int n, doublereal *const c)
Set the equation of state parameters.
doublereal chemPot_
Value of the chemical potential of the bath species.
virtual void getGibbs_ref(doublereal *g) const
Returns the vector of the Gibbs function of the reference state at the current temperature of the sol...
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 getParameters(int &n, doublereal *const c) const
Get the equation of state parameters in a vector.
virtual void getEnthalpy_RT_ref(doublereal *hrt) const
Returns the vector of nondimensional enthalpies of the reference state at the current temperature of ...
virtual doublereal isothermalCompressibility() const
Returns the isothermal compressibility. Units: 1/Pa.
virtual doublereal standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
void setName(const std::string &nm)
Sets the string name for the phase.
size_t addElement(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.
void setNDim(size_t ndim)
Set the number of spatial dimensions (1, 2, or 3).
doublereal m_press
The current pressure of the solution (Pa). It gets initialized to 1 atm.
virtual bool addSpecies(shared_ptr< Species > spec)
double m_h0_RT
Dimensionless enthalpy at the (mtlast, m_p0)
double m_s0_R
Dimensionless entropy at the (mtlast, m_p0)
void _updateThermo() const
doublereal RT() const
Return the Gas Constant multiplied by the current temperature.
doublereal m_tlast
last value of the temperature processed by reference state
virtual void initThermoFile(const std::string &inputFile, const std::string &id)
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
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.
AnyMap m_input
Data supplied via setParameters.
A representation of the units associated with a dimensional quantity.
Class XML_Node is a tree-based representation of the contents of an XML file.
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
void addAttribute(const std::string &attrib, const std::string &value)
Add or modify an attribute of the current node.
XML_Node & child(const size_t n) const
Return a changeable reference to the n'th child of the current node.
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data.
const double OneAtm
One atmosphere [Pa].
void importPhase(XML_Node &phase, ThermoPhase *th)
Import a phase information into an empty ThermoPhase object.
Namespace for the Cantera kernel.
doublereal getFloat(const XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
compositionMap parseCompString(const std::string &ss, const std::vector< std::string > &names)
Parse a composition string into a map consisting of individual key:composition pairs.
SpeciesThermoInterpType * newSpeciesThermoInterpType(int type, double tlow, double thigh, double pref, const double *coeffs)
Create a new SpeciesThermoInterpType object given a corresponding constant.
Contains declarations for string manipulation functions within Cantera.