Cantera  2.1.2
Nasa9Poly1.h
Go to the documentation of this file.
1 /**
2  * @file Nasa9Poly1.h
3  * Header for a single-species standard state object derived
4  * from
6  * on the NASA 9 coefficient temperature polynomial form applied to
7  * one temperature region
9  *
10  * This parameterization has one NASA temperature region.
11  */
12 /*
13  * Copyright (2006) Sandia Corporation. Under the terms of
14  * Contract DE-AC04-94AL85000 with Sandia Corporation, the
15  * U.S. Government retains certain rights in this software.
16  */
17
18 #ifndef CT_NASA9POLY1_H
19 #define CT_NASA9POLY1_H
20 #include "cantera/base/global.h"
22
23 namespace Cantera
24 {
25 //! The NASA 9 polynomial parameterization for one temperature range.
26 /*!
27  * This parameterization expresses the heat capacity via a
28  * 7 coefficient polynomial.
29  * Note that this is the form used in the
30  * 2002 NASA equilibrium program. A reference to the form is
31  * provided below:
32  *
33  * "NASA Glenn Coefficients for Calculating Thermodynamic
34  * Properties of Individual Species,"
35  * B. J. McBride, M. J. Zehe, S. Gordon
36  * NASA/TP-2002-211556, Sept. 2002
37  *
38  * Nine coefficients \f$(a_0,\dots,a_6)\f$ are used to represent
39  * \f$C_p^0(T)\f$, \f$H^0(T)\f$, and \f$S^0(T) \f$ as
40  * polynomials in \f$T \f$ :
41  * \f[
42  * \frac{C_p^0(T)}{R} = a_0 T^{-2} + a_1 T^{-1} + a_2 + a_3 T
43  * + a_4 T^2 + a_5 T^3 + a_6 T^4
44  * \f]
45  *
46  * \f[
47  * \frac{H^0(T)}{RT} = - a_0 T^{-2} + a_1 \frac{\ln(T)}{T} + a_2
48  * + a_3 T + a_4 T^2 + a_5 T^3 + a_6 T^4 + \frac{a_7}{T}
49  * \f]
50  *
51  * \f[
52  * \frac{s^0(T)}{R} = - \frac{a_0}{2} T^{-2} - a_1 T^{-1} + a_2 \ln(T)
53  + + a_3 T \frac{a_4}{2} T^2 + \frac{a_5}{3} T^3 + \frac{a_6}{4} T^4 + a_8
54  * \f]
55  *
56  * The standard state is assumed to be an ideal gas at the
57  * standard pressure of 1 bar, for gases.
58  * For condensed species, the standard state is the
59  * pure crystalline or liquid substance at the standard
60  * pressure of 1 atm.
61  *
62  * These NASA representations may have multiple temperature regions
63  * through the use of the Nasa9PolyMultiTempRegion object, which uses
64  * multiple copies of this %Nasa9Poly1 object to handle multiple temperature
65  * regions.
66  *
67  * @ingroup spthermo
68  */
70 {
71 public:
72  //! Empty constructor
73  Nasa9Poly1();
74
75  //! constructor used in templated instantiations
76  /*!
77  * @param n Species index
78  * @param tlow Minimum temperature
79  * @param thigh Maximum temperature
80  * @param pref reference pressure (Pa).
81  * @param coeffs Vector of coefficients used to set the
82  * parameters for the standard state.
83  */
84  Nasa9Poly1(size_t n, doublereal tlow, doublereal thigh, doublereal pref,
85  const doublereal* coeffs);
86
87  //! copy constructor
88  /*!
89  * @param b object to be copied
90  */
91  Nasa9Poly1(const Nasa9Poly1& b);
92
93  //! assignment operator
94  /*!
95  * @param b object to be copied
96  */
97  Nasa9Poly1& operator=(const Nasa9Poly1& b);
98
101
102  virtual int reportType() const;
103
104  //! Update the properties for this species, given a temperature polynomial
105  /*!
106  * This method is called with a pointer to an array containing the
107  * functions of temperature needed by this parameterization, and three
108  * pointers to arrays where the computed property values should be
109  * written. This method updates only one value in each array.
110  *
111  * Temperature Polynomial:
112  * tt[0] = t;
113  * tt[1] = t*t;
114  * tt[2] = t*t*t;
115  * tt[3] = t*t*t*t;
116  * tt[4] = 1.0/t;
117  * tt[5] = 1.0/(t*t);
118  * tt[6] = std::log(t);
119  *
120  * @param tt vector of temperature polynomials
121  * @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
122  * @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
123  * @param s_R Vector of Dimensionless entropies. (length m_kk).
124  */
125  virtual void updateProperties(const doublereal* tt,
126  doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const;
127
128  //! Compute the reference-state property of one species
129  /*!
130  * Given temperature T in K, this method updates the values of the non-
131  * dimensional heat capacity at constant pressure, enthalpy, and entropy,
132  * at the reference pressure, Pref of one of the species. The species
133  * index is used to reference into the cp_R, h_RT, and s_R arrays.
134  *
135  * Temperature Polynomial:
136  * tt[0] = t;
137  * tt[1] = t*t;
138  * tt[2] = t*t*t;
139  * tt[3] = t*t*t*t;
140  * tt[4] = 1.0/t;
141  * tt[5] = 1.0/(t*t);
142  * tt[6] = std::log(t);
143  *
144  * @param temp Temperature (Kelvin)
145  * @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
146  * @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
147  * @param s_R Vector of Dimensionless entropies. (length m_kk).
148  */
149  virtual void updatePropertiesTemp(const doublereal temp,
150  doublereal* cp_R, doublereal* h_RT,
151  doublereal* s_R) const;
152
153  //!This utility function reports back the type of
154  //! parameterization and all of the parameters for the
155  //! species, index.
156  /*!
157  * All parameters are output variables
158  *
159  * @param n Species index
160  * @param type Integer type of the standard type
161  * @param tlow output - Minimum temperature
162  * @param thigh output - Maximum temperature
163  * @param pref output - reference pressure (Pa).
164  * @param coeffs Vector of coefficients used to set the
165  * parameters for the standard state. There are
166  * 12 of them, designed to be compatible
167  * with the multiple temperature formulation.
168  * coeffs[0] is equal to one.
169  * coeffs[1] is min temperature
170  * coeffs[2] is max temperature
171  * coeffs[3+i] from i =0,9 are the coefficients themselves
172  * @deprecated
173  */
174  virtual void reportParameters(size_t& n, int& type,
175  doublereal& tlow, doublereal& thigh,
176  doublereal& pref,
177  doublereal* const coeffs) const;
178
179  //! Modify parameters for the standard state
180  /*!
181  * @param coeffs Vector of coefficients used to set the
182  * parameters for the standard state.
183  * @deprecated
184  */
185  virtual void modifyParameters(doublereal* coeffs);
186
187 protected:
188  //! array of polynomial coefficients
190 };
191
192 }
193 #endif
Nasa9Poly1()
Empty constructor.
Definition: Nasa9Poly1.cpp:18
virtual void modifyParameters(doublereal *coeffs)
Modify parameters for the standard state.
Definition: Nasa9Poly1.cpp:127
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...
Definition: Nasa9Poly1.cpp:108
Pure Virtual Base class for the thermodynamic manager for an individual species' reference state...
This file contains definitions for utility functions and text for modules, inputfiles, logs, textlogs, HTML_logs (see Input File Handling, Diagnostic Output, Writing messages to the screen and Writing HTML Logfiles).
virtual int reportType() const
Returns an integer representing the type of parameterization.
Definition: Nasa9Poly1.cpp:59
virtual SpeciesThermoInterpType * duplMyselfAsSpeciesThermoInterpType() const
duplicator
Definition: Nasa9Poly1.cpp:54
Pure Virtual Base class for individual species reference state thermodynamic managers and text for th...
virtual void updatePropertiesTemp(const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state property of one species.
Definition: Nasa9Poly1.cpp:93
Nasa9Poly1 & operator=(const Nasa9Poly1 &b)
assignment operator
Definition: Nasa9Poly1.cpp:42
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:165
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.
Definition: Nasa9Poly1.cpp:64
The NASA 9 polynomial parameterization for one temperature range.
Definition: Nasa9Poly1.h:69
vector_fp m_coeff
array of polynomial coefficients
Definition: Nasa9Poly1.h:189