20 Mu0Poly::Mu0Poly() : m_numIntervals(0),
24 "Default constructor to be removed after Cantera 2.3.");
41 doublereal* h_RT, doublereal* s_R)
const 62 doublereal* s_R)
const 68 doublereal& tlow, doublereal& thigh,
70 doublereal*
const coeffs)
const 90 "Cantera 2.3. Use MultiSpeciesThermo::modifySpecies instead.");
96 bool dimensionlessMu0Values =
false;
98 doublereal h298 = 0.0;
100 h298 =
getFloat(Mu0Node,
"H298",
"actEnergy");
103 size_t numPoints = 1;
104 if (Mu0Node.
hasChild(
"numPoints")) {
111 throw CanteraError(
"installMu0ThermoFromXML",
"missing Mu0Values");
118 if (valNode_ptr->
attrib(
"units") ==
"Dimensionless") {
119 dimensionlessMu0Values =
true;
121 if (cValues.size() != numPoints) {
122 throw CanteraError(
"installMu0ThermoFromXML",
"numPoints inconsistent");
129 "missing Mu0Temperatures");
132 if (cTemperatures.size() != numPoints) {
133 throw CanteraError(
"installMu0ThermoFromXML",
"numPoints inconsistent");
137 if (dimensionlessMu0Values) {
138 for (
size_t i = 0; i < numPoints; i++) {
139 cValues[i] *= cTemperatures[i] / 273.15;
144 c[0] =
static_cast<double>(numPoints);
146 for (
size_t i = 0; i < numPoints; i++) {
147 c[2+i*2] = cTemperatures[i];
148 c[2+i*2+1] = cValues[i];
152 fpValue(Mu0Node[
"Pref"]), &c[0]);
157 size_t nPoints = (size_t) coeffs[0];
160 "nPoints must be >= 2");
176 for (
size_t i = 0, iindex = 2; i < nPoints; i++) {
177 double T1 = coeffs[iindex];
184 if (i < nPoints - 1 && coeffs[iindex+2] <= T1) {
186 "Temperatures are not monotonic increasing");
192 "One temperature has to be 298.15");
203 double deltaT = T2 - T1;
204 double cpi = (deltaMu - T1 * s1 + T2 * s1) / (deltaT - T2 * log(T2/T1));
215 for (
size_t i = iT298 - 1; i !=
npos; i--) {
220 double deltaT = T2 - T1;
221 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.
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...
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.
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.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
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.
virtual void modifyParameters(doublereal *coeffs)
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.
virtual SpeciesThermoInterpType * duplMyselfAsSpeciesThermoInterpType() const
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