diff --git a/Cantera/src/thermo/Elements.h b/Cantera/src/thermo/Elements.h index aff197586..27c40f636 100644 --- a/Cantera/src/thermo/Elements.h +++ b/Cantera/src/thermo/Elements.h @@ -73,11 +73,12 @@ namespace Cantera { */ int atomicNumber(int m) const { return m_atomicNumbers[m]; } - //! Entropy at 298.15 K and 1 bar of stable state //! of the element /*! * units J kmol-1 K-1 + * + * @param m Element index */ doublereal entropyElement298(int m) const; @@ -152,6 +153,11 @@ namespace Cantera { * @param weight Atomic weight of the element. If no argument * is provided, a lookup is attempted. * @param atomicNumber defaults to 0 + * @param entropy298 Value of the entropy at 298 and 1 bar of the + * element in its most stable form. + * The default is to specify an ENTROPY298_UNKNOWN value, + * which will cause a throw error if its ever + * needed. */ void addUniqueElement(const std::string& symbol, doublereal weight = -12345.0, int atomicNumber = 0, diff --git a/Cantera/src/thermo/PDSS_ConstVol.cpp b/Cantera/src/thermo/PDSS_ConstVol.cpp index 99de493ea..b0fb1db2f 100644 --- a/Cantera/src/thermo/PDSS_ConstVol.cpp +++ b/Cantera/src/thermo/PDSS_ConstVol.cpp @@ -197,14 +197,14 @@ namespace Cantera { doublereal PDSS_ConstVol::enthalpy_mole() const { - double val = enthalpy_RT(); - double RT = GasConstant * m_temp; + doublereal val = enthalpy_RT(); + doublereal RT = GasConstant * m_temp; return (val * RT); } doublereal PDSS_ConstVol::enthalpy_RT() const { - double val = m_hss_RT_ptr[m_spindex]; + doublereal val = m_hss_RT_ptr[m_spindex]; return (val); } @@ -212,21 +212,21 @@ namespace Cantera { doublereal PDSS_ConstVol::intEnergy_mole() const { doublereal pVRT = (m_pres * m_Vss_ptr[m_spindex]) / (GasConstant * m_temp); - double val = m_h0_RT_ptr[m_spindex] - pVRT; - double RT = GasConstant * m_temp; + doublereal val = m_h0_RT_ptr[m_spindex] - pVRT; + doublereal RT = GasConstant * m_temp; return (val * RT); } doublereal PDSS_ConstVol::entropy_mole() const { - double val = entropy_R(); + doublereal val = entropy_R(); return (val * GasConstant); } doublereal PDSS_ConstVol::entropy_R() const { - double val = m_sss_R_ptr[m_spindex]; + doublereal val = m_sss_R_ptr[m_spindex]; return (val); } @@ -236,70 +236,70 @@ namespace Cantera { */ doublereal PDSS_ConstVol::gibbs_mole() const { - double val = gibbs_RT(); - double RT = GasConstant * m_temp; + doublereal val = gibbs_RT(); + doublereal RT = GasConstant * m_temp; return (val * RT); } doublereal PDSS_ConstVol::gibbs_RT() const { - double val = m_gss_RT_ptr[m_spindex]; + doublereal val = m_gss_RT_ptr[m_spindex]; return (val); } doublereal PDSS_ConstVol::cp_mole() const { - double val = m_cpss_R_ptr[m_spindex]; + doublereal val = m_cpss_R_ptr[m_spindex]; return (val * GasConstant); } doublereal PDSS_ConstVol::cp_R() const { - double val = m_cpss_R_ptr[m_spindex]; + doublereal val = m_cpss_R_ptr[m_spindex]; return (val); } doublereal PDSS_ConstVol::cv_mole() const { - double val = (cp_mole() - m_V0_ptr[m_spindex]); + doublereal val = (cp_mole() - m_V0_ptr[m_spindex]); return (val); } doublereal PDSS_ConstVol::molarVolume() const { - double val = m_Vss_ptr[m_spindex]; + doublereal val = m_Vss_ptr[m_spindex]; return (val); } doublereal PDSS_ConstVol::density() const { - double val = m_Vss_ptr[m_spindex]; + doublereal val = m_Vss_ptr[m_spindex]; return (m_mw/val); } doublereal PDSS_ConstVol::gibbs_RT_ref() const { - double val = m_g0_RT_ptr[m_spindex]; + doublereal val = m_g0_RT_ptr[m_spindex]; return (val); } doublereal PDSS_ConstVol::enthalpy_RT_ref() const { - double val = m_h0_RT_ptr[m_spindex]; + doublereal val = m_h0_RT_ptr[m_spindex]; return (val); } doublereal PDSS_ConstVol::entropy_R_ref() const { - double val = m_s0_R_ptr[m_spindex]; + doublereal val = m_s0_R_ptr[m_spindex]; return (val); } doublereal PDSS_ConstVol::cp_R_ref() const { - double val = m_cp0_R_ptr[m_spindex]; + doublereal val = m_cp0_R_ptr[m_spindex]; return (val); } doublereal PDSS_ConstVol::molarVolume_ref() const { - double val = m_V0_ptr[m_spindex]; + doublereal val = m_V0_ptr[m_spindex]; return (val); } diff --git a/Cantera/src/thermo/PDSS_ConstVol.h b/Cantera/src/thermo/PDSS_ConstVol.h index d9860e528..8e37f8799 100644 --- a/Cantera/src/thermo/PDSS_ConstVol.h +++ b/Cantera/src/thermo/PDSS_ConstVol.h @@ -289,14 +289,14 @@ namespace Cantera { /*! * @param temp Temperature (Kelvin) */ - virtual void setTemperature(double temp); + virtual void setTemperature(doublereal temp); //! Set the internal temperature and pressure /*! * @param temp Temperature (Kelvin) * @param pres pressure (Pascals) */ - virtual void setState_TP(double temp, double pres); + virtual void setState_TP(doublereal temp, doublereal pres); //! Set the internal temperature and density @@ -304,7 +304,7 @@ namespace Cantera { * @param temp Temperature (Kelvin) * @param rho Density (kg m-3) */ - virtual void setState_TR(double temp, double rho); + virtual void setState_TR(doublereal temp, doublereal rho); /** * @} diff --git a/Cantera/src/thermo/PDSS_IdealGas.cpp b/Cantera/src/thermo/PDSS_IdealGas.cpp index 7bfd7438e..0dc1c60fd 100644 --- a/Cantera/src/thermo/PDSS_IdealGas.cpp +++ b/Cantera/src/thermo/PDSS_IdealGas.cpp @@ -159,14 +159,14 @@ namespace Cantera { */ doublereal PDSS_IdealGas::enthalpy_mole() const { - double val = enthalpy_RT(); - double RT = GasConstant * m_temp; + doublereal val = enthalpy_RT(); + doublereal RT = GasConstant * m_temp; return (val * RT); } doublereal PDSS_IdealGas::enthalpy_RT() const { - double val = m_h0_RT_ptr[m_spindex]; + doublereal val = m_h0_RT_ptr[m_spindex]; return (val); } @@ -177,8 +177,8 @@ namespace Cantera { */ doublereal PDSS_IdealGas::intEnergy_mole() const { - double val = m_h0_RT_ptr[m_spindex] - 1.0; - double RT = GasConstant * m_temp; + doublereal val = m_h0_RT_ptr[m_spindex] - 1.0; + doublereal RT = GasConstant * m_temp; return (val * RT); } @@ -188,13 +188,13 @@ namespace Cantera { */ doublereal PDSS_IdealGas::entropy_mole() const { - double val = entropy_R(); + doublereal val = entropy_R(); return (val * GasConstant); } doublereal PDSS_IdealGas::entropy_R() const { - double val = m_s0_R_ptr[m_spindex] - log(m_pres/m_p0); + doublereal val = m_s0_R_ptr[m_spindex] - log(m_pres/m_p0); return (val); } @@ -204,14 +204,14 @@ namespace Cantera { */ doublereal PDSS_IdealGas::gibbs_mole() const { - double val = gibbs_RT(); - double RT = GasConstant * m_temp; + doublereal val = gibbs_RT(); + doublereal RT = GasConstant * m_temp; return (val * RT); } doublereal PDSS_IdealGas::gibbs_RT() const { - double val = m_g0_RT_ptr[m_spindex] + log(m_pres/m_p0); + doublereal val = m_g0_RT_ptr[m_spindex] + log(m_pres/m_p0); return (val); } @@ -221,13 +221,13 @@ namespace Cantera { */ doublereal PDSS_IdealGas::cp_mole() const { - double val = cp_R(); + doublereal val = cp_R(); return (val * GasConstant); } doublereal PDSS_IdealGas::cp_R() const { - double val = m_cp0_R_ptr[m_spindex]; + doublereal val = m_cp0_R_ptr[m_spindex]; return (val); } @@ -254,17 +254,17 @@ namespace Cantera { doublereal PDSS_IdealGas::gibbs_RT_ref() const { - double val = m_g0_RT_ptr[m_spindex]; + doublereal val = m_g0_RT_ptr[m_spindex]; return (val); } doublereal PDSS_IdealGas::enthalpy_RT_ref() const { - double val = m_h0_RT_ptr[m_spindex]; + doublereal val = m_h0_RT_ptr[m_spindex]; return (val); } doublereal PDSS_IdealGas::entropy_R_ref() const { - double val = m_s0_R_ptr[m_spindex]; + doublereal val = m_s0_R_ptr[m_spindex]; return (val); } @@ -318,12 +318,12 @@ namespace Cantera { * Obtain the temperature from the owning VPStandardStateTP object * if you can. */ - double PDSS_IdealGas::temperature() const { + doublereal PDSS_IdealGas::temperature() const { m_temp = m_vpssmgr_ptr->temperature(); return m_temp; } - void PDSS_IdealGas::setTemperature(double temp) { + void PDSS_IdealGas::setTemperature(doublereal temp) { m_temp = temp; m_spthermo->update_one(m_spindex, temp, m_cp0_R_ptr, m_h0_RT_ptr, m_s0_R_ptr); @@ -338,12 +338,12 @@ namespace Cantera { } - void PDSS_IdealGas::setState_TP(double temp, double pres) { + void PDSS_IdealGas::setState_TP(doublereal temp, doublereal pres) { m_pres = pres; setTemperature(temp); } - void PDSS_IdealGas::setState_TR(double temp, double rho) { + void PDSS_IdealGas::setState_TR(doublereal temp, doublereal rho) { m_pres = GasConstant * temp * rho / m_mw; setTemperature(temp); } diff --git a/Cantera/src/thermo/SpeciesThermoFactory.h b/Cantera/src/thermo/SpeciesThermoFactory.h index d649317ef..32a11d8f8 100755 --- a/Cantera/src/thermo/SpeciesThermoFactory.h +++ b/Cantera/src/thermo/SpeciesThermoFactory.h @@ -267,7 +267,7 @@ namespace Cantera { return sptherm; } - //! Create a new species thermo manager instance, by specifying + //! Create a new species thermo manager instance, by specifying //!the type and (optionally) a pointer to the factory to use to create it. /*! * This utility program is a basic factory operation for spawning a @@ -277,8 +277,8 @@ namespace Cantera { * derives from SpeciesThermoFactory. However, no applications of this * have been done yet. * - * @param type Species thermo type. - * @param f Pointer to a SpeciesThermoFactory. optional parameter. + * @param stype String specifying the species thermo type + * @param f Pointer to a SpeciesThermoFactory. optional parameter. * Defautls to NULL. */ inline SpeciesThermo* newSpeciesThermoMgr(std::string &stype, diff --git a/Cantera/src/thermo/WaterPropsIAPWS.cpp b/Cantera/src/thermo/WaterPropsIAPWS.cpp index a2d92e2d9..a39c4d246 100644 --- a/Cantera/src/thermo/WaterPropsIAPWS.cpp +++ b/Cantera/src/thermo/WaterPropsIAPWS.cpp @@ -39,7 +39,7 @@ static const doublereal M_water = 18.015268; */ //static const doublereal Rgas = 8.314472E3; // Joules kmol-1 K-1 static const doublereal Rgas = 8.314371E3; // Joules kmol-1 K-1 - +//@{ #ifndef MAX # define MAX(x,y) (( (x) > (y) ) ? (x) : (y)) #endif @@ -47,7 +47,7 @@ static const doublereal Rgas = 8.314371E3; // Joules kmol-1 K-1 #ifndef MIN # define MIN(x,y) (( (x) < (y) ) ? (x) : (y)) #endif - +//@} WaterPropsIAPWS:: WaterPropsIAPWS() : m_phi(0), diff --git a/Cantera/src/thermo/WaterPropsIAPWS.h b/Cantera/src/thermo/WaterPropsIAPWS.h index 56e4807ef..1c5bf7673 100644 --- a/Cantera/src/thermo/WaterPropsIAPWS.h +++ b/Cantera/src/thermo/WaterPropsIAPWS.h @@ -271,8 +271,6 @@ public: /*! * alpha = d (ln V) / dT at constant P. * - * @param temperature Input temperature (Kelvin) - * @param pressure Input pressure (Pa) * @return * Returns the coefficient of thermal expansion */ @@ -328,23 +326,33 @@ public: //! temperature as an input parameter. /*! * @param temperature input temperature (kelvin) + * @param waterState integer specifying the water state + * * @return * Returns the saturation pressure * units = Pascal */ doublereal psat(doublereal temperature, int waterState = WATER_LIQUID); - //! Return the value of the density at the water spinodal point + //! Return the value of the density at the water spinodal point (on the liquid side) //! for the current temperature. /*! - * + * @return returns the density with units of kg m-3 */ doublereal densSpinodalWater() const; + //! Return the value of the density at the water spinodal point (on the gas side) + //! for the current temperature. + /*! + * @return returns the density with units of kg m-3 + */ doublereal densSpinodalSteam() const; //! Returns the Phase State flag for the current state of the object /*! + * @param checkState If true, this function does a complete check to see where + * in paramters space we are + * * There are three values: * WATER_GAS below the critical temperature but below the critical density * WATER_LIQUID below the critical temperature but above the critical density diff --git a/Cantera/src/thermo/speciesThermoTypes.h b/Cantera/src/thermo/speciesThermoTypes.h index 777aff675..f8e742821 100755 --- a/Cantera/src/thermo/speciesThermoTypes.h +++ b/Cantera/src/thermo/speciesThermoTypes.h @@ -69,6 +69,9 @@ //! This is implemented in the class Adsorbate. #define ADSORBATE 1024 +//! Type of reference state thermo which is a wrapper around a pressure dependent +//! standard state object. Basically, the reference state pressure isn't special. +//! A general object is called with the pressure set at the reference state. #define PDSS_TYPE 37 #include "ct_defs.h"