00001 /** 00002 * @file ConstCpPoly.h 00003 * Headers for the \link Cantera::SpeciesThermoInterpType SpeciesThermoInterpType\endlink 00004 * object that employs a constant heat capacity assumption (see \ref spthermo and 00005 * \link Cantera::ConstCpPoly ConstCpPoly\endlink). 00006 */ 00007 /* 00008 * $Author: hkmoffa $ 00009 * $Revision: 279 $ 00010 * $Date: 2009-12-05 14:08:43 -0500 (Sat, 05 Dec 2009) $ 00011 */ 00012 // Copyright 2001 California Institute of Technology 00013 00014 00015 #ifndef CT_CONSTCPPOLY_H 00016 #define CT_CONSTCPPOLY_H 00017 00018 #include "SpeciesThermoInterpType.h" 00019 00020 namespace Cantera { 00021 00022 /** 00023 * A constant-heat capacity species thermodynamic property manager class. 00024 * This makes the 00025 * assumption that the heat capacity is a constant. Then, the following 00026 * relations are used to complete the specification of the thermodynamic 00027 * functions for the species. 00028 * 00029 * \f[ 00030 * \frac{c_p(T)}{R} = Cp0\_R 00031 * \f] 00032 * \f[ 00033 * \frac{h^0(T)}{RT} = \frac{1}{T} * (h0\_R + (T - T_0) * Cp0\_R) 00034 * \f] 00035 * \f[ 00036 * \frac{s^0(T)}{R} = (s0\_R + (log(T) - log(T_0)) * Cp0\_R) 00037 * \f] 00038 * 00039 * This parameterization takes 4 input values. These are: 00040 * - c[0] = \f$ T_0 \f$(Kelvin) 00041 * - c[1] = \f$ H_k^o(T_0, p_{ref}) \f$ (J/kmol) 00042 * - c[2] = \f$ S_k^o(T_0, p_{ref}) \f$ (J/kmol K) 00043 * - c[3] = \f$ {Cp}_k^o(T_0, p_{ref}) \f$ (J(kmol K) 00044 * 00045 * The multispecies SimpleThermo class makes the same assumptions as 00046 * this class does. 00047 * 00048 * @see SimpleThermo 00049 * 00050 * @ingroup spthermo 00051 */ 00052 class ConstCpPoly: public SpeciesThermoInterpType { 00053 00054 public: 00055 00056 //! empty constructor 00057 ConstCpPoly(); 00058 00059 //! Constructor used in templated instantiations 00060 /*! 00061 * @param n Species index 00062 * @param tlow Minimum temperature 00063 * @param thigh Maximum temperature 00064 * @param pref reference pressure (Pa). 00065 * @param coeffs Vector of coefficients used to set the 00066 * parameters for the standard state for species n. 00067 * There are 4 coefficients for the %ConstCpPoly parameterization. 00068 * - c[0] = \f$ T_0 \f$(Kelvin) 00069 * - c[1] = \f$ H_k^o(T_0, p_{ref}) \f$ (J/kmol) 00070 * - c[2] = \f$ S_k^o(T_0, p_{ref}) \f$ (J/kmol K) 00071 * - c[3] = \f$ {Cp}_k^o(T_0, p_{ref}) \f$ (J(kmol K) 00072 * 00073 */ 00074 ConstCpPoly(int n, doublereal tlow, doublereal thigh, 00075 doublereal pref, 00076 const doublereal* coeffs); 00077 00078 //! copy constructor 00079 ConstCpPoly(const ConstCpPoly&); 00080 00081 //! Assignment operator 00082 ConstCpPoly& operator=(const ConstCpPoly&); 00083 00084 //! Destructor 00085 virtual ~ConstCpPoly(); 00086 00087 //! Duplicator 00088 virtual SpeciesThermoInterpType * 00089 duplMyselfAsSpeciesThermoInterpType() const; 00090 //! Returns the minimum temperature that the thermo 00091 //! parameterization is valid 00092 doublereal minTemp() const; 00093 00094 //! Returns the maximum temperature that the thermo 00095 //! parameterization is valid 00096 doublereal maxTemp() const; 00097 00098 //! Returns the reference pressure (Pa) 00099 doublereal refPressure() const; 00100 00101 //! Returns an integer representing the type of parameterization 00102 virtual int reportType() const { return CONSTANT_CP; } 00103 00104 //! Returns an integer representing the species index 00105 virtual int speciesIndex() const { return m_index; } 00106 00107 //! Update the properties for this species, given a temperature polynomial 00108 /*! 00109 * This method is called with a pointer to an array containing the functions of 00110 * temperature needed by this parameterization, and three pointers to arrays where the 00111 * computed property values should be written. This method updates only one value in 00112 * each array. 00113 * 00114 * Form and Length of the temperature polynomial: 00115 * - m_t[0] = tt; 00116 * 00117 * @param tt Vector of temperature polynomials 00118 * @param cp_R Vector of Dimensionless heat capacities. 00119 * (length m_kk). 00120 * @param h_RT Vector of Dimensionless enthalpies. 00121 * (length m_kk). 00122 * @param s_R Vector of Dimensionless entropies. 00123 * (length m_kk). 00124 */ 00125 void updateProperties(const doublereal* tt, 00126 doublereal* cp_R, doublereal* h_RT, 00127 doublereal* s_R) const; 00128 00129 //! Compute the reference-state property of one species 00130 /*! 00131 * Given temperature T in K, this method updates the values of 00132 * the non-dimensional heat capacity at constant pressure, 00133 * enthalpy, and entropy, at the reference pressure, Pref 00134 * of one of the species. The species index is used 00135 * to reference into the cp_R, h_RT, and s_R arrays. 00136 * 00137 * @param temp Temperature (Kelvin) 00138 * @param cp_R Vector of Dimensionless heat capacities. 00139 * (length m_kk). 00140 * @param h_RT Vector of Dimensionless enthalpies. 00141 * (length m_kk). 00142 * @param s_R Vector of Dimensionless entropies. 00143 * (length m_kk). 00144 */ 00145 void updatePropertiesTemp(const doublereal temp, 00146 doublereal* cp_R, doublereal* h_RT, 00147 doublereal* s_R) const; 00148 //!This utility function reports back the type of 00149 //! parameterization and all of the parameters for the 00150 //! species, index. 00151 /*! 00152 * All parameters are output variables 00153 * 00154 * @param n Species index 00155 * @param type Integer type of the standard type 00156 * @param tlow output - Minimum temperature 00157 * @param thigh output - Maximum temperature 00158 * @param pref output - reference pressure (Pa). 00159 * @param coeffs Vector of coefficients used to set the 00160 * parameters for the standard state. 00161 */ 00162 void reportParameters(int &n, int &type, 00163 doublereal &tlow, doublereal &thigh, 00164 doublereal &pref, 00165 doublereal* const coeffs) const; 00166 //! Modify parameters for the standard state 00167 /*! 00168 * @param coeffs Vector of coefficients used to set the 00169 * parameters for the standard state. 00170 */ 00171 virtual void modifyParameters(doublereal* coeffs); 00172 00173 #ifdef H298MODIFY_CAPABILITY 00174 00175 virtual doublereal reportHf298(doublereal* const h298 = 0) const; 00176 00177 virtual void modifyOneHf298(const int k, const doublereal Hf298New); 00178 00179 #endif 00180 00181 protected: 00182 //! Base temperature 00183 doublereal m_t0; 00184 //! Dimensionless value of the heat capacity 00185 doublereal m_cp0_R; 00186 //! dimensionless value of the enthaply at t0 00187 doublereal m_h0_R; 00188 //! Dimensionless value of the entropy at t0 00189 doublereal m_s0_R; 00190 //! log of the t0 value 00191 doublereal m_logt0; 00192 //! Minimum temperature for which the parameterization is valid (Kelvin) 00193 doublereal m_lowT; 00194 //! Maximum temperature for which the parameterization is valid (Kelvin) 00195 doublereal m_highT; 00196 //! Reference pressure (Pa) 00197 doublereal m_Pref; 00198 //! Species Index 00199 int m_index; 00200 00201 private: 00202 00203 }; 00204 00205 } 00206 00207 #endif