Cleaned up Doxygen documentation for class PDSS and descendants

This commit is contained in:
Ray Speth 2013-03-04 17:31:27 +00:00
parent 3426b73b7a
commit 57a9a3f458
14 changed files with 421 additions and 2508 deletions

View file

@ -16,10 +16,8 @@
class WaterPropsIAPWS;
namespace Cantera
{
/**
* @defgroup pdssthermo Species Standard-State Thermodynamic Properties
*
@ -66,19 +64,16 @@ namespace Cantera
* species in a phase at its standard states, for a range of temperatures
* and pressures.
*
* Phases which use the %VPSSMGr class must have their respective
* %ThermoPhase objects actually be derivatives of the VPStandardState
* Phases which use the VPSSMGr class must have their respective
* ThermoPhase objects actually be derivatives of the VPStandardState
* class. These classes assume that there exists a standard state
* for each species in the phase, where the Thermodynamic functions are specified
* as a function of temperature and pressure. Standard state objects for each
* species in the phase are all derived from the PDSS virtual base class.
*
*
*
* The following classes inherit from PDSS. Each of these classes
* handles just one species.
*
*
* - PDSS_IdealGas
* - standardState model = "IdealGas"
* - This model assumes that the species in the phase obeys the
@ -86,7 +81,6 @@ namespace Cantera
* uses a SimpleThermo object to handle the calculation of the
* reference state. This object adds the pressure dependencies
* to the thermo functions.
* .
*
* - PDSS_ConstVol
* - standardState model = "ConstVol"
@ -95,7 +89,6 @@ namespace Cantera
* The manager uses a SimpleThermo object to handle the
* calculation of the reference state. This object adds the
* pressure dependencies to these thermo functions.
* .
*
* - PDSS_SSVol
* - standardState model = "constant_incompressible" || model == "constant"
@ -110,63 +103,53 @@ namespace Cantera
* calculation of the reference state. This object then adds the
* pressure dependencies and the volume terms to these thermo functions
* to complete the representation.
* .
*
* - PDSS_Water
* - standardState model = "Water"
* - This model assumes that
* Species 0 is assumed to be water, and a real equation
* of state is used to model the T, P behavior.
* Note, the model asssumes that the species is liquid water,
* Note, the model assumes that the species is liquid water,
* and not steam.
* .
*
* - PDSS_HKFT
* - standardState model = "HKFT"
* - This model assumes that the species follows the
* HKFT pressure dependent equation of state
* .
* .
*
* The choice of which VPSSMGr object to be used is either implicitly made by
* Cantera by querying the XML data file for compatibility or it may
* be explicitly requested in the XML file.
*
* Normally the PDSS object is not called directly. Instead the VPSSMgr
* object manages the calls to the PDSS object for the entire set of
* species that comprise a phase. Additionally, sometimes the VPSSMgr
* object will not call the PDSS object at all to calculate
* thermodynamic properties, instead relying on its own
* determination/knowledge for how to calculate thermo quantities
* quickly given what it knows about the PDSS objects under
* its control.
* object manages the calls to the PDSS object for the entire set of species
* that comprise a phase. Additionally, sometimes the VPSSMgr object will not
* call the PDSS object at all to calculate thermodynamic properties, instead
* relying on its own determination/knowledge for how to calculate thermo
* quantities quickly given what it knows about the PDSS objects under its
* control.
*
* The PDSS objects may or may not utilize the SpeciesThermo
* reference state manager class to calculate the reference
* state thermodynamics functions in its own calculation. There
* are some classes, such as PDSS_IdealGas and PDSS+_ConstVol,
* which utilize the SpeciesThermo object because the
* calculation is very similar to the reference state
* calculation, while there are other classes, PDSS_Water and
* PDSS_HKFT, which don't utilize the reference state calculation
* at all, because it wouldn't make sense to. For example,
* using the PDSS_Water module, there isn't anything special
* about the reference pressure of 1 bar, so the reference state
* calculation would represent a duplication of work.
* Additionally, when evaluating thermodynamic properties
* at higher pressures and temperatures, near the critical point,
* evaluation of the thermodynamics at a pressure of 1 bar may
* lead to situations where the liquid is unstable, i.e., beyond
* the spinodal curve leading to potentially wrong evaluation
* results.
* The PDSS objects may or may not utilize the SpeciesThermo reference state
* manager class to calculate the reference state thermodynamics functions in
* its own calculation. There are some classes, such as PDSS_IdealGas and
* PDSS+_ConstVol, which utilize the SpeciesThermo object because the
* calculation is very similar to the reference state calculation, while
* there are other classes, PDSS_Water and PDSS_HKFT, which don't utilize the
* reference state calculation at all, because it wouldn't make sense to. For
* example, using the PDSS_Water module, there isn't anything special about
* the reference pressure of 1 bar, so the reference state calculation would
* represent a duplication of work. Additionally, when evaluating
* thermodynamic properties at higher pressures and temperatures, near the
* critical point, evaluation of the thermodynamics at a pressure of 1 bar
* may lead to situations where the liquid is unstable, i.e., beyond the
* spinodal curve leading to potentially wrong evaluation results.
*
* For cases where the PDSS object doesn't use the SpeciesThermo
* object, a dummy SpeciesThermoInterpType object is actually
* installed into the SpeciesThermo object for that species.
* This dummy SpeciesThermoInterpType object is called a
* STITbyPDSS object. This object satisfies calls to
* SpeciesThermo member functions by actually calling the
* PDSS object at the reference pressure.
* For cases where the PDSS object doesn't use the SpeciesThermo object, a
* dummy SpeciesThermoInterpType object is actually installed into the
* SpeciesThermo object for that species. This dummy SpeciesThermoInterpType
* object is called a STITbyPDSS object. This object satisfies calls to
* SpeciesThermo member functions by actually calling the PDSS object at the
* reference pressure.
*
* @ingroup thermoprops
*/
@ -182,18 +165,15 @@ class VPSSMgr;
* Virtual base class for calculation of the
* pressure dependent standard state for a single species
*
* Class %PDSS is the base class
* for a family of classes that compute properties of a set of
* species in their standard states at a range of temperatures
* and pressures. The independent variables for this object
* are temperature and pressure.
* The class may have a reference to a SpeciesThermo object
* which handles the calculation of the reference state temperature
* Class %PDSS is the base class for a family of classes that compute
* properties of a set of species in their standard states at a range of
* temperatures and pressures. The independent variables for this object are
* temperature and pressure. The class may have a reference to a SpeciesThermo
* object which handles the calculation of the reference state temperature
* behavior of a subset of species.
*
* This class is analogous to the SpeciesThermoInterpType
* class, except that the standard state inherently incorporates
* the pressure dependence.
* This class is analogous to the SpeciesThermoInterpType class, except that
* the standard state inherently incorporates the pressure dependence.
*
* The class operates on a setState temperature and pressure basis.
* It only recalculates the standard state when the setState functions
@ -201,28 +181,22 @@ class VPSSMgr;
*
* <H3> Thread Safety </H3>
*
* These classes are designed such that they are not thread safe when
* called by themselves. The reason for this is that they sometimes use
* shared SpeciesThermo resources where they set the states. This condition
* may be remedied in the future if we get serious about employing
* multithreaded capabilities by adding mutex locks to the
* SpeciesThermo resources.
* These classes are designed such that they are not thread safe when called
* by themselves. The reason for this is that they sometimes use shared
* SpeciesThermo resources where they set the states. This condition may be
* remedied in the future if we get serious about employing multithreaded
* capabilities by adding mutex locks to the SpeciesThermo resources.
*
* However, in many other respects they can be thread safe. They use
* separate memory and hold intermediate data.
* However, in many other respects they can be thread safe. They use separate
* memory and hold intermediate data.
*
* @ingroup pdssthermo
*/
class PDSS
{
public:
/**
* @name Constructors
* @{
*/
//! @name Constructors
//! @{
//! Empty Constructor
PDSS();
@ -249,34 +223,29 @@ public:
*/
PDSS& operator=(const PDSS& b);
//! Destructor for the phase
virtual ~PDSS();
//! Duplication routine for objects which inherit from %PDSS
/*!
* This virtual routine can be used to duplicate %PDSS objects
* inherited from %PDSS even if the application only has
* a pointer to %PDSS to work with.
* This function can be used to duplicate objects derived from PDSS even
* if the application only has a pointer to PDSS to work with.
*
* @return returns a pointer to the base %PDSS object type
* @return A pointer to the base %PDSS object type
*/
virtual PDSS* duplMyselfAsPDSS() const;
/**
* @}
* @name Utilities
* @{
*/
//! @}
//! @name Utilities
//! @{
//! Returns the type of the standard state parameterization
/*!
* @return Returns the integer # of the parameterization
* @return The integer # of the parameterization
*/
PDSS_enumType reportPDSSType() const;
private:
//! Set an error within this object for an unhandled capability
/*!
* @param msg Message string for this error
@ -284,121 +253,91 @@ private:
void err(const std::string& msg) const;
public:
/**
* @}
* @name Molar Thermodynamic Properties of the Species Standard State
* in the Solution
* @{
*/
//! @}
//! @name Molar Thermodynamic Properties of the Species Standard State in the Solution
//! @{
//! Return the molar enthalpy in units of J kmol-1
/*!
* Returns the species standard state enthalpy in J kmol-1 at the
* current temperature and pressure.
*
* @return returns the species standard state enthalpy in J kmol-1
* @return the species standard state enthalpy in J kmol-1 at the current
* temperature and pressure.
*/
virtual doublereal enthalpy_mole() const;
//! Return the standard state molar enthalpy divided by RT
/*!
* Returns the species standard state enthalpy divided by RT at the
* current temperature and pressure.
*
* @return returns the species standard state enthalpy in unitless form
* @return The dimensionless species standard state enthalpy divided at
* the current temperature and pressure.
*/
virtual doublereal enthalpy_RT() const;
//! Return the molar internal Energy in units of J kmol-1
/*!
* Returns the species standard state internal Energy in J kmol-1 at the
* current temperature and pressure.
*
* @return returns the species standard state internal Energy in J kmol-1
* @return The species standard state internal Energy in J kmol-1 at the
* current temperature and pressure.
*/
virtual doublereal intEnergy_mole() const;
//! Return the molar entropy in units of J kmol-1 K-1
/*!
* Returns the species standard state entropy in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state entropy in J kmol-1 K-1
* @return The species standard state entropy in J kmol-1 K-1 at the
* current temperature and pressure.
*/
virtual doublereal entropy_mole() const;
//! Return the standard state entropy divided by RT
/*!
* Returns the species standard state entropy divided by RT at the
* current temperature and pressure.
*
* @return returns the species standard state entropy divided by RT
* @return The species standard state entropy divided by RT at the current
* temperature and pressure.
*/
virtual doublereal entropy_R() const;
//! Return the molar gibbs free energy in units of J kmol-1
//! Return the molar Gibbs free energy in units of J kmol-1
/*!
* Returns the species standard state gibbs free energy in J kmol-1 at the
* @return The species standard state Gibbs free energy in J kmol-1 at the
* current temperature and pressure.
*
* @return returns the species standard state gibbs free energy in J kmol-1
*/
virtual doublereal gibbs_mole() const;
//! Return the molar gibbs free energy divided by RT
//! Return the molar Gibbs free energy divided by RT
/*!
* Returns the species standard state gibbs free energy divided by RT at the
* current temperature and pressure.
*
* @return returns the species standard state gibbs free energy divided by RT
* @return The species standard state Gibbs free energy divided by RT at
* the current temperature and pressure.
*/
virtual doublereal gibbs_RT() const;
//! Return the molar const pressure heat capacity in units of J kmol-1 K-1
/*!
* Returns the species standard state Cp in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state Cp in J kmol-1 K-1
* @return The species standard state Cp in J kmol-1 K-1 at the current
* temperature and pressure.
*/
virtual doublereal cp_mole() const;
//! Return the molar const pressure heat capacity divided by RT
/*!
* Returns the species standard state Cp divided by RT at the
* current temperature and pressure.
*
* @return returns the species standard state Cp divided by RT
* @return The species standard state Cp divided by RT at the current
* temperature and pressure.
*/
virtual doublereal cp_R() const;
//! Return the molar const volume heat capacity in units of J kmol-1 K-1
/*!
* Returns the species standard state Cv in J kmol-1 K-1 at the
* @return The species standard state Cv in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state Cv in J kmol-1 K-1
*/
virtual doublereal cv_mole() const;
//! Return the molar volume at standard state
/*!
* Returns the species standard state molar volume at the
* current temperature and pressure
*
* @return returns the standard state molar volume divided by R
* units are m**3 kmol-1.
* @return The standard state molar volume at the current temperature and
* pressure. Units are m**3 kmol-1.
*/
virtual doublereal molarVolume() const;
//! Return the standard state density at standard state
/*!
* Returns the species standard state density at the
* current temperature and pressure
*
* @return returns the standard state density
* units are kg m-3
* @return The standard state density at the current temperature and
* pressure. units are kg m-3
*/
virtual doublereal density() const;
@ -418,12 +357,9 @@ public:
//! between the current pressure and the reference pressure, p0.
virtual doublereal cpDelp_mole() const;
/**
* @}
* @name Properties of the Reference State of the Species
* in the Solution
* @{
*/
//! @}
//! @name Properties of the Reference State of the Species in the Solution
//! @{
//! Return the reference pressure for this phase.
doublereal refPressure() const {
@ -435,7 +371,6 @@ public:
return m_minTemp;
}
//! return the minimum temperature
doublereal maxTemp() const {
return m_maxTemp;
@ -443,55 +378,41 @@ public:
//! Return the molar gibbs free energy divided by RT at reference pressure
/*!
* Returns the species reference state gibbs free energy divided by RT at the
* current temperature.
*
* @return returns the reference state gibbs free energy divided by RT
* @return The reference state gibbs free energy at the current
* temperature, divided by RT.
*/
virtual doublereal gibbs_RT_ref() const;
//! Return the molar enthalpy divided by RT at reference pressure
/*!
* Returns the species reference state enthalpy divided by RT at the
* current temperature.
*
* @return returns the reference state enthalpy divided by RT
* @return The species reference state enthalpy at the current
* temperature, divided by RT.
*/
virtual doublereal enthalpy_RT_ref() const;
//! Return the molar entropy divided by R at reference pressure
/*!
* Returns the species reference state entropy divided by R at the
* current temperature.
*
* @return returns the reference state entropy divided by R
* @return The species reference state entropy at the current
* temperature, divided by R.
*/
virtual doublereal entropy_R_ref() const;
//! Return the molar heat capacity divided by R at reference pressure
/*!
* Returns the species reference state heat capacity divided by R at the
* @return The species reference state heat capacity divided by R at the
* current temperature.
*
* @return returns the reference state heat capacity divided by R
*/
virtual doublereal cp_R_ref() const;
//! Return the molar volume at reference pressure
/*!
* Returns the species reference state molar volume at the
* current temperature.
*
* @return returns the reference state molar volume divided by R
* units are m**3 kmol-1.
* @return The reference state molar volume. units are m**3 kmol-1.
*/
virtual doublereal molarVolume_ref() const;
/**
* @}
* @name Mechanical Equation of State Properties
* @{
*/
//! @}
//! @name Mechanical Equation of State Properties
//! @{
//! Returns the pressure (Pa)
virtual doublereal pressure() const;
@ -516,7 +437,7 @@ public:
virtual doublereal thermalExpansionCoeff() const;
//@}
/// @name Partial Molar Properties of the Solution -----------------
/// @name Partial Molar Properties of the Solution
//@{
//! Set the internal temperature
@ -542,11 +463,9 @@ public:
*/
virtual void setState_TR(doublereal temp, doublereal rho);
/**
* @}
* @name Miscellaneous properties of the standard state
* @{
*/
//! @}
//! @name Miscellaneous properties of the standard state
//! @{
//! critical temperature
virtual doublereal critTemperature() const;
@ -573,12 +492,9 @@ public:
*/
void setMolecularWeight(doublereal mw);
/**
* @}
* @name Initialization of the Object
* @{
*/
//! @}
//! @name Initialization of the Object
//! @{
//! Initialization routine for all of the shallow pointers
/*!
@ -588,7 +504,6 @@ public:
* The initThermo() routines get called before the initThermoXML() routines
* from the constructPDSSXML() routine.
*
*
* Calls initPtrs();
*/
virtual void initThermo();
@ -607,12 +522,9 @@ public:
*/
virtual void initThermoXML(const XML_Node& phaseNode, const std::string& id);
//! This utility function reports back the type of
//! parameterization and all of the parameters for the
//! species, index.
//! This utility function reports back the type of parameterization and
//! all of the parameters for the species, index.
/*!
*
* @param kindex Species index
* @param type Integer type of the standard type
* @param c Vector of coefficients used to set the
@ -620,13 +532,11 @@ public:
* @param minTemp output - Minimum temperature
* @param maxTemp output - Maximum temperature
* @param refPressure output - reference pressure (Pa).
*
*/
virtual void reportParams(size_t& kindex, int& type, doublereal* const c,
doublereal& minTemp, doublereal& maxTemp,
doublereal& refPressure) const;
private:
//! Initialize all of the internal shallow pointers that can be initialized
/*!
@ -640,7 +550,7 @@ public:
* This command is called to reinitialize all shallow pointers in the
* object. It's needed for the duplicator capability
*
* @param vptp_ptr Pointer to the Variable pressure %ThermoPhase object
* @param vptp_ptr Pointer to the Variable pressure ThermoPhase object
* This object must have already been malloced.
*
* @param vpssmgr_ptr Pointer to the variable pressure standard state
@ -652,11 +562,9 @@ public:
*/
virtual void initAllPtrs(VPStandardStateTP* vptp_ptr, VPSSMgr* vpssmgr_ptr,
SpeciesThermo* spthermo_ptr);
//@}
protected:
//! Enumerated type describing the type of the PDSS object
PDSS_enumType m_pdssType;
@ -675,7 +583,7 @@ protected:
//! Maximum temperature
doublereal m_maxTemp;
//! Thermophase which this species belongs to.
//! ThermoPhase which this species belongs to.
/*!
* Note, in some
* applications (i.e., mostly testing applications, this may be a null
@ -692,45 +600,41 @@ protected:
doublereal m_mw;
/**
* Species index in the thermophase corresponding to this species.
* Species index in the ThermoPhase corresponding to this species.
*/
size_t m_spindex;
//! Pointer to the species thermodynamic property manager.
/*!
* This is a copy of the pointer in the ThermoPhase object.
* Note, this object doesn't own the pointer.
* If the SpeciesThermo ThermoPhase object doesn't know
* or doesn't control the calculation, this will be
* set to zero.
* This is a copy of the pointer in the ThermoPhase object. Note, this
* object doesn't own the pointer. If the SpeciesThermo ThermoPhase object
* doesn't know or doesn't control the calculation, this will be set to
* zero.
*/
SpeciesThermo* m_spthermo;
//! Reference state enthalpy divided by RT.
/*!
* Storage for the thermo properties is provided by
* VPSSMgr. This object owns a shallow pointer.
* Calculated at the current value of T and m_p0
* Storage for the thermo properties is provided by VPSSMgr. This object
* owns a shallow pointer. Calculated at the current value of T and m_p0
*/
doublereal* m_h0_RT_ptr;
//! Reference state heat capacity divided by R.
/*!
* Storage for the thermo properties is provided by
* VPSSMgr.
* Calculated at the current value of T and m_p0
* Storage for the thermo properties is provided by VPSSMgr. Calculated
* at the current value of T and m_p0
*/
doublereal* m_cp0_R_ptr;
//! Reference state entropy divided by R.
/*!
* Storage for the thermo properties is provided by
* VPSSMgr.
* Calculated at the current value of T and m_p0
* Storage for the thermo properties is provided by VPSSMgr. Calculated
* at the current value of T and m_p0
*/
doublereal* m_s0_R_ptr;
//! Reference state gibbs free energy divided by RT.
//! Reference state Gibbs free energy divided by RT.
/*!
* Calculated at the current value of T and m_p0
*/
@ -738,52 +642,45 @@ protected:
//! Reference state molar volume (m3 kg-1)
/*!
* Storage for the thermo properties is provided by
* VPSSMgr.
* Calculated at the current value of T and m_p0
* Storage for the thermo properties is provided by VPSSMgr. Calculated
* at the current value of T and m_p0
*/
doublereal* m_V0_ptr;
//! Standard state enthalpy divided by RT.
/*!
* Storage for the thermo properties is provided by
* VPSSMgr.
* Calculated at the current value of T and P
* Storage for the thermo properties is provided by VPSSMgr. Calculated
* at the current value of T and P.
*/
doublereal* m_hss_RT_ptr;
//! Standard state heat capacity divided by R.
/*!
* Storage for the thermo properties is provided by
* VPSSMgr.
* Calculated at the current value of T and P
* Storage for the thermo properties is provided by VPSSMgr. Calculated
* at the current value of T and P.
*/
doublereal* m_cpss_R_ptr;
//! Standard state entropy divided by R.
/*!
* Storage for the thermo properties is provided by
* VPSSMgr.
* Calculated at the current value of T and P
* Storage for the thermo properties is provided by VPSSMgr. Calculated
* at the current value of T and P.
*/
doublereal* m_sss_R_ptr;
//! Standard state gibbs free energy divided by RT.
//! Standard state Gibbs free energy divided by RT.
/*!
* Storage for the thermo properties is provided by
* VPSSMgr.
* Calculated at the current value of T and P
* Storage for the thermo properties is provided by VPSSMgr. Calculated
* at the current value of T and P.
*/
doublereal* m_gss_RT_ptr;
//! Standard State molar volume (m3 kg-1)
/*!
* Storage for the thermo properties is provided by
* VPSSMgr.
* Calculated at the current value of T and P
* Storage for the thermo properties is provided by VPSSMgr. Calculated
* at the current value of T and P.
*/
doublereal* m_Vss_ptr;
};
}

View file

@ -21,20 +21,13 @@ class VPStandardStateTP;
//! Class for pressure dependent standard states that use a constant volume model
/*!
* Class for pressure dependent standard states that use a constant volume model.
*
*
* @ingroup pdssthermo
*/
class PDSS_ConstVol : public PDSS
{
public:
/**
* @name Constructors
* @{
*/
//! @name Constructors
//! @{
//! Constructor
/*!
@ -43,7 +36,6 @@ public:
*/
PDSS_ConstVol(VPStandardStateTP* tp, size_t spindex);
//! Constructor that initializes the object by examining the input file
//! of the ThermoPhase object
/*!
@ -89,277 +81,70 @@ public:
//! Destructor
virtual ~PDSS_ConstVol();
//! Duplicator
virtual PDSS* duplMyselfAsPDSS() const;
/**
* @}
* @name Utilities
* @{
*/
//! @}
//! @name Molar Thermodynamic Properties of the Species Standard State in the Solution
//! @{
/**
* @}
* @name Molar Thermodynamic Properties of the Species Standard State
* in the Solution
* @{
*/
//! Return the molar enthalpy in units of J kmol-1
/*!
* Returns the species standard state enthalpy in J kmol-1 at the
* current temperature and pressure.
*
* @return returns the species standard state enthalpy in J kmol-1
*/
// See PDSS.h for documentation of functions overridden from Class PDSS
virtual doublereal enthalpy_mole() const;
//! Return the standard state molar enthalpy divided by RT
/*!
* Returns the species standard state enthalpy divided by RT at the
* current temperature and pressure.
*
* @return returns the species standard state enthalpy in unitless form
*/
virtual doublereal enthalpy_RT() const;
//! Return the molar internal Energy in units of J kmol-1
/*!
* Returns the species standard state internal Energy in J kmol-1 at the
* current temperature and pressure.
*
* @return returns the species standard state internal Energy in J kmol-1
*/
virtual doublereal intEnergy_mole() const;
//! Return the molar entropy in units of J kmol-1 K-1
/*!
* Returns the species standard state entropy in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state entropy in J kmol-1 K-1
*/
virtual doublereal entropy_mole() const;
//! Return the standard state entropy divided by RT
/*!
* Returns the species standard state entropy divided by RT at the
* current temperature and pressure.
*
* @return returns the species standard state entropy divided by RT
*/
virtual doublereal entropy_R() const;
//! Return the molar gibbs free energy in units of J kmol-1
/*!
* Returns the species standard state gibbs free energy in J kmol-1 at the
* current temperature and pressure.
*
* @return returns the species standard state gibbs free energy in J kmol-1
*/
virtual doublereal gibbs_mole() const;
//! Return the molar gibbs free energy divided by RT
/*!
* Returns the species standard state gibbs free energy divided by RT at the
* current temperature and pressure.
*
* @return returns the species standard state gibbs free energy divided by RT
*/
virtual doublereal gibbs_RT() const;
//! Return the molar const pressure heat capacity in units of J kmol-1 K-1
/*!
* Returns the species standard state Cp in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state Cp in J kmol-1 K-1
*/
virtual doublereal cp_mole() const;
//! Return the molar const pressure heat capacity divided by RT
/*!
* Returns the species standard state Cp divided by RT at the
* current temperature and pressure.
*
* @return returns the species standard state Cp divided by RT
*/
virtual doublereal cp_R() const;
//! Return the molar const volume heat capacity in units of J kmol-1 K-1
/*!
* Returns the species standard state Cv in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state Cv in J kmol-1 K-1
*/
virtual doublereal cv_mole() const;
//! Return the molar volume at standard state
/*!
* Returns the species standard state molar volume at the
* current temperature and pressure
*
* @return returns the standard state molar volume divided by R
* units are m**3 kmol-1.
*/
virtual doublereal molarVolume() const;
//! Return the standard state density at standard state
/*!
* Returns the species standard state density at the
* current temperature and pressure
*
* @return returns the standard state density
* units are kg m-3
*/
virtual doublereal density() const;
/**
* @}
* @name Properties of the Reference State of the Species
* in the Solution
* @{
*/
//! @}
//! @name Properties of the Reference State of the Species in the Solution
//! @{
//! Return the molar gibbs free energy divided by RT at reference pressure
/*!
* Returns the species reference state gibbs free energy divided by RT at the
* current temperature.
*
* @return returns the reference state gibbs free energy divided by RT
*/
virtual doublereal gibbs_RT_ref() const;
//! Return the molar enthalpy divided by RT at reference pressure
/*!
* Returns the species reference state enthalpy divided by RT at the
* current temperature.
*
* @return returns the reference state enthalpy divided by RT
*/
virtual doublereal enthalpy_RT_ref() const;
//! Return the molar entropy divided by R at reference pressure
/*!
* Returns the species reference state entropy divided by R at the
* current temperature.
*
* @return returns the reference state entropy divided by R
*/
virtual doublereal entropy_R_ref() const;
//! Return the molar heat capacity divided by R at reference pressure
/*!
* Returns the species reference state heat capacity divided by R at the
* current temperature.
*
* @return returns the reference state heat capacity divided by R
*/
virtual doublereal cp_R_ref() const;
//! Return the molar volume at reference pressure
/*!
* Returns the species reference state molar volume at the
* current temperature.
*
* @return returns the reference state molar volume divided by R
* units are m**3 kmol-1.
*/
virtual doublereal molarVolume_ref() const;
/**
* @}
* @name Mechanical Equation of State Properties
* @{
*/
//! @}
//! @name Mechanical Equation of State Properties
//! @{
//! Sets the pressure in the object
/*!
* Currently, this sets the pressure in the PDSS object.
* It is indeterminant what happens to the owning VPStandardStateTP
* object and to the VPSSMgr object.
*
* @param pres Pressure to be set (Pascal)
*/
virtual void setPressure(doublereal pres);
//! Set the internal temperature
/*!
* @param temp Temperature (Kelvin)
*/
virtual void setTemperature(doublereal temp);
//! Set the internal temperature and pressure
/*!
* @param temp Temperature (Kelvin)
* @param pres pressure (Pascals)
*/
virtual void setState_TP(doublereal temp, doublereal pres);
//! Set the internal temperature and density
/*!
* @param temp Temperature (Kelvin)
* @param rho Density (kg m-3)
*/
virtual void setState_TR(doublereal temp, doublereal rho);
/**
* @}
* @name Miscellaneous properties of the standard state
* @{
*/
//! @}
//! @name Miscellaneous properties of the standard state
//! @{
/// critical temperature
virtual doublereal critTemperature() const;
/// critical pressure
virtual doublereal critPressure() const;
/// critical density
virtual doublereal critDensity() const;
/// saturation pressure
/*!
* @param t Temperature (kelvin)
*/
virtual doublereal satPressure(doublereal t);
/**
* @}
* @name Initialization of the Object
* @{
*/
//! @}
//! @name Initialization of the Object
//! @{
//! Initialization routine for all of the shallow pointers
/*!
* This is a cascading call, where each level should call the
* the parent level.
*
* The initThermo() routines get called before the initThermoXML() routines
* from the constructPDSSXML() routine.
*
*
* Calls initPtrs();
*/
virtual void initThermo();
//! Initialization of a PDSS object using an
//! input XML file.
/*!
*
* This routine is a precursor to constructPDSSXML(XML_Node*)
* routine, which does most of the work.
*
* @param vptp_ptr Pointer to the Variable pressure %ThermoPhase object
* This object must have already been malloced.
*
* @param spindex Species index within the phase
*
* @param inputFile XML file containing the description of the
* phase
*
* @param inputFile XML file containing the description of the phase
* @param id Optional parameter identifying the name of the
* phase. If none is given, the first XML
* phase element will be used.
@ -369,24 +154,19 @@ public:
//! Initialization of a PDSS object using an xml tree
/*!
* This routine is a driver for the initialization of the
* object.
* This routine is a driver for the initialization of the object.
*
* basic logic:
* initThermo() (cascade)
* getStuff from species Part of XML file
* initThermoXML(phaseNode) (cascade)
* - initThermo() (cascade)
* - getStuff from species Part of XML file
* - initThermoXML(phaseNode) (cascade)
*
* @param vptp_ptr Pointer to the Variable pressure %ThermoPhase object
* This object must have already been malloced.
*
* @param spindex Species index within the phase
*
* @param speciesNode XML Node containing the species information
*
* @param phaseNode Reference to the phase Information for the phase
* that owns this species.
*
* @param spInstalled Boolean indicating whether the species is
* already installed.
*/
@ -394,35 +174,18 @@ public:
const XML_Node& speciesNode,
const XML_Node& phaseNode, bool spInstalled);
//! Initialization routine for the PDSS object based on the phaseNode
/*!
* This is a cascading call, where each level should call the
* the parent level.
*
* @param phaseNode Reference to the phase Information for the phase
* that owns this species.
*
* @param id Optional parameter identifying the name of the
* phase. If none is given, the first XML
* phase element will be used.
*/
virtual void initThermoXML(const XML_Node& phaseNode, const std::string& id);
//@}
private:
//! Value of the constant molar volume for the species
/*!
* m3 / kmol
*/
doublereal m_constMolarVolume;
};
}
#endif

