27Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion()
32Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion(vector<Nasa9Poly1*>& regionPts) :
46 throw CanteraError(
"Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion",
47 "refPressure inconsistency");
51 throw CanteraError(
"Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion",
52 "minTemp bounds inconsistency");
55 throw CanteraError(
"Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion",
56 "Temp bounds inconsistency");
62Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion(
double tlow,
double thigh,
double pref,
66 size_t regions =
static_cast<size_t>(coeffs[0]);
68 for (
size_t i=0; i<regions; i++) {
70 pref, coeffs + 11*i + 3);
79 throw CanteraError(
"Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion",
80 "minTemp bounds inconsistency");
83 throw CanteraError(
"Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion",
84 "Temp bounds inconsistency");
94 for (
const auto& region : regions) {
108Nasa9PolyMultiTempRegion::~Nasa9PolyMultiTempRegion()
121 T_poly[2] = T_poly[1] * T;
122 T_poly[3] = T_poly[2] * T;
124 T_poly[5] = T_poly[4] / T;
125 T_poly[6] = std::log(T);
131 doublereal* s_R)
const
145 doublereal* cp_R, doublereal* h_RT,
146 doublereal* s_R)
const
166 doublereal& tlow, doublereal& thigh,
168 doublereal*
const coeffs)
const
180 double pref_tmp = 0.0;
181 for (
size_t iReg = 0; iReg <
m_regionPts.size(); iReg++) {
182 m_regionPts[iReg]->reportParameters(n_tmp, type_tmp,
183 coeffs[index], coeffs[index+1],
185 for (
int i = 0; i < 9; i++) {
186 coeffs[index+2+i] = ctmp[3+i];
194 thermo[
"model"] =
"NASA9";
198 thermo[
"temperature-ranges"].setQuantity(T_ranges,
"K");
199 thermo[
"data"] = std::vector<vector_fp>();
201 region->getParameters(thermo);
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.
The NASA 9 polynomial parameterization for one temperature range.
void setParameters(const vector_fp &coeffs)
Set the array of 9 polynomial coefficients.
virtual int reportType() const
Returns an integer representing the type of parameterization.
vector_fp m_lowerTempBounds
Lower boundaries of each temperature regions.
void setParameters(const std::map< double, vector_fp > ®ions)
Set the array of polynomial coefficients for each temperature region.
virtual void getParameters(AnyMap &thermo) const
Store the parameters of the species thermo object such that an identical species thermo object could ...
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 size_t nCoeffs() const
This utility function returns the number of coefficients for a given type of species parameterization...
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::vector< std::unique_ptr< Nasa9Poly1 > > m_regionPts
Individual temperature region objects.
int m_currRegion
current region
virtual void updateTemperaturePoly(double T, double *T_poly) const
Given the temperature T, compute the terms of the temperature polynomial T_poly.
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.
Abstract Base class for the thermodynamic manager for an individual species' reference state.
virtual doublereal maxTemp() const
Returns the maximum temperature that the thermo parameterization is valid.
virtual void setRefPressure(double Pref)
Set the reference pressure [Pa].
virtual doublereal refPressure() const
Returns the reference pressure (Pa)
virtual void getParameters(AnyMap &thermo) const
Store the parameters of the species thermo object such that an identical species thermo object could ...
doublereal m_lowT
lowest valid temperature
virtual void setMinTemp(double Tmin)
Set the minimum temperature at which the thermo parameterization is valid.
doublereal m_highT
Highest valid temperature.
doublereal m_Pref
Reference state pressure.
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
Namespace for the Cantera kernel.
Contains const definitions for types of species reference-state thermodynamics managers (see Species ...
#define NASA9MULTITEMP
9 coefficient NASA Polynomials in multiple temperature regions This is implemented in the class Nasa9...