00001 /** 00002 * @file VPSSMgr_IdealGas.h 00003 * Declaration file for a derived class that handles the calculation 00004 * of standard state thermo properties for 00005 * a set of species which have an Ideal Gas dependence 00006 * (see \ref mgrpdssthermocalc and 00007 * class \link Cantera::VPSSMgr_IdealGas VPSSMgr_IdealGas\endlink). 00008 */ 00009 /* 00010 * $Author: hkmoffa $ 00011 * $Revision: 279 $ 00012 * $Date: 2009-12-05 14:08:43 -0500 (Sat, 05 Dec 2009) $ 00013 */ 00014 00015 /* 00016 * Copywrite (2005) Sandia Corporation. Under the terms of 00017 * Contract DE-AC04-94AL85000 with Sandia Corporation, the 00018 * U.S. Government retains certain rights in this software. 00019 */ 00020 00021 #ifndef CT_VPSSMGR_IDEALGAS_H 00022 #define CT_VPSSMGR_IDEALGAS_H 00023 00024 #include "ct_defs.h" 00025 #include "PDSS.h" 00026 #include "VPSSMgr.h" 00027 00028 namespace Cantera { 00029 00030 class SpeciesThermoInterpType; 00031 class VPStandardStateTP; 00032 class SpeciesThermo; 00033 00034 00035 //! Virtual base class for the species thermo manager classes. 00036 /*! 00037 * This class defines the interface which all subclasses must implement. 00038 * 00039 * Class %VPSSSpeciesThermo is the base class 00040 * for a family of classes that compute properties of a set of 00041 * species in their reference state at a range of temperatures. 00042 * Note, the pressure dependence of the reference state is not 00043 * handled by this particular species standard state model. 00044 * 00045 * @ingroup mgrpdssthermocalc 00046 */ 00047 class VPSSMgr_IdealGas : public VPSSMgr { 00048 00049 public: 00050 00051 00052 //! Basic constructor that initializes the object 00053 /*! 00054 * @param vp_ptr Pointer to the owning ThermoPhase 00055 * @param spth Species thermo pointer. 00056 */ 00057 VPSSMgr_IdealGas(VPStandardStateTP *vp_ptr, SpeciesThermo *spth); 00058 00059 //! Destructor 00060 virtual ~VPSSMgr_IdealGas(); 00061 00062 //! Copy Constructor for the %SpeciesThermo object. 00063 /*! 00064 * @param right Reference to %SpeciesThermo object to be copied into the 00065 * current one. 00066 */ 00067 VPSSMgr_IdealGas(const VPSSMgr_IdealGas &right); 00068 00069 //! Assignment operator for the %SpeciesThermo object 00070 /*! 00071 * This is NOT a virtual function. 00072 * 00073 * @param right Reference to %SpeciesThermo object to be copied into the 00074 * current one. 00075 */ 00076 VPSSMgr_IdealGas& operator=(const VPSSMgr_IdealGas &right); 00077 00078 //! Duplication routine for objects which inherit from 00079 //! %VPSSSpeciesThermo 00080 /*! 00081 * This virtual routine can be used to duplicate %VPSSSpeciesThermo objects 00082 * inherited from %VPSSSpeciesThermo even if the application only has 00083 * a pointer to %VPSSSpeciesThermo to work with. 00084 */ 00085 virtual VPSSMgr *duplMyselfAsVPSSMgr() const; 00086 00087 /*! 00088 * @name Properties of the Standard State of the Species in the Solution 00089 * 00090 * Within VPStandardStateTP, these properties are calculated via a common routine, 00091 * _updateStandardStateThermo(), 00092 * which must be overloaded in inherited objects. 00093 * The values are cached within this object, and are not recalculated unless 00094 * the temperature or pressure changes. 00095 */ 00096 //@{ 00097 00098 /** 00099 * Returns the vector of nondimensional 00100 * internal Energies of the standard state at the current temperature 00101 * and pressure of the solution for each species. 00102 * \f[ 00103 * u^{ss}_k(T,P) = h^{ss}_k(T) - P * V^{ss}_k 00104 * \f] 00105 * 00106 * @param urt Output vector of nondimensional standard state 00107 * internal energies. length = m_kk. 00108 */ 00109 virtual void getIntEnergy_RT(doublereal *urt) const; 00110 00111 /** 00112 * Get the molar volumes of each species in their standard 00113 * states at the current 00114 * <I>T</I> and <I>P</I> of the solution. 00115 * units = m^3 / kmol 00116 * 00117 * This is redefined here to call the internal function, _updateStandardStateThermo(), 00118 * which calculates all standard state properties at the same time. 00119 * 00120 * @param vol Output vector of species volumes. length = m_kk. 00121 * units = m^3 / kmol 00122 */ 00123 virtual void getStandardVolumes(doublereal *vol) const; 00124 00125 protected: 00126 00127 //! Updates the standard state thermodynamic functions at the current 00128 //! T and P of the solution. 00129 /*! 00130 * @internal 00131 * 00132 * If m_useTmpStandardStateStorage is true, 00133 * this function must be called every time the temperature or pressure 00134 * has changed. 00135 * 00136 * This function is responsible for updating the following internal members, 00137 * when m_useTmpStandardStateStorage is true. 00138 * 00139 * - m_hss_RT; 00140 * - m_cpss_R; 00141 * - m_gss_RT; 00142 * - m_sss_R; 00143 * - m_Vss 00144 * 00145 * If m_useTmpStandardStateStorage is not true, this function may be 00146 * required to be called everytime this class is invoked. 00147 * 00148 */ 00149 virtual void _updateStandardStateThermo(); 00150 00151 public: 00152 00153 //@} 00154 /// @name Thermodynamic Values for the Species Reference States (VPStandardStateTP) 00155 /*! 00156 * There are also temporary 00157 * variables for holding the species reference-state values of Cp, H, S, and V at the 00158 * last temperature and reference pressure called. These functions are not recalculated 00159 * if a new call is made using the previous temperature. 00160 * All calculations are done within the routine _updateRefStateThermo(). 00161 */ 00162 //@{ 00163 00164 00165 00166 //! @name Initialization Methods - For Internal use (VPStandardState) 00167 /*! 00168 * The following methods are used in the process of constructing 00169 * the phase and setting its parameters from a specification in an 00170 * input file. They are not normally used in application programs. 00171 * To see how they are used, see files importCTML.cpp and 00172 * ThermoFactory.cpp. 00173 * 00174 */ 00175 //@{ 00176 00177 //! Initialize the thermo for this standard state thermo calculator 00178 /*! 00179 * This task is done last, after createInstallPDSS() and after 00180 * initThermo(). 00181 * 00182 * @param phaseNode Reference to the phase node in the XML tree 00183 * @param id string name of the phase 00184 */ 00185 virtual void initThermoXML(XML_Node& phaseNode, std::string id); 00186 00187 //! Create and install an ideal gas standard state manager 00188 //! for one species within this object 00189 /*! 00190 * This function sets up the internal data within this object for 00191 * handling the calculation of the standard state for the species. 00192 * 00193 * - It registers the species with the SpeciesThermo object for the 00194 * containing VPStandardStateTP phase. 00195 * - It also creates a PDSS object, which basically contains a 00196 * duplication of some of this information and returns a pointer to 00197 * the new object. 00198 * . 00199 * @param k Species index within the phase 00200 * @param speciesNode Reference to the species node in the XML tree 00201 * @param phaseNode_ptr Pointer to the phase node in the XML tree 00202 * 00203 * @return Returns a pointer to the a newly malloced PDSS object 00204 * containing the parameterization 00205 */ 00206 virtual PDSS* createInstallPDSS(int k, const XML_Node& speciesNode, 00207 const XML_Node * const phaseNode_ptr); 00208 00209 00210 //! This utility function reports the type of parameterization 00211 //! used for the species with index number index. 00212 /*! 00213 * 00214 * @param index Species index 00215 */ 00216 virtual PDSS_enumType reportPDSSType(int index = -1) const ; 00217 00218 00219 //! This utility function reports the type of manager 00220 //! for the calculation of standard state properties 00221 /*! 00222 * 00223 */ 00224 virtual VPSSMgr_enumType reportVPSSMgrType() const ; 00225 00226 }; 00227 //@} 00228 } 00229 00230 #endif 00231