Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 #ifndef CT_NASA9POLYMULTITEMPREGION_H
14 #define CT_NASA9POLYMULTITEMPREGION_H
15 // Copyright 2007 Sandia National Laboratories
16 
18 
19 namespace Cantera
20 {
21 //! The NASA 9 polynomial parameterization for a single species
22 //! encompassing multiple temperature regions.
23 /*!
24  * The parameterization used in each temperature range is described in the
25  * documentation for class Nasa9Poly1.
26  *
27  * These NASA representations may have multiple temperature regions
28  * through the use of this Nasa9PolyMultiTempRegion object, which uses
29  * multiple copies of the Nasa9Poly1 object to handle multiple temperature
30  * regions.
31  *
32  * @ingroup spthermo
33  * @see Nasa9Poly1
34  */
36 {
37 public:
38  //! Empty constructor
40 
41  //! Constructor used in templated instantiations
42  /*!
43  * @param regionPts Vector of pointers to Nasa9Poly1 objects. These
44  * objects all refer to the temperature regions for the
45  * same species. The vector must be in increasing
46  * temperature region format. Together they
47  * represent the reference temperature parameterization
48  * for a single species.
49  *
50  * Note, after the constructor, we will own the underlying
51  * Nasa9Poly1 objects and be responsible for owning them.
52  */
53  Nasa9PolyMultiTempRegion(std::vector<Cantera::Nasa9Poly1*> &regionPts);
54 
55  //! Copy constructor
56  /*!
57  * @param b object to be copied
58  */
60 
61  //! Assignment operator
62  /*!
63  * @param b object to be copied
64  */
66 
67  //! Destructor
68  virtual ~Nasa9PolyMultiTempRegion();
69 
71  duplMyselfAsSpeciesThermoInterpType() const;
72 
73  virtual int reportType() const;
74 
75  virtual void setIndex(size_t index);
76 
77  virtual size_t temperaturePolySize() const { return 7; }
78  virtual void updateTemperaturePoly(double T, double* T_poly) const;
79 
80  //! Update the properties for this species, given a temperature polynomial
81  /*!
82  * This method is called with a pointer to an array containing the
83  * functions of temperature needed by this parameterization, and three
84  * pointers to arrays where the computed property values should be
85  * written. This method updates only one value in each array.
86  *
87  * Temperature Polynomial:
88  * tt[0] = t;
89  * tt[1] = t*t;
90  * tt[2] = t*t*t;
91  * tt[3] = t*t*t*t;
92  * tt[4] = 1.0/t;
93  * tt[5] = 1.0/(t*t);
94  * tt[6] = std::log(t);
95  *
96  * @param tt vector of temperature polynomials
97  * @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
98  * @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
99  * @param s_R Vector of Dimensionless entropies. (length m_kk).
100  */
101  virtual void updateProperties(const doublereal* tt,
102  doublereal* cp_R, doublereal* h_RT,
103  doublereal* s_R) const;
104 
105  //! Compute the reference-state property of one species
106  /*!
107  * Given temperature T in K, this method updates the values of
108  * the non-dimensional heat capacity at constant pressure,
109  * enthalpy, and entropy, at the reference pressure, Pref
110  * of one of the species. The species index is used
111  * to reference into the cp_R, h_RT, and s_R arrays.
112  *
113  * Temperature Polynomial:
114  * tt[0] = t;
115  * tt[1] = t*t;
116  * tt[2] = t*t*t;
117  * tt[3] = t*t*t*t;
118  * tt[4] = 1.0/t;
119  * tt[5] = 1.0/(t*t);
120  * tt[6] = std::log(t);
121  *
122  * @param temp Temperature (Kelvin)
123  * @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
124  * @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
125  * @param s_R Vector of Dimensionless entropies. (length m_kk).
126  */
127  virtual void updatePropertiesTemp(const doublereal temp,
128  doublereal* cp_R, doublereal* h_RT,
129  doublereal* s_R) const;
130 
131  //!This utility function reports back the type of
132  //! parameterization and all of the parameters for the
133  //! species, index.
134  /*!
135  * All parameters are output variables
136  *
137  * @param n Species index
138  * @param type Integer type of the standard type
139  * @param tlow output - Minimum temperature
140  * @param thigh output - Maximum temperature
141  * @param pref output - reference pressure (Pa).
142  * @param coeffs Vector of coefficients used to set the
143  * parameters for the standard state.
144  * There are 1 + 11*nzones coefficients
145  * coeffs[0] is equal to nTempZones.
146  * index = 1
147  * for each zone:
148  * coeffs[index] = minTempZone
149  * coeffs[index+1] = maxTempZone
150  * coeffs[index+2+i] from i =0,9 are the coefficients themselves
151  */
152  virtual void reportParameters(size_t& n, int& type,
153  doublereal& tlow, doublereal& thigh,
154  doublereal& pref,
155  doublereal* const coeffs) const;
156 
157  //! Modify parameters for the standard state
158  /*!
159  * @param coeffs Vector of coefficients used to set the
160  * parameters for the standard state.
161  */
162  virtual void modifyParameters(doublereal* coeffs);
163 
164 protected:
165  //! Number of temperature regions
167 
168  //! Lower boundaries of each temperature regions
170 
171  //! pointers to the objects
172  /*!
173  * This object will now own these pointers and delete
174  * them when the current object is deleted.
175  */
176  std::vector<Nasa9Poly1*>m_regionPts;
177 
178  //! current region
179  mutable int m_currRegion;
180 };
181 
182 }
183 #endif
size_t m_numTempRegions
Number of temperature regions.
Pure Virtual Base class for the thermodynamic manager for an individual species' reference state...
Header for a single-species standard state object derived from SpeciesThermoInterpType based on the N...
vector_fp m_lowerTempBounds
Lower boundaries of each temperature regions.
virtual int reportType() const
Returns an integer representing the type of parameterization.
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.
virtual size_t temperaturePolySize() const
Number of terms in the temperature polynomial for this parameterization.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Definition: ct_defs.h:157
Nasa9PolyMultiTempRegion & operator=(const Nasa9PolyMultiTempRegion &b)
Assignment operator.
The NASA 9 polynomial parameterization for a single species encompassing multiple temperature regions...
virtual void modifyParameters(doublereal *coeffs)
Modify parameters for the standard state.
virtual void updatePropertiesTemp(const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state property of one species.
std::vector< Nasa9Poly1 * > m_regionPts
pointers to the objects
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...