21 Mu0Poly::Mu0Poly() : m_numIntervals(0),
28 const doublereal* coeffs) :
38 m_numIntervals(b.m_numIntervals),
41 m_mu0_R_int(b.m_mu0_R_int),
42 m_h0_R_int(b.m_h0_R_int),
43 m_s0_R_int(b.m_s0_R_int),
44 m_cp0_R_int(b.m_cp0_R_int)
51 SpeciesThermoInterpType::operator=(b);
71 doublereal* h_RT, doublereal* s_R)
const
85 doublereal rt = 1.0/T;
95 doublereal* s_R)
const
101 doublereal& tlow, doublereal& thigh,
103 doublereal*
const coeffs)
const
131 doublereal tmin, tmax;
132 bool dimensionlessMu0Values =
false;
133 const XML_Node& Mu0Node = *Mu0Node_ptr;
135 tmin =
fpValue(Mu0Node[
"Tmin"]);
136 tmax =
fpValue(Mu0Node[
"Tmax"]);
137 doublereal pref =
fpValue(Mu0Node[
"Pref"]);
139 doublereal h298 = 0.0;
141 h298 =
getFloat(Mu0Node,
"H298",
"actEnergy");
144 size_t numPoints = 1;
145 if (Mu0Node.
hasChild(
"numPoints")) {
151 getByTitle(const_cast<XML_Node&>(Mu0Node),
"Mu0Values");
154 "missing required while processing "
163 string uuu = (*valNode_ptr)[
"units"];
164 if (uuu ==
"Dimensionless") {
165 dimensionlessMu0Values =
true;
167 size_t ns = cValues.size();
168 if (ns != numPoints) {
170 "numPoints inconsistent while processing "
176 getByTitle(const_cast<XML_Node&>(Mu0Node),
"Mu0Temperatures");
179 "missing required while processing + "
183 ns = cTemperatures.size();
184 if (ns != numPoints) {
186 "numPoints inconsistent while processing "
193 if (dimensionlessMu0Values) {
194 for (
size_t i = 0; i < numPoints; i++) {
195 cValues[i] *= cTemperatures[i] / 273.15;
202 c[0] =
static_cast<double>(numPoints);
204 for (
size_t i = 0; i < numPoints; i++) {
205 c[2+i*2] = cTemperatures[i];
206 c[2+i*2+1] = cValues[i];
216 size_t nPoints = (size_t) coeffs[0];
219 "nPoints must be >= 2");
238 for (i = 0, iindex = 2; i < nPoints; i++) {
246 if (i < nPoints - 1) {
247 T2 = coeffs[iindex+2];
250 "Temperatures are not monotonic increasing");
257 "One temperature has to be 298.15");
263 doublereal mu2, s1, s2, h1, h2, cpi, deltaMu, deltaT;
277 cpi = (deltaMu - T1 * s1 + T2 * s1) / (deltaT - T2 * log(T2/T1));
278 h2 = h1 + cpi * deltaT;
279 s2 = s1 + cpi * log(T2/T1);
294 for (i = iT298 - 1; i !=
npos; i--) {
303 cpi = (deltaMu - T1 * s2 + T2 * s2) / (deltaT - T1 * log(T2/T1));
304 h1 = h2 - cpi * deltaT;
305 s1 = s2 - cpi * log(T2/T1);
309 if (i == (m_numIntervals-1)) {
315 printf(
" Temp mu0(J/kmol) cp0(J/kmol/K) "
316 " h0(J/kmol) s0(J/kmol/K) \n");
317 for (i = 0; i < nPoints; i++) {
318 printf(
"%12.3g %12.5g %12.5g %12.5g %12.5g\n",
doublereal fpValue(const std::string &val)
Translate a string into one doublereal value.
Header for a single-species standard state object derived from SpeciesThermoInterpType based on a pie...
Pure Virtual Base class for the thermodynamic manager for an individual species' reference state...
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data...
vector_fp m_s0_R_int
Entropy at the points.
virtual void updatePropertiesTemp(const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state property of one species.
const size_t npos
index returned by functions to indicate "no position"
size_t m_index
species index
size_t m_numIntervals
Number of intervals in the interpolating linear approximation.
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.
Class XML_Node is a tree-based representation of the contents of an XML file.
vector_fp m_cp0_R_int
Heat capacity at the points.
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...
doublereal getFloat(const Cantera::XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
The Mu0Poly class implements an interpolation of the Gibbs free energy based on a piecewise constant ...
void installMu0ThermoFromXML(const std::string &speciesName, SpeciesThermo &sp, size_t k, const XML_Node *Mu0Node_ptr)
Install a Mu0 polynomial thermodynamic reference state.
Pure Virtual base class for the species thermo manager classes.
doublereal m_H298
Value of the enthalpy at T = 298.15.
XML_Node * getByTitle(const Cantera::XML_Node &node, const std::string &title)
Search the child nodes of the current node for an XML Node with a Title attribute of a given name...
#define MU0_INTERP
piecewise interpolation of mu0.
Contains const definitions for types of species reference-state thermodynamics managers (see Species ...
virtual void reportParameters(size_t &n, int &type, doublereal &tlow, doublereal &thigh, doublereal &pref, doublereal *const coeffs) const
Mu0Poly & operator=(const Mu0Poly &)
Assignment operator.
virtual SpeciesThermoInterpType * duplMyselfAsSpeciesThermoInterpType() const
duplicator
Classes providing support for XML data files.
doublereal m_highT
Highest valid temperature.
vector_fp m_mu0_R_int
Mu0's are primary input data.
Base class for exceptions thrown by Cantera classes.
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
virtual void modifyParameters(doublereal *coeffs)
Modify parameters for the standard state.
doublereal m_lowT
lowest valid temperature
virtual void updateProperties(const doublereal *tPoly, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Update the properties for this species, given a temperature polynomial.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
vector_fp m_t0_int
Points at which the standard state chemical potential are given.
Contains declarations for string manipulation functions within Cantera.
vector_fp m_h0_R_int
Dimensionless Enthalpies at the temperature points.
doublereal m_Pref
Reference state pressure.
int getInteger(const Cantera::XML_Node &parent, const std::string &name)
Get an integer value from a child element.
size_t getFloatArray(const Cantera::XML_Node &node, std::vector< doublereal > &v, const bool convert, const std::string &unitsString, const std::string &nodeName)
This function reads the current node or a child node of the current node with the default name...
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
void processCoeffs(const doublereal *coeffs)
process the coefficients