Clean up remaining Thermo comments

This commit is contained in:
Ray Speth 2015-11-10 12:19:36 -05:00
parent f8b12adef4
commit fe4035647f
26 changed files with 624 additions and 821 deletions

View file

@ -34,7 +34,7 @@ namespace Cantera
#define DHFORM_BETAIJ 3
#define DHFORM_PITZER_BETAIJ 4
//@}
/*
/*!
* @name Acceptable ways to calculate the value of A_Debye
*/
//@{

View file

@ -14,13 +14,13 @@ namespace Cantera
{
/*!
* @name Types of Element Constraint Equations
*
* There may be several different types of element constraints handled
* by the equilibrium program and by Cantera in other contexts.
* These defines are used to assign each constraint to one category.
* @{
*/
* @name Types of Element Constraint Equations
*
* There may be several different types of element constraints handled by the
* equilibrium program and by Cantera in other contexts. These defines are used
* to assign each constraint to one category.
* @{
*/
//! An element constraint that is current turned off
#define CT_ELEM_TYPE_TURNEDOFF -1
@ -28,9 +28,9 @@ namespace Cantera
//! Normal element constraint consisting of positive coefficients for the
//! formula matrix.
/*!
* All species have positive coefficients within the formula matrix.
* With this constraint, we may employ various strategies to handle
* small values of the element number successfully.
* All species have positive coefficients within the formula matrix. With this
* constraint, we may employ various strategies to handle small values of the
* element number successfully.
*/
#define CT_ELEM_TYPE_ABSPOS 0
@ -48,27 +48,28 @@ namespace Cantera
//! Constraint associated with maintaining a fixed lattice stoichiometry in a solid
/*!
* The constraint may have positive or negative values. The lattice 0 species will
* have negative values while higher lattices will have positive values
* The constraint may have positive or negative values. The lattice 0 species
* will have negative values while higher lattices will have positive values
*/
#define CT_ELEM_TYPE_LATTICERATIO 3
//! Constraint associated with maintaining frozen kinetic equilibria in
//! some functional groups within molecules
/*!
* We seek here to say that some functional groups or ionic states should be
* treated as if they are separate elements given the time scale of the problem.
* This will be abs positive constraint. We have not implemented any examples yet.
* A requirement will be that we must be able to add and subtract these constraints.
* We seek here to say that some functional groups or ionic states should be
* treated as if they are separate elements given the time scale of the problem.
* This will be abs positive constraint. We have not implemented any examples
* yet. A requirement will be that we must be able to add and subtract these
* constraints.
*/
#define CT_ELEM_TYPE_KINETICFROZEN 4
//! Constraint associated with the maintenance of a surface phase
/*!
* We don't have any examples of this yet either. However, surfaces only exist
* because they are interfaces between bulk layers. If we want to treat surfaces
* within thermodynamic systems we must come up with a way to constrain their total
* number.
* We don't have any examples of this yet either. However, surfaces only exist
* because they are interfaces between bulk layers. If we want to treat surfaces
* within thermodynamic systems we must come up with a way to constrain their
* total number.
*/
#define CT_ELEM_TYPE_SURFACECONSTRAINT 5

View file

@ -17,11 +17,10 @@ namespace Cantera
//! A species thermodynamic property manager for a phase.
/*!
* This is a general manager that can handle a wide variety
* of species thermodynamic polynomials for individual species.
* It is slow, however, because it recomputes the functions of
* temperature needed for each species. What it does is to create
* a vector of SpeciesThermoInterpType objects.
* This is a general manager that can handle a wide variety of species
* thermodynamic polynomials for individual species. It is slow, however,
* because it recomputes the functions of temperature needed for each species.
* What it does is to create a vector of SpeciesThermoInterpType objects.
*
* @ingroup mgrsrefcalc
*/
@ -31,18 +30,8 @@ public:
//! Constructor
GeneralSpeciesThermo();
//! Copy constructor
/*!
* @param b Object to be copied
*/
GeneralSpeciesThermo(const GeneralSpeciesThermo& b);
//! Assignment operator
/*!
* @param b Object to be copied
*/
GeneralSpeciesThermo& operator=(const GeneralSpeciesThermo& b);
virtual SpeciesThermo* duplMyselfAsSpeciesThermo() const;
virtual void install_STIT(size_t index,
@ -93,7 +82,6 @@ private:
//! Provide the SpeciesthermoInterpType object
/*!
* @param k species index
*
* @return pointer to the SpeciesThermoInterpType object.
*/
SpeciesThermoInterpType* provideSTIT(size_t k);
@ -103,12 +91,11 @@ protected:
typedef std::pair<size_t, shared_ptr<SpeciesThermoInterpType> > index_STIT;
typedef std::map<int, std::vector<index_STIT> > STIT_map;
typedef std::map<int, vector_fp> tpoly_map;
/**
* This is the main data structure, which contains the
* SpeciesThermoInterpType objects, sorted by the parameterization type.
* `m_sp[i]` is the vector of [species index, STIT] pairs which use
* parameterization `i`.
*/
//! This is the main data structure, which contains the
//! SpeciesThermoInterpType objects, sorted by the parameterization type.
//! `m_sp[i]` is the vector of [species index, STIT] pairs which use
//! parameterization `i`.
STIT_map m_sp;
//! Temperature polynomials for each thermo parameterization
@ -125,8 +112,8 @@ protected:
//! reference pressure (Pa)
doublereal m_p0;
//! Make the class VPSSMgr a friend because we need to access
//! the function provideSTIT()
//! Make the class VPSSMgr a friend because we need to access the function
//! provideSTIT()
friend class VPSSMgr;
};

View file

@ -1281,7 +1281,7 @@ public:
virtual doublereal entropy_mole() const;
/// Molar Gibbs function. Units: J/kmol.
/*
/*!
* (HKM -> Bump up to Parent object)
*/
virtual doublereal gibbs_mole() const;
@ -1289,7 +1289,7 @@ public:
virtual doublereal cp_mole() const;
/// Molar heat capacity at constant volume. Units: J/kmol/K.
/*
/*!
* (HKM -> Bump up to Parent object)
*/
virtual doublereal cv_mole() const;

View file

@ -19,135 +19,119 @@ namespace Cantera
/**
* @defgroup pdssthermo Species Standard-State Thermodynamic Properties
*
* In this module we describe %Cantera's treatment of
* pressure dependent standard states
* (PDSS) objects. These are objects that calculate the standard
* state of a single species that depends on both temperature
* and pressure.
* In this module we describe %Cantera's treatment of pressure dependent
* standard states (PDSS) objects. These are objects that calculate the standard
* state of a single species that depends on both temperature and pressure.
*
* To compute the thermodynamic properties of multicomponent
* solutions, it is necessary to know something about the
* thermodynamic properties of the individual species present in
* the solution. Exactly what sort of species properties are
* required depends on the thermodynamic model for the
* solution. For a gaseous solution (i.e., a gas mixture), the
* species properties required are usually ideal gas properties at
* the mixture temperature and at a reference pressure (almost always at
* 1 bar). For other types of solutions, however, it may
* not be possible to isolate the species in a "pure" state. For
* example, the thermodynamic properties of, say, Na+ and Cl- in
* saltwater are not easily determined from data on the properties
* of solid NaCl, or solid Na metal, or chlorine gas. In this
* case, the solvation in water is fundamental to the identity of
* the species, and some other reference state must be used. One
* common convention for liquid solutions is to use thermodynamic
* data for the solutes in the limit of infinite dilution within the
* pure solvent; another convention is to reference all properties
* to unit molality.
* To compute the thermodynamic properties of multicomponent solutions, it is
* necessary to know something about the thermodynamic properties of the
* individual species present in the solution. Exactly what sort of species
* properties are required depends on the thermodynamic model for the solution.
* For a gaseous solution (i.e., a gas mixture), the species properties required
* are usually ideal gas properties at the mixture temperature and at a
* reference pressure (almost always at 1 bar). For other types of solutions,
* however, it may not be possible to isolate the species in a "pure" state. For
* example, the thermodynamic properties of, say, Na+ and Cl- in saltwater are
* not easily determined from data on the properties of solid NaCl, or solid Na
* metal, or chlorine gas. In this case, the solvation in water is fundamental
* to the identity of the species, and some other reference state must be used.
* One common convention for liquid solutions is to use thermodynamic data for
* the solutes in the limit of infinite dilution within the pure solvent;
* another convention is to reference all properties to unit molality.
*
* In defining these standard states for species in a phase, we make
* the following definition. A reference state is a standard state
* of a species in a phase limited to one particular pressure, the reference
* pressure. The reference state specifies the dependence of all
* thermodynamic functions as a function of the temperature, in
* between a minimum temperature and a maximum temperature. The
* reference state also specifies the molar volume of the species
* as a function of temperature. The molar volume is a thermodynamic
* function.
* A full standard state does the same thing as a reference state,
* but specifies the thermodynamics functions at all pressures.
* In defining these standard states for species in a phase, we make the
* following definition. A reference state is a standard state of a species in a
* phase limited to one particular pressure, the reference pressure. The
* reference state specifies the dependence of all thermodynamic functions as a
* function of the temperature, in between a minimum temperature and a maximum
* temperature. The reference state also specifies the molar volume of the
* species as a function of temperature. The molar volume is a thermodynamic
* function. A full standard state does the same thing as a reference state, but
* specifies the thermodynamics functions at all pressures.
*
* Class PDSS is the base class
* for a family of classes that compute properties of a single
* species in a phase at its standard states, for a range of temperatures
* and pressures.
* Class PDSS is the base class for a family of classes that compute properties
* of a single 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
* 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.
* 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.
* 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
* ideal gas law for their pressure dependence. The manager
* uses a SimpleThermo object to handle the calculation of the
* reference state. This object adds the pressure dependencies
* to the thermo functions.
* - PDSS_IdealGas
* - standardState model = "IdealGas"
* - This model assumes that the species in the phase obeys the ideal gas law
* for their pressure dependence. The manager 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"
* - This model assumes that the species in the phase obeys the
* constant partial molar volume pressure dependence.
* 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_ConstVol
* - standardState model = "ConstVol"
* - This model assumes that the species in the phase obeys the constant
* partial molar volume pressure dependence. 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"
* - standardState model = "temperature_polynomial"
* - standardState model = "density_temperature_polynomial"
* - This model assumes that the species in the phase obey a
* fairly general equation of state, but one that separates out
* the calculation of the standard state density and/or volume.
* 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.
* - PDSS_SSVol
* - standardState model = "constant_incompressible" || model == "constant"
* - standardState model = "temperature_polynomial"
* - standardState model = "density_temperature_polynomial"
* - This model assumes that the species in the phase obey a fairly general
* equation of state, but one that separates out the calculation of the
* standard state density and/or volume. 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.
*
* - 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 assumes that the species is liquid water,
* and not steam.
* - 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
* 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
* - 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.
* 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.
* 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.
*
* 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
*/
@ -157,11 +141,10 @@ class SpeciesThermo;
class VPStandardStateTP;
class VPSSMgr;
//! Virtual base class for a species with a pressure dependent
//! standard state
//! Virtual base class for a species with a pressure dependent standard state
/*!
* Virtual base class for calculation of the
* pressure dependent standard state for a single species
* 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
@ -173,14 +156,14 @@ class VPSSMgr;
* 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.
* 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.
*
* <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
* 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.
@ -202,26 +185,15 @@ public:
//! Constructor that initializes the object by examining the XML entries
//! from the ThermoPhase object
/*!
* This function calls the constructPDSS member function.
* This function calls the constructPDSS member function.
*
* @param tp Pointer to the ThermoPhase object pertaining to the phase
* @param spindex Species index of the species in the phase
* @param tp Pointer to the ThermoPhase object pertaining to the phase
* @param spindex Species index of the species in the phase
*/
PDSS(VPStandardStateTP* tp, size_t spindex);
//! Copy Constructor
/*!
* @param b object to be copied
*/
PDSS(const PDSS& b);
//! Assignment operator
/*!
* @param b Object to be copied
*/
PDSS& operator=(const PDSS& b);
//! Destructor for the phase
virtual ~PDSS() {}
//! Duplication routine for objects which inherit from PDSS
@ -244,7 +216,8 @@ public:
PDSS_enumType reportPDSSType() const;
//! @}
//! @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
@ -409,9 +382,9 @@ public:
//! 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.
* 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)
*/
@ -421,7 +394,7 @@ public:
/*!
* The thermal expansion coefficient is defined as
* \f[
* \beta = \frac{1}{v}\left(\frac{\partial v}{\partial T}\right)_P
* \beta = \frac{1}{v}\left(\frac{\partial v}{\partial T}\right)_P
* \f]
*/
virtual doublereal thermalExpansionCoeff() const;
@ -488,26 +461,26 @@ public:
//! Initialization routine for all of the shallow pointers
/*!
* This is a cascading call, where each level should call the
* the parent level.
* 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.
* The initThermo() routines get called before the initThermoXML() routines
* from the constructPDSSXML() routine.
*
* Calls initPtrs();
* 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.
* 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.
* @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);
@ -572,23 +545,19 @@ protected:
//! ThermoPhase which this species belongs to.
/*!
* Note, in some
* applications (i.e., mostly testing applications, this may be a null
* value. Applications should test whether this is null before usage.
* Note, in some applications (i.e., mostly testing applications, this may
* be a null value. Applications should test whether this is null before
* usage.
*/
VPStandardStateTP* m_tp;
//! Pointer to the VPSS manager for this object
VPSSMgr* m_vpssmgr_ptr;
/**
* Molecular Weight of the species
*/
//! Molecular Weight of the species
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.
@ -600,72 +569,72 @@ protected:
*/
SpeciesThermo* m_spthermo;
//! Reference state enthalpy divided by RT.
//! 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
*/
doublereal* m_h0_RT_ptr;
//! Reference state heat capacity divided by R.
//! 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
*/
doublereal* m_cp0_R_ptr;
//! Reference state entropy divided by R.
//! 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
* Calculated at the current value of T and m_p0
*/
doublereal* m_g0_RT_ptr;
//! Reference state molar volume (m3 kg-1)
//! 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.
//! 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.
//! 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.
//! 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)
//! 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

@ -28,8 +28,8 @@ public:
//! Constructor
/*!
* @param tp Pointer to the ThermoPhase object pertaining to the phase
* @param spindex Species index of the species in the phase
* @param tp Pointer to the ThermoPhase object pertaining to the phase
* @param spindex Species index of the species in the phase
*/
PDSS_ConstVol(VPStandardStateTP* tp, size_t spindex);
@ -42,8 +42,8 @@ public:
* @param spindex Species index of the species in the phase
* @param inputFile String name of the input file
* @param id String name of the phase in the input file. The default
* is the empty string, in which case the first phase in the
* file is used.
* is the empty string, in which case the first phase in
* the file is used.
* @deprecated To be removed after Cantera 2.3.
*/
PDSS_ConstVol(VPStandardStateTP* tp, size_t spindex,
@ -58,28 +58,19 @@ public:
* @param spindex Species index of the species in the phase
* @param speciesNode Reference to the species XML tree.
* @param phaseRef Reference to the XML tree containing the phase information.
* @param spInstalled Boolean indicating whether the species is installed yet
* or not.
* @param spInstalled Boolean indicating whether the species is installed
* yet or not.
*/
PDSS_ConstVol(VPStandardStateTP* vptp_ptr, size_t spindex, const XML_Node& speciesNode,
const XML_Node& phaseRef, bool spInstalled);
//! Copy Constructor
/*!
* @param b Object to be copied
*/
PDSS_ConstVol(const PDSS_ConstVol& b);
//! Assignment operator
/*!
* @param b Object to be copied
*/
PDSS_ConstVol& operator=(const PDSS_ConstVol& b);
virtual PDSS* duplMyselfAsPDSS() const;
//! @}
//! @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
@ -123,19 +114,18 @@ public:
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.
* 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.
* @param id Optional parameter identifying the name of the phase.
* If none is given, the first XML phase element will be
* used.
* @deprecated To be removed after Cantera 2.3.
*/
void constructPDSSFile(VPStandardStateTP* vptp_ptr, size_t spindex,

View file

@ -42,18 +42,6 @@ public:
*/
PDSS_HKFT(VPStandardStateTP* tp, size_t spindex);
//! Copy Constructor
/*!
* @param b object to be copied
*/
PDSS_HKFT(const PDSS_HKFT& b);
//! Assignment operator
/*!
* @param b Object to be copied
*/
PDSS_HKFT& operator=(const PDSS_HKFT& b);
//! Constructor that initializes the object by examining the input file
//! of the ThermoPhase object
/*!
@ -85,9 +73,9 @@ public:
PDSS_HKFT(VPStandardStateTP* vptp_ptr, size_t spindex, const XML_Node& speciesNode,
const XML_Node& phaseRef, bool spInstalled);
//! Destructor for the phase
PDSS_HKFT(const PDSS_HKFT& b);
PDSS_HKFT& operator=(const PDSS_HKFT& b);
virtual ~PDSS_HKFT();
virtual PDSS* duplMyselfAsPDSS() const;
//! @}
@ -152,8 +140,7 @@ public:
* @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.
@ -162,7 +149,7 @@ public:
void constructPDSSFile(VPStandardStateTP* vptp_ptr, size_t spindex,
const std::string& inputFile, const std::string& id);
//! Initialization of a PDSS object using an XML tree
//! Initialization of a PDSS object using an XML tree
/*!
* This routine is a driver for the initialization of the object.
*
@ -205,10 +192,10 @@ public:
* - c[10] = m_omega_pr_tr;
* .
*
* @param kindex Species index
* @param kindex 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 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).
@ -269,7 +256,7 @@ private:
*/
doublereal bg(const doublereal temp, const int ifunc = 0) const;
//! function g appearing in the formulation
//! function g appearing in the formulation
/*!
* Function g appearing in the Johnson et al formulation
*
@ -311,7 +298,7 @@ private:
doublereal gstar(const doublereal temp, const doublereal pres,
const int ifunc = 0) const;
//! Function to look up Element Free Energies
//! 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
@ -333,17 +320,14 @@ private:
void convertDGFormation();
private:
//! Water standard state calculator
//! Water standard state calculator
/*!
* derived from the equation of state for water.
* This object doesn't own the object. Just a shallow pointer.
*/
PDSS_Water* m_waterSS;
//! density of standard-state water
/*!
* internal temporary variable
*/
//! density of standard-state water. internal temporary variable
mutable doublereal m_densWaterSS;
//! Pointer to the water property calculator

View file

@ -35,18 +35,6 @@ public:
*/
PDSS_IdealGas(VPStandardStateTP* tp, int spindex);
//! Copy Constructor
/*!
* @param b Object to be copied
*/
PDSS_IdealGas(const PDSS_IdealGas& b);
//! Assignment operator
/*!
* @param b Object to be copied
*/
PDSS_IdealGas& operator=(const PDSS_IdealGas& b);
//! Constructor that initializes the object by examining the input file
//! of the ThermoPhase object
/*!
@ -56,8 +44,8 @@ public:
* @param spindex Species index of the species in the phase
* @param inputFile String name of the input file
* @param id String name of the phase in the input file. The default
* is the empty string, in which case the first phase in the
* file is used.
* is the empty string, in which case the first phase in
* the file is used.
* @deprecated To be removed after Cantera 2.3.
*/
PDSS_IdealGas(VPStandardStateTP* tp, int spindex,
@ -78,6 +66,8 @@ public:
PDSS_IdealGas(VPStandardStateTP* vptp_ptr, size_t spindex, const XML_Node& speciesNode,
const XML_Node& phaseRef, bool spInstalled);
PDSS_IdealGas(const PDSS_IdealGas& b);
PDSS_IdealGas& operator=(const PDSS_IdealGas& b);
virtual PDSS* duplMyselfAsPDSS() const;
//! @}

View file

@ -33,8 +33,8 @@ public:
//! Constructor
/*!
* @param tp Pointer to the ThermoPhase object pertaining to the phase
* @param spindex Species index of the species in the phase
* @param tp Pointer to the ThermoPhase object pertaining to the phase
* @param spindex Species index of the species in the phase
*/
PDSS_IonsFromNeutral(VPStandardStateTP* tp, size_t spindex);
@ -57,30 +57,20 @@ public:
//! Constructor that initializes the object by examining the input file
//! of the ThermoPhase object
/*!
* This function calls the constructPDSSXML member function.
* This function calls the constructPDSSXML member function.
*
* @param vptp_ptr Pointer to the ThermoPhase object pertaining to the phase
* @param spindex Species index of the species in the phase
* @param speciesNode Reference to the species XML tree.
* @param phaseRef Reference to the XML tree containing the phase information.
* @param spInstalled Boolean indicating whether the species is installed yet
* or not.
* @param vptp_ptr Pointer to the ThermoPhase object pertaining to the phase
* @param spindex Species index of the species in the phase
* @param speciesNode Reference to the species XML tree.
* @param phaseRef Reference to the XML tree containing the phase information.
* @param spInstalled Boolean indicating whether the species is installed
* yet or not.
*/
PDSS_IonsFromNeutral(VPStandardStateTP* vptp_ptr, size_t spindex, const XML_Node& speciesNode,
const XML_Node& phaseRef, bool spInstalled);
//! Copy Constructor
/*!
* @param b Object to be copied
*/
PDSS_IonsFromNeutral(const PDSS_IonsFromNeutral& b);
//! Assignment operator
/*!
* @param b Object to be copied
*/
PDSS_IonsFromNeutral& operator=(const PDSS_IonsFromNeutral& b);
virtual PDSS* duplMyselfAsPDSS() const;
virtual void initAllPtrs(VPStandardStateTP* vptp_ptr, VPSSMgr* vpssmgr_ptr,
SpeciesThermo* spthermo_ptr);
@ -102,10 +92,12 @@ public:
* \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>.
* <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;
virtual doublereal cp_R() const;
@ -152,7 +144,7 @@ public:
void constructPDSSFile(VPStandardStateTP* vptp_ptr, size_t spindex,
const std::string& inputFile, const std::string& id);
//! Initialization of a PDSS object using an XML tree
//! Initialization of a PDSS object using an XML tree
/*!
* This routine is a driver for the initialization of the object.
*
@ -187,15 +179,15 @@ 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
//! Number of neutral molecule species that make up the stoichiometric
//! vector for this species, in terms of calculating thermodynamic functions
size_t numMult_;
//! Vector of species indices in the neutral molecule ThermoPhase
std::vector<size_t> idNeutralMoleculeVec;
//! Stoichiometric coefficient for this species using the Neutral Molecule Species
//! in the vector idNeutralMoleculeVec
//! Stoichiometric coefficient for this species using the Neutral Molecule
//! Species in the vector idNeutralMoleculeVec
vector_fp factorVec;
//! Add 2RTln2 to the entropy and Gibbs free energies for this species

View file

@ -17,20 +17,20 @@
namespace Cantera
{
//! Class for pressure dependent standard states that uses a standard state volume
//! model of some sort.
//! 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.
* 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:
@ -197,18 +197,8 @@ public:
PDSS_SSVol(VPStandardStateTP* vptp_ptr, size_t spindex, const XML_Node& speciesNode,
const XML_Node& phaseRef, bool spInstalled);
//! Copy Constructor
/*!
* @param b Object to be copied
*/
PDSS_SSVol(const PDSS_SSVol& b);
//! Assignment operator
/*!
* @param b Object to be copied
*/
PDSS_SSVol& operator=(const PDSS_SSVol& b);
virtual PDSS* duplMyselfAsPDSS() const;
//! @}

View file

@ -22,29 +22,28 @@ namespace Cantera
//! standard state
/*!
* 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:
* Base state for thermodynamic properties:
*
* Delta_Hfo_gas(298.15) = -241.826 kJ/gmol
* So_gas(298.15, 1bar) = 188.835 J/gmolK
* 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:
*
* (http://webbook.nist.gov)
* Delta_Hfo_gas(298.15) = -241.826 kJ/gmol
* So_gas(298.15, 1bar) = 188.835 J/gmolK
*
* 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:
* (http://webbook.nist.gov)
*
* Ho(1bar) = H(P0)
* 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:
*
* So(1bar) = S(P0) + RT ln(1bar/P0)
* Ho(1bar) = H(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.
* 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.
*
* @ingroup pdssthermo
*/
@ -65,23 +64,11 @@ public:
/*!
* This function calls the constructPDSS member function.
*
* @param tp Pointer to the ThermoPhase object pertaining to the phase
* @param spindex Species index of the species in the phase
* @param tp Pointer to the ThermoPhase object pertaining to the phase
* @param spindex Species index of the species in the phase
*/
PDSS_Water(VPStandardStateTP* tp, int spindex);
//! Copy Constructor
/*!
* @param b object to be copied
*/
PDSS_Water(const PDSS_Water& b);
//! Assignment operator
/*!
* @param b Object to be copied
*/
PDSS_Water& operator=(const PDSS_Water& b);
//! Constructor that initializes the object by examining the input file
//! of the variable pressure ThermoPhase object
/*!
@ -101,25 +88,19 @@ public:
//! Constructor that initializes the object by examining the input file
//! of the variable pressure ThermoPhase object
/*!
* This function calls the constructPDSSXML member function.
* This function calls the constructPDSSXML member function.
*
* @param tp Pointer to the ThermoPhase object pertaining to the phase
* @param spindex Species index of the species in the phase
* @param speciesNode Reference to the species XML tree.
* @param phaseRef Reference to the XML tree containing the phase information.
* @param spInstalled Is the species already installed.
* @param tp Pointer to the ThermoPhase object pertaining to the phase
* @param spindex Species index of the species in the phase
* @param speciesNode Reference to the species XML tree.
* @param phaseRef Reference to the XML tree containing the phase information.
* @param spInstalled Is the species already installed.
*/
PDSS_Water(VPStandardStateTP* tp, int spindex, const XML_Node& speciesNode,
const XML_Node& phaseRef, bool spInstalled);
//! 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.
*
* @return returns a pointer to the base PDSS object type
*/
PDSS_Water(const PDSS_Water& b);
PDSS_Water& operator=(const PDSS_Water& b);
virtual PDSS* duplMyselfAsPDSS() const;
//! @}
@ -144,8 +125,8 @@ public:
//! Returns a reference pressure value that can be safely calculated by the
//! underlying real equation of state for water
/*!
* Note, this function is needed because trying to calculate a one atm
* value around the critical point will cause a crash
* Note, this function is needed because trying to calculate a one atm value
* around the critical point will cause a crash
*
* @param temp Temperature (Kelvin)
*/
@ -169,8 +150,7 @@ public:
//! Set the density of the water phase
/*!
* This is a non-virtual function because it specific
* to this object.
* This is a non-virtual function because it specific to this object.
*
* @param dens Density of the water (kg/m3)
*/
@ -178,7 +158,8 @@ public:
virtual doublereal thermalExpansionCoeff() const;
//! Return the derivative of the volumetric thermal expansion coefficient. Units: 1/K2.
//! Return the derivative of the volumetric thermal expansion coefficient.
//! Units: 1/K2.
/*!
* The thermal expansion coefficient is defined as
* \f[

View file

@ -96,14 +96,8 @@ class Phase
public:
Phase(); //!< Default constructor.
virtual ~Phase(); //!< Destructor.
//! Copy Constructor
//! @param right Reference to the class to be used in the copy
virtual ~Phase();
Phase(const Phase& right);
//! Assignment operator
//! @param right Reference to the class to be used in the copy
Phase& operator=(const Phase& right);
//! Returns a const reference to the XML_Node that describes the phase.

View file

@ -105,6 +105,11 @@ public:
virtual void getChemPotentials(doublereal* mu) const;
doublereal nc() const;
doublereal nv() const;
/*!
* Energy at the top of the conduction band. By default, energies are
* referenced to this energy, and so this function simply returns zero.
*/
doublereal ec() const;
doublereal ev() const;
doublereal bandgap() const {

View file

@ -18,99 +18,92 @@ class SpeciesThermoInterpType;
/**
* @defgroup mgrsrefcalc Managers for Calculating Reference-State Thermodynamics
*
* The ThermoPhase object relies on a set of manager classes to calculate
* the thermodynamic properties of the reference state for all
* of the species in the phase. This may be a computationally
* significant cost, so efficiency is important.
* This group describes how this is done efficiently within Cantera.
* The ThermoPhase object relies on a set of manager classes to calculate the
* thermodynamic properties of the reference state for all of the species in the
* phase. This may be a computationally significant cost, so efficiency is
* important. This group describes how this is done efficiently within Cantera.
*
* To compute the thermodynamic properties of multicomponent
* solutions, it is necessary to know something about the
* thermodynamic properties of the individual species present in
* the solution. Exactly what sort of species properties are
* required depends on the thermodynamic model for the
* solution. For a gaseous solution (i.e., a gas mixture), the
* species properties required are usually ideal gas properties at
* the mixture temperature and at a reference pressure (almost always at
* 1 bar).
* To compute the thermodynamic properties of multicomponent solutions, it is
* necessary to know something about the thermodynamic properties of the
* individual species present in the solution. Exactly what sort of species
* properties are required depends on the thermodynamic model for the solution.
* For a gaseous solution (i.e., a gas mixture), the species properties required
* are usually ideal gas properties at the mixture temperature and at a
* reference pressure (almost always at 1 bar).
*
* In defining these standard states for species in a phase, we make
* the following definition. A reference state is a standard state
* of a species in a phase limited to one particular pressure, the reference
* pressure. The reference state specifies the dependence of all
* thermodynamic functions as a function of the temperature, in
* between a minimum temperature and a maximum temperature. The
* reference state also specifies the molar volume of the species
* as a function of temperature. The molar volume is a thermodynamic
* function. By contrast, a full standard state does the same thing
* as a reference state, but specifies the thermodynamics functions
* at all pressures.
* In defining these standard states for species in a phase, we make the
* following definition. A reference state is a standard state of a species in a
* phase limited to one particular pressure, the reference pressure. The
* reference state specifies the dependence of all thermodynamic functions as a
* function of the temperature, in between a minimum temperature and a maximum
* temperature. The reference state also specifies the molar volume of the
* species as a function of temperature. The molar volume is a thermodynamic
* function. By contrast, a full standard state does the same thing as a
* reference state, but specifies the thermodynamics functions at all pressures.
*
* Whatever the conventions used by a particular solution model,
* means need to be provided to compute the species properties in
* the reference state. Class SpeciesThermo is the base class
* for a family of classes that compute properties of all
* species in a phase in their reference states, for a range of temperatures.
* Note, the pressure dependence of the species thermodynamic functions is not
* handled by this particular species thermodynamic model. SpeciesThermo
* calculates the reference-state thermodynamic values of all species in a single
* phase during each call. The vector nature of the operation leads to
* a lower operation count and better efficiency, especially if the
* individual reference state classes are known to the reference-state
* manager class so that common operations may be grouped together.
* Whatever the conventions used by a particular solution model, means need to
* be provided to compute the species properties in the reference state. Class
* SpeciesThermo is the base class for a family of classes that compute
* properties of all species in a phase in their reference states, for a range
* of temperatures. Note, the pressure dependence of the species thermodynamic
* functions is not handled by this particular species thermodynamic model.
* SpeciesThermo calculates the reference-state thermodynamic values of all
* species in a single phase during each call. The vector nature of the
* operation leads to a lower operation count and better efficiency, especially
* if the individual reference state classes are known to the reference-state
* manager class so that common operations may be grouped together.
*
* The most important member function for the SpeciesThermo class
* is the member function \link SpeciesThermo::update() update()\endlink.
* The function calculates the values of Cp, H, and S for all of the
* species at once at the specified temperature.
* The most important member function for the SpeciesThermo class is the member
* function \link SpeciesThermo::update() update()\endlink. The function
* calculates the values of Cp, H, and S for all of the species at once at the
* specified temperature.
*
* Usually, all of the species in a phase are installed into a SpeciesThermo
* class. However, there is no requirement that a SpeciesThermo
* object handles all of the species in a phase. The member function
* \link SpeciesThermo::install_STIT() install_STIT()\endlink
* is called to install each species into the SpeciesThermo object.
* Usually, all of the species in a phase are installed into a SpeciesThermo
* class. However, there is no requirement that a SpeciesThermo object handles
* all of the species in a phase. The member function
* \link SpeciesThermo::install_STIT() install_STIT()\endlink
* is called to install each species into the SpeciesThermo object.
*
* The following classes inherit from SpeciesThermo. Each of these classes
* handle multiple species, usually all of the species in a phase. However,
* there is no requirement that a SpeciesThermo object handles all of the
* species in a phase.
* The following classes inherit from SpeciesThermo. Each of these classes
* handle multiple species, usually all of the species in a phase. However,
* there is no requirement that a SpeciesThermo object handles all of the
* species in a phase.
*
* - GeneralSpeciesThermo in file GeneralSpeciesThermo.h
* - This is a general model. Each species is handled separately
* via a vector over SpeciesThermoInterpType classes.
* - GeneralSpeciesThermo in file GeneralSpeciesThermo.h
* - This is a general model. Each species is handled separately
* via a vector over SpeciesThermoInterpType classes.
*
* The class SpeciesThermoInterpType is a pure virtual base class for
* calculation of thermodynamic functions for a single species
* in its reference state.
* The following classes inherit from SpeciesThermoInterpType.
* calculation of thermodynamic functions for a single species in its reference
* state. The following classes inherit from SpeciesThermoInterpType.
*
* - NasaPoly1 in file NasaPoly1.h
* - This is a one zone model, consisting of a 7
* coefficient NASA Polynomial format.
* - NasaPoly1 in file NasaPoly1.h
* - This is a one zone model, consisting of a 7 coefficient NASA Polynomial
* format.
* - NasaPoly2 in file NasaPoly2.h
* - This is a two zone model, with each zone consisting of a 7
* coefficient NASA Polynomial format.
* - This is a two zone model, with each zone consisting of a 7 coefficient
* NASA Polynomial format.
* - ShomatePoly in file ShomatePoly.h
* - This is a one zone model, consisting of a 7
* coefficient Shomate Polynomial format.
* - This is a one zone model, consisting of a 7 coefficient Shomate
* Polynomial format.
* - ShomatePoly2 in file ShomatePoly.h
* - This is a two zone model, with each zone consisting of a 7
* coefficient Shomate Polynomial format.
* - This is a two zone model, with each zone consisting of a 7 coefficient
* Shomate Polynomial format.
* - ConstCpPoly in file ConstCpPoly.h
* - This is a one-zone constant heat capacity model.
* - This is a one-zone constant heat capacity model.
* - Mu0Poly in file Mu0Poly.h
* - This is a multi-zone model. The chemical potential is given
* at a set number of temperatures. Between each temperature
* the heat capacity is treated as a constant.
* - This is a multi-zone model. The chemical potential is given at a set
* number of temperatures. Between each temperature the heat capacity is
* treated as a constant.
* - Nasa9Poly1 in file Nasa9Poly1.h
* - This is a one zone model, consisting of the 9
* coefficient NASA Polynomial format.
* - This is a one zone model, consisting of the 9 coefficient NASA
* Polynomial format.
* - Nasa9PolyMultiTempRegion in file Nasa9PolyMultiTempRegion.h
* - This is a multiple zone model, consisting of the 9
* coefficient NASA Polynomial format in each zone.
* - This is a multiple zone model, consisting of the 9 coefficient NASA
* Polynomial format in each zone.
*
* The GeneralSpeciesThermo SpeciesThermo object is completely general. It
* does not try to coordinate the individual species calculations at all and
* The GeneralSpeciesThermo SpeciesThermo object is completely general. It does
* not try to coordinate the individual species calculations at all and
* therefore is the slowest but most general implementation.
*
* @ingroup thermoprops
@ -119,7 +112,7 @@ class SpeciesThermoInterpType;
//! Pure Virtual base class for the species thermo manager classes.
/*!
* This class defines the interface which all subclasses must implement.
* This class defines the interface which all subclasses must implement.
*
* Class SpeciesThermo is the base class for a family of classes that compute
* properties of a set of species in their reference state at a range of
@ -129,22 +122,18 @@ class SpeciesThermoInterpType;
class SpeciesThermo
{
public:
//! Constructor
SpeciesThermo() {}
//! Destructor
virtual ~SpeciesThermo() {}
//! Duplication routine for objects derived from SpeciesThermo
/*!
* This function can be used to duplicate objects derived from
* SpeciesThermo even if the application only has a pointer to
* SpeciesThermo to work with.
* This function can be used to duplicate objects derived from SpeciesThermo
* even if the application only has a pointer to SpeciesThermo to work with.
*/
virtual SpeciesThermo* duplMyselfAsSpeciesThermo() const = 0;
//! Install a new species thermodynamic property
//! parameterization for one species.
//! Install a new species thermodynamic property parameterization for one
//! species.
/*!
* @param index Index of the species being installed
* @param stit Pointer to the SpeciesThermoInterpType object
@ -169,8 +158,8 @@ public:
//! Like update(), but only updates the single species k.
/*!
* The default treatment is to just call update() which means that
* potentially the operation takes a m_kk*m_kk hit.
* The default treatment is to just call update() which means that
* potentially the operation takes a m_kk*m_kk hit.
*
* @param k species index
* @param T Temperature (Kelvin)
@ -219,8 +208,8 @@ public:
*/
virtual doublereal refPressure(size_t k=npos) const =0;
//! This utility function reports the type of parameterization
//! used for the species with index number *index*.
//! This utility function reports the type of parameterization used for the
//! species with index number *index*.
/*!
* @param index Species index
*/
@ -243,25 +232,28 @@ public:
doublereal& maxTemp,
doublereal& refPressure) const =0;
//! Report the 298 K Heat of Formation of the standard state of one species (J kmol-1)
//! Report the 298 K Heat of Formation of the standard state of one species
//! (J kmol-1)
/*!
* The 298K Heat of Formation is defined as the enthalpy change to create the standard state
* of the species from its constituent elements in their standard states at 298 K and 1 bar.
* The 298K Heat of Formation is defined as the enthalpy change to create
* the standard state of the species from its constituent elements in their
* standard states at 298 K and 1 bar.
*
* @param k species index
* @return Returns the current value of the Heat of Formation at 298K and 1 bar
* @param k species index
* @returns the current value of the Heat of Formation at 298K and 1 bar
*/
virtual doublereal reportOneHf298(const size_t k) const = 0;
//! Modify the value of the 298 K Heat of Formation of the standard state of
//! one species in the phase (J kmol-1)
//! Modify the value of the 298 K Heat of Formation of the standard state of
//! one species in the phase (J kmol-1)
/*!
* The 298K heat of formation is defined as the enthalpy change to create the standard state
* of the species from its constituent elements in their standard states at 298 K and 1 bar.
* The 298K heat of formation is defined as the enthalpy change to create
* the standard state of the species from its constituent elements in their
* standard states at 298 K and 1 bar.
*
* @param k Index of the species
* @param Hf298New Specify the new value of the Heat of Formation at 298K and 1 bar.
* units = J/kmol.
* @param k Index of the species
* @param Hf298New Specify the new value of the Heat of Formation at
* 298K and 1 bar. units = J/kmol.
*/
virtual void modifyOneHf298(const size_t k, const doublereal Hf298New) = 0;
@ -273,7 +265,8 @@ protected:
void markInstalled(size_t k);
private:
std::vector<bool> m_installed; // indicates if data for species has been installed
//! indicates if data for species has been installed
std::vector<bool> m_installed;
};
//@}
}

View file

@ -16,10 +16,10 @@ namespace Cantera
{
/*!
* @addtogroup thermoprops
* @addtogroup thermoprops
*
* Standard ThermoPhase objects may be instantiated by calling
* the main %Cantera factory class for ThermoPhase objects; This class is called ThermoFactory.
* Standard ThermoPhase objects may be instantiated by calling the main %Cantera
* factory class for ThermoPhase objects; This class is called ThermoFactory.
*/
//@{
@ -71,11 +71,9 @@ public:
//! Create a new thermodynamic property manager.
/*!
* @param model String to look up the model against
* @return
* Returns a pointer to a new ThermoPhase instance matching the
* model string. Returns NULL if something went wrong.
* Throws an exception UnknownThermoPhaseModel if the string
* wasn't matched.
* @returns a pointer to a new ThermoPhase instance matching the model
* string. Returns NULL if something went wrong. Throws an exception
* UnknownThermoPhaseModel if the string wasn't matched.
*/
virtual ThermoPhase* newThermoPhase(const std::string& model);
@ -90,15 +88,13 @@ private:
static std::mutex thermo_mutex;
};
//! Create a new thermo manager instance.
//! Create a new thermo manager instance.
/*!
* @param model String to look up the model against
* @param f ThermoFactory instance to use in matching the string
* @return
* Returns a pointer to a new ThermoPhase instance matching the
* model string. Returns NULL if something went wrong.
* Throws an exception UnknownThermoPhaseModel if the string
* wasn't matched.
* @returns a pointer to a new ThermoPhase instance matching the model string.
* Returns NULL if something went wrong. Throws an exception
* UnknownThermoPhaseModel if the string wasn't matched.
*/
inline ThermoPhase* newThermoPhase(const std::string& model,
ThermoFactory* f=0)
@ -111,16 +107,13 @@ inline ThermoPhase* newThermoPhase(const std::string& model,
//! Translate the eosType id into a string
/*!
* Returns a string representation of the eosType id for a phase.
* @param ieos eosType id of the phase. This is unique for the phase
* @param length maximum length of the return string. Defaults to 100
*
* @return returns a string representation.
* @returns a string representation of the eosType id for a phase
*/
std::string eosTypeString(int ieos, int length = 100);
//! Create a new ThermoPhase object and initializes it according to the XML
//! tree.
//! Create a new ThermoPhase object and initializes it according to the XML tree
/*!
* This routine first looks up the identity of the model for the solution
* thermodynamics in the model attribute of the thermo child of the XML phase
@ -139,81 +132,70 @@ ThermoPhase* newPhase(XML_Node& phase);
//! Create and Initialize a ThermoPhase object from an XML input file.
/*!
* This routine is a wrapper around the newPhase(XML_Node) routine
* which does the work. The wrapper locates the input phase XML_Node
* in a file, and then instantiates the object, returning the pointer
* to the ThermoPhase object.
* This routine is a wrapper around the newPhase(XML_Node) routine which does
* the work. The wrapper locates the input phase XML_Node in a file, and then
* instantiates the object, returning the pointer to the ThermoPhase object.
*
* @param infile name of the input file
* @param id name of the phase id in the file.
* If this is blank, the first phase in the file is used.
* @return
* Returns an initialized ThermoPhase object.
* @returns an initialized ThermoPhase object.
*/
ThermoPhase* newPhase(const std::string& infile, std::string id="");
//! Import a phase information into an empty ThermoPhase object
/*!
* Here we read an XML description of the thermodynamic information
* for a phase. At the end of this routine, the phase should
* be ready to be used within applications. This routine contains
* some key routines that are used as pass back routines so that
* the phase (and the contents of the XML file) may contain
* variable parameterizations for the specification of the
* species standard states, the equation of state, and the
* specification of other nonidealities. Below, a description
* is presented of the main algorithm for bringing up a ThermoPhase
* object, with care to present points where customizations
* occur.
* Here we read an XML description of the thermodynamic information for a phase.
* At the end of this routine, the phase should be ready to be used within
* applications. This routine contains some key routines that are used as pass
* back routines so that the phase (and the contents of the XML file) may
* contain variable parameterizations for the specification of the species
* standard states, the equation of state, and the specification of other
* nonidealities. Below, a description is presented of the main algorithm for
* bringing up a ThermoPhase object, with care to present points where
* customizations occur.
*
* Before invoking this routine, either the ThermoPhase Factory routines
* are called or direct constructor routines are called that
* instantiate an inherited ThermoPhase object. This object is input
* to this routine, and therefore contains inherited routines that
* drive the customization of the initialization process.
* Before invoking this routine, either the ThermoPhase Factory routines are
* called or direct constructor routines are called that instantiate an
* inherited ThermoPhase object. This object is input to this routine, and
* therefore contains inherited routines that drive the customization of the
* initialization process.
*
* At the start of the routine, we import descriptions of the elements
* that make up the species in a phase.
* At the start of the routine, we import descriptions of the elements that make
* up the species in a phase.
*
* We call setParametersFromXML(eos) to read parameters about
* the thermo phase before the species are read in.
* We call setParametersFromXML(eos) to read parameters about the thermo phase
* before the species are read in.
*
* We call addElementsFromXML() to add elements into the
* description of the phase.
* We call addElementsFromXML() to add elements into the description of the
* phase.
*
* We create a new species thermo manager. Function
* 'newSpeciesThermoMgr' looks at the species in the database
* to see what thermodynamic property parameterizations are
* used, and selects a class that can handle the
* parameterizations found.
* We create a new species thermo manager. Function 'newSpeciesThermoMgr' looks
* at the species in the database to see what thermodynamic property
* parameterizations are used, and selects a class that can handle the
* parameterizations found.
*
* We import information about the species, including their
* reference state thermodynamic polynomials. We then freeze
* the state of the species in the element.
* We import information about the species, including their reference state
* thermodynamic polynomials. We then freeze the state of the species in the
* element.
*
* Finally, we call initThermoXML(),
* a member function of the ThermoPhase object, to "finish"
* the description. Now that the species are known,
* additional information may be read in about the thermodynamics
* of the phase, (e.g., virial coefficients, which are
* binary or ternary interaction parameters between species).
* Finally, we call initThermoXML(), a member function of the ThermoPhase
* object, to "finish" the description. Now that the species are known,
* additional information may be read in about the thermodynamics of the phase,
* (e.g., virial coefficients, which are binary or ternary interaction
* parameters between species).
*
* @param phase 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 th Pointer to the ThermoPhase object which will
* handle the thermodynamics for this phase.
* We initialize part of the ThermoPhase object
* here, especially for those objects which are
* part of the Cantera Kernel.
*
* @param spfactory species Thermo factory pointer, if
* available. If not available, one will be
* created.
* @param phase 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 th Pointer to the ThermoPhase object which will handle the
* thermodynamics for this phase. We initialize part of the
* ThermoPhase object here, especially for those objects which are
* part of the Cantera Kernel.
* @param spfactory species Thermo factory pointer, if available. If not
* available, one will be created.
* @ingroup thermoprops
*/
void importPhase(XML_Node& phase, ThermoPhase* th);
@ -223,10 +205,9 @@ void installElements(Phase& th, const XML_Node& phaseNode);
//! Search an XML tree for species data.
/*!
* This utility routine will search the XML tree for the species
* named by the string, kname. It will return the XML_Node
* pointer to the species data for that species.
* Failures of any kind return the null pointer.
* This utility routine will search the XML tree for the species named by the
* string, kname. It will return the XML_Node pointer to the species data for
* that species. Failures of any kind return the null pointer.
*
* @param kname String containing the name of the species.
* @param phaseSpeciesData Pointer to the XML speciesData element

View file

@ -92,25 +92,12 @@ const int cSS_CONVENTION_SLAVE = 2;
class ThermoPhase : public Phase
{
public:
//! Constructor. Note that ThermoPhase is meant to be used as
//! a base class, so this constructor should not be called
//! explicitly.
//! Constructor. Note that ThermoPhase is meant to be used as a base class,
//! so this constructor should not be called explicitly.
ThermoPhase();
//! Destructor. Deletes the species thermo manager.
virtual ~ThermoPhase();
//!Copy Constructor for the ThermoPhase object.
/*!
* @param right ThermoPhase to be copied
*/
ThermoPhase(const ThermoPhase& right);
//! Assignment operator
/*!
* @param right Reference to ThermoPhase object to be copied into the
* current one.
*/
ThermoPhase& operator=(const ThermoPhase& right);
//! Duplication routine for objects which inherit from ThermoPhase.

View file

@ -37,12 +37,11 @@ class PDSS_Water;
* the electric potential of phase *p*.
*
* The potential \f$ \phi_p \f$ is tracked and internally stored within the
* base ThermoPhase object. It constitutes a specification of the internal
* state of the phase; it's the third state variable, the first two being
* temperature and density (or, pressure, for incompressible equations of
* state). It may be set with the function,
* ThermoPhase::setElectricPotential(), and may be queried with the function
* ThermoPhase::electricPotential().
* base ThermoPhase object. It constitutes a specification of the internal state
* of the phase; it's the third state variable, the first two being temperature
* and density (or, pressure, for incompressible equations of state). It may be
* set with the function, ThermoPhase::setElectricPotential(), and may be
* queried with the function ThermoPhase::electricPotential().
*
* Note, the overall electrochemical potential of a phase may not be changed
* by the potential because many phases enforce charge neutrality:
@ -84,11 +83,11 @@ class PDSS_Water;
//! The WaterProps class is used to house several approximation routines for
//! properties of water.
/*!
* The class is also a wrapper around the WaterPropsIAPWS class which
* provides the calculations for the equation of state properties for water.
* The class is also a wrapper around the WaterPropsIAPWS class which provides
* the calculations for the equation of state properties for water.
*
* In particular, this class house routine for the calculation
* of the dielectric constant of water
* In particular, this class house routine for the calculation of the dielectric
* constant of water
*
* Most if not all of the member functions are static.
*/
@ -110,20 +109,15 @@ public:
*/
WaterProps(PDSS_Water* wptr);
//! Copy Constructor
WaterProps(const WaterProps& b);
//! destructor
virtual ~WaterProps();
//! Assignment operator
WaterProps& operator=(const WaterProps& b);
//! Simple calculation of water density at atmospheric pressure.
//! Valid up to boiling point.
/*!
* This formulation has no dependence on the pressure and shouldn't
* be used where accuracy is needed.
* This formulation has no dependence on the pressure and shouldn't be used
* where accuracy is needed.
*
* @param T temperature in kelvin
* @param P Pressure in pascal
@ -145,70 +139,62 @@ public:
//! Bradley-Pitzer equation for the dielectric constant
//! of water as a function of temperature and pressure.
/*!
* Returns the dimensionless relative dielectric constant
* and its derivatives.
* Returns the dimensionless relative dielectric constant and its
* derivatives.
*
* Range of validity: 0 to 350C, 0 to 1 kbar pressure
*
* @param T temperature (kelvin)
* @param P_pascal pressure in pascal
* @param ifunc changes what's returned from the function
*
* @return Depends on the value of ifunc:
* - ifunc = 0 return value
* - ifunc = 1 return temperature derivative
* - ifunc = 2 return temperature second derivative
* - ifunc = 3 return pressure first derivative
*
* Validation:
* Numerical experiments indicate that this function agrees with
* the Archer and Wang data in the CRC p. 6-10 to all 4 significant
* digits shown (0 to 100C).
* Validation: Numerical experiments indicate that this function agrees with
* the Archer and Wang data in the CRC p. 6-10 to all 4 significant digits
* shown (0 to 100C).
*
* value at 25C and 1 atm, relEps = 78.38
* value at 25C and 1 atm, relEps = 78.38
*/
doublereal relEpsilon(doublereal T, doublereal P_pascal, int ifunc = 0);
//! ADebye calculates the value of A_Debye as a function
//! of temperature and pressure according to relations
//! that take into account the temperature and pressure
//! dependence of the water density and dielectric constant.
//! ADebye calculates the value of A_Debye as a function of temperature and
//! pressure according to relations that take into account the temperature
//! and pressure dependence of the water density and dielectric constant.
/*!
* The A_Debye expression appears on the top of the
* ln actCoeff term in the general Debye-Huckel expression
* It depends on temperature and pressure. And, therefore,
* most be recalculated whenever T or P changes.
* The units returned by this expression are sqrt(kg/gmol).
* The A_Debye expression appears on the top of the ln actCoeff term in the
* general Debye-Huckel expression It depends on temperature and pressure.
* And, therefore, most be recalculated whenever T or P changes. The units
* returned by this expression are sqrt(kg/gmol).
*
* \f[
* A_{Debye} = \frac{1}{8 \pi} \sqrt{\frac{2 N_{Avog} \rho_w}{1000}}
* {\left(\frac{e^2}{\epsilon k_{boltz} T}\right)}^{\frac{3}{2}}
* \f]
* \f[
* A_{Debye} = \frac{1}{8 \pi} \sqrt{\frac{2 N_{Avog} \rho_w}{1000}}
* {\left(\frac{e^2}{\epsilon k_{boltz} T}\right)}^{\frac{3}{2}}
* \f]
*
* Nominal value at 25C and 1atm = 1.172576 sqrt(kg/gmol).
* Nominal value at 25C and 1atm = 1.172576 sqrt(kg/gmol).
*
* Based on:
* Based on:
* - epsilon/epsilon_0 = 78.54 (water at 25C)
* - T = 298.15 K
* - B_Debye = 3.28640E9 sqrt(kg/gmol)/m
*
* @param T Temperature (kelvin)
* @param P pressure (pascal)
* @param ifunc Changes what's returned from the routine
*
* @param T Temperature (kelvin)
* @param P pressure (pascal)
* @param ifunc Changes what's returned from the routine
* @return Returns a single doublereal whose meaning depends on ifunc:
* - ifunc = 0 return value
* - ifunc = 1 return temperature derivative
* - ifunc = 2 return temperature second derivative
* - ifunc = 3 return pressure first derivative
*
* Verification:
*
* With the epsRelWater value from the Bradley-Pitzer relation,
* and the water density from the density_IAPWS() function,
* The A_Debye computed with this function agrees with
* the Pitzer table p. 99 to 4 significant digits at 25C.
* and 20C. (Aphi = ADebye/3)
* Verification: With the epsRelWater value from the Bradley-Pitzer
* relation, and the water density from the density_IAPWS() function, The
* A_Debye computed with this function agrees with the Pitzer table p. 99 to
* 4 significant digits at 25C. and 20C. (Aphi = ADebye/3)
*/
doublereal ADebye(doublereal T, doublereal P, int ifunc);
@ -231,15 +217,14 @@ public:
//! Returns the density of water
/*!
* This function uses the internal state of the
* underlying water object
* This function uses the internal state of the underlying water object
*/
doublereal density_IAPWS() const;
//! returns the coefficient of thermal expansion
/*!
* @param T Temperature (kelvin)
* @param P pressure (pascal)
* @param T Temperature (kelvin)
* @param P pressure (pascal)
*/
doublereal coeffThermalExp_IAPWS(doublereal T, doublereal P);
@ -253,34 +238,34 @@ public:
//! Returns the viscosity of water at the current conditions
//! (kg/m/s)
/*!
* This function calculates the value of the viscosity of pure
* water at the current T and P.
* This function calculates the value of the viscosity of pure water at the
* current T and P.
*
* The formulas used are from the paper
* J. V. Sengers, J. T. R. Watson, "Improved International
* Formulations for the Viscosity and Thermal Conductivity of
* Water Substance", J. Phys. Chem. Ref. Data, 15, 1291 (1986).
* The formulas used are from the paper: J. V. Sengers, J. T. R. Watson,
* "Improved International Formulations for the Viscosity and Thermal
* Conductivity of Water Substance", J. Phys. Chem. Ref. Data, 15, 1291
* (1986).
*
* The formulation is accurate for all temperatures and pressures,
* for steam and for water, even near the critical point.
* Pressures above 500 MPa and temperature above 900 C are suspect.
* The formulation is accurate for all temperatures and pressures, for steam
* and for water, even near the critical point. Pressures above 500 MPa and
* temperature above 900 C are suspect.
*/
doublereal viscosityWater() const;
//! Returns the thermal conductivity of water at the current conditions
//! (W/m/K)
/*!
* This function calculates the value of the thermal conductivity of
* water at the current T and P.
* This function calculates the value of the thermal conductivity of
* water at the current T and P.
*
* The formulas used are from the paper
* J. V. Sengers, J. T. R. Watson, "Improved International
* Formulations for the Viscosity and Thermal Conductivity of
* Water Substance", J. Phys. Chem. Ref. Data, 15, 1291 (1986).
* The formulas used are from the paper: J. V. Sengers, J. T. R. Watson,
* "Improved International Formulations for the Viscosity and Thermal
* Conductivity of Water Substance", J. Phys. Chem. Ref. Data, 15, 1291
* (1986).
*
* The formulation is accurate for all temperatures and pressures,
* for steam and for water, even near the critical point.
* Pressures above 500 MPa and temperature above 900 C are suspect.
* The formulation is accurate for all temperatures and pressures, for steam
* and for water, even near the critical point. Pressures above 500 MPa and
* temperature above 900 C are suspect.
*/
doublereal thermalConductivityWater() const;

View file

@ -17,14 +17,14 @@
namespace Cantera
{
/**
* @name Names for the phase regions
* @name Names for the phase regions
*
* These constants are defined and used in the interface
* to describe the location of where we are in (T,rho) space.
* These constants are defined and used in the interface to describe the
* location of where we are in (T,rho) space.
*
* WATER_UNSTABLELIQUID indicates that we are in the unstable region, inside the
* spinodal curve where dpdrho < 0.0 amonst other properties. The difference
* between WATER_UNSTABLELIQUID and WATER_UNSTABLEGAS is that
* WATER_UNSTABLELIQUID indicates that we are in the unstable region, inside the
* spinodal curve where dpdrho < 0.0 amonst other properties. The difference
* between WATER_UNSTABLELIQUID and WATER_UNSTABLEGAS is that
* for WATER_UNSTABLELIQUID d2pdrho2 > 0 and dpdrho < 0.0
* for WATER_UNSTABLEGAS d2pdrho2 < 0 and dpdrho < 0.0
*/
@ -161,10 +161,7 @@ public:
//! Base constructor
WaterPropsIAPWS();
//! Copy constructor
WaterPropsIAPWS(const WaterPropsIAPWS& right);
//! assignment constructor
WaterPropsIAPWS& operator=(const WaterPropsIAPWS& right);
//! Set the internal state of the object wrt temperature and density
@ -182,8 +179,8 @@ public:
//! using the last temperature and density
doublereal Gibbs() const;
//! Calculate the enthalpy in mks units of J kmol-1
//! using the last temperature and density
//! Calculate the enthalpy in mks units of J kmol-1
//! using the last temperature and density
doublereal enthalpy() const;
//! Calculate the internal energy in mks units of J kmol-1
@ -200,8 +197,8 @@ public:
//! at the last temperature and density
doublereal cp() const;
//! Calculate the molar volume (kmol m-3)
//! at the last temperature and density
//! Calculate the molar volume (kmol m-3) at the last temperature and
//! density
doublereal molarVolume() const;
//! Calculates the pressure (Pascals), given the current value of the
@ -209,8 +206,7 @@ public:
/*!
* The density is an independent variable in the underlying equation of state
*
* @return
* returns the pressure (Pascal)
* @returns the pressure (Pascal)
*/
doublereal pressure() const;
@ -231,15 +227,12 @@ public:
* WaterPropsIAPWSphi::dfind(), which does the iterative calculation to
* find the density condition that matches the desired input pressure.
*
* @param temperature: Kelvin
* @param pressure : Pressure in Pascals (Newton/m**2)
* @param phase : guessed phase of water
* : -1: no guessed phase
* @param rhoguess : guessed density of the water
* : -1.0 no guessed density
* @return
* Returns the density. If an error is encountered in the calculation
* the value of -1.0 is returned.
* @param temperature Kelvin
* @param pressure Pressure in Pascals (Newton/m**2)
* @param phase guessed phase of water; -1: no guessed phase
* @param rhoguess guessed density of the water; -1.0 no guessed density
* @returns the density. If an error is encountered in the calculation the
* value of -1.0 is returned.
*/
doublereal density(doublereal temperature, doublereal pressure,
int phase = -1, doublereal rhoguess = -1.0);
@ -247,7 +240,7 @@ public:
//! Calculates the density given the temperature and the pressure,
//! and a guess at the density, while not changing the internal state
/*!
* Note, below T_c, this is a multivalued function.
* Note, below T_c, this is a multivalued function.
*
* The density() function calculates the density that is consistent with a
* particular value of the temperature and pressure. It may therefore be
@ -261,14 +254,11 @@ public:
* WaterPropsIAPWSphi::dfind(), which does the iterative calculation to
* find the density condition that matches the desired input pressure.
*
* @param pressure : Pressure in Pascals (Newton/m**2)
* @param phase : guessed phase of water
* : -1: no guessed phase
* @param rhoguess : guessed density of the water
* : -1.0 no guessed density
* @return
* Returns the density. If an error is encountered in the calculation
* the value of -1.0 is returned.
* @param pressure Pressure in Pascals (Newton/m**2)
* @param phase guessed phase of water; -1: no guessed phase
* @param rhoguess guessed density of the water; -1.0: no guessed density
* @returns the density. If an error is encountered in the calculation the
* value of -1.0 is returned.
*/
doublereal density_const(doublereal pressure, int phase = -1, doublereal rhoguess = -1.0) const;
@ -276,55 +266,50 @@ public:
/*!
* The density is an independent variable in the underlying equation of state
*
* @return Returns the density (kg m-3)
* @returns the density (kg m-3)
*/
doublereal density() const;
//! Returns the temperature (Kelvin)
/*!
* @return Returns the internally stored temperature
* @return s the internally stored temperature
*/
doublereal temperature() const;
//! Returns the coefficient of thermal expansion.
/*!
* alpha = d (ln V) / dT at constant P.
* alpha = d (ln V) / dT at constant P.
*
* @return
* Returns the coefficient of thermal expansion
* @returns the coefficient of thermal expansion
*/
doublereal coeffThermExp() const;
//! Returns the isochoric pressure derivative wrt temperature
/*!
* beta = M / (rho * Rgas) (d (pressure) / dT) at constant rho
* beta = M / (rho * Rgas) (d (pressure) / dT) at constant rho
*
* Note for ideal gases this is equal to one.
* Note for ideal gases this is equal to one.
*
* beta = delta (phi0_d() + phiR_d())
* - tau delta (phi0_dt() + phiR_dt())
* beta = delta (phi0_d() + phiR_d()) - tau delta (phi0_dt() + phiR_dt())
*/
doublereal coeffPresExp() const;
//! Returns the coefficient of isothermal compressibility for the
//! state of the object
//! Returns the coefficient of isothermal compressibility for the state of
//! the object
/*!
* kappa = - d (ln V) / dP at constant T.
* kappa = - d (ln V) / dP at constant T.
*
* units - 1/Pascal
* units - 1/Pascal
*
* @return
* returns the isothermal compressibility
* @returns the isothermal compressibility
*/
doublereal isothermalCompressibility() const;
//! Returns the value of dp / drho at constant T for the
//! state of the object
//! Returns the value of dp / drho at constant T for the state of the object
/*!
* units - Joules / kg
*
* @return
* returns dpdrho
* @returns dpdrho
*/
doublereal dpdrho() const;
@ -335,8 +320,7 @@ public:
*
* @param temperature Input temperature (Kelvin)
*
* @return
* Returns the estimated saturation pressure
* @returns the estimated saturation pressure
*/
doublereal psat_est(doublereal temperature) const;
@ -344,33 +328,32 @@ public:
//! an input parameter, and sets the internal state to the saturated
//! conditions.
/*!
* Note this function will return the saturation pressure, given the
* temperature. It will then set the state of the system to the
* saturation condition. The input parameter waterState is used to either
* specify the liquid state or the gas state at the desired temperature
* and saturated pressure.
* Note this function will return the saturation pressure, given the
* temperature. It will then set the state of the system to the saturation
* condition. The input parameter waterState is used to either specify the
* liquid state or the gas state at the desired temperature and saturated
* pressure.
*
* If the input temperature, T, is above T_c, this routine will set the
* internal state to T and the pressure to P_c. Then, return P_c.
* If the input temperature, T, is above T_c, this routine will set the
* internal state to T and the pressure to P_c. Then, return P_c.
*
* @param temperature input temperature (kelvin)
* @param waterState integer specifying the water state
*
* @return Returns the saturation pressure. units = Pascal
* @returns the saturation pressure. units = Pascal
*/
doublereal psat(doublereal temperature, int waterState = WATER_LIQUID);
//! Return the value of the density at the water spinodal point (on the liquid side)
//! for the current temperature.
//! Return the value of the density at the water spinodal point (on the
//! liquid side) for the current temperature.
/*!
* @return returns the density with units of kg m-3
* @returns the density with units of kg m-3
*/
doublereal densSpinodalWater() const;
//! Return the value of the density at the water spinodal point (on the gas side)
//! for the current temperature.
//! Return the value of the density at the water spinodal point (on the gas
//! side) for the current temperature.
/*!
* @return returns the density with units of kg m-3
* @returns the density with units of kg m-3
*/
doublereal densSpinodalSteam() const;
@ -388,7 +371,7 @@ public:
//! Returns the critical temperature of water (Kelvin)
/*!
* This is hard coded to the value 647.096 Kelvin
* This is hard coded to the value 647.096 Kelvin
*/
doublereal Tcrit() const {
return 647.096;
@ -396,7 +379,7 @@ public:
//! Returns the critical pressure of water (22.064E6 Pa)
/*!
* This is hard coded to the value of 22.064E6 pascals
* This is hard coded to the value of 22.064E6 pascals
*/
doublereal Pcrit() const {
return 22.064E6;
@ -414,7 +397,7 @@ private:
//! Calculate the dimensionless temp and rho and store internally.
/*!
* @param temperature input temperature (kelvin)
* @param rho density in kg m-3
* @param rho density in kg m-3
*/
void calcDim(doublereal temperature, doublereal rho);
@ -445,16 +428,10 @@ private:
//! pointer to the underlying object that does the calculations.
mutable WaterPropsIAPWSphi m_phi;
//! Dimensionless temperature
/*!
* tau = T_C / T
*/
//! Dimensionless temperature, tau = T_C / T
doublereal tau;
//! Dimensionless density
/*!
* delta = rho / rho_c
*/
//! Dimensionless density, delta = rho / rho_c
mutable doublereal delta;
//! Current state of the system

View file

@ -110,16 +110,15 @@ public:
/**
* This function computes the reduced density, given the reduced pressure
* and the reduced temperature, tau. It takes an initial guess,
* deltaGuess. DeltaGuess is important as this is a multivalued function
* below the critical point.
* and the reduced temperature, tau. It takes an initial guess, deltaGuess.
* DeltaGuess is important as this is a multivalued function below the
* critical point.
*
* @param p_red Value of the dimensionless pressure
* @param tau Dimensionless temperature = T_c/T
* @param deltaGuess Initial guess for the dimensionless density
* @param deltaGuess Initial guess for the dimensionless density
*
* @return
* Returns the dimensionless density.
* @returns the dimensionless density.
*/
doublereal dfind(doublereal p_red, doublereal tau, doublereal deltaGuess);

View file

@ -6,9 +6,9 @@ namespace Cantera
{
/**
* This generic id is used as the default in virtual base
* classes that employ id's. It is used to indicate the lack
* of an inherited class that would define the id.
* This generic id is used as the default in virtual base classes that employ
* id's. It is used to indicate the lack of an inherited class that would define
* the id.
*/
const int cNone = 0;
@ -21,18 +21,16 @@ const int cHarmonicOsc = 4;
/**
* Equation of state types:
*
* These types are used in the member function eosType() of
* the virtual base class ThermoPhase. They are used to
* distinguish different types of equation of states. Also, they
* may be used for upcasting from the ThermoPhase class. Their
* id's should be distinct.
* These types are used in the member function eosType() of the virtual base
* class ThermoPhase. They are used to distinguish different types of equation
* of states. Also, they may be used for upcasting from the ThermoPhase class.
* Their id's should be distinct.
*
* Users who wish to define their own equation of states which
* derive from ThermoPhase should define a unique id which
* doesn't conflict with those listed below. The Cantera Kernel
* however, will not be know about the class and will therefore
* not be able to initialize the class within its "factory"
* routines.
* Users who wish to define their own equation of states which derive from
* ThermoPhase should define a unique id which doesn't conflict with those
* listed below. The Cantera Kernel however, will not be know about the class
* and will therefore not be able to initialize the class within its "factory"
* routines.
*/
const int cIdealGas = 1; // IdealGasPhase in IdealGasPhase.h
const int cIncompressible = 2; // ConstDensityThermo in ConstDensityThermo.h
@ -103,7 +101,8 @@ const int cVPSS_MolalSoln = 1060;
enum SSVolume_Model_enumType {
//! This approximation is for a constant volume
cSSVOLUME_CONSTANT = 0,
//! This approximation is for a species with a quadratic polynomial in temperature
//! This approximation is for a species with a quadratic polynomial in
//! temperature
/*!
* V^ss_i = ai + bi T + ci T2
*/
@ -128,7 +127,6 @@ enum PDSS_enumType {
cPDSS_IONSFROMNEUTRAL
};
//! enum for VPSSMgr types that are responsible for calculating the species
//! standard state and reference-state thermodynamic properties.
enum VPSSMgr_enumType {
@ -161,4 +159,3 @@ const int cAqueousKinetics = 8;
}
#endif

View file

@ -15,12 +15,12 @@ namespace Cantera
{
/*! Database for atomic molecular weights
* Values are taken from the 1989 Standard Atomic Weights, CRC
* Values are taken from the 1989 Standard Atomic Weights, CRC
*
* awTable[] is a static function with scope limited to this file.
* It can only be referenced via the LookupWtElements() function.
* awTable[] is a static function with scope limited to this file.
* It can only be referenced via the LookupWtElements() function.
*
* units = kg / kg-mol (or equivalently gm / gm-mol)
* units = kg / kg-mol (or equivalently gm / gm-mol)
*
* This structure was picked because it's simple, compact, and extensible.
*/
@ -30,10 +30,10 @@ struct awData {
};
/*!
* @var static struct awData aWTable[]
* \brief aWTable is a vector containing the atomic weights database.
* @var static struct awData aWTable[]
* \brief aWTable is a vector containing the atomic weights database.
*
* The size of the table is given by the initial instantiation.
* The size of the table is given by the initial instantiation.
*/
static struct awData aWTable[] = {
{"H", 1.00794},

View file

@ -2823,9 +2823,8 @@ void HMWSoln::s_update_d2lnMolalityActCoeff_dT2() const
// Zero the unscaled 2nd derivatives
m_d2lnActCoeffMolaldT2_Unscaled.assign(m_kk, 0.0);
/*
* Calculate the unscaled 2nd derivatives
*/
//! Calculate the unscaled 2nd derivatives
s_updatePitzer_d2lnMolalityActCoeff_dT2();
for (size_t k = 1; k < m_kk; k++) {

View file

@ -1,13 +1,12 @@
/**
* @file Nasa9Poly1.cpp
* Definitions for a single-species standard state object derived
* from
* \link Cantera::SpeciesThermoInterpType SpeciesThermoInterpType\endlink
* based
* on the NASA 9 coefficient temperature polynomial form applied to one temperature region
* (see \ref spthermo and class \link Cantera::Nasa9Poly1 Nasa9Poly1\endlink).
* @file Nasa9Poly1.cpp Definitions for a single-species standard state object
* derived from
* \link Cantera::SpeciesThermoInterpType SpeciesThermoInterpType\endlink based
* on the NASA 9 coefficient temperature polynomial form applied to one
* temperature region (see \ref spthermo and class \link Cantera::Nasa9Poly1
* Nasa9Poly1\endlink).
*
* This parameterization has one NASA temperature region.
* This parameterization has one NASA temperature region.
*/
// Copyright 2007 Sandia National Laboratories

View file

@ -1,9 +1,8 @@
/**
* @file PureFluidPhase.cpp
* Definitions for a ThermoPhase object for a pure fluid phase consisting
* of gas, liquid, mixed-gas-liquid
* and supercritical fluid (see \ref thermoprops
* and class \link Cantera::PureFluidPhase PureFluidPhase\endlink).
* @file PureFluidPhase.cpp Definitions for a ThermoPhase object for a pure
* fluid phase consisting of gas, liquid, mixed-gas-liquid and supercritical
* fluid (see \ref thermoprops and class \link Cantera::PureFluidPhase
* PureFluidPhase\endlink).
*/
#include "cantera/base/xml.h"
#include "cantera/thermo/PureFluidPhase.h"

View file

@ -40,11 +40,6 @@ doublereal SemiconductorPhase::ev() const
return 0.0;
}
/**
* Energy at the top of the conduction band. By default, energies
* are referenced to this energy, and so this function simply
* returns zero.
*/
doublereal SemiconductorPhase::ec() const
{
return ev() + bandgap();

View file

@ -34,21 +34,31 @@ VPSSMgrFactory* VPSSMgrFactory::s_factory = 0;
// Defn of the static mutex variable that locks the VPSSMgr factory singleton
std::mutex VPSSMgrFactory::vpss_species_thermo_mutex;
//! Examine the types of species thermo parameterizations, and return a flag indicating the type of parameterization
//! needed by the species.
//! Examine the types of species thermo parameterizations, and return a flag
//! indicating the type of parameterization needed by the species.
/*!
* @param spDataNodeList Species Data XML node. This node contains a list
* of species XML nodes underneath it.
* @param has_nasa_idealGas Boolean indicating that one species has a NASA ideal gas standard state
* @param has_nasa_constVol Boolean indicating that one species has a NASA ideal solution standard state
* @param has_shomate_idealGas Boolean indicating that one species has a Shomate ideal gas standard state
* @param has_shomate_constVol Boolean indicating that one species has a Shomate ideal solution standard state
* @param has_simple_idealGas Boolean indicating that one species has a simple ideal gas standard state
* @param has_simple_constVol Boolean indicating that one species has a simple ideal solution standard state
* @param has_water Boolean indicating that one species has a water standard state
* @param has_tpx Boolean indicating that one species has a tpx standard state
* @param has_hptx Boolean indicating that one species has a htpx standard state
* @param has_other Boolean indicating that one species has different standard state than the ones listed above
* @param has_nasa_idealGas Boolean indicating that one species has a
* NASA ideal gas standard state
* @param has_nasa_constVol Boolean indicating that one species has a
* NASA ideal solution standard state
* @param has_shomate_idealGas Boolean indicating that one species has a
* Shomate ideal gas standard state
* @param has_shomate_constVol Boolean indicating that one species has a
* Shomate ideal solution standard state
* @param has_simple_idealGas Boolean indicating that one species has a
* simple ideal gas standard state
* @param has_simple_constVol Boolean indicating that one species has a
* simple ideal solution standard state
* @param has_water Boolean indicating that one species has a
* water standard state
* @param has_tpx Boolean indicating that one species has a
* tpx standard state
* @param has_hptx Boolean indicating that one species has a
* htpx standard state
* @param has_other Boolean indicating that one species has
* different standard state than the ones listed above
*
* @todo Make sure that spDadta_node is species Data XML node by checking
* its name is speciesData
@ -206,9 +216,8 @@ VPSSMgr* VPSSMgrFactory::newVPSSMgr(VPStandardStateTP* vp_ptr,
std::string ssManager;
std::string vpssManager;
// First look for any explicit instructions within the XML Database
// for the standard state manager and the variable pressure
// standard state manager
// First look for any explicit instructions within the XML Database for the
// standard state manager and the variable pressure standard state manager
if (phaseNode_ptr && phaseNode_ptr->hasChild("thermo")) {
const XML_Node& thermoNode = phaseNode_ptr->child("thermo");
if (thermoNode.hasChild("standardStateManager")) {