Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ConstCpPoly.h
Go to the documentation of this file.
1 /**
2  * @file ConstCpPoly.h
3  * Headers for the \link Cantera::SpeciesThermoInterpType SpeciesThermoInterpType\endlink
4  * object that employs a constant heat capacity assumption (see \ref spthermo and
5  * \link Cantera::ConstCpPoly ConstCpPoly\endlink).
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  * @ingroup spthermo
46  */
48 {
49 public:
50  //! empty constructor
51  ConstCpPoly();
52 
53  //! Constructor used in templated instantiations
54  /*!
55  * @param n Species index
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
60  * parameters for the standard state for species n.
61  * There are 4 coefficients for the ConstCpPoly parameterization.
62  * - c[0] = \f$ T_0 \f$(Kelvin)
63  * - c[1] = \f$ H_k^o(T_0, p_{ref}) \f$ (J/kmol)
64  * - c[2] = \f$ S_k^o(T_0, p_{ref}) \f$ (J/kmol K)
65  * - c[3] = \f$ {Cp}_k^o(T_0, p_{ref}) \f$ (J(kmol K)
66  * @deprecated Use the constructor which does not take the species index. To
67  * be removed after Cantera 2.2.
68  */
69  ConstCpPoly(size_t n, doublereal tlow, doublereal thigh,
70  doublereal pref,
71  const doublereal* coeffs);
72 
73  //! Normal constructor
74  /*!
75  * @param tlow Minimum temperature
76  * @param thigh Maximum temperature
77  * @param pref reference pressure (Pa).
78  * @param coeffs Vector of coefficients used to set the
79  * parameters for the standard state for species n.
80  * There are 4 coefficients for the ConstCpPoly parameterization.
81  * - c[0] = \f$ T_0 \f$(Kelvin)
82  * - c[1] = \f$ H_k^o(T_0, p_{ref}) \f$ (J/kmol)
83  * - c[2] = \f$ S_k^o(T_0, p_{ref}) \f$ (J/kmol K)
84  * - c[3] = \f$ {Cp}_k^o(T_0, p_{ref}) \f$ (J(kmol K)
85  */
86  ConstCpPoly(double tlow, double thigh, double pref, const double* coeffs);
87 
88  //! copy constructor
89  ConstCpPoly(const ConstCpPoly&);
90 
91  //! Assignment operator
93 
95  duplMyselfAsSpeciesThermoInterpType() const;
96 
97  virtual int reportType() const {
98  return CONSTANT_CP;
99  }
100 
101  //! Update the properties for this species, given a temperature polynomial
102  /*!
103  * This method is called with a pointer to an array containing the functions of
104  * temperature needed by this parameterization, and three pointers to arrays where the
105  * computed property values should be written. This method updates only one value in
106  * each array.
107  *
108  * Form and Length of the temperature polynomial:
109  * - m_t[0] = tt;
110  *
111  * @param tt Vector of temperature polynomials
112  * @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
113  * @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
114  * @param s_R Vector of Dimensionless entropies. (length m_kk).
115  */
116  void updateProperties(const doublereal* tt,
117  doublereal* cp_R, doublereal* h_RT,
118  doublereal* s_R) const;
119 
120  void updatePropertiesTemp(const doublereal temp,
121  doublereal* cp_R, doublereal* h_RT,
122  doublereal* s_R) const;
123  void reportParameters(size_t& n, int& type,
124  doublereal& tlow, doublereal& thigh,
125  doublereal& pref,
126  doublereal* const coeffs) const;
127  //! Modify parameters for the standard state
128  /*!
129  * @param coeffs Vector of coefficients used to set the
130  * parameters for the standard state.
131  */
132  virtual void modifyParameters(doublereal* coeffs);
133 
134  virtual doublereal reportHf298(doublereal* const h298 = 0) const;
135  virtual void modifyOneHf298(const size_t k, const doublereal Hf298New);
136 
137 protected:
138  //! Base temperature
139  doublereal m_t0;
140  //! Dimensionless value of the heat capacity
141  doublereal m_cp0_R;
142  //! dimensionless value of the enthaply at t0
143  doublereal m_h0_R;
144  //! Dimensionless value of the entropy at t0
145  doublereal m_s0_R;
146  //! log of the t0 value
147  doublereal m_logt0;
148 };
149 
150 }
151 
152 #endif
Pure Virtual Base class for the thermodynamic manager for an individual species' reference state...
#define CONSTANT_CP
Constant Cp.
virtual void modifyOneHf298(const size_t k, const doublereal Hf298New)
Modify the value of the 298 K Heat of Formation of one species in the phase (J kmol-1) ...
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: ConstCpPoly.cpp:99
virtual void modifyParameters(doublereal *coeffs)
Modify parameters for the standard state.
virtual doublereal reportHf298(doublereal *const h298=0) const
Report the 298 K Heat of Formation of the standard state of one species (J kmol-1) ...
ConstCpPoly & operator=(const ConstCpPoly &)
Assignment operator.
Definition: ConstCpPoly.cpp:55
doublereal m_s0_R
Dimensionless value of the entropy at t0.
Definition: ConstCpPoly.h:145
A constant-heat capacity species thermodynamic property manager class.
Definition: ConstCpPoly.h:47
Pure Virtual Base class for individual species reference state thermodynamic managers and text for th...
virtual int reportType() const
Returns an integer representing the type of parameterization.
Definition: ConstCpPoly.h:97
doublereal m_h0_R
dimensionless value of the enthaply at t0
Definition: ConstCpPoly.h:143
doublereal m_t0
Base temperature.
Definition: ConstCpPoly.h:139
void updatePropertiesTemp(const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state property of one species.
Definition: ConstCpPoly.cpp:87
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: ConstCpPoly.cpp:74
ConstCpPoly()
empty constructor
Definition: ConstCpPoly.cpp:13
doublereal m_logt0
log of the t0 value
Definition: ConstCpPoly.h:147
doublereal m_cp0_R
Dimensionless value of the heat capacity.
Definition: ConstCpPoly.h:141