Nasa9Poly1.h

Go to the documentation of this file.
00001 /**
00002  *  @file Nasa9Poly1.h
00003  *  Header for a single-species standard state object derived
00004  *  from 
00005  *  \link Cantera::SpeciesThermoInterpType SpeciesThermoInterpType\endlink  based 
00006  *  on the NASA 9 coefficient temperature polynomial form applied to
00007  *   one temperature region
00008  *  (see \ref spthermo and class \link Cantera::Nasa9Poly1 Nasa9Poly1\endlink).
00009  *
00010  *  This parameterization has one NASA temperature region.
00011  */
00012 /*
00013  * Copywrite (2006) Sandia Corporation. Under the terms of 
00014  * Contract DE-AC04-94AL85000 with Sandia Corporation, the
00015  * U.S. Government retains certain rights in this software.
00016  */
00017 
00018 #ifndef CT_NASA9POLY1_H
00019 #define CT_NASA9POLY1_H
00020 
00021 /* 
00022  * $Revision: 279 $
00023  * $Date: 2009-12-05 14:08:43 -0500 (Sat, 05 Dec 2009) $
00024  */
00025 
00026 
00027 
00028 #include "global.h"
00029 #include "SpeciesThermoInterpType.h"
00030 
00031 namespace Cantera {
00032 
00033  
00034   //! The NASA 9 polynomial parameterization for one temperature range.
00035   /*!
00036    *  This parameterization expresses the heat capacity via a
00037    *  7 coefficient polynomial.
00038    *  Note that this is the form used in the
00039    *  2002 NASA equilibrium program. A reference to the form is 
00040    *  provided below:
00041    *
00042    *  "NASA Glenn Coefficients for Calculating Thermodynamic
00043    *  Properties of Individual Species," 
00044    *  B. J. McBride, M. J. Zehe, S. Gordon
00045    *  NASA/TP-2002-211556, Sept. 2002
00046    *
00047    * Nine coefficients \f$(a_0,\dots,a_6)\f$ are used to represent
00048    * \f$ C_p^0(T)\f$, \f$ H^0(T)\f$, and \f$ S^0(T) \f$ as 
00049    * polynomials in \f$ T \f$ :  
00050    * \f[
00051    * \frac{C_p^0(T)}{R} = a_0 T^{-2} + a_1 T^{-1} + a_2 + a_3 T 
00052    *                  + a_4 T^2 + a_5 T^3 + a_6 T^4
00053    * \f]
00054    * 
00055    * \f[
00056    * \frac{H^0(T)}{RT} = - a_0 T^{-2} + a_1 \frac{\ln(T)}{T} + a_2 
00057    * + a_3 T + a_4 T^2  + a_5 T^3 + a_6 T^4 + \frac{a_7}{T}
00058    * \f]
00059    *
00060    * \f[
00061    * \frac{s^0(T)}{R} = - \frac{a_0}{2} T^{-2} - a_1 T^{-1} + a_2 \ln(T)
00062    +    + a_3 T  \frac{a_4}{2} T^2 + \frac{a_5}{3} T^3  + \frac{a_6}{4} T^4 + a_8 
00063    * \f]
00064    * 
00065    *  The standard state is assumed to be an ideal gas at the
00066    *  standard pressure of 1 bar, for gases.
00067    *  For condensed species, the standard state is the
00068    *  pure crystalline or liquid substance at the standard
00069    *  pressure of 1 atm.
00070    * 
00071    * These NASA representations may have multiple temperature regions
00072    * through the use of the Nasa9PolyMultiTempRegion object, which uses
00073    * multiple copies of this %Nasa9Poly1 object to handle multiple temperature
00074    * regions.
00075    *
00076    * @ingroup spthermo
00077    */
00078   class Nasa9Poly1 : public SpeciesThermoInterpType {
00079 
00080   public:
00081 
00082     //! Empty constructor
00083     Nasa9Poly1();
00084 
00085 
00086     //! constructor used in templated instantiations
00087     /*!
00088      * @param n            Species index
00089      * @param tlow         Minimum temperature
00090      * @param thigh        Maximum temperature
00091      * @param pref         reference pressure (Pa).
00092      * @param coeffs       Vector of coefficients used to set the
00093      *                     parameters for the standard state.
00094      */
00095     Nasa9Poly1(int n, doublereal tlow, doublereal thigh, doublereal pref,
00096                const doublereal* coeffs);
00097 
00098     //! copy constructor
00099     /*!
00100      * @param b object to be copied
00101      */
00102     Nasa9Poly1(const Nasa9Poly1& b);
00103 
00104     //! assignment operator
00105     /*!
00106      * @param b object to be copied
00107      */
00108     Nasa9Poly1& operator=(const Nasa9Poly1& b);
00109 
00110     //! Destructor
00111     virtual ~Nasa9Poly1();
00112 
00113     //! duplicator
00114     virtual SpeciesThermoInterpType *
00115     duplMyselfAsSpeciesThermoInterpType() const;
00116 
00117     //! Returns the minimum temperature that the thermo
00118     //! parameterization is valid
00119     virtual doublereal minTemp() const;
00120 
00121     //! Returns the maximum temperature that the thermo
00122     //! parameterization is valid
00123     virtual doublereal maxTemp() const;
00124 
00125     //! Returns the reference pressure (Pa)
00126     virtual doublereal refPressure() const;
00127 
00128     //! Returns an integer representing the type of parameterization
00129     virtual int reportType() const;
00130 
00131     //! Returns an integer representing the species index
00132     virtual int speciesIndex() const;
00133 
00134     //! Update the properties for this species, given a temperature polynomial
00135     /*!
00136      * This method is called with a pointer to an array containing the functions of
00137      * temperature needed by this  parameterization, and three pointers to arrays where the
00138      * computed property values should be written. This method updates only one value in
00139      * each array.
00140      *
00141      * Temperature Polynomial:
00142      *  tt[0] = t;
00143      *  tt[1] = t*t;
00144      *  tt[2] = t*t*t;
00145      *  tt[3] = t*t*t*t;
00146      *  tt[4] = 1.0/t;
00147      *  tt[5] = 1.0/(t*t);
00148      *  tt[6] = std::log(t);
00149      *
00150      * @param tt      vector of temperature polynomials
00151      * @param cp_R    Vector of Dimensionless heat capacities.
00152      *                (length m_kk).
00153      * @param h_RT    Vector of Dimensionless enthalpies.
00154      *                (length m_kk).
00155      * @param s_R     Vector of Dimensionless entropies.
00156      *                (length m_kk).
00157      */
00158     virtual void updateProperties(const doublereal* tt, 
00159                                   doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const;
00160 
00161  
00162     //! Compute the reference-state property of one species
00163     /*!
00164      * Given temperature T in K, this method updates the values of
00165      * the non-dimensional heat capacity at constant pressure,
00166      * enthalpy, and entropy, at the reference pressure, Pref
00167      * of one of the species. The species index is used
00168      * to reference into the cp_R, h_RT, and s_R arrays.
00169      *
00170      * Temperature Polynomial:
00171      *  tt[0] = t;
00172      *  tt[1] = t*t;
00173      *  tt[2] = t*t*t;
00174      *  tt[3] = t*t*t*t;
00175      *  tt[4] = 1.0/t;
00176      *  tt[5] = 1.0/(t*t);
00177      *  tt[6] = std::log(t);
00178      *
00179      * @param temp    Temperature (Kelvin)
00180      * @param cp_R    Vector of Dimensionless heat capacities.
00181      *                (length m_kk).
00182      * @param h_RT    Vector of Dimensionless enthalpies.
00183      *                (length m_kk).
00184      * @param s_R     Vector of Dimensionless entropies.
00185      *                (length m_kk).
00186      */
00187     virtual void updatePropertiesTemp(const doublereal temp, 
00188                                       doublereal* cp_R, doublereal* h_RT, 
00189                                       doublereal* s_R) const;
00190 
00191     //!This utility function reports back the type of 
00192     //! parameterization and all of the parameters for the 
00193     //! species, index.
00194     /*!
00195      * All parameters are output variables
00196      *
00197      * @param n         Species index
00198      * @param type      Integer type of the standard type
00199      * @param tlow      output - Minimum temperature
00200      * @param thigh     output - Maximum temperature
00201      * @param pref      output - reference pressure (Pa).
00202      * @param coeffs    Vector of coefficients used to set the
00203      *                  parameters for the standard state. There are
00204      *                  12 of them, designed to be compatible
00205      *                  with the multiple temperature formulation.
00206      *      coeffs[0] is equal to one.
00207      *      coeffs[1] is min temperature
00208      *      coeffs[2] is max temperature
00209      *      coeffs[3+i] from i =0,9 are the coefficients themselves
00210      */
00211     virtual void reportParameters(int &n, int &type,
00212                                   doublereal &tlow, doublereal &thigh,
00213                                   doublereal &pref,
00214                                   doublereal* const coeffs) const;
00215 
00216     //! Modify parameters for the standard state
00217     /*!
00218      * @param coeffs   Vector of coefficients used to set the
00219      *                 parameters for the standard state.
00220      */
00221     virtual void modifyParameters(doublereal* coeffs);
00222 
00223   protected:
00224     //! lowest valid temperature
00225     doublereal m_lowT;    
00226     //! highest valid temperature
00227     doublereal m_highT;   
00228     //! standard-state pressure
00229     doublereal m_Pref;     
00230     //! species index
00231     int m_index;  
00232     //! array of polynomial coefficients       
00233     array_fp m_coeff;
00234   };
00235 
00236 }
00237 #endif
00238 
Generated by  doxygen 1.6.3