21 Mu0Poly::Mu0Poly(
double tlow,
double thigh,
double pref,
const double* coeffs) :
30 doublereal* h_RT, doublereal* s_R)
const 51 doublereal* s_R)
const 57 doublereal& tlow, doublereal& thigh,
59 doublereal*
const coeffs)
const 78 bool dimensionlessMu0Values =
false;
80 doublereal h298 = 0.0;
82 h298 =
getFloat(Mu0Node,
"H298",
"actEnergy");
93 throw CanteraError(
"installMu0ThermoFromXML",
"missing Mu0Values");
100 if (valNode_ptr->
attrib(
"units") ==
"Dimensionless") {
101 dimensionlessMu0Values =
true;
103 if (cValues.size() != numPoints) {
104 throw CanteraError(
"installMu0ThermoFromXML",
"numPoints inconsistent");
111 "missing Mu0Temperatures");
114 if (cTemperatures.size() != numPoints) {
115 throw CanteraError(
"installMu0ThermoFromXML",
"numPoints inconsistent");
119 if (dimensionlessMu0Values) {
120 for (
size_t i = 0; i < numPoints; i++) {
121 cValues[i] *= cTemperatures[i] / 273.15;
126 c[0] =
static_cast<double>(numPoints);
128 for (
size_t i = 0; i < numPoints; i++) {
129 c[2+i*2] = cTemperatures[i];
130 c[2+i*2+1] = cValues[i];
134 fpValue(Mu0Node[
"Pref"]), &c[0]);
139 size_t nPoints = (size_t) coeffs[0];
142 "nPoints must be >= 2");
158 for (
size_t i = 0, iindex = 2; i < nPoints; i++) {
159 double T1 = coeffs[iindex];
166 if (i < nPoints - 1 && coeffs[iindex+2] <= T1) {
168 "Temperatures are not monotonic increasing");
174 "One temperature has to be 298.15");
185 double deltaT = T2 - T1;
186 double cpi = (deltaMu - T1 * s1 + T2 * s1) / (deltaT - T2 * log(T2/T1));
197 for (
size_t i = iT298 - 1; i !=
npos; i--) {
202 double deltaT = T2 - T1;
203 double cpi = (deltaMu - T1 * s2 + T2 * s2) / (deltaT - T1 * log(T2/T1));
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...
Abstract 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.
size_t getFloatArray(const XML_Node &node, vector_fp &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...
const size_t npos
index returned by functions to indicate "no position"
size_t m_numIntervals
Number of intervals in the interpolating linear approximation.
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.
The Mu0Poly class implements an interpolation of the Gibbs free energy based on a piecewise constant ...
doublereal m_H298
Value of the enthalpy at T = 298.15.
#define MU0_INTERP
piecewise interpolation of mu0.
virtual void updatePropertiesTemp(const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state property of one species.
virtual void updateProperties(const doublereal *tt, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Update the properties for this species, given a temperature polynomial.
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.
doublereal m_lowT
lowest valid temperature
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
int getInteger(const XML_Node &parent, const std::string &name)
Get an integer value from a child element.
virtual void reportParameters(size_t &n, int &type, doublereal &tlow, doublereal &thigh, doublereal &pref, doublereal *const coeffs) const
This utility function reports back the type of parameterization and all of the parameters for the spe...
std::string attrib(const std::string &attr) const
Function returns the value of an attribute.
XML_Node * getByTitle(const 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...
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.
doublereal getFloat(const XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
vector_fp m_h0_R_int
Dimensionless Enthalpies at the temperature points.
doublereal m_Pref
Reference state pressure.
Namespace for the Cantera kernel.
Mu0Poly * newMu0ThermoFromXML(const XML_Node &Mu0Node)
Install a Mu0 polynomial thermodynamic reference state.
void processCoeffs(const doublereal *coeffs)
process the coefficients