21Nasa9Poly1::Nasa9Poly1()
26Nasa9Poly1::Nasa9Poly1(
double tlow,
double thigh,
double pref,
27 const double* coeffs) :
29 m_coeff(coeffs, coeffs + 9)
35 if (coeffs.size() != 9) {
36 throw CanteraError(
"Nasa9Poly1::setParameters",
"Array must contain "
37 "9 coefficients, but {} were given.", coeffs.size());
51 T_poly[2] = T_poly[1] * T;
52 T_poly[3] = T_poly[2] * T;
54 T_poly[5] = T_poly[4] / T;
55 T_poly[6] = std::log(T);
62 double ct0 =
m_coeff[0] * tt[5];
63 double ct1 =
m_coeff[1] * tt[4];
65 double ct3 =
m_coeff[3] * tt[0];
66 double ct4 =
m_coeff[4] * tt[1];
67 double ct5 =
m_coeff[5] * tt[2];
68 double ct6 =
m_coeff[6] * tt[3];
70 double cpdivR = ct0 + ct1 + ct2 + ct3 + ct4 + ct5 + ct6;
71 double hdivRT = -ct0 + tt[6]*ct1 + ct2 + 0.5*ct3 + 1.0/3.0*ct4
72 + 0.25*ct5 + 0.2*ct6 +
m_coeff[7] * tt[4];
73 double sdivR = -0.5*ct0 - ct1 + tt[6]*ct2 + ct3 + 0.5*ct4
74 + 1.0/3.0*ct5 + 0.25*ct6 +
m_coeff[8];
91 double& pref,
double*
const coeffs)
const
101 for (
int i = 0; i < 9; i++) {
110 thermo[
"data"].asVector<vector<double>>().push_back(
m_coeff);
Header for a single-species standard state object derived from SpeciesThermoInterpType based on the N...
A map of string keys to values whose type can vary at runtime.
Base class for exceptions thrown by Cantera classes.
vector< double > m_coeff
array of polynomial coefficients
int reportType() const override
Returns an integer representing the type of parameterization.
void setParameters(const vector< double > &coeffs)
Set the array of 9 polynomial coefficients.
void getParameters(AnyMap &thermo) const override
Store the parameters of the species thermo object such that an identical species thermo object could ...
void updateTemperaturePoly(double T, double *T_poly) const override
Given the temperature T, compute the terms of the temperature polynomial T_poly.
void reportParameters(size_t &n, int &type, double &tlow, double &thigh, double &pref, double *const coeffs) const override
This utility function reports back the type of parameterization and all of the parameters for the spe...
void updateProperties(const double *tt, double *cp_R, double *h_RT, double *s_R) const override
Update the properties for this species, given a temperature polynomial.
void updatePropertiesTemp(const double temp, double *cp_R, double *h_RT, double *s_R) const override
Compute the reference-state property of one species.
Abstract Base class for the thermodynamic manager for an individual species' reference state.
double m_Pref
Reference state pressure.
double m_lowT
lowest valid temperature
double m_highT
Highest valid temperature.
Namespace for the Cantera kernel.
#define NASA9
9 coefficient NASA Polynomials This is implemented in the class Nasa9Poly1 in Nasa9Poly1....