View file

@ -27,37 +27,13 @@ class WaterProps;
//! Class for pressure dependent standard states corresponding to
//! ionic solutes in electrolyte water.
/*!
*
* Virtual base class for calculation of the
* pressure dependent standard state for a single species
*
* Class %PDSS is the base class
* for a family of classes that compute properties of a set of
* species in their standard states at a range of temperatures
* and pressures. The independent variables for this object
* are temperature and pressure.
* The class may have a reference to a SpeciesThermo object
* which handles the calculation of the reference state temperature
* behavior of a subset of species.
*
* This class is analogous to the SpeciesThermoInterpType
* class, except that the standard state inherently incorporates
* the pressure dependence.
*
* The class operates on a setState temperature and pressure basis.
* It only recalculates the standard state when the setState functions
* for temperature and pressure are called
*
* @ingroup pdssthermo
*/
class PDSS_HKFT : public PDSS
{
public:
/**
* @name Constructors
* @{
*/
//! @name Constructors
//! @{
//! Constructor that initializes the object by examining the XML entries
//! from the ThermoPhase object
@ -114,35 +90,14 @@ public:
//! Destructor for the phase
virtual ~PDSS_HKFT();
//! Duplicator
virtual PDSS* duplMyselfAsPDSS() const;
/**
* @}
* @name Utilities
* @{
*/
//! @}
//! @name Molar Thermodynamic Properties of the Solution
//! @{
/**
* @}
* @name Molar Thermodynamic Properties of the Species Standard State
* in the Solution
* @{
*/
// See PDSS.h for documentation of functions overridden from Class PDSS
/**
* @}
* @name Molar Thermodynamic Properties of the Solution --------------
* @{
*/
//! Return the molar enthalpy in units of J kmol-1
/*!
* Returns the species standard state enthalpy in J kmol-1 at the
* current temperature and pressure.
*
* @return returns the species standard state enthalpy in J kmol-1
*/
virtual doublereal enthalpy_mole() const;
#ifdef DEBUG_MODE
@ -158,223 +113,63 @@ public:
doublereal enthalpy_mole2() const;
#endif
//! Return the standard state molar enthalpy divided by RT
/*!
* Returns the species standard state enthalpy divided by RT at the
* current temperature and pressure.
*
* @return returns the species standard state enthalpy in unitless form
*/
virtual doublereal enthalpy_RT() const;
//! Return the molar internal Energy in units of J kmol-1
/*!
* Returns the species standard state internal Energy in J kmol-1 at the
* current temperature and pressure.
*
* @return returns the species standard state internal Energy in J kmol-1
*/
virtual doublereal intEnergy_mole() const;
//! Return the molar entropy in units of J kmol-1 K-1
/*!
* Returns the species standard state entropy in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state entropy in J kmol-1 K-1
*/
virtual doublereal entropy_mole() const;
//! Return the molar gibbs free energy in units of J kmol-1
/*!
* Returns the species standard state gibbs free energy in J kmol-1 at the
* current temperature and pressure.
*
* @return returns the species standard state gibbs free energy in J kmol-1
*/
virtual doublereal gibbs_mole() const;
//! Return the molar const pressure heat capacity in units of J kmol-1 K-1
/*!
* Returns the species standard state Cp in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state Cp in J kmol-1 K-1
*/
virtual doublereal cp_mole() const;
//! Return the molar const volume heat capacity in units of J kmol-1 K-1
/*!
* Returns the species standard state Cv in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state Cv in J kmol-1 K-1
*/
virtual doublereal cv_mole() const;
//! Return the molar volume at standard state
/*!
* Returns the species standard state molar volume at the
* current temperature and pressure
*
* @return returns the standard state molar volume divided by R
* units are m**3 kmol-1.
*/
virtual doublereal molarVolume() const;
//! Return the standard state density at standard state
/*!
* Returns the species standard state density at the
* current temperature and pressure
*
* @return returns the standard state density
* units are kg m-3
*/
virtual doublereal density() const;
/**
* @}
* @name Properties of the Reference State of the Species
* in the Solution
* @{
*/
//! @}
//! @name Properties of the Reference State of the Species in the Solution
//! @{
//! Return the reference pressure for this phase.
doublereal refPressure() const {
return m_p0;
}
//! Return the molar gibbs free energy divided by RT at reference pressure
/*!
* Returns the species reference state gibbs free energy divided by RT at the
* current temperature.
*
* @return returns the reference state gibbs free energy divided by RT
*/
virtual doublereal gibbs_RT_ref() const;
//! Return the molar enthalpy divided by RT at reference pressure
/*!
* Returns the species reference state enthalpy divided by RT at the
* current temperature.
*
* @return returns the reference state enthalpy divided by RT
*/
virtual doublereal enthalpy_RT_ref() const;
//! Return the molar entropy divided by R at reference pressure
/*!
* Returns the species reference state entropy divided by R at the
* current temperature.
*
* @return returns the reference state entropy divided by R
*/
virtual doublereal entropy_R_ref() const;
//! Return the molar heat capacity divided by R at reference pressure
/*!
* Returns the species reference state heat capacity divided by R at the
* current temperature.
*
* @return returns the reference state heat capacity divided by R
*/
virtual doublereal cp_R_ref() const;
//! Return the molar volume at reference pressure
/*!
* Returns the species reference state molar volume at the
* current temperature.
*
* @return returns the reference state molar volume divided by R
* units are m**3 kmol-1.
*/
virtual doublereal molarVolume_ref() const;
/**
* @}
* @name Mechanical Equation of State Properties
* @{
*/
//! @}
//! @name Mechanical Equation of State Properties
//! @{
//! Returns the pressure (Pa)
virtual doublereal pressure() const;
//! Sets the pressure in the object
/*!
* Currently, this sets the pressure in the PDSS object.
* It is indeterminant what happens to the owning VPStandardStateTP
* object and to the VPSSMgr object.
*
* @param pres Pressure to be set (Pascal)
*/
virtual void setPressure(doublereal pres);
//! Set the internal temperature
/*!
* @param temp Temperature (Kelvin)
*/
virtual void setTemperature(doublereal temp);
//! Return the current stored temperature
doublereal temperature() const;
//! Set the internal temperature and pressure
/*!
* @param temp Temperature (Kelvin)
* @param pres pressure (Pascals)
*/
virtual void setState_TP(doublereal temp, doublereal pres);
/**
* @}
* @name Miscellaneous properties of the standard state
* @{
*/
//! @}
//! @name Miscellaneous properties of the standard state
//! @{
/// critical temperature
virtual doublereal critTemperature() const;
/// critical pressure
virtual doublereal critPressure() const;
/// critical density
virtual doublereal critDensity() const;
/**
* @}
* @name Initialization of the Object
* @{
*/
//! @}
//! @name Initialization of the Object
//! @{
//! Initialization routine for all of the shallow pointers
/*!
* This is a cascading call, where each level should call the
* the parent level.
*
* The initThermo() routines get called before the initThermoXML() routines
* from the constructPDSSXML() routine.
*
*
* Calls initPtrs();
*/
virtual void initThermo();
//! Initialization of a PDSS object using an
//! input XML file.
//! Initialization of a PDSS object using an input XML file.
/*!
*
* This routine is a precursor to constructPDSSXML(XML_Node*)
* routine, which does most of the work.
*
* @param vptp_ptr Pointer to the Variable pressure %ThermoPhase object
* This object must have already been malloced.
*
* @param spindex Species index within the phase
*
* @param inputFile XML file containing the description of the
* phase
*
* @param id Optional parameter identifying the name of the
* phase. If none is given, the first XML
* phase element will be used.
@ -384,24 +179,19 @@ public:
//! Initialization of a PDSS object using an xml tree
/*!
* This routine is a driver for the initialization of the
* object.
* This routine is a driver for the initialization of the object.
*
* basic logic:
* initThermo() (cascade)
* getStuff from species Part of XML file
* initThermoXML(phaseNode) (cascade)
* - initThermo() (cascade)
* - getStuff from species Part of XML file
* - initThermoXML(phaseNode) (cascade)
*
* @param vptp_ptr Pointer to the Variable pressure %ThermoPhase object
* This object must have already been malloced.
*
* @param spindex Species index within the phase
*
* @param speciesNode XML Node containing the species information
*
* @param phaseNode Reference to the phase Information for the phase
* that owns this species.
*
* @param spInstalled Boolean indicating whether the species is
* already installed.
*/
@ -409,43 +199,13 @@ public:
const XML_Node& speciesNode,
const XML_Node& phaseNode, bool spInstalled);
//! Initialization routine for the PDSS object based on the phaseNode
/*!
* This is a cascading call, where each level should call the
* the parent level.
*
* @param phaseNode Reference to the phase Information for the phase
* that owns this species.
*
* @param id Optional parameter identifying the name of the
* phase. If none is given, the first XML
* phase element will be used.
*/
virtual void initThermoXML(const XML_Node& phaseNode, const std::string& id);
//! Initialize or Reinitialize all shallow pointers in the object
/*!
* This command is called to reinitialize all shallow pointers in the
* object. It's needed for the duplicator capability
*
* @param vptp_ptr Pointer to the Variable pressure %ThermoPhase object
* This object must have already been malloced.
*
* @param vpssmgr_ptr Pointer to the variable pressure standard state
* calculator for this phase
*
* @param spthermo_ptr Pointer to the optional SpeciesThermo object
* that will handle the calculation of the reference
* state thermodynamic coefficients.
*/
virtual void initAllPtrs(VPStandardStateTP* vptp_ptr, VPSSMgr* vpssmgr_ptr,
SpeciesThermo* spthermo_ptr);
//! This utility function reports back the type of
//! parameterization and all of the parameters for the
//! species, index.
//! This utility function reports back the type of parameterization and
//! all of the parameters for the species, index.
/*!
*
* The following parameters are reported
*
* - c[0] = m_deltaG_formation_tr_pr;
@ -468,7 +228,6 @@ public:
* @param minTemp output - Minimum temperature
* @param maxTemp output - Maximum temperature
* @param refPressure output - reference pressure (Pa).
*
*/
virtual void reportParams(size_t& kindex, int& type, doublereal* const c,
doublereal& minTemp, doublereal& maxTemp,
@ -476,14 +235,11 @@ public:
//@}
private:
//! Main routine that actually calculates the gibbs free energy difference
//! between the reference state at Tr, Pr and T,P
/*!
* This is eEqn. 59 in Johnson et al. (1992).
*
*/
doublereal deltaG() const;
@ -563,7 +319,6 @@ private:
//! Evaluate the Gstar value appearing in the HKFT formulation
/*!
*
* @param temp Temperature kelvin
* @param pres Pressure (pascal)
* @param ifunc parameters specifying the desired information
@ -577,26 +332,23 @@ private:
//! Function to look up Element Free Energies
/*!
* This function looks up the argument string in the element database and
* returns the associated 298 K Gibbs Free energy of the element in its
* stable state.
*
* This static function looks up the argument string in the
* element database and returns the associated 298 K Gibbs Free energy
* of the element in its stable state
* @param elemName String. Only the first 3 characters are significant
*
* @param elemName String. Only the first 3 characters are significant
* @return value contains the Gibbs free energy for that element
*
* @return
* Return value contains the Gibbs free energy for that element
*
* @exception CanteraError
* @exception CanteraError
* If a match is not found, a CanteraError is thrown as well
*/
doublereal LookupGe(const std::string& elemName);
//! Translate a Gibbs free energy of formation value to a NIST-based Chemical potential
/*!
* Internally, this function is used to translate the input value,
* m_deltaG_formation_tr_pr,
* to the internally stored value, m_Mu0_tr_pr.
* Internally, this function is used to translate the input value,
* m_deltaG_formation_tr_pr, to the internally stored value, m_Mu0_tr_pr.
*/
void convertDGFormation();
@ -691,12 +443,8 @@ private:
//! Charge of the ion
doublereal m_charge_j;
};
}
#endif

