25Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion(vector<Nasa9Poly1*>& regionPts)
38 throw CanteraError(
"Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion",
39 "refPressure inconsistency");
43 throw CanteraError(
"Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion",
44 "minTemp bounds inconsistency");
47 throw CanteraError(
"Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion",
48 "Temp bounds inconsistency");
54Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion(
double tlow,
double thigh,
double pref,
58 size_t regions =
static_cast<size_t>(coeffs[0]);
60 for (
size_t i=0; i<regions; i++) {
62 pref, coeffs + 11*i + 3);
71 throw CanteraError(
"Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion",
72 "minTemp bounds inconsistency");
75 throw CanteraError(
"Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion",
76 "Temp bounds inconsistency");
86 for (
const auto& [Tmin, coeffs] : regions) {
109 T_poly[2] = T_poly[1] * T;
110 T_poly[3] = T_poly[2] * T;
112 T_poly[5] = T_poly[4] / T;
113 T_poly[6] = std::log(T);
117 double* cp_R,
double* h_RT,
double* s_R)
const
131 double* cp_R,
double* h_RT,
double* s_R)
const
151 double& tlow,
double& thigh,
double& pref,
double*
const coeffs)
const
163 double pref_tmp = 0.0;
164 for (
size_t iReg = 0; iReg <
m_regionPts.size(); iReg++) {
165 m_regionPts[iReg]->reportParameters(n_tmp, type_tmp,
166 coeffs[index], coeffs[index+1],
168 for (
int i = 0; i < 9; i++) {
169 coeffs[index+2+i] = ctmp[3+i];
177 thermo[
"model"] =
"NASA9";
181 thermo[
"temperature-ranges"].setQuantity(T_ranges,
"K");
182 thermo[
"data"] = vector<vector<double>>();
184 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< double > &coeffs)
Set the array of 9 polynomial coefficients.
int reportType() const override
Returns an integer representing the type of parameterization.
void setParameters(const map< double, vector< double > > ®ions)
Set the array of polynomial coefficients for each temperature region.
void getParameters(AnyMap &thermo) const override
Store the parameters of the species thermo object such that an identical species thermo object could ...
size_t nCoeffs() const override
This utility function returns the number of coefficients for a given type of species parameterization...
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...
vector< double > m_lowerTempBounds
Lower boundaries of each temperature regions.
vector< unique_ptr< Nasa9Poly1 > > m_regionPts
Individual temperature region objects.
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.
int m_currRegion
current region
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.
virtual double maxTemp() const
Returns the maximum temperature that the thermo parameterization is valid.
double m_Pref
Reference state pressure.
virtual void setRefPressure(double Pref)
Set 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 ...
double m_lowT
lowest valid temperature
virtual void setMinTemp(double Tmin)
Set the minimum temperature at which the thermo parameterization is valid.
virtual double refPressure() const
Returns the reference pressure (Pa)
double m_highT
Highest valid temperature.
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...