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