View file

@ -14,13 +14,11 @@
#include "PDSS.h"
namespace Cantera
{
class XML_Node;
class VPStandardStateTP;
//! Derived class for pressure dependent standard states of an ideal gas species
/*!
* This class is for a single Ideal Gas species.
@ -29,13 +27,9 @@ class VPStandardStateTP;
*/
class PDSS_IdealGas : public PDSS
{
public:
/**
* @name Constructors
* @{
*/
//! @name Constructors
//! @{
//! Constructor
/*!
@ -71,7 +65,6 @@ public:
PDSS_IdealGas(VPStandardStateTP* tp, int spindex,
const std::string& inputFile, const std::string& id = "");
//! Constructor that initializes the object by examining the input file
//! of the ThermoPhase object
/*!
@ -87,267 +80,66 @@ public:
PDSS_IdealGas(VPStandardStateTP* vptp_ptr, size_t spindex, const XML_Node& speciesNode,
const XML_Node& phaseRef, bool spInstalled);
//! Destructor
virtual ~PDSS_IdealGas();
//! Duplicator
virtual PDSS* duplMyselfAsPDSS() const;
/**
* @}
* @name Utilities
* @{
*/
//! @}
//! @name Molar Thermodynamic Properties of the Species Standard State in the Solution
//! @{
/**
* @}
* @name Molar Thermodynamic Properties of the Species Standard State
* in the Solution
* @{
*/
// See PDSS.h for documentation of functions overridden from Class PDSS
//! Return the molar enthalpy in units of J kmol-1
/*!
* Returns the species standard state enthalpy in J kmol-1 at the
* current temperature and pressure.
*
* @return returns the species standard state enthalpy in J kmol-1
*/
virtual doublereal enthalpy_mole() const;
//! Return the standard state molar enthalpy divided by RT
/*!
* Returns the species standard state enthalpy divided by RT at the
* current temperature and pressure.
*
* @return returns the species standard state enthalpy in unitless form
*/
virtual doublereal enthalpy_RT() const;
//! Return the molar internal Energy in units of J kmol-1
/*!
* Returns the species standard state internal Energy in J kmol-1 at the
* current temperature and pressure.
*
* @return returns the species standard state internal Energy in J kmol-1
*/
virtual doublereal intEnergy_mole() const;
//! Return the molar entropy in units of J kmol-1 K-1
/*!
* Returns the species standard state entropy in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state entropy in J kmol-1 K-1
*/
virtual doublereal entropy_mole() const;
//! Return the standard state entropy divided by RT
/*!
* Returns the species standard state entropy divided by RT at the
* current temperature and pressure.
*
* @return returns the species standard state entropy divided by RT
*/
virtual doublereal entropy_R() const;
//! Return the molar gibbs free energy in units of J kmol-1
/*!
* Returns the species standard state gibbs free energy in J kmol-1 at the
* current temperature and pressure.
*
* @return returns the species standard state gibbs free energy in J kmol-1
*/
virtual doublereal gibbs_mole() const;
//! Return the molar gibbs free energy divided by RT
/*!
* Returns the species standard state gibbs free energy divided by RT at the
* current temperature and pressure.
*
* @return returns the species standard state gibbs free energy divided by RT
*/
virtual doublereal gibbs_RT() const;
//! Return the molar const pressure heat capacity in units of J kmol-1 K-1
/*!
* Returns the species standard state Cp in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state Cp in J kmol-1 K-1
*/
virtual doublereal cp_mole() const;
//! Return the molar const pressure heat capacity divided by RT
/*!
* Returns the species standard state Cp divided by RT at the
* current temperature and pressure.
*
* @return returns the species standard state Cp divided by RT
*/
virtual doublereal cp_R() const;
//! Return the molar const volume heat capacity in units of J kmol-1 K-1
/*!
* Returns the species standard state Cv in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state Cv in J kmol-1 K-1
*/
virtual doublereal cv_mole() const;
//! Return the molar volume at standard state
/*!
* Returns the species standard state molar volume at the
* current temperature and pressure
*
* @return returns the standard state molar volume divided by R
* units are m**3 kmol-1.
*/
virtual doublereal molarVolume() const;
//! Return the standard state density at standard state
/*!
* Returns the species standard state density at the
* current temperature and pressure
*
* @return returns the standard state density
* units are kg m-3
*/
virtual doublereal density() const;
/**
* @}
* @name Properties of the Reference State of the Species
* in the Solution
* @{
*/
//! @}
//! @name Properties of the Reference State of the Species in the Solution
//! @{
//! Return the molar gibbs free energy divided by RT at reference pressure
/*!
* Returns the species reference state gibbs free energy divided by RT at the
* current temperature.
*
* @return returns the reference state gibbs free energy divided by RT
*/
virtual doublereal gibbs_RT_ref() const;
//! Return the molar enthalpy divided by RT at reference pressure
/*!
* Returns the species reference state enthalpy divided by RT at the
* current temperature.
*
* @return returns the reference state enthalpy divided by RT
*/
virtual doublereal enthalpy_RT_ref() const;
//! Return the molar entropy divided by R at reference pressure
/*!
* Returns the species reference state entropy divided by R at the
* current temperature.
*
* @return returns the reference state entropy divided by R
*/
virtual doublereal entropy_R_ref() const;
//! Return the molar heat capacity divided by R at reference pressure
/*!
* Returns the species reference state heat capacity divided by R at the
* current temperature.
*
* @return returns the reference state heat capacity divided by R
*/
virtual doublereal cp_R_ref() const;
//! Return the molar volume at reference pressure
/*!
* Returns the species reference state molar volume at the
* current temperature.
*
* @return returns the reference state molar volume divided by R
* units are m**3 kmol-1.
*/
virtual doublereal molarVolume_ref() const;
/*
* Get the difference in the standard state thermodynamic properties
* between the reference pressure, po, and the current pressure.
*/
//! @}
//! @name Mechanical Equation of State Properties
//! @{
/**
* @}
* @name Mechanical Equation of State Properties
* @{
*/
//! Returns the pressure (Pa)
virtual doublereal pressure() const;
//! Sets the pressure in the object
/*!
* Currently, this sets the pressure in the PDSS object.
* It is indeterminant what happens to the owning VPStandardStateTP
* object and to the VPSSMgr object.
*
* @param pres Pressure to be set (Pascal)
*/
virtual void setPressure(doublereal pres);
//! Set the internal temperature
/*!
* @param temp Temperature (Kelvin)
*/
virtual void setTemperature(doublereal temp);
//! Return the current stored temperature
doublereal temperature() const;
//! Set the internal temperature and pressure
/*!
* @param temp Temperature (Kelvin)
* @param pres pressure (Pascals)
*/
virtual void setState_TP(doublereal temp, doublereal pres);
//! Set the internal temperature and density
/*!
* @param temp Temperature (Kelvin)
* @param rho Density (Pascals)
*/
virtual void setState_TR(doublereal temp, doublereal rho);
/**
* @}
* @name Miscellaneous properties of the standard state
* @{
*/
//! @}
//! @name Miscellaneous properties of the standard state
//! @{
/// critical temperature
virtual doublereal critTemperature() const;
/// critical pressure
virtual doublereal critPressure() const;
/// critical density
virtual doublereal critDensity() const;
/// saturation pressure
/*!
* @param t Temperature (Kelvin)
*/
virtual doublereal satPressure(doublereal t);
/**
* @}
* @name Initialization of the Object
* @{
*/
//! @}
//! @name Initialization of the Object
//! @{
//! Initialization of a PDSS object using an
//! input XML file.
//! Initialization of a PDSS object using an input XML file.
/*!
*
* This routine is a precursor to constructPDSSXML(XML_Node*)
* routine, which does most of the work.
*
@ -356,8 +148,7 @@ public:
*
* @param spindex Species index within the phase
*
* @param inputFile XML file containing the description of the
* phase
* @param inputFile XML file containing the description of the phase
*
* @param id Optional parameter identifying the name of the
* phase. If none is given, the first XML
@ -368,13 +159,12 @@ public:
//!Initialization of a PDSS object using an xml tree
/*!
* This routine is a driver for the initialization of the
* object.
* This routine is a driver for the initialization of the object.
*
* basic logic:
* initThermo() (cascade)
* getStuff from species Part of XML file
* initThermoXML(phaseNode) (cascade)
* basic logic:
* - initThermo() (cascade)
* - get stuff from species part of XML file
* - initThermoXML(phaseNode) (cascade)
*
* @param vptp_ptr Pointer to the Variable pressure %ThermoPhase object
* This object must have already been malloced.
@ -391,33 +181,8 @@ public:
void constructPDSSXML(VPStandardStateTP* vptp_ptr, size_t spindex,
const XML_Node& phaseNode, const std::string& id);
//! Initialization routine for the PDSS object based on the phaseNode
/*!
* This is a cascading call, where each level should call the
* the parent level.
*
* @param phaseNode Reference to the phase Information for the phase
* that owns this species.
*
* @param id Optional parameter identifying the name of the
* phase. If none is given, the first XML
* phase element will be used.
*/
virtual void initThermoXML(const XML_Node& phaseNode, const std::string& id);
//! Initialization routine for all of the shallow pointers
/*!
* This is a cascading call, where each level should call the
* the parent level.
*
* The initThermo() routines get called before the initThermoXML() routines
* from the constructPDSSXML() routine.
*
*
* Calls initPtrs();
*/
virtual void initThermo();
//@}
};
}

View file

