GeneralSpeciesThermo.h

Go to the documentation of this file.
00001 /**
00002  * @file GeneralSpeciesThermo.h
00003  *  Headers for a completely general species thermodynamic property
00004  *  manager for a phase (see \ref mgrsrefcalc and
00005  * \link Cantera::GeneralSpeciesThermo GeneralSpeciesThermo\endlink).
00006  *
00007  *  Because it is general, it is slow.
00008  */
00009 
00010 /*
00011  * $Author: hkmoffa $
00012  * $Revision: 279 $
00013  * $Date: 2009-12-05 14:08:43 -0500 (Sat, 05 Dec 2009) $
00014  */
00015 
00016 #ifndef CT_GENERALSPECIESTHERMO_H
00017 #define CT_GENERALSPECIESTHERMO_H
00018 #include <string>
00019 #include "ct_defs.h"
00020 #include "SpeciesThermoMgr.h"
00021 #include "NasaPoly1.h"
00022 #include "Nasa9Poly1.h"
00023 #include "speciesThermoTypes.h"
00024 
00025 
00026 namespace Cantera {
00027 
00028   //! A species thermodynamic property manager for a phase.
00029   /*!
00030    * This is a general manager that can handle a wide variety
00031    * of species thermodynamic polynomials for individual species.
00032    * It is slow, however, because it recomputes the functions of
00033    * temperature needed for each species. What it does is to create
00034    * a vector of SpeciesThermoInterpType objects.
00035    *
00036    * @ingroup mgrsrefcalc
00037    */
00038   class GeneralSpeciesThermo : public SpeciesThermo {
00039     
00040   public:
00041 
00042     //! Constructor
00043     GeneralSpeciesThermo();
00044 
00045     //! Copy constructor
00046     /*!
00047      * @param b   Object to be copied
00048      */
00049     GeneralSpeciesThermo(const GeneralSpeciesThermo &b);
00050 
00051     //! Assignment operator
00052     /*!
00053      * @param b   Object to be copied
00054      */
00055     GeneralSpeciesThermo & operator=(const GeneralSpeciesThermo &b);
00056 
00057     //! Destructor
00058     virtual ~GeneralSpeciesThermo();
00059 
00060     //! Duplicator
00061     virtual SpeciesThermo *duplMyselfAsSpeciesThermo() const ;
00062 
00063     //! Install a new species thermodynamic property
00064     //! parameterization for one species.  
00065     /*!
00066      * Install a SpeciesThermoInterpType object for the species, index.
00067      * This routine contains an internal list of  SpeciesThermoInterpType
00068      * objects that it knows about. A factory-type lookup is done
00069      * to create the object.
00070      *
00071      * @param name      Name of the species
00072      * @param index     The 'update' method will update the property 
00073      *                  values for this species 
00074      *                  at position i index in the property arrays.  
00075      * @param type      int flag specifying the type of parameterization to be
00076      *                 installed. 
00077      * @param c        vector of coefficients for the parameterization. 
00078      *                 This vector is simply passed through to the
00079      *                 parameterization constructor. It's length depends upon
00080      *                 the parameterization.
00081      * @param minTemp  minimum temperature for which this parameterization
00082      *                 is valid.
00083      * @param maxTemp  maximum temperature for which this parameterization
00084      *                 is valid.
00085      * @param refPressure standard-state pressure for this 
00086      *                    parameterization. 
00087      * @see speciesThermoTypes.h 
00088      *
00089      * @todo Create a factory method for SpeciesThermoInterpType.
00090      *       That's basically what we are doing here.
00091      */
00092     virtual void install(std::string name, int index, int type, 
00093                          const doublereal* c, 
00094                          doublereal minTemp, doublereal maxTemp,
00095                          doublereal refPressure);
00096 
00097     //! Install a new species thermodynamic property
00098     //! parameterization for one species.
00099     /*!
00100      * @param stit_ptr Pointer to the SpeciesThermoInterpType object
00101      *          This will set up the thermo for one species
00102      */
00103     virtual void install_STIT(SpeciesThermoInterpType *stit_ptr);
00104 
00105     //! Install a PDSS object to handle the reference state thermodynamics
00106     //! calculation
00107     /*!
00108      * @param k           species index
00109      * @param PDSS_ptr    Pressure dependent standard state (PDSS) object
00110      *                    that will handle the reference state calc
00111      * @param vpssmgr_ptr Pointer to the variable pressure standard state
00112      *                    manager that handles the PDSS object.
00113      */
00114     void installPDSShandler(int k, PDSS *PDSS_ptr, VPSSMgr *vpssmgr_ptr);
00115 
00116     //! Like update(), but only updates the single species k.
00117     /*!
00118      * @param k       species index
00119      * @param T       Temperature (Kelvin)
00120      * @param cp_R    Vector of Dimensionless heat capacities.
00121      *                (length m_kk).
00122      * @param h_RT    Vector of Dimensionless enthalpies.
00123      *                (length m_kk).
00124      * @param s_R     Vector of Dimensionless entropies.
00125      *                (length m_kk).
00126      */
00127     virtual void update_one(int k, doublereal T, doublereal* cp_R, 
00128                             doublereal* h_RT,
00129                             doublereal* s_R) const;
00130 
00131     //! Compute the reference-state properties for all species.
00132     /*!
00133      * Given temperature T in K, this method updates the values of
00134      * the non-dimensional heat capacity at constant pressure,
00135      * enthalpy, and entropy, at the reference pressure, Pref
00136      * of each of the standard states.
00137      *
00138      * @param T       Temperature (Kelvin)
00139      * @param cp_R    Vector of Dimensionless heat capacities.
00140      *                (length m_kk).
00141      * @param h_RT    Vector of Dimensionless enthalpies.
00142      *                (length m_kk).
00143      * @param s_R     Vector of Dimensionless entropies.
00144      *                (length m_kk).
00145      */ 
00146     virtual void update(doublereal T, doublereal* cp_R, 
00147                         doublereal* h_RT, doublereal* s_R) const;
00148                 
00149     //! Minimum temperature.
00150     /*!
00151      * If no argument is supplied, this
00152      * method returns the minimum temperature for which \e all
00153      * parameterizations are valid. If an integer index k is
00154      * supplied, then the value returned is the minimum
00155      * temperature for species k in the phase.
00156      *
00157      * @param k    Species index
00158      */ 
00159     virtual doublereal minTemp(int k=-1) const;
00160 
00161     //! Maximum temperature.
00162     /*!
00163      * If no argument is supplied, this
00164      * method returns the maximum temperature for which \e all
00165      * parameterizations are valid. If an integer index k is
00166      * supplied, then the value returned is the maximum
00167      * temperature for parameterization k.
00168      *
00169      * @param k  Species Index
00170      */
00171     virtual doublereal maxTemp(int k=-1) const;
00172 
00173     //! The reference-state pressure for species k.
00174     /*!
00175      *
00176      * returns the reference state pressure in Pascals for
00177      * species k. If k is left out of the argument list,
00178      * it returns the reference state pressure for the first
00179      * species.
00180      * Note that some SpeciesThermo implementations, such
00181      * as those for ideal gases, require that all species
00182      * in the same phase have the same reference state pressures.
00183      *
00184      * @param k Species Index
00185      */
00186     virtual doublereal refPressure(int k = -1) const;
00187 
00188     //! This utility function reports the type of parameterization
00189     //! used for the species with index number index.
00190     /*!
00191      *
00192      * @param index  Species index
00193      */
00194     virtual int reportType(int index) const;
00195 
00196     //! This utility function reports back the type of 
00197     //! parameterization and all of the parameters for the species, index.
00198     /*!
00199      * @param index     Species index
00200      * @param type      Integer type of the standard type
00201      * @param c         Vector of coefficients used to set the
00202      *                  parameters for the standard state.
00203      * @param minTemp   output - Minimum temperature
00204      * @param maxTemp   output - Maximum temperature
00205      * @param refPressure output - reference pressure (Pa).
00206      */
00207     virtual void reportParams(int index, int &type, 
00208                               doublereal * const c, 
00209                               doublereal &minTemp, 
00210                               doublereal &maxTemp,
00211                               doublereal &refPressure) const;
00212 
00213     //! Modify parameters for the standard state
00214     /*!
00215      * @param index Species index
00216      * @param c     Vector of coefficients used to set the
00217      *              parameters for the standard state.
00218      */
00219     virtual void modifyParams(int index, doublereal *c);
00220 
00221 #ifdef H298MODIFY_CAPABILITY
00222 
00223     virtual doublereal reportOneHf298(int k) const;
00224 
00225     virtual void modifyOneHf298(const int k, const doublereal Hf298New);
00226 
00227 #endif
00228 
00229   private:
00230     //! Provide the SpeciesthermoInterpType object
00231     /*!
00232      *  provide access to the SpeciesThermoInterpType object.
00233      *  This 
00234      *
00235      *  @param k  integer parameter
00236      *
00237      * @return pointer to the SpeciesThermoInterpType object.
00238      */
00239     SpeciesThermoInterpType * provideSTIT(int k);
00240 
00241   protected:
00242 
00243     /**
00244      * This is the main unknown in the object. It is 
00245      * a list of pointers to type SpeciesThermoInterpType.
00246      * Note, this object owns the objects, so they are deleted
00247      * in the destructor of this object.
00248      *   Note, that in some instances, m_sp[k] = 0, e.g., no
00249      * SpeciesThermoInterpType is installed for one or more
00250      * species. These cases must be handled by the calling
00251      * routine.
00252      */
00253     std::vector<SpeciesThermoInterpType *> m_sp;
00254 
00255     //! Maximum value of the lowest temperature
00256     doublereal                         m_tlow_max;
00257 
00258     //! Minimum value of the highest temperature
00259     doublereal                         m_thigh_min;
00260 
00261     //! reference pressure (Pa)
00262     doublereal                         m_p0;
00263 
00264     /**
00265      * Internal variable indicating the length of the 
00266      * number of species in the phase.
00267      */
00268     int m_kk;
00269 
00270 
00271     //! Make the class VPSSMgr a friend because we need to access
00272     //! the function provideSTIT()
00273     friend class VPSSMgr;
00274   
00275 
00276   };
00277 
00278 }
00279 
00280 #endif
00281 
Generated by  doxygen 1.6.3