00001 /** 00002 * @file PDSS_IdealGas.h 00003 * Declarations for the class PDSS_IdealGas (pressure dependent standard state) 00004 * which handles calculations for a single ideal gas species in a phase 00005 * (see \ref pdssthermo and class \link Cantera::PDSS_IdealGas PDSS_IdealGas\endlink). 00006 */ 00007 /* 00008 * Copywrite (2006) Sandia Corporation. Under the terms of 00009 * Contract DE-AC04-94AL85000 with Sandia Corporation, the 00010 * U.S. Government retains certain rights in this software. 00011 */ 00012 /* 00013 * $Id: PDSS_IdealGas.h 279 2009-12-05 19:08:43Z hkmoffa $ 00014 */ 00015 00016 #ifndef CT_PDSS_IDEALGAS_H 00017 #define CT_PDSS_IDEALGAS_H 00018 00019 #include "PDSS.h" 00020 00021 00022 namespace Cantera { 00023 class XML_Node; 00024 class VPStandardStateTP; 00025 00026 00027 //! Derived class for pressure dependent standard states of an ideal gas species 00028 /*! 00029 * This class is for a single Ideal Gas species. 00030 * 00031 * @ingroup pdssthermo 00032 */ 00033 class PDSS_IdealGas : public PDSS { 00034 00035 public: 00036 00037 /** 00038 * @name Constructors 00039 * @{ 00040 */ 00041 00042 //! Constructor 00043 /*! 00044 * @param tp Pointer to the ThermoPhase object pertaining to the phase 00045 * @param spindex Species index of the species in the phase 00046 */ 00047 PDSS_IdealGas(VPStandardStateTP *tp, int spindex); 00048 00049 //! Copy Constructur 00050 /*! 00051 * @param b Object to be copied 00052 */ 00053 PDSS_IdealGas(const PDSS_IdealGas& b); 00054 00055 //! Assignment operator 00056 /*! 00057 * @param b Object to be copeid 00058 */ 00059 PDSS_IdealGas& operator=(const PDSS_IdealGas& b); 00060 00061 //! Constructor that initializes the object by examining the input file 00062 //! of the ThermoPhase object 00063 /*! 00064 * This function calls the constructPDSSFile member function. 00065 * 00066 * @param tp Pointer to the ThermoPhase object pertaining to the phase 00067 * @param spindex Species index of the species in the phase 00068 * @param inputFile String name of the input file 00069 * @param id String name of the phase in the input file. The default 00070 * is the empty string, in which case the first phase in the 00071 * file is used. 00072 */ 00073 PDSS_IdealGas(VPStandardStateTP *tp, int spindex, 00074 std::string inputFile, std::string id = ""); 00075 00076 00077 //! Constructor that initializes the object by examining the input file 00078 //! of the ThermoPhase object 00079 /*! 00080 * This function calls the constructPDSSXML member function. 00081 * 00082 * @param vptp_ptr Pointer to the ThermoPhase object pertaining to the phase 00083 * @param spindex Species index of the species in the phase 00084 * @param speciesNode Reference to the species XML tree. 00085 * @param phaseRef Reference to the XML tree containing the phase information. 00086 * @param spInstalled Boolean indicating whether the species is installed yet 00087 * or not. 00088 */ 00089 PDSS_IdealGas(VPStandardStateTP *vptp_ptr, int spindex, const XML_Node& speciesNode, 00090 const XML_Node& phaseRef, bool spInstalled); 00091 00092 00093 //! Destructor 00094 virtual ~PDSS_IdealGas(); 00095 00096 //! Duplicator 00097 virtual PDSS *duplMyselfAsPDSS() const; 00098 00099 /** 00100 * @} 00101 * @name Utilities 00102 * @{ 00103 */ 00104 00105 /** 00106 * @} 00107 * @name Molar Thermodynamic Properties of the Species Standard State 00108 * in the Solution 00109 * @{ 00110 */ 00111 00112 //! Return the molar enthalpy in units of J kmol-1 00113 /*! 00114 * Returns the species standard state enthalpy in J kmol-1 at the 00115 * current temperature and pressure. 00116 * 00117 * @return returns the species standard state enthalpy in J kmol-1 00118 */ 00119 virtual doublereal enthalpy_mole() const; 00120 00121 //! Return the standard state molar enthalpy divided by RT 00122 /*! 00123 * Returns the species standard state enthalpy divided by RT at the 00124 * current temperature and pressure. 00125 * 00126 * @return returns the species standard state enthalpy in unitless form 00127 */ 00128 virtual doublereal enthalpy_RT() const; 00129 00130 //! Return the molar internal Energy in units of J kmol-1 00131 /*! 00132 * Returns the species standard state internal Energy in J kmol-1 at the 00133 * current temperature and pressure. 00134 * 00135 * @return returns the species standard state internal Energy in J kmol-1 00136 */ 00137 virtual doublereal intEnergy_mole() const; 00138 00139 //! Return the molar entropy in units of J kmol-1 K-1 00140 /*! 00141 * Returns the species standard state entropy in J kmol-1 K-1 at the 00142 * current temperature and pressure. 00143 * 00144 * @return returns the species standard state entropy in J kmol-1 K-1 00145 */ 00146 virtual doublereal entropy_mole() const; 00147 00148 //! Return the standard state entropy divided by RT 00149 /*! 00150 * Returns the species standard state entropy divided by RT at the 00151 * current temperature and pressure. 00152 * 00153 * @return returns the species standard state entropy divided by RT 00154 */ 00155 virtual doublereal entropy_R() const; 00156 00157 //! Return the molar gibbs free energy in units of J kmol-1 00158 /*! 00159 * Returns the species standard state gibbs free energy in J kmol-1 at the 00160 * current temperature and pressure. 00161 * 00162 * @return returns the species standard state gibbs free energy in J kmol-1 00163 */ 00164 virtual doublereal gibbs_mole() const; 00165 00166 //! Return the molar gibbs free energy divided by RT 00167 /*! 00168 * Returns the species standard state gibbs free energy divided by RT at the 00169 * current temperature and pressure. 00170 * 00171 * @return returns the species standard state gibbs free energy divided by RT 00172 */ 00173 virtual doublereal gibbs_RT() const; 00174 00175 //! Return the molar const pressure heat capacity in units of J kmol-1 K-1 00176 /*! 00177 * Returns the species standard state Cp in J kmol-1 K-1 at the 00178 * current temperature and pressure. 00179 * 00180 * @return returns the species standard state Cp in J kmol-1 K-1 00181 */ 00182 virtual doublereal cp_mole() const; 00183 00184 //! Return the molar const pressure heat capacity divided by RT 00185 /*! 00186 * Returns the species standard state Cp divided by RT at the 00187 * current temperature and pressure. 00188 * 00189 * @return returns the species standard state Cp divided by RT 00190 */ 00191 virtual doublereal cp_R() const; 00192 00193 //! Return the molar const volume heat capacity in units of J kmol-1 K-1 00194 /*! 00195 * Returns the species standard state Cv in J kmol-1 K-1 at the 00196 * current temperature and pressure. 00197 * 00198 * @return returns the species standard state Cv in J kmol-1 K-1 00199 */ 00200 virtual doublereal cv_mole() const; 00201 00202 //! Return the molar volume at standard state 00203 /*! 00204 * Returns the species standard state molar volume at the 00205 * current temperature and pressure 00206 * 00207 * @return returns the standard state molar volume divided by R 00208 * units are m**3 kmol-1. 00209 */ 00210 virtual doublereal molarVolume() const; 00211 00212 //! Return the standard state density at standard state 00213 /*! 00214 * Returns the species standard state density at the 00215 * current temperature and pressure 00216 * 00217 * @return returns the standard state density 00218 * units are kg m-3 00219 */ 00220 virtual doublereal density() const; 00221 00222 /** 00223 * @} 00224 * @name Properties of the Reference State of the Species 00225 * in the Solution 00226 * @{ 00227 */ 00228 00229 //! Return the molar gibbs free energy divided by RT at reference pressure 00230 /*! 00231 * Returns the species reference state gibbs free energy divided by RT at the 00232 * current temperature. 00233 * 00234 * @return returns the reference state gibbs free energy divided by RT 00235 */ 00236 virtual doublereal gibbs_RT_ref() const; 00237 00238 //! Return the molar enthalpy divided by RT at reference pressure 00239 /*! 00240 * Returns the species reference state enthalpy divided by RT at the 00241 * current temperature. 00242 * 00243 * @return returns the reference state enthalpy divided by RT 00244 */ 00245 virtual doublereal enthalpy_RT_ref() const; 00246 00247 //! Return the molar entropy divided by R at reference pressure 00248 /*! 00249 * Returns the species reference state entropy divided by R at the 00250 * current temperature. 00251 * 00252 * @return returns the reference state entropy divided by R 00253 */ 00254 virtual doublereal entropy_R_ref() const; 00255 00256 //! Return the molar heat capacity divided by R at reference pressure 00257 /*! 00258 * Returns the species reference state heat capacity divided by R at the 00259 * current temperature. 00260 * 00261 * @return returns the reference state heat capacity divided by R 00262 */ 00263 virtual doublereal cp_R_ref() const; 00264 00265 //! Return the molar volume at reference pressure 00266 /*! 00267 * Returns the species reference state molar volume at the 00268 * current temperature. 00269 * 00270 * @return returns the reference state molar volume divided by R 00271 * units are m**3 kmol-1. 00272 */ 00273 virtual doublereal molarVolume_ref() const; 00274 00275 /* 00276 * Get the difference in the standard state thermodynamic properties 00277 * between the reference pressure, po, and the current pressure. 00278 */ 00279 00280 /** 00281 * @} 00282 * @name Mechanical Equation of State Properties 00283 * @{ 00284 */ 00285 00286 //! Returns the pressure (Pa) 00287 virtual doublereal pressure() const; 00288 00289 //! Sets the pressure in the object 00290 /*! 00291 * Currently, this sets the pressure in the PDSS object. 00292 * It is indeterminant what happens to the owning VPStandardStateTP 00293 * object and to the VPSSMgr object. 00294 * 00295 * @param pres Pressure to be set (Pascal) 00296 */ 00297 virtual void setPressure(doublereal pres); 00298 00299 //! Set the internal temperature 00300 /*! 00301 * @param temp Temperature (Kelvin) 00302 */ 00303 virtual void setTemperature(doublereal temp); 00304 00305 //! Return the current storred temperature 00306 doublereal temperature() const; 00307 00308 //! Set the internal temperature and pressure 00309 /*! 00310 * @param temp Temperature (Kelvin) 00311 * @param pres pressure (Pascals) 00312 */ 00313 virtual void setState_TP(doublereal temp, doublereal pres); 00314 00315 //! Set the internal temperature and density 00316 /*! 00317 * @param temp Temperature (Kelvin) 00318 * @param rho Density (Pascals) 00319 */ 00320 virtual void setState_TR(doublereal temp, doublereal rho); 00321 00322 /** 00323 * @} 00324 * @name Miscellaneous properties of the standard state 00325 * @{ 00326 */ 00327 00328 /// critical temperature 00329 virtual doublereal critTemperature() const; 00330 00331 /// critical pressure 00332 virtual doublereal critPressure() const; 00333 00334 /// critical density 00335 virtual doublereal critDensity() const; 00336 00337 /// saturation pressure 00338 /*! 00339 * @param t Temperature (Kelvin) 00340 */ 00341 virtual doublereal satPressure(doublereal t); 00342 00343 /** 00344 * @} 00345 * @name Initialization of the Object 00346 * @{ 00347 */ 00348 00349 //! Initialization of a PDSS object using an 00350 //! input XML file. 00351 /*! 00352 * 00353 * This routine is a precursor to constructPDSSXML(XML_Node*) 00354 * routine, which does most of the work. 00355 * 00356 * @param vptp_ptr Pointer to the Variable pressure %ThermoPhase object 00357 * This object must have already been malloced. 00358 * 00359 * @param spindex Species index within the phase 00360 * 00361 * @param inputFile XML file containing the description of the 00362 * phase 00363 * 00364 * @param id Optional parameter identifying the name of the 00365 * phase. If none is given, the first XML 00366 * phase element will be used. 00367 */ 00368 void constructPDSSFile(VPStandardStateTP *vptp_ptr, int spindex, 00369 std::string inputFile, std::string id); 00370 00371 //!Initialization of a PDSS object using an xml tree 00372 /*! 00373 * This routine is a driver for the initialization of the 00374 * object. 00375 * 00376 * basic logic: 00377 * initThermo() (cascade) 00378 * getStuff from species Part of XML file 00379 * initThermoXML(phaseNode) (cascade) 00380 * 00381 * @param vptp_ptr Pointer to the Variable pressure %ThermoPhase object 00382 * This object must have already been malloced. 00383 * 00384 * @param spindex Species index within the phase 00385 * 00386 * @param phaseNode Reference to the phase Information for the phase 00387 * that owns this species. 00388 * 00389 * @param id Optional parameter identifying the name of the 00390 * phase. If none is given, the first XML 00391 * phase element will be used. 00392 */ 00393 void constructPDSSXML(VPStandardStateTP *vptp_ptr, int spindex, 00394 const XML_Node& phaseNode, std::string id); 00395 00396 //! Initialization routine for the PDSS object based on the phaseNode 00397 /*! 00398 * This is a cascading call, where each level should call the 00399 * the parent level. 00400 * 00401 * @param phaseNode Reference to the phase Information for the phase 00402 * that owns this species. 00403 * 00404 * @param id Optional parameter identifying the name of the 00405 * phase. If none is given, the first XML 00406 * phase element will be used. 00407 */ 00408 virtual void initThermoXML(const XML_Node& phaseNode, std::string& id); 00409 00410 //! Initialization routine for all of the shallow pointers 00411 /*! 00412 * This is a cascading call, where each level should call the 00413 * the parent level. 00414 * 00415 * The initThermo() routines get called before the initThermoXML() routines 00416 * from the constructPDSSXML() routine. 00417 * 00418 * 00419 * Calls initPtrs(); 00420 */ 00421 virtual void initThermo(); 00422 00423 //@} 00424 00425 00426 00427 protected: 00428 00429 //! Maximum temperature the standard states are good for 00430 doublereal m_tmin; 00431 00432 //! Minimum temperature the standard states are good for 00433 doublereal m_tmax; 00434 00435 }; 00436 } 00437 00438 #endif 00439 00440 00441