@ -15,14 +15,12 @@
#include "PDSS.h"
namespace Cantera
{
class XML_Node;
class VPStandardStateTP;
class ThermoPhase;
//! Derived class for pressure dependent standard states of an ideal gas species
/*!
* This class is for a single Ideal Gas species.
@ -31,13 +29,9 @@ class ThermoPhase;
*/
class PDSS_IonsFromNeutral : public PDSS
{
public:
/**
* @name Constructors
* @{
*/
//! @name Constructors
//! @{
//! Constructor
/*!
@ -61,7 +55,6 @@ public:
PDSS_IonsFromNeutral(VPStandardStateTP* tp, size_t spindex,
const std::string& inputFile, const std::string& id = "");
//! Constructor that initializes the object by examining the input file
//! of the ThermoPhase object
/*!
@ -92,301 +85,88 @@ public:
//! Destructor
virtual ~PDSS_IonsFromNeutral();
//! Duplicator
virtual PDSS* duplMyselfAsPDSS() const;
//! Initialize or Reinitialize all shallow pointers in the object
/*!
* This command is called to reinitialize all shallow pointers in the
* object. It's needed for the duplicator capability.
* We need to have an inherited function here to set neutralMoleculePhase_ properly.
*
* @param vptp_ptr Pointer to the Variable pressure %ThermoPhase object
* This object must have already been malloced.
*
* @param vpssmgr_ptr Pointer to the variable pressure standard state
* calculator for this phase
*
* @param spthermo_ptr Pointer to the optional SpeciesThermo object
* that will handle the calculation of the reference
* state thermodynamic coefficients.
*/
virtual void initAllPtrs(VPStandardStateTP* vptp_ptr, VPSSMgr* vpssmgr_ptr,
SpeciesThermo* spthermo_ptr);
/**
* @}
* @name Utilities
* @{
*/
//! @}
//! @name Molar Thermodynamic Properties of the Species Standard State in the Solution
//! @{
/**
* @}
* @name Molar Thermodynamic Properties of the Species Standard State
* in the Solution
* @{
*/
// See PDSS.h for documentation of functions overridden from Class PDSS
//! Return the molar enthalpy in units of J kmol-1
/*!
* Returns the species standard state enthalpy in J kmol-1 at the
* current temperature and pressure.
*
* @return returns the species standard state enthalpy in J kmol-1
*/
virtual doublereal enthalpy_mole() const;
//! Return the standard state molar enthalpy divided by RT
/*!
* Returns the species standard state enthalpy divided by RT at the
* current temperature and pressure.
*
* @return returns the species standard state enthalpy in unitless form
*/
virtual doublereal enthalpy_RT() const;
//! Return the molar internal Energy in units of J kmol-1
/*!
* Returns the species standard state internal Energy in J kmol-1 at the
* current temperature and pressure.
*
* @return returns the species standard state internal Energy in J kmol-1
*/
virtual doublereal intEnergy_mole() const;
//! Return the molar entropy in units of J kmol-1 K-1
/*!
* Returns the species standard state entropy in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state entropy in J kmol-1 K-1
*/
virtual doublereal entropy_mole() const;
//! Return the standard state entropy divided by RT
/*!
* Returns the species standard state entropy divided by RT at the
* current temperature and pressure.
*
* @return returns the species standard state entropy divided by RT
*/
virtual doublereal entropy_R() const;
//! Return the molar gibbs free energy in units of J kmol-1
/*!
* Returns the species standard state gibbs free energy in J kmol-1 at the
* current temperature and pressure.
*
* @return returns the species standard state gibbs free energy in J kmol-1
*/
virtual doublereal gibbs_mole() const;
//! Return the molar gibbs free energy divided by <I>RT</I>
/*!
* Returns the species standard state gibbs free energy divided by <I>RT</I> at the
* current temperature and pressure.
* @copydoc PDSS::gibbs_RT()
*
* \f[
* \frac{\mu^o_k}{RT} = \sum_{m}{ \alpha_{m , k} \frac{\mu^o_{m}}{RT}} + ( 1 - \delta_{k,sp}) 2.0 \ln{2.0}
* \f]
* \f[
* \frac{\mu^o_k}{RT} = \sum_{m}{ \alpha_{m , k} \frac{\mu^o_{m}}{RT}} + ( 1 - \delta_{k,sp}) 2.0 \ln{2.0}
* \f]
*
* <I>m</I> is the neutral molecule species index. \f$ \alpha_{m , k} \f$ is the stoiciometric
* coefficient for the neutral molecule, <I>m</I>, that creates the thermodynamics for the ionic species <I>k</I>.
* A factor \f$ 2.0 \ln{2.0} \f$ is added to all ions except for the species ionic species, which in this
* case is the single anion species, with species index <I>sp</I>.
*
* @return Returns the species standard state gibbs free energy divided by <I>RT</I>
* <I>m</I> is the neutral molecule species index. \f$ \alpha_{m , k} \f$ is the stoiciometric
* coefficient for the neutral molecule, <I>m</I>, that creates the thermodynamics for the ionic species <I>k</I>.
* A factor \f$ 2.0 \ln{2.0} \f$ is added to all ions except for the species ionic species, which in this
* case is the single anion species, with species index <I>sp</I>.
*/
virtual doublereal gibbs_RT() const;
//! Return the molar const pressure heat capacity in units of J kmol-1 K-1
/*!
* Returns the species standard state Cp in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state Cp in J kmol-1 K-1
*/
virtual doublereal cp_mole() const;
//! Return the molar const pressure heat capacity divided by RT
/*!
* Returns the species standard state Cp divided by RT at the
* current temperature and pressure.
*
* @return returns the species standard state Cp divided by RT
*/
virtual doublereal cp_R() const;
//! Return the molar const volume heat capacity in units of J kmol-1 K-1
/*!
* Returns the species standard state Cv in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state Cv in J kmol-1 K-1
*/
virtual doublereal cv_mole() const;
//! Return the molar volume at standard state
/*!
* Returns the species standard state molar volume at the
* current temperature and pressure
*
* @return returns the standard state molar volume divided by R
* units are m**3 kmol-1.
*/
virtual doublereal molarVolume() const;
//! Return the standard state density at standard state
/*!
* Returns the species standard state density at the
* current temperature and pressure
*
* @return returns the standard state density
* units are kg m-3
*/
virtual doublereal density() const;
/**
* @}
* @name Properties of the Reference State of the Species
* in the Solution
* @{
*/
//! @}
//! @name Properties of the Reference State of the Species in the Solution
//! @{
//! Return the molar gibbs free energy divided by RT at reference pressure
/*!
* Returns the species reference state gibbs free energy divided by RT at the
* current temperature.
*
* @return returns the reference state gibbs free energy divided by RT
*/
virtual doublereal gibbs_RT_ref() const;
//! Return the molar enthalpy divided by RT at reference pressure
/*!
* Returns the species reference state enthalpy divided by RT at the
* current temperature.
*
* @return returns the reference state enthalpy divided by RT
*/
virtual doublereal enthalpy_RT_ref() const;
//! Return the molar entropy divided by R at reference pressure
/*!
* Returns the species reference state entropy divided by R at the
* current temperature.
*
* @return returns the reference state entropy divided by R
*/
virtual doublereal entropy_R_ref() const;
//! Return the molar heat capacity divided by R at reference pressure
/*!
* Returns the species reference state heat capacity divided by R at the
* current temperature.
*
* @return returns the reference state heat capacity divided by R
*/
virtual doublereal cp_R_ref() const;
//! Return the molar volume at reference pressure
/*!
* Returns the species reference state molar volume at the
* current temperature.
*
* @return returns the reference state molar volume divided by R
* units are m**3 kmol-1.
*/
virtual doublereal molarVolume_ref() const;
/*
* Get the difference in the standard state thermodynamic properties
* between the reference pressure, po, and the current pressure.
*/
//! @}
//! @name Mechanical Equation of State Properties
//! @{
/**
* @}
* @name Mechanical Equation of State Properties
* @{
*/
//! Returns the pressure (Pa)
virtual doublereal pressure() const;
//! Sets the pressure in the object
/*!
* Currently, this sets the pressure in the PDSS object.
* It is indeterminant what happens to the owning VPStandardStateTP
* object and to the VPSSMgr object.
*
* @param pres Pressure to be set (Pascal)
*/
virtual void setPressure(doublereal pres);
//! Set the internal temperature
/*!
* @param temp Temperature (Kelvin)
*/
virtual void setTemperature(doublereal temp);
//! Return the current stored temperature
doublereal temperature() const;
//! Set the internal temperature and pressure
/*!
* @param temp Temperature (Kelvin)
* @param pres pressure (Pascals)
*/
virtual void setState_TP(doublereal temp, doublereal pres);
//! Set the internal temperature and density
/*!
* @param temp Temperature (Kelvin)
* @param rho Density (Pascals)
*/
virtual void setState_TR(doublereal temp, doublereal rho);
/**
* @}
* @name Miscellaneous properties of the standard state
* @{
*/
//! @}
//! @name Miscellaneous properties of the standard state
//! @{
/// critical temperature
virtual doublereal critTemperature() const;
/// critical pressure
virtual doublereal critPressure() const;
/// critical density
virtual doublereal critDensity() const;
/// saturation pressure
/*!
* @param t Temperature (Kelvin)
*/
virtual doublereal satPressure(doublereal t);
/**
* @}
* @name Initialization of the Object
* @{
*/
//! @}
//! @name Initialization of the Object
//! @{
//! Initialization of a PDSS object using an
//! input XML file.
//! Initialization of a PDSS object using an input XML file.
/*!
*
* This routine is a precursor to constructPDSSXML(XML_Node*)
* routine, which does most of the work.
*
* @param vptp_ptr Pointer to the Variable pressure %ThermoPhase object
* @param vptp_ptr Pointer to the Variable pressure ThermoPhase object
* This object must have already been malloced.
*
* @param spindex Species index within the phase
*
* @param inputFile XML file containing the description of the
* phase
* @param inputFile XML file containing the description of the phase
*
* @param id Optional parameter identifying the name of the
* phase. If none is given, the first XML
@ -400,9 +180,9 @@ public:
* This routine is a driver for the initialization of the object.
*
* basic logic:
* initThermo() (cascade)
* getStuff from species Part of XML file
* initThermoXML(phaseNode) (cascade)
* - initThermo() (cascade)
* - getStuff from species Part of XML file
* - initThermoXML(phaseNode) (cascade)
*
* @param vptp_ptr Pointer to the Variable pressure %ThermoPhase object
* This object must have already been malloced.
@ -423,37 +203,10 @@ public:
const XML_Node& speciesNode,
const XML_Node& phaseNode, const std::string& id);
//! Initialization routine for the PDSS object based on the phaseNode
/*!
* This is a cascading call, where each level should call the
* the parent level.
*
* @param phaseNode Reference to the phase Information for the phase
* that owns this species.
*
* @param id Optional parameter identifying the name of the
* phase. If none is given, the first XML
* phase element will be used.
*/
virtual void initThermoXML(const XML_Node& phaseNode, const std::string& id);
//! Initialization routine for all of the shallow pointers
/*!
* This is a cascading call, where each level should call the
* the parent level.
*
* The initThermo() routines get called before the initThermoXML() routines
* from the constructPDSSXML() routine.
*
*
* Calls initPtrs();
*/
virtual void initThermo();
//@}
protected:
//! Pointer to the Neutral Molecule ThermoPhase object
/*!
@ -462,7 +215,6 @@ protected:
const ThermoPhase* neutralMoleculePhase_;
public:
//! Number of neutral molecule species that make up the stoichiometric vector for
//! this species, in terms of calculating thermodynamic functions
size_t numMult_;
@ -489,6 +241,3 @@ public:
}
#endif

View file

@ -23,86 +23,82 @@ class VPStandardStateTP;
//! Class for pressure dependent standard states that uses a standard state volume
//! model of some sort.
/*!
* Class PDSS_SSVol is an implementation class that compute the properties of a single
* species in a phase at its standard states, for a range of temperatures
* and pressures. This particular class assumes that the calculation of the
* thermodynamics functions can be separated into a temperature polynomial representation
* for thermo functions that can be handled bey a SimpleThermo object and
* a separate calculation for the standard state volume.
* The Models include a cubic polynomial in temperature for either
* the standard state volume or the standard state density.
* The manager uses a SimpleThermo object to handle the
* calculation of the reference state. This object then adds the
* pressure dependencies and the volume terms to these thermo functions
* to complete the representation.
* Class PDSS_SSVol is an implementation class that compute the properties of a
* single species in a phase at its standard states, for a range of
* temperatures and pressures. This particular class assumes that the
* calculation of the thermodynamics functions can be separated into a
* temperature polynomial representation for thermo functions that can be
* handled bey a SimpleThermo object and a separate calculation for the
* standard state volume. The Models include a cubic polynomial in temperature
* for either the standard state volume or the standard state density. The
* manager uses a SimpleThermo object to handle the calculation of the
* reference state. This object then adds the pressure dependencies and the
* volume terms to these thermo functions to complete the representation.
*
* The class includes the following models for the representation of the
* standard state volume:
* The class includes the following models for the representation of the
* standard state volume:
*
* - Constant Volume
* - This standard state model is invoked with the keyword "constant_incompressible"
* or "constant". The standard state volume is considered constant.
* \f[
* V^o_k(T,P) = a_0
* \f]
* .
* - Constant Volume
* - This standard state model is invoked with the keyword "constant_incompressible"
* or "constant". The standard state volume is considered constant.
* \f[
* V^o_k(T,P) = a_0
* \f]
*
* - Temperature polynomial for the standard state volume
* - This standard state model is invoked with the keyword "temperature_polynomial".
* The standard state volume is considered a function of temperature only.
* \f[
* V^o_k(T,P) = a_0 + a_1 T + a_2 T^2 + a_3 T^3 + a_4 T^4
* \f]
* .
* - Temperature polynomial for the standard state volume
* - This standard state model is invoked with the keyword "temperature_polynomial".
* The standard state volume is considered a function of temperature only.
* \f[
* V^o_k(T,P) = a_0 + a_1 T + a_2 T^2 + a_3 T^3 + a_4 T^4
* \f]
*
* - Temperature polynomial for the standard state density
* - This standard state model is invoked with the keyword "density_temperature_polynomial".
* The standard state density, which is the inverse of the volume,
* is considered a function of temperature only.
* \f[
* {\rho}^o_k(T,P) = \frac{M_k}{V^o_k(T,P)} = a_0 + a_1 T + a_2 T^2 + a_3 T^3 + a_4 T^4
* \f]
* .
* .
* - Temperature polynomial for the standard state density
* - This standard state model is invoked with the keyword "density_temperature_polynomial".
* The standard state density, which is the inverse of the volume,
* is considered a function of temperature only.
* \f[
* {\rho}^o_k(T,P) = \frac{M_k}{V^o_k(T,P)} = a_0 + a_1 T + a_2 T^2 + a_3 T^3 + a_4 T^4
* \f]
*
* <b> Specification of Species Standard %State Properties </b>
*
* The standard molar Gibbs free energy for species <I>k</I> is determined from the enthalpy
* and entropy expressions
* The standard molar Gibbs free energy for species <I>k</I> is determined from
* the enthalpy and entropy expressions
*
* \f[
* G^o_k(T,P) = H^o_k(T,P) - S^o_k(T,P)
* \f]
*
* The enthalpy is calculated mostly from the %SpeciesThermo object's enthalpy evalulator. The
* dependence on pressure originates from the Maxwell relation
* The enthalpy is calculated mostly from the %SpeciesThermo object's enthalpy
* evalulator. The dependence on pressure originates from the Maxwell relation
*
* \f[
* {\left(\frac{dH^o_k}{dP}\right)}_T = T {\left(\frac{dS^o_k}{dP}\right)}_T + V^o_k
* \f]
* which is equal to
* which is equal to
*
* \f[
* {\left(\frac{dH^o_k}{dP}\right)}_T = V^o_k - T {\left(\frac{dV^o_k}{dT}\right)}_P
* \f]
*
* The entropy is calculated mostly from the %SpeciesThermo objects entropy evalulator. The
* dependence on pressure originates from the Maxwell relation:
* The entropy is calculated mostly from the %SpeciesThermo objects entropy
* evalulator. The dependence on pressure originates from the Maxwell relation:
*
* \f[
* {\left(\frac{dS^o_k}{dP}\right)}_T = - {\left(\frac{dV^o_k}{dT}\right)}_P
* \f]
*
* The standard state constant-pressure heat capacity expression is obtained from taking the
* temperature derivative of the Maxwell relation involving the enthalpy given above
* to yield an expression for the pressure dependence of the heat capacity.
* The standard state constant-pressure heat capacity expression is obtained
* from taking the temperature derivative of the Maxwell relation involving the
* enthalpy given above to yield an expression for the pressure dependence of
* the heat capacity.
*
* \f[
* {\left(\frac{d{C}^o_{p,k}}{dP}\right)}_T = - T {\left(\frac{{d}^2{V}^o_k}{{dT}^2}\right)}_T
* \f]
*
* The standard molar Internal Energy for species <I>k</I> is determined from the following
* relation.
* The standard molar Internal Energy for species <I>k</I> is determined from the following
* relation.
*
* \f[
* U^o_k(T,P) = H^o_k(T,P) - p V^o_k
@ -110,66 +106,61 @@ class VPStandardStateTP;
*
* <b> XML Example </b>
*
* An example of the specification of a standard state for the LiCl molten salt
* which employs a constant molar volume expression.
* An example of the specification of a standard state for the LiCl molten salt
* which employs a constant molar volume expression.
*
@verbatim
<speciesData id="species_MoltenSalt">
<species name="LiCl(L)">
<atomArray> Li:1 Cl:1 </atomArray>
<standardState model="constant_incompressible">
<molarVolume> 0.02048004 </molarVolume>
</standardState>
<thermo>
<Shomate Pref="1 bar" Tmax="2000.0" Tmin="700.0">
<floatArray size="7">
73.18025, -9.047232, -0.316390,
0.079587, 0.013594, -417.1314,
157.6711
</floatArray>
</Shomate>
</thermo>
</species>
</speciesData>
@endverbatim
* @code
* <speciesData id="species_MoltenSalt">
* <species name="LiCl(L)">
* <atomArray> Li:1 Cl:1 </atomArray>
* <standardState model="constant_incompressible">
* <molarVolume> 0.02048004 </molarVolume>
* </standardState>
* <thermo>
* <Shomate Pref="1 bar" Tmax="2000.0" Tmin="700.0">
* <floatArray size="7">
* 73.18025, -9.047232, -0.316390,
* 0.079587, 0.013594, -417.1314,
* 157.6711
* </floatArray>
* </Shomate>
* </thermo>
* </species>
* </speciesData>
* @endcode
*
* An example of the specification of a standard state for the LiCl molten salt
* which has a temperature dependent standard state volume.
*
@verbatim
<speciesData id="species_MoltenSalt">
<species name="LiCl(L)">
<atomArray> Li:1 Cl:1 </atomArray>
<standardState model="density_temperature_polynomial">
<densityTemperaturePolynomial units="gm/cm3" >
1.98715, -5.890906E-4, 0.0, 0.0
</densityTemperaturePolynomial>
</standardState>
<thermo>
<Shomate Pref="1 bar" Tmax="2000.0" Tmin="700.0">
<floatArray size="7">
73.18025, -9.047232, -0.316390,
0.079587, 0.013594, -417.1314,
157.6711
</floatArray>
</Shomate>
</thermo>
</species>
</speciesData>
@endverbatim
* An example of the specification of a standard state for the LiCl molten salt
* which has a temperature dependent standard state volume.
*
* @code
* <speciesData id="species_MoltenSalt">
* <species name="LiCl(L)">
* <atomArray> Li:1 Cl:1 </atomArray>
* <standardState model="density_temperature_polynomial">
* <densityTemperaturePolynomial units="gm/cm3" >
* 1.98715, -5.890906E-4, 0.0, 0.0
* </densityTemperaturePolynomial>
* </standardState>
* <thermo>
* <Shomate Pref="1 bar" Tmax="2000.0" Tmin="700.0">
* <floatArray size="7">
* 73.18025, -9.047232, -0.316390,
* 0.079587, 0.013594, -417.1314,
* 157.6711
* </floatArray>
* </Shomate>
* </thermo>
* </species>
* </speciesData>
* @endcode
*
* @ingroup pdssthermo
*/
class PDSS_SSVol : public PDSS
{
public:
/**
* @name Constructors
* @{
*/
//! @name Constructors
//! @{
//! Constructor
/*!
@ -178,7 +169,6 @@ public:
*/
PDSS_SSVol(VPStandardStateTP* tp, size_t spindex);
//! Constructor that initializes the object by examining the input file
//! of the ThermoPhase object
/*!
@ -224,274 +214,67 @@ public:
//! Destructor
virtual ~PDSS_SSVol();
//! Duplicator
virtual PDSS* duplMyselfAsPDSS() const;
/**
* @}
* @name Utilities
* @{
*/
//! @}
//! @name Molar Thermodynamic Properties of the Species Standard State in the Solution
//! @{
/**
* @}
* @name Molar Thermodynamic Properties of the Species Standard State
* in the Solution
* @{
*/
// See PDSS.h for documentation of functions overridden from Class PDSS
//! Return the molar enthalpy in units of J kmol-1
/*!
* Returns the species standard state enthalpy in J kmol-1 at the
* current temperature and pressure.
*
* @return returns the species standard state enthalpy in J kmol-1
*/
virtual doublereal enthalpy_mole() const;
//! Return the standard state molar enthalpy divided by RT
/*!
* Returns the species standard state enthalpy divided by RT at the
* current temperature and pressure.
*
* @return returns the species standard state enthalpy in unitless form
*/
virtual doublereal enthalpy_RT() const;
//! Return the molar internal Energy in units of J kmol-1
/*!
* Returns the species standard state internal Energy in J kmol-1 at the
* current temperature and pressure.
*
* @return returns the species standard state internal Energy in J kmol-1
*/
virtual doublereal intEnergy_mole() const;
//! Return the molar entropy in units of J kmol-1 K-1
/*!
* Returns the species standard state entropy in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state entropy in J kmol-1 K-1
*/
virtual doublereal entropy_mole() const;
//! Return the standard state entropy divided by RT
/*!
* Returns the species standard state entropy divided by RT at the
* current temperature and pressure.
*
* @return returns the species standard state entropy divided by RT
*/
virtual doublereal entropy_R() const;
//! Return the molar gibbs free energy in units of J kmol-1
/*!
* Returns the species standard state gibbs free energy in J kmol-1 at the
* current temperature and pressure.
*
* @return returns the species standard state gibbs free energy in J kmol-1
*/
virtual doublereal gibbs_mole() const;
//! Return the molar gibbs free energy divided by RT
/*!
* Returns the species standard state gibbs free energy divided by RT at the
* current temperature and pressure.
*
* @return returns the species standard state gibbs free energy divided by RT
*/
virtual doublereal gibbs_RT() const;
//! Return the molar const pressure heat capacity in units of J kmol-1 K-1
/*!
* Returns the species standard state Cp in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state Cp in J kmol-1 K-1
*/
virtual doublereal cp_mole() const;
//! Return the molar const pressure heat capacity divided by RT
/*!
* Returns the species standard state Cp divided by RT at the
* current temperature and pressure.
*
* @return returns the species standard state Cp divided by RT
*/
virtual doublereal cp_R() const;
//! Return the molar const volume heat capacity in units of J kmol-1 K-1
/*!
* Returns the species standard state Cv in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state Cv in J kmol-1 K-1
*/
virtual doublereal cv_mole() const;
//! Return the molar volume at standard state
/*!
* Returns the species standard state molar volume at the
* current temperature and pressure
*
* @return returns the standard state molar volume divided by R
* units are m**3 kmol-1.
*/
virtual doublereal molarVolume() const;
//! Return the standard state density at standard state
/*!
* Returns the species standard state density at the
* current temperature and pressure
*
* @return returns the standard state density
* units are kg m-3
*/
virtual doublereal density() const;
/**
* @}
* @name Properties of the Reference State of the Species
* in the Solution
* @{
*/
//! @}
//! @name Properties of the Reference State of the Species in the Solution
//! @{
//! Return the molar gibbs free energy divided by RT at reference pressure
/*!
* Returns the species reference state gibbs free energy divided by RT at the
* current temperature.
*
* @return returns the reference state gibbs free energy divided by RT
*/
virtual doublereal gibbs_RT_ref() const;
//! Return the molar enthalpy divided by RT at reference pressure
/*!
* Returns the species reference state enthalpy divided by RT at the
* current temperature.
*
* @return returns the reference state enthalpy divided by RT
*/
virtual doublereal enthalpy_RT_ref() const;
//! Return the molar entropy divided by R at reference pressure
/*!
* Returns the species reference state entropy divided by R at the
* current temperature.
*
* @return returns the reference state entropy divided by R
*/
virtual doublereal entropy_R_ref() const;
//! Return the molar heat capacity divided by R at reference pressure
/*!
* Returns the species reference state heat capacity divided by R at the
* current temperature.
*
* @return returns the reference state heat capacity divided by R
*/
virtual doublereal cp_R_ref() const;
//! Return the molar volume at reference pressure
/*!
* Returns the species reference state molar volume at the
* current temperature.
*
* @return returns the reference state molar volume divided by R
* units are m**3 kmol-1.
*/
virtual doublereal molarVolume_ref() const;
private:
//! Does the internal calculation of the volume
/*!
*
*/
void calcMolarVolume() const;
/**
* @}
* @name Mechanical Equation of State Properties
* @{
*/
//! @}
//! @name Mechanical Equation of State Properties
//! @{
//! Sets the pressure in the object
/*!
* Currently, this sets the pressure in the PDSS object.
* It is indeterminant what happens to the owning VPStandardStateTP
* object and to the VPSSMgr object.
*
* @param pres Pressure to be set (Pascal)
*/
virtual void setPressure(doublereal pres);
//! Set the internal temperature
/*!
* @param temp Temperature (Kelvin)
*/
virtual void setTemperature(doublereal temp);
//! Set the internal temperature and pressure
/*!
* @param temp Temperature (Kelvin)
* @param pres pressure (Pascals)
*/
virtual void setState_TP(doublereal temp, doublereal pres);
//! Set the internal temperature and density
/*!
* @param temp Temperature (Kelvin)
* @param rho Density (kg m-3)
*/
virtual void setState_TR(doublereal temp, doublereal rho);
/**
* @}
* @name Miscellaneous properties of the standard state
* @{
*/
//! @}
//! @name Miscellaneous properties of the standard state
//! @{
/// critical temperature
virtual doublereal critTemperature() const;
/// critical pressure
virtual doublereal critPressure() const;
/// critical density
virtual doublereal critDensity() const;
/// saturation pressure
/*!
* @param t Temperature (kelvin)
*/
virtual doublereal satPressure(doublereal t);
/**
* @}
* @name Initialization of the Object
* @{
*/
//! @}
//! @name Initialization of the Object
//! @{
//! Initialization routine for all of the shallow pointers
/*!
* This is a cascading call, where each level should call the
* the parent level.
*
* The initThermo() routines get called before the initThermoXML() routines
* from the constructPDSSXML() routine.
*
*
* Calls initPtrs();
*/
virtual void initThermo();
//! Initialization of a PDSS object using an
//! input XML file.
//! Initialization of a PDSS object using an input XML file.
/*!
*
* This routine is a precursor to constructPDSSXML(XML_Node*)
* routine, which does most of the work.
*
@ -500,8 +283,7 @@ private:
*
* @param spindex Species index within the phase
*
* @param inputFile XML file containing the description of the
* phase
* @param inputFile XML file containing the description of the phase
*
* @param id Optional parameter identifying the name of the
* phase. If none is given, the first XML
@ -512,13 +294,12 @@ private:
//! Initialization of a PDSS object using an xml tree
/*!
* This routine is a driver for the initialization of the
* object.
* This routine is a driver for the initialization of the object.
*
* basic logic:
* initThermo() (cascade)
* getStuff from species Part of XML file
* initThermoXML(phaseNode) (cascade)
* - initThermo() (cascade)
* - getStuff from species Part of XML file
* - initThermoXML(phaseNode) (cascade)
*
* @param vptp_ptr Pointer to the Variable pressure %ThermoPhase object
* This object must have already been malloced.
@ -537,24 +318,10 @@ private:
const XML_Node& speciesNode,
const XML_Node& phaseNode, bool spInstalled);
//! Initialization routine for the PDSS object based on the phaseNode
/*!
* This is a cascading call, where each level should call the
* the parent level.
*
* @param phaseNode Reference to the phase Information for the phase
* that owns this species.
*
* @param id Optional parameter identifying the name of the
* phase. If none is given, the first XML
* phase element will be used.
*/
virtual void initThermoXML(const XML_Node& phaseNode, const std::string& id);
//@}
private:
//! Enumerated data type describing the type of volume model
//! used to calculate the standard state volume of the species
SSVolume_Model_enumType volumeModel_;
@ -573,12 +340,8 @@ private:
//! 2nd derivative of the volume wrt temperature
mutable doublereal d2VdT2_;
};
}
#endif

View file

@ -16,9 +16,6 @@
#include "PDSS.h"
#include "VPStandardStateTP.h"
namespace Cantera
{
class WaterPropsIAPWS;
@ -27,7 +24,6 @@ class WaterProps;
//! Class for the liquid water pressure dependent
//! standard state
/*!
*
* Notes:
* Base state for thermodynamic properties:
*
@ -38,7 +34,7 @@ class WaterProps;
* Delta_Hfo_gas(298.15) = -241.826 kJ/gmol
* So_gas(298.15, 1bar) = 188.835 J/gmolK
*
* (http://webbook.nist.gov)
* (http://webbook.nist.gov)
*
* The "o" here refers to a hypothetical ideal gas state. The way
* we achieve this in practice is to evaluate at a very low pressure
@ -57,13 +53,9 @@ class WaterProps;
*/
class PDSS_Water : public PDSS
{
public:
/**
* @name Constructors
* @{
*/
//! @name Constructors
//! @{
//! Bare constructor
/*!
@ -135,99 +127,24 @@ public:
*/
virtual PDSS* duplMyselfAsPDSS() const;
/**
* @}
* @name Utilities
* @{
*/
//! @}
//! @name Molar Thermodynamic Properties of the Species Standard State in the Solution
//! @{
/**
* @}
* @name Molar Thermodynamic Properties of the Species Standard State
* in the Solution
* @{
*/
// See PDSS.h for documentation of functions overridden from Class PDSS
//! Return the molar enthalpy in units of J kmol-1
/*!
* Returns the species standard state enthalpy in J kmol-1 at the
* current temperature and pressure.
*
* @return returns the species standard state enthalpy in J kmol-1
*/
virtual doublereal enthalpy_mole() const;
//! Return the molar internal Energy in units of J kmol-1
/*!
* Returns the species standard state internal Energy in J kmol-1 at the
* current temperature and pressure.
*
* @return returns the species standard state internal Energy in J kmol-1
*/
virtual doublereal intEnergy_mole() const;
//! Return the molar entropy in units of J kmol-1 K-1
/*!
* Returns the species standard state entropy in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state entropy in J kmol-1 K-1
*/
virtual doublereal entropy_mole() const;
//! Return the molar gibbs free energy in units of J kmol-1
/*!
* Returns the species standard state gibbs free energy in J kmol-1 at the
* current temperature and pressure.
*
* @return returns the species standard state gibbs free energy in J kmol-1
*/
virtual doublereal gibbs_mole() const;
//! Return the molar const pressure heat capacity in units of J kmol-1 K-1
/*!
* Returns the species standard state Cp in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state Cp in J kmol-1 K-1
*/
virtual doublereal cp_mole() const;
//! Return the molar const volume heat capacity in units of J kmol-1 K-1
/*!
* Returns the species standard state Cv in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state Cv in J kmol-1 K-1
*/
virtual doublereal cv_mole() const;
//! Return the molar volume at standard state
/*!
* Returns the species standard state molar volume at the
* current temperature and pressure
*
* @return returns the standard state molar volume divided by R
* units are m**3 kmol-1.
*/
virtual doublereal molarVolume() const;
//! Return the standard state density at standard state
/*!
* Returns the species standard state density at the
* current temperature and pressure
*
* @return returns the standard state density
* units are kg m-3
*/
virtual doublereal density() const;
/**
* @}
* @name Properties of the Reference State of the Species
* in the Solution
* @{
*/
//! @}
//! @name Properties of the Reference State of the Species in the Solution
//! @{
//! Returns a reference pressure value that can be safely calculated by the
//! underlying real equation of state for water
@ -239,92 +156,20 @@ public:
*/
doublereal pref_safe(doublereal temp) const;
//! Return the molar gibbs free energy divided by RT at reference pressure
/*!
* Returns the species reference state gibbs free energy divided by RT at the
* current temperature.
*
* @return returns the reference state gibbs free energy divided by RT
*/
virtual doublereal gibbs_RT_ref() const;
//! Return the molar enthalpy divided by RT at reference pressure
/*!
* Returns the species reference state enthalpy divided by RT at the
* current temperature.
*
* @return returns the reference state enthalpy divided by RT
*/
virtual doublereal enthalpy_RT_ref() const;
//! Return the molar entropy divided by R at reference pressure
/*!
* Returns the species reference state entropy divided by R at the
* current temperature.
*
* @return returns the reference state entropy divided by R
*/
virtual doublereal entropy_R_ref() const;
//! Return the molar heat capacity divided by R at reference pressure
/*!
* Returns the species reference state heat capacity divided by R at the
* current temperature.
*
* @return returns the reference state heat capacity divided by R
*/
virtual doublereal cp_R_ref() const;
//! Return the molar volume at reference pressure
/*!
* Returns the species reference state molar volume at the
* current temperature.
*
* @return returns the reference state molar volume divided by R
* units are m**3 kmol-1.
*/
virtual doublereal molarVolume_ref() const;
\
/**
* @}
* @name Mechanical Equation of State Properties
* @{
*/
//! @}
//! @name Mechanical Equation of State Properties
//! @{
//! Report the current pressure used in the object
/*!
* @return Returns the pressure (Pascal)
*/
virtual doublereal pressure() const;
//! Set the pressure internally
/*!
* @param pres Value of the pressure (Pascals)
*/
virtual void setPressure(doublereal pres);
//! Set the internal temperature
/*!
* @param temp Temperature (Kelvin)
*/
virtual void setTemperature(doublereal temp);
//! Set the temperature and pressure in the object
/*!
* @param temp Temperature (Kelvin)
* @param pres Pressure (Pascal)
*/
virtual void setState_TP(doublereal temp, doublereal pres);
//! Set the temperature and density in the object
/*!
* @param temp Temperature (Kelvin)
* @param rho Density (kg/m3)
*/
virtual void setState_TR(doublereal temp, doublereal rho);
//! Set the density of the water phase
@ -336,14 +181,6 @@ public:
*/
void setDensity(doublereal dens);
//! Return the volumetric thermal expansion coefficient. Units: 1/K.
/*!
* The thermal expansion coefficient is defined as
* \f[
* \beta = \frac{1}{v}\left(\frac{\partial v}{\partial T}\right)_P
* \f]
*/
virtual doublereal thermalExpansionCoeff() const;
//! Return the derivative of the volumetric thermal expansion coefficient. Units: 1/K2.
@ -368,25 +205,13 @@ public:
*/
virtual doublereal isothermalCompressibility() const;
/**
* @}
* @name Miscellaneous properties of the standard state
* @{
*/
//! @}
//! @name Miscellaneous properties of the standard state
//! @{
//! critical temperature
virtual doublereal critTemperature() const;
//! critical pressure
virtual doublereal critPressure() const;
//! critical density
virtual doublereal critDensity() const;
//! Return the saturation pressure at a given temperature
/*!
* @param t Temperature (Kelvin)
*/
virtual doublereal satPressure(doublereal t);
//! Get a pointer to a changeable WaterPropsIAPWS object
@ -399,16 +224,11 @@ public:
return m_waterProps;
}
/**
* @}
* @name Initialization of the Object
* @{
*/
//! @}
//! @name Initialization of the Object
//! @{
//! Internal routine that initializes the underlying water model
/*!
* This routine is not virtual
*/
void constructSet();
//! Initialization of a PDSS object using an
@ -422,8 +242,7 @@ public:
*
* @param spindex Species index within the phase
*
* @param inputFile XML file containing the description of the
* phase
* @param inputFile XML file containing the description of the phase
*
* @param id Optional parameter identifying the name of the
* phase. If none is given, the first XML
@ -438,11 +257,11 @@ public:
* object.
*
* basic logic:
* initThermo() (cascade)
* getStuff from species Part of XML file
* initThermoXML(phaseNode) (cascade)
* - initThermo() (cascade)
* - getStuff from species Part of XML file
* - initThermoXML(phaseNode) (cascade)
*
* @param vptp_ptr Pointer to the Variable pressure %ThermoPhase object
* @param vptp_ptr Pointer to the Variable pressure ThermoPhase object
* This object must have already been malloced.
*
* @param spindex Species index within the phase
@ -457,40 +276,11 @@ public:
void constructPDSSXML(VPStandardStateTP* vptp_ptr, int spindex,
const XML_Node& phaseNode, const std::string& id);
//! Initialization routine for all of the shallow pointers
/*!
* This is a cascading call, where each level should call the
* the parent level.
*
* The initThermo() routines get called before the initThermoXML() routines
* from the constructPDSSXML() routine.
*
*
* Calls initPtrs();
*/
virtual void initThermo();
//! Initialization routine for the PDSS object based on the phaseNode
/*!
* This is a cascading call, where each level should call the
* the parent level.
*
* @param phaseNode Reference to the phase Information for the phase
* that owns this species.
*
* @param id Optional parameter identifying the name of the
* phase. If none is given, the first XML
* phase element will be used.
*/
virtual void initThermoXML(const XML_Node& phaseNode, const std::string& id);
//@}
protected:
private:
//! Pointer to the WaterPropsIAPWS object, which does the actual calculations
//! for the real equation of state
/*!
@ -517,11 +307,13 @@ private:
//! state of the fluid
/*!
* 0 WATER_GAS 0
* 1 WATER_LIQUID 1
* 2 WATER_SUPERCRIT 2
* 3 WATER_UNSTABLELIQUID 3
* @code
* 0 WATER_GAS
* 1 WATER_LIQUID
* 2 WATER_SUPERCRIT
* 3 WATER_UNSTABLELIQUID
* 4 WATER_UNSTABLEGAS
* @endcode
*/
int m_iState;

View file

@ -21,9 +21,6 @@
namespace Cantera
{
/**
* Basic list of constructors and duplicators
*/
PDSS::PDSS() :
m_pdssType(cPDSS_UNDEF),
m_temp(-1.0),
@ -80,9 +77,6 @@ PDSS::PDSS(VPStandardStateTP* tp, size_t spindex) :
}
}
PDSS::PDSS(const PDSS& b) :
m_pdssType(cPDSS_UNDEF),
m_temp(-1.0),
@ -113,11 +107,6 @@ PDSS::PDSS(const PDSS& b) :
*this = b;
}
/**
* Assignment operator
* ok -> we don't know what to do here, so we'll
* first implement a shallow copy.
*/
PDSS& PDSS::operator=(const PDSS& b)
{
if (&b == this) {
@ -173,23 +162,11 @@ PDSS::~PDSS()
{
}
// Duplicator from the %PDSS parent class
/*
* Given a pointer to a %PDSS object, this function will
* duplicate the %PDSS object and all underlying structures.
* This is basically a wrapper around the copy constructor.
*
* @return returns a pointer to a %PDSS
*/
PDSS* PDSS::duplMyselfAsPDSS() const
{
return new PDSS(*this);
}
// Returns the type of the standard state parameterization
/*
* @return Returns the integer # of the parameterization
*/
PDSS_enumType PDSS::reportPDSSType() const
{
return m_pdssType;
@ -237,14 +214,6 @@ void PDSS::initPtrs()
m_Vss_ptr = &(m_vpssmgr_ptr->mPDSS_Vss[0]);
}
// Return the molar enthalpy in units of J kmol-1
/*
* Returns the species standard state enthalpy in J kmol-1 at the
* current temperature and pressure.
* (NOTE: assumes that ThermoPhase Ref Polynomials are up-to-date)
*/
doublereal PDSS::enthalpy_mole() const
{
err("enthalpy_mole()");
@ -257,26 +226,12 @@ doublereal PDSS::enthalpy_RT() const
return enthalpy_mole()/RT;
}
// Return the molar internal Energy in units of J kmol-1
/*
* Returns the species standard state internal Energy in J kmol-1 at the
* current temperature and pressure.
*
* @return returns the species standard state internal Energy in J kmol-1
*/
doublereal PDSS::intEnergy_mole() const
{
err("intEnergy_mole()");
return 0.0;
}
// Return the molar entropy in units of J kmol-1 K-1
/*
* Returns the species standard state entropy in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state entropy in J kmol-1 K-1
*/
doublereal PDSS::entropy_mole() const
{
err("entropy_mole()");
@ -288,13 +243,6 @@ doublereal PDSS::entropy_R() const
return entropy_mole()/GasConstant;
}
// Return the molar gibbs free energy in units of J kmol-1
/*
* Returns the species standard state gibbs free energy in J kmol-1 at the
* current temperature and pressure.
*
* @return returns the species standard state gibbs free energy in J kmol-1
*/
doublereal PDSS::gibbs_mole() const
{
err("gibbs_mole()");
@ -307,13 +255,6 @@ doublereal PDSS::gibbs_RT() const
return gibbs_mole()/RT;
}
// Return the molar const pressure heat capacity in units of J kmol-1 K-1
/*
* Returns the species standard state Cp in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state Cp in J kmol-1 K-1
*/
doublereal PDSS::cp_mole() const
{
err("cp_mole()");
@ -337,13 +278,6 @@ doublereal PDSS::density() const
return 0.0;
}
// Return the molar const volume heat capacity in units of J kmol-1 K-1
/*
* Returns the species standard state Cv in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state Cv in J kmol-1 K-1
*/
doublereal PDSS::cv_mole() const
{
err("cv_mole()");
@ -380,11 +314,6 @@ doublereal PDSS::molarVolume_ref() const
return 0.0;
}
/**
* Return the difference in enthalpy between current p
* and ref p0, in mks units of
* in units of J kmol-1
*/
doublereal PDSS::
enthalpyDelp_mole() const
{
@ -393,12 +322,6 @@ enthalpyDelp_mole() const
return enthalpy_mole() - RT * tmp;
}
/**
* Return the difference in entropy between current p
* and ref p0, in mks units of
* J kmol-1 K-1
*/
doublereal PDSS::entropyDelp_mole() const
{
doublereal tmp = entropy_R_ref();
@ -406,11 +329,6 @@ doublereal PDSS::entropyDelp_mole() const
}
/**
* Calculate the difference in Gibbs free energy between current p and
* the ref p0, in mks units of
* J kmol-1 K-1.
*/
doublereal PDSS::gibbsDelp_mole() const
{
doublereal RT = m_temp * GasConstant;
@ -418,57 +336,35 @@ doublereal PDSS::gibbsDelp_mole() const
return gibbs_mole() - RT * tmp;
}
// Return the molar const volume heat capacity in units of J kmol-1 K-1
/*
* Returns the species standard state Cv in J kmol-1 K-1 at the
* current temperature and pressure.
*
* @return returns the species standard state Cv in J kmol-1 K-1
*/
doublereal PDSS::cpDelp_mole() const
{
doublereal tmp = cp_R_ref();
return cp_mole() - GasConstant * tmp;
}
/**
* Calculate the pressure (Pascals), given the temperature and density
* Temperature: kelvin
* rho: density in kg m-3
*/
doublereal PDSS::pressure() const
{
return m_pres;
}
// Return the volumetric thermal expansion coefficient. Units: 1/K.
/*
* The thermal expansion coefficient is defined as
* \f[
* \beta = \frac{1}{v}\left(\frac{\partial v}{\partial T}\right)_P
* \f]
*/
doublereal PDSS::thermalExpansionCoeff() const
{
throw CanteraError("PDSS::thermalExpansionCoeff()", "unimplemented");
return 0.0;
}
/// critical temperature
doublereal PDSS::critTemperature() const
{
err("critTemperature()");
return 0.0;
}
/// critical pressure
doublereal PDSS::critPressure() const
{
err("critPressure()");
return 0.0;
}
/// critical density
doublereal PDSS::critDensity() const
{
err("critDensity()");
@ -480,13 +376,6 @@ void PDSS::setPressure(doublereal pres)
m_pres = pres;
}
/**
* Return the temperature
*
* Obtain the temperature from the owning ThermoPhase object
* if you can.
*/
doublereal PDSS::temperature() const
{
return m_temp;
@ -516,20 +405,17 @@ void PDSS::setState_TR(doublereal temp, doublereal rho)
err("setState_TR()");
}
/// saturation pressure
doublereal PDSS::satPressure(doublereal t)
{
err("satPressure()");
return 0.0;
}
void PDSS::err(const std::string& msg) const
{
throw CanteraError("PDSS::" + msg, "unimplemented");
}
void PDSS::reportParams(size_t& kindex, int& type,
doublereal* const c,
doublereal& minTemp_,

View file

@ -22,17 +22,12 @@ using namespace std;
namespace Cantera
{
/**
* Basic list of constructors and duplicators
*/
PDSS_ConstVol::PDSS_ConstVol(VPStandardStateTP* tp, size_t spindex) :
PDSS(tp, spindex)
{
m_pdssType = cPDSS_CONSTVOL;
}
PDSS_ConstVol::PDSS_ConstVol(VPStandardStateTP* tp, size_t spindex,
const std::string& inputFile, const std::string& id) :
PDSS(tp, spindex)
@ -51,7 +46,6 @@ PDSS_ConstVol::PDSS_ConstVol(VPStandardStateTP* tp, size_t spindex,
constructPDSSXML(tp, spindex, speciesNode, phaseRoot, spInstalled) ;
}
PDSS_ConstVol::PDSS_ConstVol(const PDSS_ConstVol& b) :
PDSS(b)
{
@ -62,9 +56,6 @@ PDSS_ConstVol::PDSS_ConstVol(const PDSS_ConstVol& b) :
*this = b;
}
/*
* Assignment operator
*/
PDSS_ConstVol& PDSS_ConstVol::operator=(const PDSS_ConstVol& b)
{
if (&b == this) {
@ -79,28 +70,11 @@ PDSS_ConstVol::~PDSS_ConstVol()
{
}
// Duplicator
PDSS* PDSS_ConstVol::duplMyselfAsPDSS() const
{
return new PDSS_ConstVol(*this);
}
/*
* constructPDSSXML:
*
* Initialization of a PDSS_ConstVol object using an
* xml file.
*
* This routine is a precursor to initThermo(XML_Node*)
* routine, which does most of the work.
*
* @param infile XML file containing the description of the
* phase
*
* @param id Optional parameter identifying the name of the
* phase. If none is given, the first XML
* phase element will be used.
*/
void PDSS_ConstVol::constructPDSSXML(VPStandardStateTP* tp, size_t spindex,
const XML_Node& speciesNode,
const XML_Node& phaseNode, bool spInstalled)
@ -130,28 +104,10 @@ void PDSS_ConstVol::constructPDSSXML(VPStandardStateTP* tp, size_t spindex,
// initThermoXML(phaseNode, id);
}
/*
* constructPDSSFile():
*
* Initialization of a PDSS_ConstVol object using an
* xml file.
*
* This routine is a precursor to initThermo(XML_Node*)
* routine, which does most of the work.
*
* @param infile XML file containing the description of the
* phase
*
* @param id Optional parameter identifying the name of the
* phase. If none is given, the first XML
* phase element will be used.
*/
void PDSS_ConstVol::constructPDSSFile(VPStandardStateTP* tp, size_t spindex,
const std::string& inputFile,
const std::string& id)
{
if (inputFile.size() == 0) {
throw CanteraError("PDSS_ConstVol::initThermo",
"input file is null");
@ -218,7 +174,6 @@ PDSS_ConstVol::enthalpy_RT() const
return m_hss_RT_ptr[m_spindex];
}
doublereal
PDSS_ConstVol::intEnergy_mole() const
{
@ -228,7 +183,6 @@ PDSS_ConstVol::intEnergy_mole() const
return val * RT;
}
doublereal
PDSS_ConstVol::entropy_mole() const
{
@ -242,10 +196,6 @@ PDSS_ConstVol::entropy_R() const
return m_sss_R_ptr[m_spindex];
}
/*
* Calculate the Gibbs free energy in mks units of
* J kmol-1 K-1.
*/
doublereal
PDSS_ConstVol::gibbs_mole() const
{
@ -319,23 +269,18 @@ doublereal PDSS_ConstVol::molarVolume_ref() const
return m_V0_ptr[m_spindex];
}
// critical temperature
doublereal PDSS_ConstVol::critTemperature() const
{
throw CanteraError("PDSS_ConstVol::critTemperature()", "unimplemented");
return 0.0;
}
// critical pressure
doublereal PDSS_ConstVol::critPressure() const
{
throw CanteraError("PDSS_ConstVol::critPressure()", "unimplemented");
return 0.0;
}
// critical density
doublereal PDSS_ConstVol::critDensity() const
{
throw CanteraError("PDSS_ConstVol::critDensity()", "unimplemented");
@ -366,14 +311,12 @@ void PDSS_ConstVol::setTemperature(doublereal temp)
}
void PDSS_ConstVol::setState_TP(doublereal temp, doublereal pres)
{
setTemperature(temp);
setPressure(pres);
}
void PDSS_ConstVol::setState_TR(doublereal temp, doublereal rho)
{
doublereal rhoStored = m_mw / m_constMolarVolume;
@ -384,7 +327,6 @@ void PDSS_ConstVol::setState_TR(doublereal temp, doublereal rho)
setTemperature(temp);
}
// saturation pressure
doublereal PDSS_ConstVol::satPressure(doublereal t)
{
return 1.0E-200;

View file

@ -25,10 +25,6 @@ using namespace ctml;
namespace Cantera
{
/*
* Basic list of constructors and duplicators
*/
PDSS_HKFT::PDSS_HKFT(VPStandardStateTP* tp, size_t spindex) :
PDSS(tp, spindex),
m_waterSS(0),
@ -58,7 +54,6 @@ PDSS_HKFT::PDSS_HKFT(VPStandardStateTP* tp, size_t spindex) :
m_presR_bar = OneAtm * 1.0E-5;
}
PDSS_HKFT::PDSS_HKFT(VPStandardStateTP* tp, size_t spindex,
const std::string& inputFile, const std::string& id) :
PDSS(tp, spindex),
@ -155,9 +150,6 @@ PDSS_HKFT::PDSS_HKFT(const PDSS_HKFT& b) :
*this = b;
}
/*
* Assignment operator
*/
PDSS_HKFT& PDSS_HKFT::operator=(const PDSS_HKFT& b)
{
if (&b == this) {
@ -200,23 +192,16 @@ PDSS_HKFT& PDSS_HKFT::operator=(const PDSS_HKFT& b)
return *this;
}
/*
* Destructor for the PDSS_HKFT class
*/
PDSS_HKFT::~PDSS_HKFT()
{
delete m_waterProps;
}
// Duplicator
PDSS* PDSS_HKFT::duplMyselfAsPDSS() const
{
return new PDSS_HKFT(*this);
}
/*
* Return the molar enthalpy in units of J kmol-1
*/
doublereal PDSS_HKFT::enthalpy_mole() const
{
// Ok we may change this evaluation method in the future.
@ -251,10 +236,6 @@ doublereal PDSS_HKFT::enthalpy_mole2() const
}
#endif
/*
* Calculate the internal energy in mks units of
* J kmol-1
*/
doublereal PDSS_HKFT::intEnergy_mole() const
{
doublereal hh = enthalpy_RT();
@ -262,33 +243,20 @@ doublereal PDSS_HKFT::intEnergy_mole() const
return hh - mv * m_pres;
}
/*
* Calculate the entropy in mks units of
* J kmol-1 K-1
*/
doublereal PDSS_HKFT::entropy_mole() const
{
doublereal delS = deltaS();
return m_Entrop_tr_pr * 1.0E3 * 4.184 + delS;
}
/*
* Calculate the Gibbs free energy in mks units of
* J kmol-1
*/
doublereal PDSS_HKFT::gibbs_mole() const
{
doublereal delG = deltaG();
return m_Mu0_tr_pr + delG;
}
/*
* Calculate the constant pressure heat capacity
* in mks units of J kmol-1 K-1
*/
doublereal PDSS_HKFT::cp_mole() const
{
doublereal pbar = m_pres * 1.0E-5;
doublereal c1term = m_c1;
@ -382,10 +350,6 @@ doublereal PDSS_HKFT::cp_mole() const
return Cp;
}
/*
* Calculate the constant volume heat capacity
* in mks units of J kmol-1 K-1
*/
doublereal
PDSS_HKFT::cv_mole() const
{
@ -395,7 +359,6 @@ PDSS_HKFT::cv_mole() const
doublereal PDSS_HKFT::molarVolume() const
{
// Initially do all calculations in (cal/gmol/Pa)
doublereal a1term = m_a1 * 1.0E-5;
@ -505,11 +468,6 @@ PDSS_HKFT::molarVolume_ref() const
return ee;
}
/*
* Calculate the pressure (Pascals), given the temperature and density
* Temperature: kelvin
* rho: density in kg m-3
*/
doublereal
PDSS_HKFT::pressure() const
{
@ -538,7 +496,6 @@ void PDSS_HKFT::setState_TP(doublereal temp, doublereal pres)
setPressure(pres);
}
// critical temperature
doublereal
PDSS_HKFT::critTemperature() const
{
@ -546,21 +503,18 @@ PDSS_HKFT::critTemperature() const
return 0.0;
}
// critical pressure
doublereal PDSS_HKFT::critPressure() const
{
throw CanteraError("PDSS_HKFT::critPressure()", "unimplemented");
return 0.0;
}
// critical density
doublereal PDSS_HKFT::critDensity() const
{
throw CanteraError("PDSS_HKFT::critDensity()", "unimplemented");
return 0.0;
}
void PDSS_HKFT::initThermo()
{
PDSS::initThermo();
@ -626,7 +580,6 @@ void PDSS_HKFT::initThermo()
}
}
void PDSS_HKFT::initThermoXML(const XML_Node& phaseNode, const std::string& id)
{
PDSS::initThermoXML(phaseNode, id);
@ -635,7 +588,6 @@ void PDSS_HKFT::initThermoXML(const XML_Node& phaseNode, const std::string& id)
void PDSS_HKFT::initAllPtrs(VPStandardStateTP* vptp_ptr, VPSSMgr* vpssmgr_ptr,
SpeciesThermo* spthermo_ptr)
{
PDSS::initAllPtrs(vptp_ptr, vpssmgr_ptr, spthermo_ptr);
m_waterSS = (PDSS_Water*) m_tp->providePDSS(0);
delete m_waterProps;
@ -806,7 +758,6 @@ void PDSS_HKFT::constructPDSSFile(VPStandardStateTP* tp, size_t spindex,
const std::string& inputFile,
const std::string& id)
{
if (inputFile.size() == 0) {
throw CanteraError("PDSS_HKFT::initThermo",
"input file is null");
@ -844,7 +795,6 @@ void PDSS_HKFT::constructPDSSFile(VPStandardStateTP* tp, size_t spindex,
#ifdef DEBUG_MODE
doublereal PDSS_HKFT::deltaH() const
{
doublereal pbar = m_pres * 1.0E-5;
doublereal c1term = m_c1 * (m_temp - 298.15);
@ -907,7 +857,6 @@ doublereal PDSS_HKFT::deltaH() const
doublereal PDSS_HKFT::deltaG() const
{
doublereal pbar = m_pres * 1.0E-5;
//doublereal m_presR_bar = OneAtm * 1.0E-5;
@ -952,10 +901,8 @@ doublereal PDSS_HKFT::deltaG() const
return deltaG_calgmol * 1.0E3 * 4.184;
}
doublereal PDSS_HKFT::deltaS() const
{
doublereal pbar = m_pres * 1.0E-5;
doublereal c1term = m_c1 * log(m_temp/298.15);
@ -1011,11 +958,6 @@ doublereal PDSS_HKFT::deltaS() const
return deltaS_calgmol * 1.0E3 * 4.184;
}
// Internal formula for the calculation of a_g()
/*
* The output of this is in units of Angstroms
*/
doublereal PDSS_HKFT::ag(const doublereal temp, const int ifunc) const
{
static doublereal ag_coeff[3] = { -2.037662, 5.747000E-3, -6.557892E-6};
@ -1031,11 +973,6 @@ doublereal PDSS_HKFT::ag(const doublereal temp, const int ifunc) const
return ag_coeff[2] * 2.0;
}
// Internal formula for the calculation of b_g()
/*
* the output of this is unitless
*/
doublereal PDSS_HKFT::bg(const doublereal temp, const int ifunc) const
{
static doublereal bg_coeff[3] = { 6.107361, -1.074377E-2, 1.268348E-5};
@ -1051,10 +988,8 @@ doublereal PDSS_HKFT::bg(const doublereal temp, const int ifunc) const
return bg_coeff[2] * 2.0;
}
doublereal PDSS_HKFT::f(const doublereal temp, const doublereal pres, const int ifunc) const
{
static doublereal af_coeff[3] = { 3.666666E1, -0.1504956E-9, 0.5107997E-13};
doublereal TC = temp - 273.15;
doublereal presBar = pres / 1.0E5;
@ -1096,7 +1031,6 @@ doublereal PDSS_HKFT::f(const doublereal temp, const doublereal pres, const int
return 0.0;
}
doublereal PDSS_HKFT::g(const doublereal temp, const doublereal pres, const int ifunc) const
{
doublereal afunc = ag(temp, 0);
@ -1157,7 +1091,6 @@ doublereal PDSS_HKFT::g(const doublereal temp, const doublereal pres, const int
return 0.0;
}
doublereal PDSS_HKFT::gstar(const doublereal temp, const doublereal pres, const int ifunc) const
{
doublereal gval = g(temp, pres, ifunc);
@ -1183,20 +1116,6 @@ doublereal PDSS_HKFT::gstar(const doublereal temp, const doublereal pres, const
return res;
}
//! Static function to look up Element Free Energies
/*!
*
* This static function looks up the argument string in the
* database above and returns the associated Gibbs Free energies.
*
* @param elemName String. Only the first 3 characters are significant
*
* @return
* Return value contains the Gibbs free energy for that element
*
* @exception CanteraError
* If a match is not found, a CanteraError is thrown as well
*/
doublereal PDSS_HKFT::LookupGe(const std::string& elemName)
{
size_t iE = m_tp->elementIndex(elemName);
@ -1243,32 +1162,16 @@ void PDSS_HKFT::convertDGFormation()
m_Mu0_tr_pr = dg + totalSum;
}
// This utility function reports back the type of
// parameterization and all of the parameters for the
// species, index.
/*
*
* @param index Species index
* @param type Integer type of the standard type
* @param c Vector of coefficients used to set the
* parameters for the standard state.
* @param minTemp output - Minimum temperature
* @param maxTemp output - Maximum temperature
* @param refPressure output - reference pressure (Pa).
*
*/
void PDSS_HKFT::reportParams(size_t& kindex, int& type,
doublereal* const c,
doublereal& minTemp_,
doublereal& maxTemp_,
doublereal& refPressure_) const
{
// Fill in the first part
PDSS::reportParams(kindex, type, c, minTemp_, maxTemp_,
refPressure_);
c[0] = m_deltaG_formation_tr_pr;
c[1] = m_deltaH_formation_tr_pr;
c[2] = m_Mu0_tr_pr;
@ -1280,9 +1183,6 @@ void PDSS_HKFT::reportParams(size_t& kindex, int& type,
c[8] = m_c1;
c[9] = m_c2;
c[10] = m_omega_pr_tr;
}
}

View file

@ -13,7 +13,6 @@
#include "cantera/base/ctml.h"
#include "cantera/thermo/PDSS_IdealGas.h"
#include "cantera/thermo/ThermoFactory.h"
#include "cantera/thermo/VPStandardStateTP.h"
#include <fstream>
@ -22,17 +21,12 @@ using namespace std;
namespace Cantera
{
/**
* Basic list of constructors and duplicators
*/
PDSS_IdealGas::PDSS_IdealGas(VPStandardStateTP* tp, int spindex) :
PDSS(tp, spindex)
{
m_pdssType = cPDSS_IDEALGAS;
}
PDSS_IdealGas::PDSS_IdealGas(VPStandardStateTP* tp, int spindex,
const std::string& inputFile, const std::string& id) :
PDSS(tp, spindex)
@ -41,8 +35,6 @@ PDSS_IdealGas::PDSS_IdealGas(VPStandardStateTP* tp, int spindex,
constructPDSSFile(tp, spindex, inputFile, id);
}
PDSS_IdealGas::PDSS_IdealGas(VPStandardStateTP* tp, size_t spindex, const XML_Node& speciesNode,
const XML_Node& phaseRoot, bool spInstalled) :
PDSS(tp, spindex)
@ -55,8 +47,6 @@ PDSS_IdealGas::PDSS_IdealGas(VPStandardStateTP* tp, size_t spindex, const XML_No
constructPDSSXML(tp, spindex, phaseRoot, id);
}
PDSS_IdealGas::PDSS_IdealGas(const PDSS_IdealGas& b) :
PDSS(b)
{
@ -67,9 +57,6 @@ PDSS_IdealGas::PDSS_IdealGas(const PDSS_IdealGas& b) :
*this = b;
}
/*
* Assignment operator
*/
PDSS_IdealGas& PDSS_IdealGas::operator=(const PDSS_IdealGas& b)
{
if (&b == this) {
@ -83,30 +70,11 @@ PDSS_IdealGas::~PDSS_IdealGas()
{
}
// Duplicator
PDSS* PDSS_IdealGas::duplMyselfAsPDSS() const
{
return new PDSS_IdealGas(*this);
}
/*
* constructPDSSXML:
*
* Initialization of a PDSS_IdealGas object using an
* xml file.
*
* This routine is a precursor to initThermo(XML_Node*)
* routine, which does most of the work.
*
* @param infile XML file containing the description of the
* phase
*
* @param id Optional parameter identifying the name of the
* phase. If none is given, the first XML
* phase element will be used.
*/
void PDSS_IdealGas::constructPDSSXML(VPStandardStateTP* tp, size_t spindex,
const XML_Node& phaseNode, const std::string& id)
{
@ -114,12 +82,10 @@ void PDSS_IdealGas::constructPDSSXML(VPStandardStateTP* tp, size_t spindex,
//initThermoXML(phaseNode, id);
}
void PDSS_IdealGas::constructPDSSFile(VPStandardStateTP* tp, size_t spindex,
const std::string& inputFile,
const std::string& id)
{
if (inputFile.size() == 0) {
throw CanteraError("PDSS_IdealGas::constructPDSSFile",
"input file is null");
@ -161,9 +127,6 @@ void PDSS_IdealGas::initThermo()
m_maxTemp = m_spthermo->maxTemp(m_spindex);
}
/*
* Return the molar enthalpy in units of J kmol-1
*/
doublereal
PDSS_IdealGas::enthalpy_mole() const
{
@ -178,11 +141,6 @@ PDSS_IdealGas::enthalpy_RT() const
return m_h0_RT_ptr[m_spindex];
}
/*
* Calculate the internal energy in mks units of
* J kmol-1
*/
doublereal
PDSS_IdealGas::intEnergy_mole() const
{
@ -191,10 +149,6 @@ PDSS_IdealGas::intEnergy_mole() const
return val * RT;
}
/*
* Calculate the entropy in mks units of
* J kmol-1 K-1
*/
doublereal
PDSS_IdealGas::entropy_mole() const
{
@ -208,10 +162,6 @@ PDSS_IdealGas::entropy_R() const
return m_s0_R_ptr[m_spindex] - log(m_pres/m_p0);
}
/*
* Calculate the Gibbs free energy in mks units of
* J kmol-1 K-1.
*/
doublereal
PDSS_IdealGas::gibbs_mole() const
{
@ -226,10 +176,6 @@ PDSS_IdealGas::gibbs_RT() const
return m_g0_RT_ptr[m_spindex] + log(m_pres/m_p0);
}
/*
* Calculate the constant pressure heat capacity
* in mks units of J kmol-1 K-1
*/
doublereal
PDSS_IdealGas::cp_mole() const
{
@ -256,17 +202,12 @@ PDSS_IdealGas::density() const
return m_pres * m_mw / (GasConstant * m_temp);
}
/*
* Calculate the constant volume heat capacity
* in mks units of J kmol-1 K-1
*/
doublereal
PDSS_IdealGas::cv_mole() const
{
return cp_mole() - GasConstant;
}
doublereal
PDSS_IdealGas::gibbs_RT_ref() const
{
@ -293,11 +234,6 @@ doublereal PDSS_IdealGas::molarVolume_ref() const
return GasConstant * m_temp / m_p0;
}
/*
* Calculate the pressure (Pascals), given the temperature and density
* Temperature: kelvin
* rho: density in kg m-3
*/
doublereal PDSS_IdealGas::pressure() const
{
throw CanteraError("PDSS_IdealGas::pressure()", "unimplemented");
@ -311,35 +247,24 @@ void PDSS_IdealGas::setPressure(doublereal p)
m_Vss_ptr[m_spindex] = GasConstant * m_temp / m_pres;
}
// critical temperature
doublereal PDSS_IdealGas::critTemperature() const
{
throw CanteraError("PDSS_IdealGas::critTemperature()", "unimplemented");
return 0.0;
}
// critical pressure
doublereal PDSS_IdealGas::critPressure() const
{
throw CanteraError("PDSS_IdealGas::critPressure()", "unimplemented");
return 0.0;
}
// critical density
doublereal PDSS_IdealGas::critDensity() const
{
throw CanteraError("PDSS_IdealGas::critDensity()", "unimplemented");
return 0.0;
}
/*
* Return the temperature
*
* Obtain the temperature from the owning VPStandardStateTP object
* if you can.
*/
doublereal PDSS_IdealGas::temperature() const
{
m_temp = m_vpssmgr_ptr->temperature();
@ -361,7 +286,6 @@ void PDSS_IdealGas::setTemperature(doublereal temp)
m_Vss_ptr[m_spindex] = GasConstant * m_temp / m_pres;
}
void PDSS_IdealGas::setState_TP(doublereal temp, doublereal pres)
{
m_pres = pres;
@ -374,7 +298,6 @@ void PDSS_IdealGas::setState_TR(doublereal temp, doublereal rho)
setTemperature(temp);
}
// saturation pressure
doublereal PDSS_IdealGas::satPressure(doublereal t)
{
throw CanteraError("PDSS_IdealGas::satPressure()", "unimplemented");
@ -382,5 +305,4 @@ doublereal PDSS_IdealGas::satPressure(doublereal t)
return 0.0;
}
}

View file

@ -24,8 +24,6 @@ using namespace std;
namespace Cantera
{
//====================================================================================================================
PDSS_IonsFromNeutral::PDSS_IonsFromNeutral(VPStandardStateTP* tp, size_t spindex) :
PDSS(tp, spindex),
neutralMoleculePhase_(0),
@ -35,7 +33,7 @@ PDSS_IonsFromNeutral::PDSS_IonsFromNeutral(VPStandardStateTP* tp, size_t spindex
{
m_pdssType = cPDSS_IONSFROMNEUTRAL;
}
//====================================================================================================================
PDSS_IonsFromNeutral::PDSS_IonsFromNeutral(VPStandardStateTP* tp, size_t spindex,
const std::string& inputFile, const std::string& id) :
PDSS(tp, spindex),
@ -47,7 +45,6 @@ PDSS_IonsFromNeutral::PDSS_IonsFromNeutral(VPStandardStateTP* tp, size_t spindex
m_pdssType = cPDSS_IONSFROMNEUTRAL;
constructPDSSFile(tp, spindex, inputFile, id);
}
//====================================================================================================================
PDSS_IonsFromNeutral::PDSS_IonsFromNeutral(VPStandardStateTP* tp, size_t spindex, const XML_Node& speciesNode,
const XML_Node& phaseRoot, bool spInstalled) :
@ -64,7 +61,6 @@ PDSS_IonsFromNeutral::PDSS_IonsFromNeutral(VPStandardStateTP* tp, size_t spindex
std::string id = "";
constructPDSSXML(tp, spindex, speciesNode, phaseRoot, id);
}
//====================================================================================================================
PDSS_IonsFromNeutral::PDSS_IonsFromNeutral(const PDSS_IonsFromNeutral& b) :
PDSS(b)
@ -75,10 +71,7 @@ PDSS_IonsFromNeutral::PDSS_IonsFromNeutral(const PDSS_IonsFromNeutral& b) :
*/
*this = b;
}
//====================================================================================================================
/*
* Assignment operator
*/
PDSS_IonsFromNeutral& PDSS_IonsFromNeutral::operator=(const PDSS_IonsFromNeutral& b)
{
if (&b == this) {
@ -103,17 +96,16 @@ PDSS_IonsFromNeutral& PDSS_IonsFromNeutral::operator=(const PDSS_IonsFromNeutral
return *this;
}
//====================================================================================================================
PDSS_IonsFromNeutral::~PDSS_IonsFromNeutral()
{
}
//====================================================================================================================
//! Duplicator
PDSS* PDSS_IonsFromNeutral::duplMyselfAsPDSS() const
{
return new PDSS_IonsFromNeutral(*this);
}
//====================================================================================================================
void PDSS_IonsFromNeutral::initAllPtrs(VPStandardStateTP* tp, VPSSMgr* vpssmgr_ptr,
SpeciesThermo* spthermo)
{
@ -125,29 +117,7 @@ void PDSS_IonsFromNeutral::initAllPtrs(VPStandardStateTP* tp, VPSSMgr* vpssmgr_p
}
neutralMoleculePhase_ = ionPhase->neutralMoleculePhase_;
}
//====================================================================================================================
// Initialization of a PDSS object using an xml tree
/*
* This routine is a driver for the initialization of the
* object.
*
* basic logic:
* initThermo() (cascade)
* getStuff from species Part of XML file
* initThermoXML(phaseNode) (cascade)
*
* @param vptp_ptr Pointer to the Variable pressure %ThermoPhase object
* This object must have already been malloced.
*
* @param spindex Species index within the phase
*
* @param phaseNode Reference to the phase Information for the phase
* that owns this species.
*
* @param id Optional parameter identifying the name of the
* phase. If none is given, the first XML
* phase element will be used.
*/
void PDSS_IonsFromNeutral::constructPDSSXML(VPStandardStateTP* tp, size_t spindex,
const XML_Node& speciesNode,
const XML_Node& phaseNode, const std::string& id)
@ -200,32 +170,11 @@ void PDSS_IonsFromNeutral::constructPDSSXML(VPStandardStateTP* tp, size_t spinde
if (specialSpecies_ == 1) {
add2RTln2_ = false;
}
}
//====================================================================================================================
// Initialization of a PDSS object using an
// input XML file.
/*
*
* This routine is a precursor to constructPDSSXML(XML_Node*)
* routine, which does most of the work.
*
* @param vptp_ptr Pointer to the Variable pressure %ThermoPhase object
* This object must have already been malloced.
*
* @param spindex Species index within the phase
*
* @param inputFile XML file containing the description of the
* phase
*
* @param id Optional parameter identifying the name of the
* phase. If none is given, the first XML
* phase element will be used.
*/
void PDSS_IonsFromNeutral::constructPDSSFile(VPStandardStateTP* tp, size_t spindex,
const std::string& inputFile, const std::string& id)
{
if (inputFile.size() == 0) {
throw CanteraError("PDSS_IonsFromNeutral::constructPDSSFile",
"input file is null");
@ -260,12 +209,12 @@ void PDSS_IonsFromNeutral::constructPDSSFile(VPStandardStateTP* tp, size_t spind
constructPDSSXML(tp, spindex, *s, *fxml_phase, id);
delete fxml;
}
//=======================================================================================================
void PDSS_IonsFromNeutral::initThermoXML(const XML_Node& phaseNode, const std::string& id)
{
PDSS::initThermoXML(phaseNode, id);
}
//=======================================================================================================
void PDSS_IonsFromNeutral::initThermo()
{
PDSS::initThermo();
@ -274,10 +223,7 @@ void PDSS_IonsFromNeutral::initThermo()
m_minTemp = m_spthermo->minTemp(m_spindex);
m_maxTemp = m_spthermo->maxTemp(m_spindex);
}
//=======================================================================================================
/*
* Return the molar enthalpy in units of J kmol-1
*/
doublereal
PDSS_IonsFromNeutral::enthalpy_mole() const
{
@ -285,7 +231,7 @@ PDSS_IonsFromNeutral::enthalpy_mole() const
doublereal RT = GasConstant * m_temp;
return val * RT;
}
//=======================================================================================================
doublereal
PDSS_IonsFromNeutral::enthalpy_RT() const
{
@ -297,11 +243,7 @@ PDSS_IonsFromNeutral::enthalpy_RT() const
}
return val;
}
//=======================================================================================================
/*
* Calculate the internal energy in mks units of
* J kmol-1
*/
doublereal
PDSS_IonsFromNeutral::intEnergy_mole() const
{
@ -309,18 +251,14 @@ PDSS_IonsFromNeutral::intEnergy_mole() const
doublereal RT = GasConstant * m_temp;
return val * RT;
}
//=======================================================================================================
/*
* Calculate the entropy in mks units of
* J kmol-1 K-1
*/
doublereal
PDSS_IonsFromNeutral::entropy_mole() const
{
doublereal val = entropy_R();
return val * GasConstant;
}
//=======================================================================================================
doublereal
PDSS_IonsFromNeutral::entropy_R() const
{
@ -335,11 +273,7 @@ PDSS_IonsFromNeutral::entropy_R() const
}
return val;
}
//=======================================================================================================
/*
* Calculate the Gibbs free energy in mks units of
* J kmol-1 K-1.
*/
doublereal
PDSS_IonsFromNeutral::gibbs_mole() const
{
@ -347,7 +281,7 @@ PDSS_IonsFromNeutral::gibbs_mole() const
doublereal RT = GasConstant * m_temp;
return val * RT;
}
//=======================================================================================================
doublereal
PDSS_IonsFromNeutral::gibbs_RT() const
{
@ -362,18 +296,14 @@ PDSS_IonsFromNeutral::gibbs_RT() const
}
return val;
}
//=======================================================================================================
/*
* Calculate the constant pressure heat capacity
* in mks units of J kmol-1 K-1
*/
doublereal
PDSS_IonsFromNeutral::cp_mole() const
{
doublereal val = cp_R();
return val * GasConstant;
}
//=======================================================================================================
doublereal
PDSS_IonsFromNeutral::cp_R() const
{
@ -385,7 +315,7 @@ PDSS_IonsFromNeutral::cp_R() const
}
return val;
}
//=======================================================================================================
doublereal
PDSS_IonsFromNeutral::molarVolume() const
{
@ -397,24 +327,19 @@ PDSS_IonsFromNeutral::molarVolume() const
}
return val;
}
//=======================================================================================================
doublereal
PDSS_IonsFromNeutral::density() const
{
return (m_pres * m_mw / (GasConstant * m_temp));
}
/*
* Calculate the constant volume heat capacity
* in mks units of J kmol-1 K-1
*/
doublereal
PDSS_IonsFromNeutral::cv_mole() const
{
throw CanteraError("PDSS_IonsFromNeutral::cv_mole()", "unimplemented");
return 0.0;
}
//====================================================================================================================
doublereal
PDSS_IonsFromNeutral::gibbs_RT_ref() const
@ -430,7 +355,7 @@ PDSS_IonsFromNeutral::gibbs_RT_ref() const
}
return val;
}
//====================================================================================================================
doublereal PDSS_IonsFromNeutral::enthalpy_RT_ref() const
{
neutralMoleculePhase_->getEnthalpy_RT_ref(DATA_PTR(tmpNM));
@ -441,7 +366,7 @@ doublereal PDSS_IonsFromNeutral::enthalpy_RT_ref() const
}
return val;
}
//====================================================================================================================
doublereal PDSS_IonsFromNeutral::entropy_R_ref() const
{
neutralMoleculePhase_->getEntropy_R_ref(DATA_PTR(tmpNM));
@ -455,7 +380,7 @@ doublereal PDSS_IonsFromNeutral::entropy_R_ref() const
}
return val;
}
//====================================================================================================================
doublereal PDSS_IonsFromNeutral::cp_R_ref() const
{
neutralMoleculePhase_->getCp_R_ref(DATA_PTR(tmpNM));
@ -466,7 +391,7 @@ doublereal PDSS_IonsFromNeutral::cp_R_ref() const
}
return val;
}
//====================================================================================================================
doublereal PDSS_IonsFromNeutral::molarVolume_ref() const
{
neutralMoleculePhase_->getStandardVolumes_ref(DATA_PTR(tmpNM));
@ -477,81 +402,64 @@ doublereal PDSS_IonsFromNeutral::molarVolume_ref() const
}
return val;
}
//====================================================================================================================
/*
* Calculate the pressure (Pascals), given the temperature and density
* Temperature: kelvin
* rho: density in kg m-3
*/
doublereal PDSS_IonsFromNeutral::pressure() const
{
return m_pres;
}
//====================================================================================================================
void PDSS_IonsFromNeutral::setPressure(doublereal p)
{
m_pres = p;
}
//====================================================================================================================
// critical temperature
doublereal PDSS_IonsFromNeutral::critTemperature() const
{
throw CanteraError("PDSS_IonsFromNeutral::critTemperature()", "unimplemented");
return 0.0;
}
//====================================================================================================================
// critical pressure
doublereal PDSS_IonsFromNeutral::critPressure() const
{
throw CanteraError("PDSS_IonsFromNeutral::critPressure()", "unimplemented");
return 0.0;
}
//====================================================================================================================
// critical density
doublereal PDSS_IonsFromNeutral::critDensity() const
{
throw CanteraError("PDSS_IonsFromNeutral::critDensity()", "unimplemented");
return 0.0;
}
//====================================================================================================================
/*
* Return the temperature
*
* Obtain the temperature from the owning VPStandardStateTP object
* if you can.
*/
doublereal PDSS_IonsFromNeutral::temperature() const
{
/*
* Obtain the temperature from the owning VPStandardStateTP object if you can.
*/
m_temp = m_vpssmgr_ptr->temperature();
return m_temp;
}
//====================================================================================================================
void PDSS_IonsFromNeutral::setTemperature(doublereal temp)
{
m_temp = temp;
}
//====================================================================================================================
void PDSS_IonsFromNeutral::setState_TP(doublereal temp, doublereal pres)
{
m_pres = pres;
m_temp = temp;
}
//====================================================================================================================
void PDSS_IonsFromNeutral::setState_TR(doublereal temp, doublereal rho)
{
}
//====================================================================================================================
// saturation pressure
doublereal PDSS_IonsFromNeutral::satPressure(doublereal t)
{
throw CanteraError("PDSS_IonsFromNeutral::satPressure()", "unimplemented");
/*NOTREACHED*/
return 0.0;
}
//====================================================================================================================
}
//====================================================================================================================

View file

@ -22,10 +22,6 @@ using namespace std;
namespace Cantera
{
/**
* Basic list of constructors and duplicators
*/
PDSS_SSVol::PDSS_SSVol(VPStandardStateTP* tp, size_t spindex) :
PDSS(tp, spindex),
volumeModel_(cSSVOLUME_CONSTANT),
@ -37,7 +33,6 @@ PDSS_SSVol::PDSS_SSVol(VPStandardStateTP* tp, size_t spindex) :
TCoeff_[2] = 0.0;
}
PDSS_SSVol::PDSS_SSVol(VPStandardStateTP* tp,
size_t spindex, const std::string& inputFile, const std::string& id) :
PDSS(tp, spindex),
@ -61,7 +56,6 @@ PDSS_SSVol::PDSS_SSVol(VPStandardStateTP* tp, size_t spindex,
constructPDSSXML(tp, spindex, speciesNode, phaseRoot, spInstalled) ;
}
PDSS_SSVol::PDSS_SSVol(const PDSS_SSVol& b) :
PDSS(b),
volumeModel_(cSSVOLUME_CONSTANT),
@ -74,9 +68,6 @@ PDSS_SSVol::PDSS_SSVol(const PDSS_SSVol& b) :
*this = b;
}
/*
* Assignment operator
*/
PDSS_SSVol& PDSS_SSVol::operator=(const PDSS_SSVol& b)
{
if (&b == this) {
@ -93,28 +84,11 @@ PDSS_SSVol::~PDSS_SSVol()
{
}
//! Duplicator
PDSS* PDSS_SSVol::duplMyselfAsPDSS() const
{
return new PDSS_SSVol(*this);
}
/*
* constructPDSSXML:
*
* Initialization of a PDSS_SSVol object using an
* xml file.
*
* This routine is a precursor to initThermo(XML_Node*)
* routine, which does most of the work.
*
* @param infile XML file containing the description of the
* phase
*
* @param id Optional parameter identifying the name of the
* phase. If none is given, the first XML
* phase element will be used.
*/
void PDSS_SSVol::constructPDSSXML(VPStandardStateTP* tp, size_t spindex,
const XML_Node& speciesNode,
const XML_Node& phaseNode, bool spInstalled)
@ -155,30 +129,11 @@ void PDSS_SSVol::constructPDSSXML(VPStandardStateTP* tp, size_t spindex,
"standardState model for species isn't constant_incompressible: " + speciesNode.name());
}
std::string id = "";
}
/*
* constructPDSSFile():
*
* Initialization of a PDSS_SSVol object using an
* xml file.
*
* This routine is a precursor to initThermo(XML_Node*)
* routine, which does most of the work.
*
* @param infile XML file containing the description of the
* phase
*
* @param id Optional parameter identifying the name of the
* phase. If none is given, the first XML
* phase element will be used.
*/
void PDSS_SSVol::constructPDSSFile(VPStandardStateTP* tp, size_t spindex,
const std::string& inputFile, const std::string& id)
{
if (inputFile.size() == 0) {
throw CanteraError("PDSS_SSVol::initThermo",
"input file is null");
@ -254,7 +209,6 @@ PDSS_SSVol::intEnergy_mole() const
return val * RT;
}
doublereal
PDSS_SSVol::entropy_mole() const
{
@ -268,10 +222,6 @@ PDSS_SSVol::entropy_R() const
return m_sss_R_ptr[m_spindex];
}
/**
* Calculate the Gibbs free energy in mks units of
* J kmol-1 K-1.
*/
doublereal
PDSS_SSVol::gibbs_mole() const
{
@ -365,30 +315,24 @@ void PDSS_SSVol::calcMolarVolume() const
}
}
/// critical temperature
doublereal PDSS_SSVol::critTemperature() const
{
throw CanteraError("PDSS_SSVol::critTemperature()", "unimplemented");
return 0.0;
}
/// critical pressure
doublereal PDSS_SSVol::critPressure() const
{
throw CanteraError("PDSS_SSVol::critPressure()", "unimplemented");
return 0.0;
}
/// critical density
doublereal PDSS_SSVol::critDensity() const
{
throw CanteraError("PDSS_SSVol::critDensity()", "unimplemented");
return 0.0;
}
void PDSS_SSVol::setPressure(doublereal p)
{
m_pres = p;
@ -430,14 +374,12 @@ void PDSS_SSVol::setTemperature(doublereal temp)
}
}
void PDSS_SSVol::setState_TP(doublereal temp, doublereal pres)
{
m_pres = pres;
setTemperature(temp);
}
void PDSS_SSVol::setState_TR(doublereal temp, doublereal rho)
{
doublereal rhoStored = m_mw / m_constMolarVolume;
@ -448,7 +390,6 @@ void PDSS_SSVol::setState_TR(doublereal temp, doublereal rho)
setTemperature(temp);
}
/// saturation pressure
doublereal PDSS_SSVol::satPressure(doublereal t)
{
return 1.0E-200;

View file

@ -24,9 +24,6 @@
namespace Cantera
{
/**
* Basic list of constructors and duplicators
*/
PDSS_Water::PDSS_Water() :
PDSS(),
m_sub(0),
@ -67,7 +64,6 @@ PDSS_Water::PDSS_Water(VPStandardStateTP* tp, int spindex) :
m_maxTemp = 10000.;
}
PDSS_Water::PDSS_Water(VPStandardStateTP* tp, int spindex,
const std::string& inputFile, const std::string& id) :
PDSS(tp, spindex),
@ -113,8 +109,6 @@ PDSS_Water::PDSS_Water(VPStandardStateTP* tp, int spindex,
m_maxTemp = 10000.;
}
PDSS_Water::PDSS_Water(const PDSS_Water& b) :
PDSS(),
m_sub(0),
@ -134,9 +128,6 @@ PDSS_Water::PDSS_Water(const PDSS_Water& b) :
*this = b;
}
/**
* Assignment operator
*/
PDSS_Water& PDSS_Water::operator=(const PDSS_Water& b)
{
if (&b == this) {
@ -178,48 +169,15 @@ PDSS* PDSS_Water::duplMyselfAsPDSS() const
return new PDSS_Water(*this);
}
/*
* constructPDSSXML:
*
* Initialization of a Debye-Huckel phase using an
* xml file.
*
* This routine is a precursor to constructSet
* routine, which does most of the work.
*
* @param infile XML file containing the description of the
* phase
*
* @param id Optional parameter identifying the name of the
* phase. If none is given, the first XML
* phase element will be used.
*/
void PDSS_Water::constructPDSSXML(VPStandardStateTP* tp, int spindex,
const XML_Node& phaseNode, const std::string& id)
{
constructSet();
}
/*
* constructPDSSFile():
*
* Initialization of a Debye-Huckel phase using an
* xml file.
*
* This routine is a precursor to constructPDSSXML(XML_Node*)
* routine, which does most of the work.
*
* @param infile XML file containing the description of the
* phase
*
* @param id Optional parameter identifying the name of the
* phase. If none is given, the first XML
* phase element will be used.
*/
void PDSS_Water::constructPDSSFile(VPStandardStateTP* tp, int spindex,
const std::string& inputFile, const std::string& id)
{
if (inputFile.size() == 0) {
throw CanteraError("PDSS_Water::constructPDSSFile",
"input file is null");
@ -247,8 +205,6 @@ void PDSS_Water::constructPDSSFile(VPStandardStateTP* tp, int spindex,
delete fxml;
}
void PDSS_Water::constructSet()
{
delete m_sub;
@ -395,12 +351,6 @@ doublereal PDSS_Water::molarVolume_ref() const
return mv;
}
/**
* Calculate the pressure (Pascals), given the temperature and density
* Temperature: kelvin
* rho: density in kg m-3
*/
doublereal PDSS_Water::pressure() const
{
doublereal p = m_sub->pressure();
@ -408,11 +358,10 @@ doublereal PDSS_Water::pressure() const
return p;
}
// In this routine we must be sure to only find the water branch of the
// curve and not the gas branch
void PDSS_Water::setPressure(doublereal p)
{
// In this routine we must be sure to only find the water branch of the
// curve and not the gas branch
doublereal T = m_temp;
doublereal dens = m_dens;
int waterState = WATER_LIQUID;
@ -420,7 +369,6 @@ void PDSS_Water::setPressure(doublereal p)
waterState = WATER_SUPERCRIT;
}
#ifdef DEBUG_HKM
//printf("waterPDSS: set pres = %g t = %g, waterState = %d\n",
// p, T, waterState);
@ -445,13 +393,6 @@ void PDSS_Water::setPressure(doublereal p)
}
}
// Return the volumetric thermal expansion coefficient. Units: 1/K.
/*
* The thermal expansion coefficient is defined as
* \f[
* \beta = \frac{1}{v}\left(\frac{\partial v}{\partial T}\right)_P
* \f]
*/
doublereal PDSS_Water::thermalExpansionCoeff() const
{
return m_sub->coeffThermExp();
@ -478,19 +419,16 @@ doublereal PDSS_Water::isothermalCompressibility() const
return m_sub->isothermalCompressibility();
}
/// critical temperature
doublereal PDSS_Water::critTemperature() const
{
return m_sub->Tcrit();
}
/// critical pressure
doublereal PDSS_Water::critPressure() const
{
return m_sub->Pcrit();
}
/// critical density
doublereal PDSS_Water::critDensity() const
{
return m_sub->Rhocrit();
@ -540,7 +478,6 @@ doublereal PDSS_Water::pref_safe(doublereal temp) const
return OneAtm;
}
// saturation pressure
doublereal PDSS_Water::satPressure(doublereal t)
{
doublereal pp = m_sub->psat(t, WATER_LIQUID);