Cantera  2.0
ConstCpPoly.h
Go to the documentation of this file.
1 /**
2  * @file ConstCpPoly.h
4  * object that employs a constant heat capacity assumption (see \ref spthermo and
6  */
7 // Copyright 2001 California Institute of Technology
8
9
10 #ifndef CT_CONSTCPPOLY_H
11 #define CT_CONSTCPPOLY_H
12
14
15 namespace Cantera
16 {
17
18 /**
19  * A constant-heat capacity species thermodynamic property manager class.
20  * This makes the
21  * assumption that the heat capacity is a constant. Then, the following
22  * relations are used to complete the specification of the thermodynamic
23  * functions for the species.
24  *
25  * \f[
26  * \frac{c_p(T)}{R} = Cp0\_R
27  * \f]
28  * \f[
29  * \frac{h^0(T)}{RT} = \frac{1}{T} * (h0\_R + (T - T_0) * Cp0\_R)
30  * \f]
31  * \f[
32  * \frac{s^0(T)}{R} = (s0\_R + (log(T) - log(T_0)) * Cp0\_R)
33  * \f]
34  *
35  * This parameterization takes 4 input values. These are:
36  * - c[0] = \f$T_0 \f$(Kelvin)
37  * - c[1] = \f$H_k^o(T_0, p_{ref}) \f$ (J/kmol)
38  * - c[2] = \f$S_k^o(T_0, p_{ref}) \f$ (J/kmol K)
39  * - c[3] = \f${Cp}_k^o(T_0, p_{ref}) \f$ (J(kmol K)
40  *
41  * The multispecies SimpleThermo class makes the same assumptions as
42  * this class does.
43  *
44  * @see SimpleThermo
45  *
46  * @ingroup spthermo
47  */
49 {
50
51 public:
52
53  //! empty constructor
54  ConstCpPoly();
55
56  //! Constructor used in templated instantiations
57  /*!
58  * @param n Species index
59  * @param tlow Minimum temperature
60  * @param thigh Maximum temperature
61  * @param pref reference pressure (Pa).
62  * @param coeffs Vector of coefficients used to set the
63  * parameters for the standard state for species n.
64  * There are 4 coefficients for the %ConstCpPoly parameterization.
65  * - c[0] = \f$T_0 \f$(Kelvin)
66  * - c[1] = \f$H_k^o(T_0, p_{ref}) \f$ (J/kmol)
67  * - c[2] = \f$S_k^o(T_0, p_{ref}) \f$ (J/kmol K)
68  * - c[3] = \f${Cp}_k^o(T_0, p_{ref}) \f$ (J(kmol K)
69  *
70  */
71  ConstCpPoly(size_t n, doublereal tlow, doublereal thigh,
72  doublereal pref,
73  const doublereal* coeffs);
74
75  //! copy constructor
76  ConstCpPoly(const ConstCpPoly&);
77
78  //! Assignment operator
80
81  //! Destructor
82  virtual ~ConstCpPoly();
83
84  //! Duplicator
87  //! Returns the minimum temperature that the thermo
88  //! parameterization is valid
89  doublereal minTemp() const;
90
91  //! Returns the maximum temperature that the thermo
92  //! parameterization is valid
93  doublereal maxTemp() const;
94
95  //! Returns the reference pressure (Pa)
96  doublereal refPressure() const;
97
98  //! Returns an integer representing the type of parameterization
99  virtual int reportType() const {
100  return CONSTANT_CP;
101  }
102
103  //! Returns an integer representing the species index
104  virtual size_t speciesIndex() const {
105  return m_index;
106  }
107
108  //! Update the properties for this species, given a temperature polynomial
109  /*!
110  * This method is called with a pointer to an array containing the functions of
111  * temperature needed by this parameterization, and three pointers to arrays where the
112  * computed property values should be written. This method updates only one value in
113  * each array.
114  *
115  * Form and Length of the temperature polynomial:
116  * - m_t[0] = tt;
117  *
118  * @param tt Vector of temperature polynomials
119  * @param cp_R Vector of Dimensionless heat capacities.
120  * (length m_kk).
121  * @param h_RT Vector of Dimensionless enthalpies.
122  * (length m_kk).
123  * @param s_R Vector of Dimensionless entropies.
124  * (length m_kk).
125  */
126  void updateProperties(const doublereal* tt,
127  doublereal* cp_R, doublereal* h_RT,
128  doublereal* s_R) const;
129
130  //! Compute the reference-state property of one species
131  /*!
132  * Given temperature T in K, this method updates the values of
133  * the non-dimensional heat capacity at constant pressure,
134  * enthalpy, and entropy, at the reference pressure, Pref
135  * of one of the species. The species index is used
136  * to reference into the cp_R, h_RT, and s_R arrays.
137  *
138  * @param temp Temperature (Kelvin)
139  * @param cp_R Vector of Dimensionless heat capacities.
140  * (length m_kk).
141  * @param h_RT Vector of Dimensionless enthalpies.
142  * (length m_kk).
143  * @param s_R Vector of Dimensionless entropies.
144  * (length m_kk).
145  */
146  void updatePropertiesTemp(const doublereal temp,
147  doublereal* cp_R, doublereal* h_RT,
148  doublereal* s_R) const;
149  //!This utility function reports back the type of
150  //! parameterization and all of the parameters for the
151  //! species, index.
152  /*!
153  * All parameters are output variables
154  *
155  * @param n Species index
156  * @param type Integer type of the standard type
157  * @param tlow output - Minimum temperature
158  * @param thigh output - Maximum temperature
159  * @param pref output - reference pressure (Pa).
160  * @param coeffs Vector of coefficients used to set the
161  * parameters for the standard state.
162  */
163  void reportParameters(size_t& n, int& type,
164  doublereal& tlow, doublereal& thigh,
165  doublereal& pref,
166  doublereal* const coeffs) const;
167  //! Modify parameters for the standard state
168  /*!
169  * @param coeffs Vector of coefficients used to set the
170  * parameters for the standard state.
171  */
172  virtual void modifyParameters(doublereal* coeffs);
173
174 #ifdef H298MODIFY_CAPABILITY
175
176  virtual doublereal reportHf298(doublereal* const h298 = 0) const;
177
178  virtual void modifyOneHf298(const int k, const doublereal Hf298New);
179
180 #endif
181
182 protected:
183  //! Base temperature
184  doublereal m_t0;
185  //! Dimensionless value of the heat capacity
186  doublereal m_cp0_R;
187  //! dimensionless value of the enthaply at t0
188  doublereal m_h0_R;
189  //! Dimensionless value of the entropy at t0
190  doublereal m_s0_R;
191  //! log of the t0 value
192  doublereal m_logt0;
193  //! Minimum temperature for which the parameterization is valid (Kelvin)
194  doublereal m_lowT;
195  //! Maximum temperature for which the parameterization is valid (Kelvin)
196  doublereal m_highT;
197  //! Reference pressure (Pa)
198  doublereal m_Pref;
199  //! Species Index
200  size_t m_index;
201
202 private:
203
204 };
205
206 }
207
208 #endif