doxygen update
Added PureFluidPhase and WaterTP
This commit is contained in:
parent
ebdc0d014b
commit
3dcba97a80
8 changed files with 946 additions and 613 deletions
|
|
@ -1,7 +1,10 @@
|
|||
/**
|
||||
* @file PureFluidPhase.h
|
||||
*
|
||||
* Declares class PureFluid
|
||||
* Declares class PureFluid.
|
||||
*
|
||||
* This object is only available if the WITH_PURE_FLUIDS optional compile
|
||||
* capability has been turned on in Cantera's makefile system.
|
||||
*/
|
||||
|
||||
/* $Author$
|
||||
|
|
@ -16,6 +19,10 @@
|
|||
|
||||
#include "ThermoPhase.h"
|
||||
|
||||
/**
|
||||
* This object is only available if the WITH_PURE_FLUIDS optional compile
|
||||
* capability has been turned on in Cantera's makefile system.
|
||||
*/
|
||||
#ifdef WITH_PURE_FLUIDS
|
||||
|
||||
#include "mix_defs.h"
|
||||
|
|
@ -26,94 +33,282 @@ namespace tpx {
|
|||
|
||||
namespace Cantera {
|
||||
|
||||
//! This phase object consists of a single component that can be a gas, a liquid,
|
||||
//! a mixed gas-liquid fluid, or a fluid beyond its critical point
|
||||
/*!
|
||||
* The object inherits from ThermoPhase. However, its build on top of the
|
||||
* tpx package.
|
||||
*
|
||||
*
|
||||
* <H2> Specification of Species Standard State Properties </H2>
|
||||
*
|
||||
*
|
||||
* <H2> Application within %Kinetics Managers </H2>
|
||||
*
|
||||
*
|
||||
* <H2> XML Example </H2>
|
||||
*
|
||||
*
|
||||
* <H2> Instantiation of the Class </H2>
|
||||
*
|
||||
* @ingroup thermoprops
|
||||
*/
|
||||
class PureFluidPhase : public ThermoPhase {
|
||||
|
||||
/// Class for single-component fluids
|
||||
class PureFluidPhase : public ThermoPhase {
|
||||
public:
|
||||
|
||||
public:
|
||||
//! Base Constructor
|
||||
PureFluidPhase() : ThermoPhase(), m_sub(0), m_subflag(0),
|
||||
m_mw(-1.0), m_verbose(false) {}
|
||||
|
||||
PureFluidPhase() : ThermoPhase(), m_sub(0), m_subflag(0),
|
||||
m_mw(-1.0), m_verbose(false) {}
|
||||
|
||||
virtual ~PureFluidPhase();
|
||||
//! Destructor
|
||||
virtual ~PureFluidPhase();
|
||||
|
||||
|
||||
virtual int eosType() const { return cPureFluid; }
|
||||
//! Equation of state type
|
||||
virtual int eosType() const { return cPureFluid; }
|
||||
|
||||
virtual doublereal enthalpy_mole() const;
|
||||
virtual doublereal intEnergy_mole() const;
|
||||
virtual doublereal entropy_mole() const;
|
||||
virtual doublereal gibbs_mole() const;
|
||||
virtual doublereal cp_mole() const;
|
||||
virtual doublereal cv_mole() const;
|
||||
virtual doublereal pressure() const;
|
||||
virtual void setPressure(doublereal p);
|
||||
/// Molar enthalpy. Units: J/kmol.
|
||||
virtual doublereal enthalpy_mole() const;
|
||||
|
||||
virtual void getChemPotentials(doublereal* mu) const {
|
||||
mu[0] = gibbs_mole();
|
||||
}
|
||||
/// Molar internal energy. Units: J/kmol.
|
||||
virtual doublereal intEnergy_mole() const;
|
||||
|
||||
virtual doublereal isothermalCompressibility() const;
|
||||
virtual doublereal thermalExpansionCoeff() const;
|
||||
/// Molar entropy. Units: J/kmol/K.
|
||||
virtual doublereal entropy_mole() const;
|
||||
|
||||
tpx::Substance& TPX_Substance();
|
||||
/// Molar Gibbs function. Units: J/kmol.
|
||||
virtual doublereal gibbs_mole() const;
|
||||
|
||||
/// critical temperature
|
||||
virtual doublereal critTemperature() const;
|
||||
/// Molar heat capacity at constant pressure. Units: J/kmol/K.
|
||||
virtual doublereal cp_mole() const;
|
||||
|
||||
/// Molar heat capacity at constant volume. Units: J/kmol/K.
|
||||
virtual doublereal cv_mole() const;
|
||||
|
||||
//! Return the thermodynamic pressure (Pa).
|
||||
/*!
|
||||
* This method calculates the current pressure consistent with the
|
||||
* independent variables, T, rho.
|
||||
*/
|
||||
virtual doublereal pressure() const;
|
||||
|
||||
//! sets the thermodynamic pressure (Pa).
|
||||
/*!
|
||||
* This method calculates the density that is consistent with the
|
||||
* desired pressure, given the temperature.
|
||||
*
|
||||
* @param p Pressure (Pa)
|
||||
*/
|
||||
virtual void setPressure(doublereal p);
|
||||
|
||||
//! Get the species chemical potentials. Units: J/kmol.
|
||||
/*!
|
||||
* This function returns a vector of chemical potentials of the
|
||||
* species in solution at the current temperature, pressure
|
||||
* and mole fraction of the solution.
|
||||
*
|
||||
* @param mu Output vector of species chemical
|
||||
* potentials. Length: m_kk. Units: J/kmol
|
||||
*/
|
||||
virtual void getChemPotentials(doublereal* mu) const {
|
||||
mu[0] = gibbs_mole();
|
||||
}
|
||||
|
||||
//! Returns the isothermal compressibility. Units: 1/Pa.
|
||||
/*!
|
||||
* The isothermal compressibility is defined as
|
||||
* \f[
|
||||
* \kappa_T = -\frac{1}{v}\left(\frac{\partial v}{\partial P}\right)_T
|
||||
* \f]
|
||||
*/
|
||||
virtual doublereal isothermalCompressibility() const;
|
||||
|
||||
//! 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;
|
||||
|
||||
//! Returns a reference to the substance object
|
||||
tpx::Substance& TPX_Substance();
|
||||
|
||||
/// critical temperature
|
||||
virtual doublereal critTemperature() const;
|
||||
|
||||
/// critical pressure
|
||||
virtual doublereal critPressure() const;
|
||||
/// critical pressure
|
||||
virtual doublereal critPressure() const;
|
||||
|
||||
/// critical density
|
||||
virtual doublereal critDensity() const;
|
||||
/// critical density
|
||||
virtual doublereal critDensity() const;
|
||||
|
||||
/// saturation temperature
|
||||
virtual doublereal satTemperature(doublereal p) const;
|
||||
|
||||
virtual void setState_HP(doublereal h, doublereal p,
|
||||
doublereal tol = 1.e-8);
|
||||
/// saturation temperature
|
||||
/*!
|
||||
* @param p Pressure (Pa)
|
||||
*/
|
||||
virtual doublereal satTemperature(doublereal p) const;
|
||||
|
||||
virtual void setState_UV(doublereal u, doublereal v,
|
||||
doublereal tol = 1.e-8);
|
||||
//! Set the internally storred specific enthalpy (J/kg) and pressure (Pa) of the phase.
|
||||
/*!
|
||||
* @param h Specific enthalpy (J/kg)
|
||||
* @param p Pressure (Pa)
|
||||
* @param tol Optional parameter setting the tolerance of the
|
||||
* calculation.
|
||||
*/
|
||||
virtual void setState_HP(doublereal h, doublereal p,
|
||||
doublereal tol = 1.e-8);
|
||||
|
||||
virtual void setState_SV(doublereal s, doublereal v,
|
||||
doublereal tol = 1.e-8);
|
||||
//! Set the specific internal energy (J/kg) and specific volume (m^3/kg).
|
||||
/*!
|
||||
* This function fixes the internal state of the phase so that
|
||||
* the specific internal energy and specific volume have the value of the input parameters.
|
||||
*
|
||||
* @param u specific internal energy (J/kg)
|
||||
* @param v specific volume (m^3/kg).
|
||||
* @param tol Optional parameter setting the tolerance of the
|
||||
* calculation.
|
||||
*/
|
||||
virtual void setState_UV(doublereal u, doublereal v,
|
||||
doublereal tol = 1.e-8);
|
||||
|
||||
virtual void setState_SP(doublereal s, doublereal p,
|
||||
doublereal tol = 1.e-8);
|
||||
//! Set the specific entropy (J/kg/K) and specific volume (m^3/kg).
|
||||
/*!
|
||||
* This function fixes the internal state of the phase so that
|
||||
* the specific entropy and specific volume have the value of the input parameters.
|
||||
*
|
||||
* @param s specific entropy (J/kg/K)
|
||||
* @param v specific volume (m^3/kg).
|
||||
* @param tol Optional parameter setting the tolerance of the
|
||||
* calculation.
|
||||
*/
|
||||
virtual void setState_SV(doublereal s, doublereal v,
|
||||
doublereal tol = 1.e-8);
|
||||
|
||||
/// saturation pressure
|
||||
virtual doublereal satPressure(doublereal t) const;
|
||||
|
||||
virtual doublereal vaporFraction() const;
|
||||
|
||||
virtual void setState_Tsat(doublereal t, doublereal x);
|
||||
//! Set the specific entropy (J/kg/K) and pressure (Pa).
|
||||
/*!
|
||||
* This function fixes the internal state of the phase so that
|
||||
* the specific entropy and the pressure have the value of the input parameters.
|
||||
*
|
||||
* @param s specific entropy (J/kg/K)
|
||||
* @param p specific pressure (Pa).
|
||||
* @param tol Optional parameter setting the tolerance of the
|
||||
* calculation.
|
||||
*/
|
||||
virtual void setState_SP(doublereal s, doublereal p,
|
||||
doublereal tol = 1.e-8);
|
||||
|
||||
virtual void setState_Psat(doublereal p, doublereal x);
|
||||
|
||||
virtual void initThermo();
|
||||
virtual void setParametersFromXML(const XML_Node& eosdata);
|
||||
|
||||
//! @name Saturation properties.
|
||||
/*!
|
||||
* These methods are only implemented by subclasses that
|
||||
* implement full liquid-vapor equations of state. They may be
|
||||
* moved out of ThermoPhase at a later date.
|
||||
*/
|
||||
//@{
|
||||
|
||||
protected:
|
||||
|
||||
void Set(int n, double x, double y) const;
|
||||
void setTPXState() const;
|
||||
void check(doublereal v = 0.0) const;
|
||||
void reportTPXError() const;
|
||||
//! Return the saturation pressure given the temperatur
|
||||
/*!
|
||||
* @param t Temperature (Kelvin)
|
||||
*/
|
||||
virtual doublereal satPressure(doublereal t) const;
|
||||
|
||||
private:
|
||||
mutable tpx::Substance* m_sub;
|
||||
int m_subflag;
|
||||
doublereal m_mw;
|
||||
bool m_verbose;
|
||||
};
|
||||
//! Return the fraction of vapor at the current conditions
|
||||
virtual doublereal vaporFraction() const;
|
||||
|
||||
//! Set the state to a saturated system at a particular temperature
|
||||
/*!
|
||||
* @param t Temperature (kelvin)
|
||||
* @param x Fraction of vapor
|
||||
*/
|
||||
virtual void setState_Tsat(doublereal t, doublereal x);
|
||||
|
||||
//! Set the state to a saturated system at a particular pressure
|
||||
/*!
|
||||
* @param p Pressure (Pa)
|
||||
* @param x Fraction of vapor
|
||||
*/
|
||||
virtual void setState_Psat(doublereal p, doublereal x);
|
||||
//@}
|
||||
|
||||
//! Initialize the ThermoPhase object after all species have been set up
|
||||
/*!
|
||||
* @internal Initialize.
|
||||
*
|
||||
* This method is provided to allow
|
||||
* subclasses to perform any initialization required after all
|
||||
* species have been added. For example, it might be used to
|
||||
* resize internal work arrays that must have an entry for
|
||||
* each species. The base class implementation does nothing,
|
||||
* and subclasses that do not require initialization do not
|
||||
* need to overload this method. When importing a CTML phase
|
||||
* description, this method is called from ThermoPhase::initThermoXML(),
|
||||
* which is called from importPhase(),
|
||||
* just prior to returning from function importPhase().
|
||||
*
|
||||
* @see importCTML.cpp
|
||||
*/
|
||||
virtual void initThermo();
|
||||
|
||||
//! Set equation of state parameter values from XML entries.
|
||||
/*!
|
||||
*
|
||||
* This method is called by function importPhase() in
|
||||
* file importCTML.cpp when processing a phase definition in
|
||||
* an input file. It should be overloaded in subclasses to set
|
||||
* any parameters that are specific to that particular phase
|
||||
* model. Note, this method is called before the phase is
|
||||
* initialzed with elements and/or species.
|
||||
*
|
||||
* @param eosdata An XML_Node object corresponding to
|
||||
* the "thermo" entry for this phase in the input file.
|
||||
*/
|
||||
virtual void setParametersFromXML(const XML_Node& eosdata);
|
||||
|
||||
protected:
|
||||
|
||||
//! Main call to the tpx level to set the state of the system
|
||||
/*!
|
||||
* @param n Integer indicating which 2 thermo components are held constant
|
||||
* @param x Value of the first component
|
||||
* @param y Value of the second component
|
||||
*/
|
||||
void Set(int n, double x, double y) const;
|
||||
|
||||
//! Sets the state using a TPX::TV call
|
||||
void setTPXState() const;
|
||||
|
||||
//! Carry out a internal check on tpx, it may have thrown an error.
|
||||
/*!
|
||||
* @param v Defaults to zero
|
||||
*/
|
||||
void check(doublereal v = 0.0) const;
|
||||
|
||||
//! Report errors in the TPX level
|
||||
void reportTPXError() const;
|
||||
|
||||
private:
|
||||
|
||||
//! Pointer to the underlying tpx object Substance that does the work
|
||||
mutable tpx::Substance* m_sub;
|
||||
|
||||
//! Int indicating the type of the fluid
|
||||
/*!
|
||||
* The tpx package uses an int to indicate what fluid is being sought.
|
||||
*/
|
||||
int m_subflag;
|
||||
|
||||
//! Molecular weight of the substance (kg kmol-1)
|
||||
doublereal m_mw;
|
||||
|
||||
//! flag to turn on some printing.
|
||||
bool m_verbose;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ namespace Cantera {
|
|||
* - This is a combination of two SpeciesThermo types.
|
||||
* .
|
||||
* .
|
||||
*
|
||||
* The class SpeciesThermoInterpType is a pure virtual base class for
|
||||
* calculation of thermodynamic functions for a single species
|
||||
* in its reference state.
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ namespace Cantera {
|
|||
* C^0_k = \frac{n_0}{s_k}
|
||||
* \f]
|
||||
*
|
||||
* <b> Instanteation of the Class </b>
|
||||
* <b> Instantiation of the Class </b>
|
||||
*
|
||||
* The constructor for this phase is located in the default ThermoFactory
|
||||
* for Cantera. A new SurfPhase may be created by the following code snippet:
|
||||
|
|
|
|||
|
|
@ -37,10 +37,11 @@ namespace Cantera {
|
|||
/**
|
||||
* @defgroup thermoprops Thermodynamic Properties
|
||||
*
|
||||
*
|
||||
* These classes are used to compute the thermodynamic properties of
|
||||
* phases of matter. The main base class for describing thermodynamic
|
||||
* properties of phases within %Cantera is called ThermoPhase. %ThermoPhase
|
||||
* is a large class that describes the interface within Cantera to Thermodynamic
|
||||
* is a large class that describes the interface within %Cantera to Thermodynamic
|
||||
* functions for a phase.
|
||||
*
|
||||
*
|
||||
|
|
@ -82,13 +83,13 @@ namespace Cantera {
|
|||
*
|
||||
* Treatment of other potential energy contributions.
|
||||
*
|
||||
* Setting the State of the phase
|
||||
* Setting the %State of the phase
|
||||
*
|
||||
* Instantiation of ThermoPhase properties occurs via the following path.
|
||||
* Instantiation of %ThermoPhase properties occurs via the following path.
|
||||
*
|
||||
* Molar Basis vs. Molality Basis
|
||||
*
|
||||
* The following Objects inherit from ThermoPhase. These are known to the
|
||||
* The following Objects inherit from %ThermoPhase. These are known to the
|
||||
* internal factory methods
|
||||
*
|
||||
* - IdealGasPhase in IdealGasPhase.h
|
||||
|
|
@ -114,12 +115,13 @@ namespace Cantera {
|
|||
* - IdealGasPDSS in thermo/IdealGasPDSS.h
|
||||
* - MolalityVPSSTP in thermo/MolalityVPSSTP.h
|
||||
* - HMWSoln in thermo/HMWSoln.h
|
||||
* - WaterTP in thermo/WaterTP.h
|
||||
* .
|
||||
*
|
||||
* @see newPhase(std::string file, std::string id) Description for how to
|
||||
* read ThermoPhases from XML files.
|
||||
* @see newPhase(XML_Node &phase) How to call the Factory routine to create
|
||||
* and initialize ThermoPhase objects.
|
||||
* and initialize %ThermoPhase objects.
|
||||
*/
|
||||
|
||||
|
||||
|
|
@ -366,39 +368,39 @@ namespace Cantera {
|
|||
*/
|
||||
//@{
|
||||
|
||||
//! Set the electric potential of this phase (V).
|
||||
/*!
|
||||
* This is used by classes InterfaceKinetics and EdgeKinetics to
|
||||
* compute the rates of charge-transfer reactions, and in computing
|
||||
* the electrochemical potentials of the species.
|
||||
*
|
||||
* Each phase may have its own electric potential.
|
||||
*
|
||||
* @param v Input value of the electric potential in Volts
|
||||
*/
|
||||
void setElectricPotential(doublereal v) {
|
||||
m_phi = v;
|
||||
}
|
||||
//! Set the electric potential of this phase (V).
|
||||
/*!
|
||||
* This is used by classes InterfaceKinetics and EdgeKinetics to
|
||||
* compute the rates of charge-transfer reactions, and in computing
|
||||
* the electrochemical potentials of the species.
|
||||
*
|
||||
* Each phase may have its own electric potential.
|
||||
*
|
||||
* @param v Input value of the electric potential in Volts
|
||||
*/
|
||||
void setElectricPotential(doublereal v) {
|
||||
m_phi = v;
|
||||
}
|
||||
|
||||
//! Returns the electric potential of this phase (V).
|
||||
/*!
|
||||
* Units are Volts
|
||||
*/
|
||||
doublereal electricPotential() const { return m_phi; }
|
||||
//! Returns the electric potential of this phase (V).
|
||||
/*!
|
||||
* Units are Volts
|
||||
*/
|
||||
doublereal electricPotential() const { return m_phi; }
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @name Activities, Standard States, and Activity Concentrations
|
||||
*
|
||||
* The activity \f$a_k\f$ of a species in solution is related
|
||||
* to the chemical potential by \f[ \mu_k = \mu_k^0(T,P) +
|
||||
* \hat R T \log a_k. \f] The quantity \f$\mu_k^0(T,P)\f$ is
|
||||
* the standard chemical potential at unit activity,
|
||||
* which depends on temperature and pressure,
|
||||
* but not on composition. The
|
||||
* activity is dimensionless.
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
* @name Activities, Standard States, and Activity Concentrations
|
||||
*
|
||||
* The activity \f$a_k\f$ of a species in solution is related
|
||||
* to the chemical potential by \f[ \mu_k = \mu_k^0(T,P) +
|
||||
* \hat R T \log a_k. \f] The quantity \f$\mu_k^0(T,P)\f$ is
|
||||
* the standard chemical potential at unit activity,
|
||||
* which depends on temperature and pressure,
|
||||
* but not on composition. The
|
||||
* activity is dimensionless.
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
//! This method returns the convention used in specification
|
||||
|
|
@ -534,18 +536,18 @@ namespace Cantera {
|
|||
/// @name Partial Molar Properties of the Solution
|
||||
//@{
|
||||
|
||||
/**
|
||||
* Get the array of non-dimensional species chemical potentials
|
||||
* These are partial molar Gibbs free energies.
|
||||
* \f$ \mu_k / \hat R T \f$.
|
||||
* Units: unitless
|
||||
*
|
||||
* @param mu Output vector of dimensionless chemical potentials.
|
||||
* Length: m_kk.
|
||||
*/
|
||||
virtual void getChemPotentials_RT(doublereal* mu) const {
|
||||
err("getChemPotentials_RT");
|
||||
}
|
||||
/**
|
||||
* Get the array of non-dimensional species chemical potentials
|
||||
* These are partial molar Gibbs free energies.
|
||||
* \f$ \mu_k / \hat R T \f$.
|
||||
* Units: unitless
|
||||
*
|
||||
* @param mu Output vector of dimensionless chemical potentials.
|
||||
* Length: m_kk.
|
||||
*/
|
||||
virtual void getChemPotentials_RT(doublereal* mu) const {
|
||||
err("getChemPotentials_RT");
|
||||
}
|
||||
|
||||
|
||||
//! Get the species chemical potentials. Units: J/kmol.
|
||||
|
|
@ -720,49 +722,49 @@ namespace Cantera {
|
|||
err("getStandardVolumes");
|
||||
}
|
||||
|
||||
//@}
|
||||
/// @name Thermodynamic Values for the Species Reference States
|
||||
//@{
|
||||
//@}
|
||||
/// @name Thermodynamic Values for the Species Reference States
|
||||
//@{
|
||||
|
||||
|
||||
//! Returns the vector of nondimensional
|
||||
//! enthalpies of the reference state at the current temperature
|
||||
//! of the solution and the reference pressure for the species.
|
||||
/*!
|
||||
* This base function will throw a CanteraException unless
|
||||
* it is overwritten in a derived class.
|
||||
*
|
||||
* @param hrt Output vector containing the nondimensional reference state
|
||||
* enthalpies
|
||||
* Length: m_kk.
|
||||
*/
|
||||
virtual void getEnthalpy_RT_ref(doublereal *hrt) const {
|
||||
err("getEnthalpy_RT_ref");
|
||||
}
|
||||
//! Returns the vector of nondimensional
|
||||
//! enthalpies of the reference state at the current temperature
|
||||
//! of the solution and the reference pressure for the species.
|
||||
/*!
|
||||
* This base function will throw a CanteraException unless
|
||||
* it is overwritten in a derived class.
|
||||
*
|
||||
* @param hrt Output vector containing the nondimensional reference state
|
||||
* enthalpies
|
||||
* Length: m_kk.
|
||||
*/
|
||||
virtual void getEnthalpy_RT_ref(doublereal *hrt) const {
|
||||
err("getEnthalpy_RT_ref");
|
||||
}
|
||||
|
||||
//! Returns the vector of nondimensional
|
||||
//! Gibbs Free Energies of the reference state at the current temperature
|
||||
//! of the solution and the reference pressure for the species.
|
||||
/*!
|
||||
* @param grt Output vector containing the nondimensional reference state
|
||||
* Gibbs Free energies. Length: m_kk.
|
||||
*/
|
||||
virtual void getGibbs_RT_ref(doublereal *grt) const {
|
||||
err("getGibbs_RT_ref");
|
||||
}
|
||||
//! Returns the vector of nondimensional
|
||||
//! Gibbs Free Energies of the reference state at the current temperature
|
||||
//! of the solution and the reference pressure for the species.
|
||||
/*!
|
||||
* @param grt Output vector containing the nondimensional reference state
|
||||
* Gibbs Free energies. Length: m_kk.
|
||||
*/
|
||||
virtual void getGibbs_RT_ref(doublereal *grt) const {
|
||||
err("getGibbs_RT_ref");
|
||||
}
|
||||
|
||||
//! Returns the vector of the
|
||||
//! gibbs function of the reference state at the current temperature
|
||||
//! of the solution and the reference pressure for the species.
|
||||
/*!
|
||||
* units = J/kmol
|
||||
*
|
||||
* @param g Output vector containing the reference state
|
||||
* Gibbs Free energies. Length: m_kk. Units: J/kmol.
|
||||
*/
|
||||
virtual void getGibbs_ref(doublereal *g) const {
|
||||
err("getGibbs_ref");
|
||||
}
|
||||
//! Returns the vector of the
|
||||
//! gibbs function of the reference state at the current temperature
|
||||
//! of the solution and the reference pressure for the species.
|
||||
/*!
|
||||
* units = J/kmol
|
||||
*
|
||||
* @param g Output vector containing the reference state
|
||||
* Gibbs Free energies. Length: m_kk. Units: J/kmol.
|
||||
*/
|
||||
virtual void getGibbs_ref(doublereal *g) const {
|
||||
err("getGibbs_ref");
|
||||
}
|
||||
|
||||
//! Returns the vector of nondimensional
|
||||
//! entropies of the reference state at the current temperature
|
||||
|
|
@ -876,204 +878,204 @@ namespace Cantera {
|
|||
return temperature() * GasConstant;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Setting the State
|
||||
*
|
||||
* These methods set all or part of the thermodynamic
|
||||
* state.
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @name Setting the State
|
||||
*
|
||||
* These methods set all or part of the thermodynamic
|
||||
* state.
|
||||
* @{
|
||||
*/
|
||||
|
||||
//! Set the temperature (K), pressure (Pa), and mole fractions.
|
||||
/*!
|
||||
* Note, the mole fractions are set first before the pressure is set.
|
||||
* Setting the pressure may involve the solution of a nonlinear equation.
|
||||
*
|
||||
* @param t Temperature (K)
|
||||
* @param p Pressure (Pa)
|
||||
* @param x Vector of mole fractions.
|
||||
* Length is equal to m_kk.
|
||||
*/
|
||||
void setState_TPX(doublereal t, doublereal p, const doublereal* x);
|
||||
//! Set the temperature (K), pressure (Pa), and mole fractions.
|
||||
/*!
|
||||
* Note, the mole fractions are set first before the pressure is set.
|
||||
* Setting the pressure may involve the solution of a nonlinear equation.
|
||||
*
|
||||
* @param t Temperature (K)
|
||||
* @param p Pressure (Pa)
|
||||
* @param x Vector of mole fractions.
|
||||
* Length is equal to m_kk.
|
||||
*/
|
||||
void setState_TPX(doublereal t, doublereal p, const doublereal* x);
|
||||
|
||||
//! Set the temperature (K), pressure (Pa), and mole fractions.
|
||||
/*!
|
||||
* Note, the mole fractions are set first before the pressure is set.
|
||||
* Setting the pressure may involve the solution of a nonlinear equation.
|
||||
*
|
||||
* @param t Temperature (K)
|
||||
* @param p Pressure (Pa)
|
||||
* @param x Composition map of mole fractions. Species not in
|
||||
* the composition map are assumed to have zero mole fraction
|
||||
*/
|
||||
void setState_TPX(doublereal t, doublereal p, compositionMap& x);
|
||||
//! Set the temperature (K), pressure (Pa), and mole fractions.
|
||||
/*!
|
||||
* Note, the mole fractions are set first before the pressure is set.
|
||||
* Setting the pressure may involve the solution of a nonlinear equation.
|
||||
*
|
||||
* @param t Temperature (K)
|
||||
* @param p Pressure (Pa)
|
||||
* @param x Composition map of mole fractions. Species not in
|
||||
* the composition map are assumed to have zero mole fraction
|
||||
*/
|
||||
void setState_TPX(doublereal t, doublereal p, compositionMap& x);
|
||||
|
||||
//! Set the temperature (K), pressure (Pa), and mole fractions.
|
||||
/*!
|
||||
* Note, the mole fractions are set first before the pressure is set.
|
||||
* Setting the pressure may involve the solution of a nonlinear equation.
|
||||
*
|
||||
* @param t Temperature (K)
|
||||
* @param p Pressure (Pa)
|
||||
* @param x String containing a composition map of the mole fractions. Species not in
|
||||
* the composition map are assumed to have zero mole fraction
|
||||
*/
|
||||
void setState_TPX(doublereal t, doublereal p, const std::string& x);
|
||||
//! Set the temperature (K), pressure (Pa), and mole fractions.
|
||||
/*!
|
||||
* Note, the mole fractions are set first before the pressure is set.
|
||||
* Setting the pressure may involve the solution of a nonlinear equation.
|
||||
*
|
||||
* @param t Temperature (K)
|
||||
* @param p Pressure (Pa)
|
||||
* @param x String containing a composition map of the mole fractions. Species not in
|
||||
* the composition map are assumed to have zero mole fraction
|
||||
*/
|
||||
void setState_TPX(doublereal t, doublereal p, const std::string& x);
|
||||
|
||||
//! Set the internally storred temperature (K), pressure (Pa), and mass fractions of the phase.
|
||||
/*!
|
||||
* Note, the mass fractions are set first before the pressure is set.
|
||||
* Setting the pressure may involve the solution of a nonlinear equation.
|
||||
*
|
||||
* @param t Temperature (K)
|
||||
* @param p Pressure (Pa)
|
||||
* @param y Vector of mass fractions.
|
||||
* Length is equal to m_kk.
|
||||
*/
|
||||
void setState_TPY(doublereal t, doublereal p, const doublereal* y);
|
||||
//! Set the internally storred temperature (K), pressure (Pa), and mass fractions of the phase.
|
||||
/*!
|
||||
* Note, the mass fractions are set first before the pressure is set.
|
||||
* Setting the pressure may involve the solution of a nonlinear equation.
|
||||
*
|
||||
* @param t Temperature (K)
|
||||
* @param p Pressure (Pa)
|
||||
* @param y Vector of mass fractions.
|
||||
* Length is equal to m_kk.
|
||||
*/
|
||||
void setState_TPY(doublereal t, doublereal p, const doublereal* y);
|
||||
|
||||
//! Set the internally storred temperature (K), pressure (Pa), and mass fractions of the phase
|
||||
/*!
|
||||
* Note, the mass fractions are set first before the pressure is set.
|
||||
* Setting the pressure may involve the solution of a nonlinear equation.
|
||||
*
|
||||
* @param t Temperature (K)
|
||||
* @param p Pressure (Pa)
|
||||
* @param y Composition map of mass fractions. Species not in
|
||||
* the composition map are assumed to have zero mass fraction
|
||||
*/
|
||||
void setState_TPY(doublereal t, doublereal p, compositionMap& y);
|
||||
//! Set the internally storred temperature (K), pressure (Pa), and mass fractions of the phase
|
||||
/*!
|
||||
* Note, the mass fractions are set first before the pressure is set.
|
||||
* Setting the pressure may involve the solution of a nonlinear equation.
|
||||
*
|
||||
* @param t Temperature (K)
|
||||
* @param p Pressure (Pa)
|
||||
* @param y Composition map of mass fractions. Species not in
|
||||
* the composition map are assumed to have zero mass fraction
|
||||
*/
|
||||
void setState_TPY(doublereal t, doublereal p, compositionMap& y);
|
||||
|
||||
//! Set the internally storred temperature (K), pressure (Pa), and mass fractions of the phase
|
||||
/*!
|
||||
* Note, the mass fractions are set first before the pressure is set.
|
||||
* Setting the pressure may involve the solution of a nonlinear equation.
|
||||
*
|
||||
* @param t Temperature (K)
|
||||
* @param p Pressure (Pa)
|
||||
* @param y String containing a composition map of the mass fractions. Species not in
|
||||
* the composition map are assumed to have zero mass fraction
|
||||
*/
|
||||
void setState_TPY(doublereal t, doublereal p, const std::string& y);
|
||||
//! Set the internally storred temperature (K), pressure (Pa), and mass fractions of the phase
|
||||
/*!
|
||||
* Note, the mass fractions are set first before the pressure is set.
|
||||
* Setting the pressure may involve the solution of a nonlinear equation.
|
||||
*
|
||||
* @param t Temperature (K)
|
||||
* @param p Pressure (Pa)
|
||||
* @param y String containing a composition map of the mass fractions. Species not in
|
||||
* the composition map are assumed to have zero mass fraction
|
||||
*/
|
||||
void setState_TPY(doublereal t, doublereal p, const std::string& y);
|
||||
|
||||
//! Set the temperature (K) and pressure (Pa)
|
||||
/*!
|
||||
* Setting the pressure may involve the solution of a nonlinear equation.
|
||||
*
|
||||
* @param t Temperature (K)
|
||||
* @param p Pressure (Pa)
|
||||
*/
|
||||
void setState_TP(doublereal t, doublereal p);
|
||||
//! Set the temperature (K) and pressure (Pa)
|
||||
/*!
|
||||
* Setting the pressure may involve the solution of a nonlinear equation.
|
||||
*
|
||||
* @param t Temperature (K)
|
||||
* @param p Pressure (Pa)
|
||||
*/
|
||||
void setState_TP(doublereal t, doublereal p);
|
||||
|
||||
//! Set the pressure (Pa) and mole fractions.
|
||||
/*!
|
||||
* Note, the mole fractions are set first before the pressure is set.
|
||||
* Setting the pressure may involve the solution of a nonlinear equation.
|
||||
*
|
||||
* @param p Pressure (Pa)
|
||||
* @param x Vector of mole fractions.
|
||||
* Length is equal to m_kk.
|
||||
*/
|
||||
void setState_PX(doublereal p, doublereal* x);
|
||||
//! Set the pressure (Pa) and mole fractions.
|
||||
/*!
|
||||
* Note, the mole fractions are set first before the pressure is set.
|
||||
* Setting the pressure may involve the solution of a nonlinear equation.
|
||||
*
|
||||
* @param p Pressure (Pa)
|
||||
* @param x Vector of mole fractions.
|
||||
* Length is equal to m_kk.
|
||||
*/
|
||||
void setState_PX(doublereal p, doublereal* x);
|
||||
|
||||
|
||||
//! Set the internally storred pressure (Pa) and mass fractions.
|
||||
/*!
|
||||
* Note, the temperature is held constant during this operation.
|
||||
* Note, the mass fractions are set first before the pressure is set.
|
||||
* Setting the pressure may involve the solution of a nonlinear equation.
|
||||
*
|
||||
* @param p Pressure (Pa)
|
||||
* @param y Vector of mass fractions.
|
||||
* Length is equal to m_kk.
|
||||
*/
|
||||
void setState_PY(doublereal p, doublereal* y);
|
||||
//! Set the internally storred pressure (Pa) and mass fractions.
|
||||
/*!
|
||||
* Note, the temperature is held constant during this operation.
|
||||
* Note, the mass fractions are set first before the pressure is set.
|
||||
* Setting the pressure may involve the solution of a nonlinear equation.
|
||||
*
|
||||
* @param p Pressure (Pa)
|
||||
* @param y Vector of mass fractions.
|
||||
* Length is equal to m_kk.
|
||||
*/
|
||||
void setState_PY(doublereal p, doublereal* y);
|
||||
|
||||
//! Set the internally storred specific enthalpy (J/kg) and pressure (Pa) of the phase.
|
||||
/*!
|
||||
* @param h Specific enthalpy (J/kg)
|
||||
* @param p Pressure (Pa)
|
||||
* @param tol Optional parameter setting the tolerance of the
|
||||
* calculation.
|
||||
*/
|
||||
virtual void setState_HP(doublereal h, doublereal p,
|
||||
doublereal tol = 1.e-4);
|
||||
//! Set the internally storred specific enthalpy (J/kg) and pressure (Pa) of the phase.
|
||||
/*!
|
||||
* @param h Specific enthalpy (J/kg)
|
||||
* @param p Pressure (Pa)
|
||||
* @param tol Optional parameter setting the tolerance of the
|
||||
* calculation.
|
||||
*/
|
||||
virtual void setState_HP(doublereal h, doublereal p,
|
||||
doublereal tol = 1.e-4);
|
||||
|
||||
//! Set the specific internal energy (J/kg) and specific volume (m^3/kg).
|
||||
/*!
|
||||
* This function fixes the internal state of the phase so that
|
||||
* the specific internal energy and specific volume have the value of the input parameters.
|
||||
*
|
||||
* @param u specific internal energy (J/kg)
|
||||
* @param v specific volume (m^3/kg).
|
||||
* @param tol Optional parameter setting the tolerance of the
|
||||
* calculation.
|
||||
*/
|
||||
virtual void setState_UV(doublereal u, doublereal v,
|
||||
doublereal tol = 1.e-4);
|
||||
//! Set the specific internal energy (J/kg) and specific volume (m^3/kg).
|
||||
/*!
|
||||
* This function fixes the internal state of the phase so that
|
||||
* the specific internal energy and specific volume have the value of the input parameters.
|
||||
*
|
||||
* @param u specific internal energy (J/kg)
|
||||
* @param v specific volume (m^3/kg).
|
||||
* @param tol Optional parameter setting the tolerance of the
|
||||
* calculation.
|
||||
*/
|
||||
virtual void setState_UV(doublereal u, doublereal v,
|
||||
doublereal tol = 1.e-4);
|
||||
|
||||
//! Set the specific entropy (J/kg/K) and pressure (Pa).
|
||||
/*!
|
||||
* This function fixes the internal state of the phase so that
|
||||
* the specific entropy and the pressure have the value of the input parameters.
|
||||
*
|
||||
* @param s specific entropy (J/kg/K)
|
||||
* @param p specific pressure (Pa).
|
||||
* @param tol Optional parameter setting the tolerance of the
|
||||
* calculation.
|
||||
*/
|
||||
virtual void setState_SP(doublereal s, doublereal p,
|
||||
doublereal tol = 1.e-4);
|
||||
//! Set the specific entropy (J/kg/K) and pressure (Pa).
|
||||
/*!
|
||||
* This function fixes the internal state of the phase so that
|
||||
* the specific entropy and the pressure have the value of the input parameters.
|
||||
*
|
||||
* @param s specific entropy (J/kg/K)
|
||||
* @param p specific pressure (Pa).
|
||||
* @param tol Optional parameter setting the tolerance of the
|
||||
* calculation.
|
||||
*/
|
||||
virtual void setState_SP(doublereal s, doublereal p,
|
||||
doublereal tol = 1.e-4);
|
||||
|
||||
//! Set the specific entropy (J/kg/K) and specific volume (m^3/kg).
|
||||
/*!
|
||||
* This function fixes the internal state of the phase so that
|
||||
* the specific entropy and specific volume have the value of the input parameters.
|
||||
*
|
||||
* @param s specific entropy (J/kg/K)
|
||||
* @param v specific volume (m^3/kg).
|
||||
* @param tol Optional parameter setting the tolerance of the
|
||||
* calculation.
|
||||
*/
|
||||
virtual void setState_SV(doublereal s, doublereal v, doublereal tol = 1.e-4);
|
||||
//! Set the specific entropy (J/kg/K) and specific volume (m^3/kg).
|
||||
/*!
|
||||
* This function fixes the internal state of the phase so that
|
||||
* the specific entropy and specific volume have the value of the input parameters.
|
||||
*
|
||||
* @param s specific entropy (J/kg/K)
|
||||
* @param v specific volume (m^3/kg).
|
||||
* @param tol Optional parameter setting the tolerance of the
|
||||
* calculation.
|
||||
*/
|
||||
virtual void setState_SV(doublereal s, doublereal v, doublereal tol = 1.e-4);
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
/**
|
||||
* @name Chemical Equilibrium
|
||||
* Chemical equilibrium.
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @name Chemical Equilibrium
|
||||
* Chemical equilibrium.
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
//!This method is used by the ChemEquil equilibrium solver.
|
||||
/*!
|
||||
* It sets the state such that the chemical potentials satisfy
|
||||
* \f[ \frac{\mu_k}{\hat R T} = \sum_m A_{k,m}
|
||||
* \left(\frac{\lambda_m} {\hat R T}\right) \f] where
|
||||
* \f$ \lambda_m \f$ is the element potential of element m. The
|
||||
* temperature is unchanged. Any phase (ideal or not) that
|
||||
* implements this method can be equilibrated by ChemEquil.
|
||||
*
|
||||
* @param lambda_RT Input vector of dimensionless element potentials
|
||||
* The length is equal to nElements().
|
||||
*/
|
||||
virtual void setToEquilState(const doublereal* lambda_RT) {
|
||||
err("setToEquilState");
|
||||
}
|
||||
//!This method is used by the ChemEquil equilibrium solver.
|
||||
/*!
|
||||
* It sets the state such that the chemical potentials satisfy
|
||||
* \f[ \frac{\mu_k}{\hat R T} = \sum_m A_{k,m}
|
||||
* \left(\frac{\lambda_m} {\hat R T}\right) \f] where
|
||||
* \f$ \lambda_m \f$ is the element potential of element m. The
|
||||
* temperature is unchanged. Any phase (ideal or not) that
|
||||
* implements this method can be equilibrated by ChemEquil.
|
||||
*
|
||||
* @param lambda_RT Input vector of dimensionless element potentials
|
||||
* The length is equal to nElements().
|
||||
*/
|
||||
virtual void setToEquilState(const doublereal* lambda_RT) {
|
||||
err("setToEquilState");
|
||||
}
|
||||
|
||||
//! Stores the element potentials in the ThermoPhase object
|
||||
/*!
|
||||
* Called by function 'equilibrate' in ChemEquil.h to transfer
|
||||
* the element potentials to this object after every successful
|
||||
* equilibration routine.
|
||||
* The element potentials are storred in their dimensionless
|
||||
* forms, calculated by dividing by RT.
|
||||
*
|
||||
* @param lambda Input vector containing the element potentials.
|
||||
* Length = nElements. Units are Joules/kmol.
|
||||
*/
|
||||
void setElementPotentials(const vector_fp& lambda);
|
||||
//! Stores the element potentials in the ThermoPhase object
|
||||
/*!
|
||||
* Called by function 'equilibrate' in ChemEquil.h to transfer
|
||||
* the element potentials to this object after every successful
|
||||
* equilibration routine.
|
||||
* The element potentials are storred in their dimensionless
|
||||
* forms, calculated by dividing by RT.
|
||||
*
|
||||
* @param lambda Input vector containing the element potentials.
|
||||
* Length = nElements. Units are Joules/kmol.
|
||||
*/
|
||||
void setElementPotentials(const vector_fp& lambda);
|
||||
|
||||
|
||||
//! Returns the element potentials storred in the ThermoPhase object
|
||||
|
|
@ -1117,66 +1119,87 @@ namespace Cantera {
|
|||
|
||||
//@}
|
||||
|
||||
/// @name Saturation properties.
|
||||
/// These methods are only implemented by subclasses that
|
||||
/// implement full liquid-vapor equations of state. They may be
|
||||
/// moved out of ThermoPhase at a later date.
|
||||
///
|
||||
//! @name Saturation properties.
|
||||
/*!
|
||||
* These methods are only implemented by subclasses that
|
||||
* implement full liquid-vapor equations of state. They may be
|
||||
* moved out of ThermoPhase at a later date.
|
||||
*/
|
||||
//@{
|
||||
|
||||
//! Return the saturation temperature given the pressure
|
||||
/*!
|
||||
* @param p Pressure (Pa)
|
||||
*/
|
||||
virtual doublereal satTemperature(doublereal p) const {
|
||||
err("satTemperature"); return -1.0;
|
||||
}
|
||||
|
||||
|
||||
//! Return the saturation pressure given the temperature
|
||||
/*!
|
||||
* @param t Temperature (Kelvin)
|
||||
*/
|
||||
virtual doublereal satPressure(doublereal t) const {
|
||||
err("satPressure"); return -1.0;
|
||||
}
|
||||
|
||||
|
||||
//! Return the fraction of vapor at the current conditions
|
||||
virtual doublereal vaporFraction() const {
|
||||
err("vaprFraction"); return -1.0;
|
||||
}
|
||||
|
||||
//! Set the state to a saturated system at a particular temperature
|
||||
/*!
|
||||
* @param t Temperature (kelvin)
|
||||
* @param x Fraction of vapor
|
||||
*/
|
||||
virtual void setState_Tsat(doublereal t, doublereal x) {
|
||||
err("setState_sat");
|
||||
}
|
||||
|
||||
//! Set the state to a saturated system at a particular pressure
|
||||
/*!
|
||||
* @param p Pressure (Pa)
|
||||
* @param x Fraction of vapor
|
||||
*/
|
||||
virtual void setState_Psat(doublereal p, doublereal x) {
|
||||
err("setState_sat");
|
||||
}
|
||||
|
||||
|
||||
|
||||
//@}
|
||||
|
||||
|
||||
//! @name Initialization Methods - For Internal Use (%ThermoPhase)
|
||||
/*!
|
||||
* The following methods are used in the process of constructing
|
||||
* the phase and setting its parameters from a specification in an
|
||||
* input file. They are not normally used in application programs.
|
||||
* To see how they are used,
|
||||
* see files importCTML.cpp and ThermoFactory.cpp.
|
||||
*/
|
||||
//@{
|
||||
//! @name Initialization Methods - For Internal Use (%ThermoPhase)
|
||||
/*!
|
||||
* The following methods are used in the process of constructing
|
||||
* the phase and setting its parameters from a specification in an
|
||||
* input file. They are not normally used in application programs.
|
||||
* To see how they are used,
|
||||
* see files importCTML.cpp and ThermoFactory.cpp.
|
||||
*/
|
||||
//@{
|
||||
|
||||
//! Store a reference to the XML tree containing the species data for this phase.
|
||||
/*!
|
||||
* This is used to access data needed to construct transport manager later.
|
||||
* @internal
|
||||
*
|
||||
* @param data Pointer to the XML_Node data containing
|
||||
* information about the species in the phase.
|
||||
*/
|
||||
void saveSpeciesData(const XML_Node* data) {
|
||||
m_speciesData = data;
|
||||
}
|
||||
//! Store a reference to the XML tree containing the species data for this phase.
|
||||
/*!
|
||||
* This is used to access data needed to construct transport manager later.
|
||||
* @internal
|
||||
*
|
||||
* @param data Pointer to the XML_Node data containing
|
||||
* information about the species in the phase.
|
||||
*/
|
||||
void saveSpeciesData(const XML_Node* data) {
|
||||
m_speciesData = data;
|
||||
}
|
||||
|
||||
/// Return a pointer to the XML tree containing the species
|
||||
/// data for this phase.
|
||||
const XML_Node* speciesData() {
|
||||
if (!m_speciesData) {
|
||||
throw CanteraError("ThermoPhase::speciesData",
|
||||
"m_speciesData is NULL");
|
||||
}
|
||||
return m_speciesData;
|
||||
/// Return a pointer to the XML tree containing the species
|
||||
/// data for this phase.
|
||||
const XML_Node* speciesData() {
|
||||
if (!m_speciesData) {
|
||||
throw CanteraError("ThermoPhase::speciesData",
|
||||
"m_speciesData is NULL");
|
||||
}
|
||||
return m_speciesData;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -1197,35 +1220,35 @@ namespace Cantera {
|
|||
void setSpeciesThermo(SpeciesThermo* spthermo)
|
||||
{ m_spthermo = spthermo; }
|
||||
|
||||
/**
|
||||
* @internal Return a reference to the species thermodynamic property
|
||||
* manager. @todo This method will fail if no species thermo
|
||||
* manager has been installed.
|
||||
*/
|
||||
SpeciesThermo& speciesThermo() { return *m_spthermo; }
|
||||
/**
|
||||
* @internal Return a reference to the species thermodynamic property
|
||||
* manager. @todo This method will fail if no species thermo
|
||||
* manager has been installed.
|
||||
*/
|
||||
SpeciesThermo& speciesThermo() { return *m_spthermo; }
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* Initialization of a ThermoPhase object using an
|
||||
* ctml file.
|
||||
*
|
||||
* This routine is a precursor to initThermoXML(XML_Node*)
|
||||
* routine, which does most of the work.
|
||||
* Here we read extra information about the XML description
|
||||
* of a phase. Regular information about elements and species
|
||||
* and their reference state thermodynamic information
|
||||
* have already been read at this point.
|
||||
* For example, we do not need to call this function for
|
||||
* ideal gas equations of state.
|
||||
*
|
||||
* @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 encountered will be used.
|
||||
*/
|
||||
virtual void initThermoFile(std::string inputFile, std::string id);
|
||||
/**
|
||||
* @internal
|
||||
* Initialization of a ThermoPhase object using an
|
||||
* ctml file.
|
||||
*
|
||||
* This routine is a precursor to initThermoXML(XML_Node*)
|
||||
* routine, which does most of the work.
|
||||
* Here we read extra information about the XML description
|
||||
* of a phase. Regular information about elements and species
|
||||
* and their reference state thermodynamic information
|
||||
* have already been read at this point.
|
||||
* For example, we do not need to call this function for
|
||||
* ideal gas equations of state.
|
||||
*
|
||||
* @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 encountered will be used.
|
||||
*/
|
||||
virtual void initThermoFile(std::string inputFile, std::string id);
|
||||
|
||||
|
||||
//!Import and initialize a ThermoPhase object using an XML tree.
|
||||
|
|
@ -1291,18 +1314,18 @@ namespace Cantera {
|
|||
int index() { return m_index; }
|
||||
|
||||
|
||||
/**
|
||||
* @internal Set the index number. The Cantera interface
|
||||
* library uses this method to set the index number to the
|
||||
* location of the pointer to this object in the pointer array
|
||||
* it maintains. Using this method for any other purpose will
|
||||
* lead to unpredictable results if used in conjunction with
|
||||
* the interface library.
|
||||
*
|
||||
* @param m Input the index number.
|
||||
*/
|
||||
void setIndex(int m) { m_index = m; }
|
||||
|
||||
/**
|
||||
* @internal Set the index number. The Cantera interface
|
||||
* library uses this method to set the index number to the
|
||||
* location of the pointer to this object in the pointer array
|
||||
* it maintains. Using this method for any other purpose will
|
||||
* lead to unpredictable results if used in conjunction with
|
||||
* the interface library.
|
||||
*
|
||||
* @param m Input the index number.
|
||||
*/
|
||||
void setIndex(int m) { m_index = m; }
|
||||
|
||||
|
||||
//! Set the equation of state parameters
|
||||
/*!
|
||||
|
|
@ -1359,40 +1382,40 @@ namespace Cantera {
|
|||
//@}
|
||||
|
||||
|
||||
protected:
|
||||
protected:
|
||||
|
||||
//! Pointer to the species thermodynamic property manager
|
||||
SpeciesThermo* m_spthermo;
|
||||
//! Pointer to the species thermodynamic property manager
|
||||
SpeciesThermo* m_spthermo;
|
||||
|
||||
/// Pointer to the XML tree containing the species
|
||||
/// data for this phase. This is used to access data needed to
|
||||
/// construct the transport manager and other properties
|
||||
/// later in the initialization process.
|
||||
const XML_Node* m_speciesData;
|
||||
/// Pointer to the XML tree containing the species
|
||||
/// data for this phase. This is used to access data needed to
|
||||
/// construct the transport manager and other properties
|
||||
/// later in the initialization process.
|
||||
const XML_Node* m_speciesData;
|
||||
|
||||
//! Index number of the phase
|
||||
/*!
|
||||
* The Cantera interface library uses this member to set the index number to the
|
||||
* location of the pointer to this object in the pointer array of ThermoPhase's
|
||||
* it maintains. Using this member for any other purpose will
|
||||
* lead to unpredictable results if used in conjunction with
|
||||
* the interface library.
|
||||
*/
|
||||
int m_index;
|
||||
//! Index number of the phase
|
||||
/*!
|
||||
* The Cantera interface library uses this member to set the index number to the
|
||||
* location of the pointer to this object in the pointer array of ThermoPhase's
|
||||
* it maintains. Using this member for any other purpose will
|
||||
* lead to unpredictable results if used in conjunction with
|
||||
* the interface library.
|
||||
*/
|
||||
int m_index;
|
||||
|
||||
//! Storred value of the electric potential for this phase
|
||||
/*!
|
||||
* Units are Volts
|
||||
*/
|
||||
doublereal m_phi;
|
||||
//! Storred value of the electric potential for this phase
|
||||
/*!
|
||||
* Units are Volts
|
||||
*/
|
||||
doublereal m_phi;
|
||||
|
||||
/// Vector of element potentials.
|
||||
/// -> length equal to number of elements
|
||||
vector_fp m_lambdaRRT;
|
||||
//! Boolean indicating whether there is a valid set of saved element potentials for this phase
|
||||
bool m_hasElementPotentials;
|
||||
/// Vector of element potentials.
|
||||
/// -> length equal to number of elements
|
||||
vector_fp m_lambdaRRT;
|
||||
//! Boolean indicating whether there is a valid set of saved element potentials for this phase
|
||||
bool m_hasElementPotentials;
|
||||
|
||||
private:
|
||||
private:
|
||||
|
||||
//! Error function that gets called for unhandled cases
|
||||
/*!
|
||||
|
|
@ -1400,7 +1423,7 @@ namespace Cantera {
|
|||
*/
|
||||
doublereal err(std::string msg) const;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
//! typedef for the ThermoPhase class
|
||||
typedef ThermoPhase thermophase_t;
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ namespace Cantera {
|
|||
*this = b;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Assignment operator
|
||||
*/
|
||||
WaterTP& WaterTP::operator=(const WaterTP&b) {
|
||||
|
|
@ -113,15 +113,7 @@ namespace Cantera {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* constructPhase:
|
||||
*
|
||||
* Initialization of a Debye-Huckel phase 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
|
||||
*
|
||||
|
|
@ -143,19 +135,14 @@ namespace Cantera {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
/*
|
||||
* initThermo():
|
||||
*
|
||||
* Initialization of a Debye-Huckel phase using an
|
||||
* xml file.
|
||||
*
|
||||
* This routine is a precursor to initThermo(XML_Node*)
|
||||
* This routine is a precursor to constructPhaseXML(XML_Node*)
|
||||
* routine, which does most of the work.
|
||||
*
|
||||
* @param infile XML file containing the description of the
|
||||
* @param inputFile XML file containing the description of the
|
||||
* phase
|
||||
*
|
||||
* @param id Optional parameter identifying the name of the
|
||||
|
|
@ -195,10 +182,6 @@ namespace Cantera {
|
|||
|
||||
|
||||
void WaterTP::initThermo() {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void WaterTP::
|
||||
|
|
@ -291,7 +274,7 @@ namespace Cantera {
|
|||
"missing or negative substance flag");
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Return the molar enthalpy in units of J kmol-1
|
||||
*/
|
||||
doublereal WaterTP::
|
||||
|
|
@ -302,7 +285,7 @@ namespace Cantera {
|
|||
return (h + EW_Offset);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Calculate the internal energy in mks units of
|
||||
* J kmol-1
|
||||
*/
|
||||
|
|
@ -314,7 +297,7 @@ namespace Cantera {
|
|||
return (u + EW_Offset);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Calculate the entropy in mks units of
|
||||
* J kmol-1 K-1
|
||||
*/
|
||||
|
|
@ -326,7 +309,7 @@ namespace Cantera {
|
|||
return (s + SW_Offset);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Calculate the Gibbs free energy in mks units of
|
||||
* J kmol-1 K-1.
|
||||
*/
|
||||
|
|
@ -338,7 +321,7 @@ namespace Cantera {
|
|||
return (g + EW_Offset - SW_Offset*T);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Calculate the constant pressure heat capacity
|
||||
* in mks units of J kmol-1 K-1
|
||||
*/
|
||||
|
|
@ -350,7 +333,7 @@ namespace Cantera {
|
|||
return cp;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Calculate the constant volume heat capacity
|
||||
* in mks units of J kmol-1 K-1
|
||||
*/
|
||||
|
|
@ -362,7 +345,7 @@ namespace Cantera {
|
|||
return cv;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Calculate the pressure (Pascals), given the temperature and density
|
||||
* Temperature: kelvin
|
||||
* rho: density in kg m-3
|
||||
|
|
@ -392,13 +375,13 @@ namespace Cantera {
|
|||
}
|
||||
|
||||
|
||||
/// critical temperature
|
||||
// critical temperature
|
||||
doublereal WaterTP::critTemperature() const { return m_sub->Tcrit(); }
|
||||
|
||||
/// critical pressure
|
||||
// critical pressure
|
||||
doublereal WaterTP::critPressure() const { return m_sub->Pcrit(); }
|
||||
|
||||
/// critical density
|
||||
// critical density
|
||||
doublereal WaterTP::critDensity() const { return m_sub->Rhocrit(); }
|
||||
|
||||
|
||||
|
|
@ -411,7 +394,7 @@ namespace Cantera {
|
|||
|
||||
|
||||
|
||||
/// saturation pressure
|
||||
// saturation pressure
|
||||
doublereal WaterTP::satPressure(doublereal t){
|
||||
doublereal pp = m_sub->psat(t);
|
||||
double dens = density();
|
||||
|
|
|
|||
|
|
@ -21,172 +21,289 @@
|
|||
class WaterPropsIAPWS;
|
||||
|
||||
namespace Cantera {
|
||||
|
||||
//! Class for single-component water. This is designed to cover just the
|
||||
//! liquid part of water.
|
||||
/*!
|
||||
*
|
||||
*
|
||||
* Notes:
|
||||
* Base state for thermodynamic properties:
|
||||
*
|
||||
* The thermodynamic base state for water is set to the NIST basis here
|
||||
* by specifying constants EW_Offset and SW_Offset. These offsets are
|
||||
* specified so that the following properties hold:
|
||||
*
|
||||
* Delta_Hfo_gas(298.15) = -241.826 kJ/gmol
|
||||
* So_gas(298.15, 1bar) = 188.835 J/gmolK
|
||||
*
|
||||
* (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
|
||||
* and then use the theoretical ideal gas results to scale up to
|
||||
* higher pressures:
|
||||
*
|
||||
* Ho(1bar) = H(P0)
|
||||
*
|
||||
* So(1bar) = S(P0) + RT ln(1bar/P0)
|
||||
*
|
||||
* The offsets used in the steam tables are different than NIST's.
|
||||
* They assume u_liq(TP) = 0.0, s_liq(TP) = 0.0, where TP is the
|
||||
* triple point conditions.
|
||||
*
|
||||
* @todo
|
||||
* I should have made this inherit from SingleSpeciesTP!
|
||||
*
|
||||
* @ingroup thermoprops
|
||||
*
|
||||
*/
|
||||
class WaterTP : public ThermoPhase {
|
||||
|
||||
public:
|
||||
|
||||
//! Base constructor
|
||||
WaterTP();
|
||||
|
||||
//! Copy constructor
|
||||
WaterTP(const WaterTP &);
|
||||
|
||||
//! Assignment operator
|
||||
WaterTP& operator=(const WaterTP&);
|
||||
|
||||
//! Full constructor for a water phase
|
||||
/*!
|
||||
* @param inputFile String name of the input file
|
||||
* @param id string id of the phase name
|
||||
*/
|
||||
WaterTP(std::string inputFile, std::string id = "");
|
||||
|
||||
//! Full constructor for a water phase
|
||||
/*!
|
||||
* @param phaseRef XML node referencing the water phase.
|
||||
* @param id string id of the phase name
|
||||
*/
|
||||
WaterTP(XML_Node& phaseRef, std::string id = "");
|
||||
|
||||
//! Destructor
|
||||
virtual ~WaterTP();
|
||||
|
||||
//! Duplicator from a ThermoPhase object
|
||||
ThermoPhase *duplMyselfAsThermoPhase();
|
||||
|
||||
/**
|
||||
*
|
||||
* @name Utilities
|
||||
* @{
|
||||
*/
|
||||
virtual int eosType() const { return -1; }
|
||||
|
||||
/**
|
||||
*Class for single-component water. This is designed to cover just the
|
||||
* liquid part of water.
|
||||
*
|
||||
*
|
||||
* Notes:
|
||||
* Base state for thermodynamic properties:
|
||||
*
|
||||
* The thermodynamic base state for water is set to the NIST basis here
|
||||
* by specifying constants EW_Offset and SW_Offset. These offsets are
|
||||
* specified so that the following properties hold:
|
||||
*
|
||||
* Delta_Hfo_gas(298.15) = -241.826 kJ/gmol
|
||||
* So_gas(298.15, 1bar) = 188.835 J/gmolK
|
||||
*
|
||||
* (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
|
||||
* and then use the theoretical ideal gas results to scale up to
|
||||
* higher pressures:
|
||||
*
|
||||
* Ho(1bar) = H(P0)
|
||||
*
|
||||
* So(1bar) = S(P0) + RT ln(1bar/P0)
|
||||
*
|
||||
* The offsets used in the steam tables are different than NIST's.
|
||||
* They assume u_liq(TP) = 0.0, s_liq(TP) = 0.0, where TP is the
|
||||
* triple point conditions.
|
||||
*
|
||||
*
|
||||
* @}
|
||||
* @name Molar Thermodynamic Properties of the Solution --------------
|
||||
* @{
|
||||
*/
|
||||
class WaterTP : public ThermoPhase {
|
||||
virtual doublereal enthalpy_mole() const;
|
||||
virtual doublereal intEnergy_mole() const;
|
||||
virtual doublereal entropy_mole() const;
|
||||
virtual doublereal gibbs_mole() const;
|
||||
virtual doublereal cp_mole() const;
|
||||
virtual doublereal cv_mole() const;
|
||||
|
||||
public:
|
||||
//@}
|
||||
/// @name Mechanical Equation of State Properties ---------------------
|
||||
//@{
|
||||
|
||||
/**
|
||||
* Basic list of constructors and duplicators
|
||||
*/
|
||||
WaterTP();
|
||||
WaterTP(const WaterTP &b);
|
||||
WaterTP& operator=(const WaterTP&b);
|
||||
WaterTP(std::string inputFile, std::string id = "");
|
||||
WaterTP(XML_Node& phaseRef, std::string id = "");
|
||||
virtual ~WaterTP();
|
||||
ThermoPhase *duplMyselfAsThermoPhase();
|
||||
|
||||
/**
|
||||
*
|
||||
* @name Utilities
|
||||
* @{
|
||||
*/
|
||||
virtual int eosType() const { return -1; }
|
||||
virtual doublereal pressure() const;
|
||||
virtual void setPressure(doublereal p);
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @name Molar Thermodynamic Properties of the Solution --------------
|
||||
* @{
|
||||
*/
|
||||
virtual doublereal enthalpy_mole() const;
|
||||
virtual doublereal intEnergy_mole() const;
|
||||
virtual doublereal entropy_mole() const;
|
||||
virtual doublereal gibbs_mole() const;
|
||||
virtual doublereal cp_mole() const;
|
||||
virtual doublereal cv_mole() const;
|
||||
/**
|
||||
* @}
|
||||
* @name Potential Energy
|
||||
* @{
|
||||
*/
|
||||
|
||||
//@}
|
||||
/// @name Mechanical Equation of State Properties ---------------------
|
||||
//@{
|
||||
/**
|
||||
* @}
|
||||
* @name Activities, Standard States, and Activity Concentrations
|
||||
* @{
|
||||
*/
|
||||
|
||||
virtual doublereal pressure() const;
|
||||
virtual void setPressure(doublereal p);
|
||||
//@}
|
||||
/// @name Partial Molar Properties of the Solution -----------------
|
||||
//@{
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @name Potential Energy
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @name Activities, Standard States, and Activity Concentrations
|
||||
* @{
|
||||
*/
|
||||
//! get the chemical potential of the water
|
||||
/*!
|
||||
* @param mu vector of chemical potentials.
|
||||
*/
|
||||
virtual void getChemPotentials(doublereal* mu) const {
|
||||
mu[0] = gibbs_mole();
|
||||
}
|
||||
|
||||
//@}
|
||||
/// @name Partial Molar Properties of the Solution -----------------
|
||||
//@{
|
||||
|
||||
virtual void getChemPotentials(doublereal* mu) const {
|
||||
mu[0] = gibbs_mole();
|
||||
}
|
||||
|
||||
//@}
|
||||
/// @name Properties of the Standard State of the Species
|
||||
// in the Solution --
|
||||
//@{
|
||||
//@}
|
||||
/// @name Properties of the Standard State of the Species
|
||||
// in the Solution --
|
||||
//@{
|
||||
|
||||
|
||||
/// critical temperature
|
||||
virtual doublereal critTemperature() const;
|
||||
/// critical temperature
|
||||
virtual doublereal critTemperature() const;
|
||||
|
||||
/// critical pressure
|
||||
virtual doublereal critPressure() const;
|
||||
/// critical pressure
|
||||
virtual doublereal critPressure() const;
|
||||
|
||||
/// critical density
|
||||
virtual doublereal critDensity() const;
|
||||
/// critical density
|
||||
virtual doublereal critDensity() const;
|
||||
|
||||
/// saturation temperature
|
||||
//virtual doublereal satTemperature(doublereal p) const;
|
||||
/// saturation temperature
|
||||
//virtual doublereal satTemperature(doublereal p) const;
|
||||
|
||||
|
||||
|
||||
/// saturation pressure
|
||||
virtual doublereal satPressure(doublereal t);
|
||||
/// saturation pressure
|
||||
/*!
|
||||
* @param t Temperature (kelvin)
|
||||
*/
|
||||
virtual doublereal satPressure(doublereal t);
|
||||
|
||||
|
||||
virtual void setTemperature(double temp);
|
||||
virtual void setTemperature(double temp);
|
||||
|
||||
virtual void constructPhase();
|
||||
virtual void constructPhaseFile(std::string inputFile, std::string id);
|
||||
virtual void constructPhaseXML(XML_Node& phaseNode, std::string id);
|
||||
virtual void constructPhase();
|
||||
|
||||
|
||||
//! Initialization of a pure water phase using an
|
||||
//! xml file.
|
||||
/*!
|
||||
* This routine is a precursor to constructPhaseXML(XML_Node*)
|
||||
* routine, which does most of the work.
|
||||
*
|
||||
* @param inputFile String name of the file.
|
||||
*
|
||||
* @param id Optional parameter identifying the name of the
|
||||
* phase. If none is given, the first XML
|
||||
* phase element will be used.
|
||||
*/
|
||||
virtual void constructPhaseFile(std::string inputFile, std::string id);
|
||||
|
||||
virtual void initThermoXML(XML_Node& eosdata, std::string id);
|
||||
virtual void initThermo();
|
||||
virtual void setParametersFromXML(const XML_Node& eosdata);
|
||||
|
||||
//! Initialization of a pure water phase using an xml file.
|
||||
/*!
|
||||
* This calls importPhase() to do the work.
|
||||
*
|
||||
* @param phaseNode 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.
|
||||
*/
|
||||
virtual void constructPhaseXML(XML_Node& phaseNode, std::string id);
|
||||
|
||||
protected:
|
||||
//!Import and initialize a ThermoPhase object using an XML tree.
|
||||
/*!
|
||||
* @internal
|
||||
*
|
||||
* Here we read extra information about the XML description
|
||||
* of a phase. Regular information about elements and species
|
||||
* and their reference state thermodynamic information
|
||||
* have already been read at this point.
|
||||
* For example, we do not need to call this function for
|
||||
* ideal gas equations of state. This function is called from importPhase()
|
||||
* after the elements and the species are initialized with
|
||||
* default ideal solution level data.
|
||||
*
|
||||
* The default implementation in ThermoPhase calls the
|
||||
* virtual function initThermo() and then sets the "state" of the
|
||||
* phase by looking for an XML element named "state", and then
|
||||
* interpreting its contents by calling the virtual function
|
||||
* setStateFromXML().
|
||||
*
|
||||
* @param phaseNode This object must be the phase node of a
|
||||
* complete XML tree
|
||||
* description of the phase, including all of the
|
||||
* species data. In other words while "phase" must
|
||||
* point to an XML phase object, it must have
|
||||
* sibling nodes "speciesData" that describe
|
||||
* the species in the phase.
|
||||
* @param id ID of the phase. If nonnull, a check is done
|
||||
* to see if phaseNode is pointing to the phase
|
||||
* with the correct id.
|
||||
*/
|
||||
virtual void initThermoXML(XML_Node& phaseNode, std::string id);
|
||||
|
||||
//! Initialize the ThermoPhase object after all species have been set up
|
||||
/*!
|
||||
* @internal Initialize.
|
||||
*
|
||||
* This method is provided to allow
|
||||
* subclasses to perform any initialization required after all
|
||||
* species have been added. For example, it might be used to
|
||||
* resize internal work arrays that must have an entry for
|
||||
* each species. The base class implementation does nothing,
|
||||
* and subclasses that do not require initialization do not
|
||||
* need to overload this method. When importing a CTML phase
|
||||
* description, this method is called from ThermoPhase::initThermoXML(),
|
||||
* which is called from importPhase(),
|
||||
* just prior to returning from function importPhase().
|
||||
*
|
||||
* @see importCTML.cpp
|
||||
*/
|
||||
virtual void initThermo();
|
||||
|
||||
//! Set equation of state parameter values from XML entries.
|
||||
/*!
|
||||
*
|
||||
* This method is called by function importPhase() in
|
||||
* file importCTML.cpp when processing a phase definition in
|
||||
* an input file. It should be overloaded in subclasses to set
|
||||
* any parameters that are specific to that particular phase
|
||||
* model. Note, this method is called before the phase is
|
||||
* initialzed with elements and/or species.
|
||||
*
|
||||
* @param eosdata An XML_Node object corresponding to
|
||||
* the "thermo" entry for this phase in the input file.
|
||||
*/
|
||||
virtual void setParametersFromXML(const XML_Node& eosdata);
|
||||
|
||||
protected:
|
||||
|
||||
void Set(int n, double x, double y) const;
|
||||
void setTPXState() const;
|
||||
void check(doublereal v = 0.0) const;
|
||||
void reportTPXError() const;
|
||||
void Set(int n, double x, double y) const;
|
||||
void setTPXState() const;
|
||||
void check(doublereal v = 0.0) const;
|
||||
void reportTPXError() const;
|
||||
|
||||
private:
|
||||
mutable WaterPropsIAPWS *m_sub;
|
||||
int m_subflag;
|
||||
doublereal m_mw;
|
||||
private:
|
||||
mutable WaterPropsIAPWS *m_sub;
|
||||
int m_subflag;
|
||||
doublereal m_mw;
|
||||
|
||||
/**
|
||||
* Offset constants used to obtain consistency with the NIST database.
|
||||
* This is added to all internal energy and enthalpy results.
|
||||
* units = J kmol-1.
|
||||
*/
|
||||
double EW_Offset;
|
||||
/**
|
||||
* Offset constants used to obtain consistency with the NIST database.
|
||||
* This is added to all internal energy and enthalpy results.
|
||||
* units = J kmol-1.
|
||||
*/
|
||||
double EW_Offset;
|
||||
|
||||
/*
|
||||
* Offset constant used to obtain consistency with NIST convention.
|
||||
* This is added to all internal entropy results.
|
||||
* units = J kmol-1 K-1.
|
||||
*/
|
||||
double SW_Offset;
|
||||
/*
|
||||
* Offset constant used to obtain consistency with NIST convention.
|
||||
* This is added to all internal entropy results.
|
||||
* units = J kmol-1 K-1.
|
||||
*/
|
||||
double SW_Offset;
|
||||
|
||||
bool m_verbose;
|
||||
bool m_verbose;
|
||||
|
||||
/**
|
||||
* Since this phase represents a liquid phase, it's an error to
|
||||
* return a gas-phase answer. However, if the below is true, then
|
||||
* a gas-phase answer is allowed. This is used to check the thermodynamic
|
||||
* consistency with ideal-gas thermo functions for example.
|
||||
*/
|
||||
bool m_allowGasPhase;
|
||||
};
|
||||
/**
|
||||
* Since this phase represents a liquid phase, it's an error to
|
||||
* return a gas-phase answer. However, if the below is true, then
|
||||
* a gas-phase answer is allowed. This is used to check the thermodynamic
|
||||
* consistency with ideal-gas thermo functions for example.
|
||||
*/
|
||||
bool m_allowGasPhase;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ EXTRACT_ALL = NO
|
|||
EXTRACT_PRIVATE = YES
|
||||
EXTRACT_STATIC = NO
|
||||
EXTRACT_LOCAL_CLASSES = YES
|
||||
EXTRACT_LOCAL_METHODS = NO
|
||||
EXTRACT_LOCAL_METHODS = YES
|
||||
HIDE_UNDOC_MEMBERS = NO
|
||||
HIDE_UNDOC_CLASSES = NO
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
|
|
@ -104,7 +104,7 @@ FILE_PATTERNS = Kinetics.h Kinetics.cpp \
|
|||
IdealGasPhase.h IdealGasPhase.cpp \
|
||||
SurfPhase.h EdgePhase.h SurfPhase.cpp \
|
||||
SpeciesThermoFactory.h SpeciesThermoFactory.cpp \
|
||||
speciesThermoTypes.h SpeciesThermoMgr.h SpeciesThermo.h SpeciesThermoInterpTypes.h \
|
||||
speciesThermoTypes.h SpeciesThermoMgr.h SpeciesThermo.h SpeciesThermoInterpType.h \
|
||||
NasaThermo.h NasaPoly1.h NasaPoly2.h \
|
||||
ShomateThermo.h ShomatePoly.h SimpleThermo.h \
|
||||
GeneralSpeciesThermo.h GeneralSpeciesThermo.cpp \
|
||||
|
|
@ -118,7 +118,10 @@ FILE_PATTERNS = Kinetics.h Kinetics.cpp \
|
|||
StoichSubstanceSSTP.h StoichSubstanceSSTP.cpp \
|
||||
DebyeHuckel.h DebyeHuckel.cpp \
|
||||
ConstDensityThermo.h ConstDensityThermo.cpp \
|
||||
WaterPropsIAPWSphi.h WaterPropsIAPWSphi.cpp WaterPropsIAPWS.h WaterPropsIAPWS.cpp
|
||||
WaterPropsIAPWSphi.h WaterPropsIAPWSphi.cpp \
|
||||
WaterPropsIAPWS.h WaterPropsIAPWS.cpp \
|
||||
WaterTP.h WaterTP.cpp \
|
||||
PureFluidPhase.h PureFluidPhase.cpp
|
||||
RECURSIVE = NO
|
||||
EXCLUDE = CVS examples converters zeroD
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
\page thermopage Thermodynamic Properties
|
||||
|
||||
Cantera can be used to compute thermodynamic properties of pure
|
||||
%Cantera can be used to compute thermodynamic properties of pure
|
||||
substances, solutions, and mixtures of various types, including ones
|
||||
containing multiple phases. The first step is to create an object that
|
||||
represents each phase.
|
||||
|
|
@ -10,7 +10,8 @@ represents each phase.
|
|||
A simple complete program that creates an object representing a gas mixture and prints its temperature is shown below.
|
||||
\include ex1.cpp
|
||||
|
||||
Class Cantera::ThermoPhase is the base class for Cantera classes that represent
|
||||
Class \link Cantera::ThermoPhase ThermoPhase \endlink
|
||||
is the base class for %Cantera classes that represent
|
||||
phases of matter. It defines the public interface for all classes that
|
||||
represent phases. For example, it specifies that they all have a
|
||||
method \c temperature() that returns the current temperature, a method
|
||||
|
|
@ -72,13 +73,23 @@ The classes that derive from ThermoPhase compute o
|
|||
For example, suppose we want to create a class to use to compute the properties of ideal gas mixtures.
|
||||
|
||||
Many of the methods of ThermoPhase are declared virtual, and are meant to be
|
||||
overloaded in classes derived from ThermoPhase. For example, class IdealGasPhase derives from ThermoPhase, and represents ideal gas mixtures.
|
||||
overloaded in classes derived from ThermoPhase. For example, class \link Cantera::IdealGasPhase IdealGasPhase \endlink
|
||||
derives from ThermoPhase, and represents ideal gas mixtures.
|
||||
|
||||
Although class ThermoPhase defines the interface for all classes
|
||||
representing phases, it only provides implementations for a few of the
|
||||
methods. This is because ThermoPhase does not actually know the
|
||||
equation of state of any phase -- this information is provided by
|
||||
classes that derive from ThermoPhase.
|
||||
The methods implemented by ThermoPhase are ones that apply to all phases, independent of the equation of state. For example, it implements methods temperature() and setTemperature(), since the temperature value is stored internally. Also, the mass density is stored internally, so
|
||||
The methods implemented by ThermoPhase are ones that apply to all phases, independent of
|
||||
the equation of state. For example, it implements methods temperature() and setTemperature(),
|
||||
since the temperature value is stored internally. Also, the mass density is stored internally, so
|
||||
|
||||
There is a list of classes which inherit from the ThermoPhase class (see \ref
|
||||
thermoprops "Thermodynamic Properties")
|
||||
|
||||
There is a list of classes which handle standard states for species (see
|
||||
\ref spthermo "Species Standard-State Thermodynamic Properties").
|
||||
|
||||
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue