| Cantera 3.0.0

Loading...
Searching...
No Matches
Nasa9PolyMultiTempRegion.h
Go to the documentation of this file.
1/**
2 * @file Nasa9PolyMultiTempRegion.h
3 * Header for a single-species standard state object derived
4 * from @link Cantera::SpeciesThermoInterpType
5 * SpeciesThermoInterpType@endlink based
6 * on the NASA 9 coefficient temperature polynomial form
7 * applied to multiple temperature regions
8 * (see @ref spthermo and class @link Cantera::Nasa9PolyMultiTempRegion Nasa9PolyMultiTempRegion@endlink).
9 *
10 * This parameterization has multiple NASA temperature regions.
11 */
12
13// This file is part of Cantera. See License.txt in the top-level directory or
14// at https://cantera.org/license.txt for license and copyright information.
15
16#ifndef CT_NASA9POLYMULTITEMPREGION_H
17#define CT_NASA9POLYMULTITEMPREGION_H
18
19#include "cantera/thermo/Nasa9Poly1.h"
20
21 namespace Cantera
22{
23//! The NASA 9 polynomial parameterization for a single species encompassing
24//! multiple temperature regions.
25/*!
26 * The parameterization used in each temperature range is described in the
27 * documentation for class Nasa9Poly1.
28 *
29 * These NASA representations may have multiple temperature regions through the
30 * use of this Nasa9PolyMultiTempRegion object, which uses multiple copies of
31 * the Nasa9Poly1 object to handle multiple temperature regions.
32 *
33 * @ingroup spthermo
34 * @see Nasa9Poly1
35 */
36 class Nasa9PolyMultiTempRegion : public SpeciesThermoInterpType
37{
38 public:
39 Nasa9PolyMultiTempRegion() = default;
40
41 //! Constructor with all input data
42 /*!
43 * @param regionPts Vector of pointers to Nasa9Poly1 objects. These objects
44 * all refer to the temperature regions for the same species. The vector
45 * must be in increasing temperature region format. Together they
46 * represent the reference temperature parameterization for a single
47 * species.
48 *
49 * Note, after the constructor, we will own the underlying Nasa9Poly1
50 * objects and be responsible for owning them.
51 */
52 Nasa9PolyMultiTempRegion(vector<Nasa9Poly1*> &regionPts);
53
54 //! Constructor with all input data
55 /*!
56 * @param tlow Minimum temperature
57 * @param thigh Maximum temperature
58 * @param pref reference pressure (Pa).
59 * @param coeffs Vector of coefficients used to set the parameters for the
60 * standard state. The vector has 1 + 11*`nzones` elements
61 * in the following order:
62 * - `coeffs[0]`: Number of zones (`nzones`)
63 * - `coeffs[1 + 11*zone]`: minimum temperature within zone
64 * - `coeffs[2 + 11*zone]`: maximum temperature within zone
65 * - `coeffs[3:11 + 11*zone]`: 9 coefficient parameterization
66 * where `zone` runs from zero to `nzones`-1.
67 */
68 Nasa9PolyMultiTempRegion(double tlow, double thigh, double pref,
69 const double* coeffs);
70
71 //! Set the array of polynomial coefficients for each temperature region
72 /*!
73 * @param regions Map where each key is the minimum temperature for a
74 * region and each value is the array of 9 polynomial
75 * coefficients for that region.
76 */
77 void setParameters(const map<double, vector<double>>& regions);
78
79 int reportType() const override;
80
81 size_t temperaturePolySize() const override { return 7; }
82 void updateTemperaturePoly(double T, double* T_poly) const override;
83
84 //! @copydoc Nasa9Poly1::updateProperties
85 void updateProperties(const double* tt, double* cp_R, double* h_RT,
86 double* s_R) const override;
87
88 void updatePropertiesTemp(const double temp, double* cp_R, double* h_RT,
89 double* s_R) const override;
90
91 size_t nCoeffs() const override;
92
93 //! This utility function reports back the type of parameterization and all
94 //! of the parameters for the species, index.
95 /*!
96 * All parameters are output variables
97 *
98 * @param n Species index
99 * @param type Integer type of the standard type
100 * @param tlow output - Minimum temperature
101 * @param thigh output - Maximum temperature
102 * @param pref output - reference pressure (Pa).
103 * @param coeffs Vector of coefficients used to set the parameters for
104 * the standard state. There are 1 + 11*nzones coefficients.
105 * coeffs[0] is equal to nTempZones.
106 * index = 1
107 * for each zone:
108 * coeffs[index] = minTempZone
109 * coeffs[index+1] = maxTempZone
110 * coeffs[index+2+i] from i =0,9 are the coefficients themselves
111 */
112 void reportParameters(size_t& n, int& type, double& tlow, double& thigh,
113 double& pref, double* const coeffs) const override;
114
115 void getParameters(AnyMap& thermo) const override;
116
117 protected:
118 //! Lower boundaries of each temperature regions
119 vector<double> m_lowerTempBounds;
120
121 //! Individual temperature region objects
122 vector<unique_ptr<Nasa9Poly1>> m_regionPts;
123
124 //! current region
125 mutable int m_currRegion = 0;
126};
127
128}
129#endif
Nasa9Poly1.h
Header for a single-species standard state object derived from SpeciesThermoInterpType based on the N...
Cantera::AnyMap
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:427
Cantera::Nasa9PolyMultiTempRegion
The NASA 9 polynomial parameterization for a single species encompassing multiple temperature regions...
Definition Nasa9PolyMultiTempRegion.h:37
Cantera::Nasa9PolyMultiTempRegion::reportType
int reportType() const override
Returns an integer representing the type of parameterization.
Definition Nasa9PolyMultiTempRegion.cpp:100
Cantera::Nasa9PolyMultiTempRegion::setParameters
void setParameters(const map< double, vector< double > > &regions)
Set the array of polynomial coefficients for each temperature region.
Definition Nasa9PolyMultiTempRegion.cpp:82
Cantera::Nasa9PolyMultiTempRegion::temperaturePolySize
size_t temperaturePolySize() const override
Number of terms in the temperature polynomial for this parameterization.
Definition Nasa9PolyMultiTempRegion.h:81
Cantera::Nasa9PolyMultiTempRegion::getParameters
void getParameters(AnyMap &thermo) const override
Store the parameters of the species thermo object such that an identical species thermo object could ...
Definition Nasa9PolyMultiTempRegion.cpp:175
Cantera::Nasa9PolyMultiTempRegion::nCoeffs
size_t nCoeffs() const override
This utility function returns the number of coefficients for a given type of species parameterization...
Definition Nasa9PolyMultiTempRegion.cpp:145
Cantera::Nasa9PolyMultiTempRegion::updateTemperaturePoly
void updateTemperaturePoly(double T, double *T_poly) const override
Given the temperature T, compute the terms of the temperature polynomial T_poly.
Definition Nasa9PolyMultiTempRegion.cpp:105
Cantera::Nasa9PolyMultiTempRegion::reportParameters
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...
Definition Nasa9PolyMultiTempRegion.cpp:150
Cantera::Nasa9PolyMultiTempRegion::m_lowerTempBounds
vector< double > m_lowerTempBounds
Lower boundaries of each temperature regions.
Definition Nasa9PolyMultiTempRegion.h:119
Cantera::Nasa9PolyMultiTempRegion::m_regionPts
vector< unique_ptr< Nasa9Poly1 > > m_regionPts
Individual temperature region objects.
Definition Nasa9PolyMultiTempRegion.h:122
Cantera::Nasa9PolyMultiTempRegion::updateProperties
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.
Definition Nasa9PolyMultiTempRegion.cpp:116
Cantera::Nasa9PolyMultiTempRegion::m_currRegion
int m_currRegion
current region
Definition Nasa9PolyMultiTempRegion.h:125
Cantera::Nasa9PolyMultiTempRegion::updatePropertiesTemp
void updatePropertiesTemp(const double temp, double *cp_R, double *h_RT, double *s_R) const override
Compute the reference-state property of one species.
Definition Nasa9PolyMultiTempRegion.cpp:130
Cantera::SpeciesThermoInterpType
Abstract Base class for the thermodynamic manager for an individual species' reference state.
Definition SpeciesThermoInterpType.h:113
Cantera
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564