Cleaned up Doxygen docs for class SpeciesThermoInterpType and descendants

This commit is contained in:
Ray Speth 2013-03-04 17:31:22 +00:00
parent c68e01d475
commit 3426b73b7a
14 changed files with 95 additions and 1043 deletions

View file

@ -5,11 +5,9 @@
* state object derived from \link Cantera::SpeciesThermoInterpType
* SpeciesThermoInterpType\endlink based on the expressions for the
* thermo properties of a species with several vibrational models.
*
*/
// Copyright 2007 California Institute of Technology
#ifndef CT_ADSORBATE_H
#define CT_ADSORBATE_H
@ -30,7 +28,6 @@ namespace Cantera
*/
class Adsorbate : public SpeciesThermoInterpType
{
public:
//! Empty constructor
@ -41,7 +38,6 @@ public:
m_nFreqs(0) {
}
//! Full Constructor
/*!
* @param n Species index
@ -74,7 +70,6 @@ public:
//! destructor
virtual ~Adsorbate() {}
//! duplicator
virtual SpeciesThermoInterpType*
duplMyselfAsSpeciesThermoInterpType() const {
Adsorbate* np = new Adsorbate(*this);
@ -96,51 +91,26 @@ public:
m_Pref = refPressure_;
}
//! Returns the minimum temperature that the thermo
//! parameterization is valid
virtual doublereal minTemp() const {
return m_lowT;
}
//! Returns the maximum temperature that the thermo
//! parameterization is valid
virtual doublereal maxTemp() const {
return m_highT;
}
//! Returns the reference pressure (Pa)
virtual doublereal refPressure() const {
return OneAtm;
}
//! Returns an integer representing the type of parameterization
virtual int reportType() const {
return ADSORBATE;
}
//! Returns an integer representing the species index
virtual size_t speciesIndex() const {
return m_index;
}
//! Compute the reference-state property of one species
/*!
* Given temperature T in K, this method updates the values of
* the non-dimensional heat capacity at constant pressure,
* enthalpy, and entropy, at the reference pressure, Pref
* of one of the species. The species index is used
* to reference into the cp_R, h_RT, and s_R arrays.
*
* @param temp Temperature (Kelvin)
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
*/
void updatePropertiesTemp(const doublereal temp,
doublereal* cp_R,
doublereal* h_RT,
@ -151,20 +121,6 @@ public:
s_R[m_index] = h_RT[m_index] - _free_energy_RT(temp);
}
//! This utility function reports back the type of
/*! parameterization and all of the parameters for the
* species, index.
*
* All parameters are output variables
*
* @param n Species index
* @param type Integer type of the standard type
* @param tlow output - Minimum temperature
* @param thigh output - Maximum temperature
* @param pref output - reference pressure (Pa).
* @param coeffs Vector of coefficients used to set the
* parameters for the standard state.
*/
void reportParameters(size_t& n, int& type,
doublereal& tlow, doublereal& thigh,
doublereal& pref,
@ -195,7 +151,6 @@ protected:
vector_fp m_freq;
doublereal m_be;
doublereal _energy_RT(double T) const {
doublereal x, hnu_kt, hnu, sum = 0.0;
doublereal kt = T*Boltzmann;
@ -227,7 +182,3 @@ protected:
}
#endif

View file

@ -70,15 +70,12 @@ class XML_Node;
*/
class Mu0Poly: public SpeciesThermoInterpType
{
public:
//! Constructor
Mu0Poly();
//! Constructor used in templated instantiations
/*!
*
* In the constructor, we calculate and store the
* piecewise linear approximation to the thermodynamic
* functions.
@ -115,27 +112,17 @@ public:
//! Destructor
virtual ~Mu0Poly();
//! Duplicator
virtual SpeciesThermoInterpType*
duplMyselfAsSpeciesThermoInterpType() const;
//! Returns the minimum temperature that the thermo
//! parameterization is valid
virtual doublereal minTemp() const;
//! Returns the maximum temperature that the thermo
//! parameterization is valid
virtual doublereal maxTemp() const;
//! Returns the reference pressure (Pa)
virtual doublereal refPressure() const;
//! Returns an integer representing the type of parameterization
virtual int reportType() const {
return MU0_INTERP;
}
//! Returns an integer representing the species index
virtual size_t speciesIndex() const {
return m_index;
}
@ -152,52 +139,18 @@ public:
* tPoly[0] = temp (Kelvin)
*
* @param tPoly vector of temperature polynomials. Length = 1
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
* @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
* @param s_R Vector of Dimensionless entropies. (length m_kk).
*/
virtual void updateProperties(const doublereal* tPoly,
doublereal* cp_R, doublereal* h_RT,
doublereal* s_R) const ;
//! Compute the reference-state property of one species
/*!
* Given temperature T in K, this method updates the values of
* the non-dimensional heat capacity at constant pressure,
* enthalpy, and entropy, at the reference pressure, Pref
* of one of the species. The species index is used
* to reference into the cp_R, h_RT, and s_R arrays.
*
* @param temp Temperature (Kelvin)
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
*/
virtual void updatePropertiesTemp(const doublereal temp,
doublereal* cp_R,
doublereal* h_RT,
doublereal* s_R) const ;
//!This utility function reports back the type of
//! parameterization and all of the parameters for the
//! species, index.
/*!
* All parameters are output variables
*
* @param n Species index
* @param type Integer type of the standard type
* @param tlow output - Minimum temperature
* @param thigh output - Maximum temperature
* @param pref output - reference pressure (Pa).
* @param coeffs Vector of coefficients used to set the
* parameters for the standard state.
*/
virtual void reportParameters(size_t& n, int& type,
doublereal& tlow, doublereal& thigh,
doublereal& pref,
@ -211,25 +164,19 @@ public:
virtual void modifyParameters(doublereal* coeffs);
protected:
/**
* Number of intervals in the interpolating linear
* approximation. Number of points is one more than the
* number of intervals.
* Number of intervals in the interpolating linear approximation. Number
* of points is one more than the number of intervals.
*/
size_t m_numIntervals;
/**
* Value of the enthalpy at T = 298.15.
* This value is tied to the Heat of formation of
* the species at 298.15.
* Value of the enthalpy at T = 298.15. This value is tied to the Heat of
* formation of the species at 298.15.
*/
doublereal m_H298;
/**
* Points at which the standard state chemical potential
* are given.
*/
//! Points at which the standard state chemical potential are given.
vector_fp m_t0_int;
/**
@ -258,14 +205,12 @@ protected:
size_t m_index;
private:
//! process the coefficients
/*!
* Mu0Poly():
*
* In the constructor, we calculate and store the
* piecewise linear approximation to the thermodynamic
* functions.
* In the constructor, we calculate and store the piecewise linear
* approximation to the thermodynamic functions.
*
* @param coeffs coefficients. These are defined as follows:
*
@ -280,7 +225,6 @@ private:
* ........
*/
void processCoeffs(const doublereal* coeffs);
};
//! Install a Mu0 polynomial thermodynamic reference state
@ -303,5 +247,3 @@ void installMu0ThermoFromXML(const std::string& speciesName,
}
#endif

View file

@ -22,12 +22,10 @@
namespace Cantera
{
//! The NASA 9 polynomial parameterization for one temperature range.
/*!
* This parameterization expresses the heat capacity via a
* 7 coefficient polynomial.
* This parameterization expresses the heat capacity via a
* 7 coefficient polynomial.
* Note that this is the form used in the
* 2002 NASA equilibrium program. A reference to the form is
* provided below:
@ -70,13 +68,10 @@ namespace Cantera
*/
class Nasa9Poly1 : public SpeciesThermoInterpType
{
public:
//! Empty constructor
Nasa9Poly1();
//! constructor used in templated instantiations
/*!
* @param n Species index
@ -104,33 +99,21 @@ public:
//! Destructor
virtual ~Nasa9Poly1();
//! duplicator
virtual SpeciesThermoInterpType*
duplMyselfAsSpeciesThermoInterpType() const;
//! Returns the minimum temperature that the thermo
//! parameterization is valid
virtual doublereal minTemp() const;
//! Returns the maximum temperature that the thermo
//! parameterization is valid
virtual doublereal maxTemp() const;
//! Returns the reference pressure (Pa)
virtual doublereal refPressure() const;
//! Returns an integer representing the type of parameterization
virtual int reportType() const;
//! Returns an integer representing the species index
virtual size_t speciesIndex() const;
//! Update the properties for this species, given a temperature polynomial
/*!
* This method is called with a pointer to an array containing the functions of
* temperature needed by this parameterization, and three pointers to arrays where the
* computed property values should be written. This method updates only one value in
* each array.
* This method is called with a pointer to an array containing the
* functions of temperature needed by this parameterization, and three
* pointers to arrays where the computed property values should be
* written. This method updates only one value in each array.
*
* Temperature Polynomial:
* tt[0] = t;
@ -142,24 +125,19 @@ public:
* tt[6] = std::log(t);
*
* @param tt vector of temperature polynomials
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
* @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
* @param s_R Vector of Dimensionless entropies. (length m_kk).
*/
virtual void updateProperties(const doublereal* tt,
doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const;
//! Compute the reference-state property of one species
/*!
* Given temperature T in K, this method updates the values of
* the non-dimensional heat capacity at constant pressure,
* enthalpy, and entropy, at the reference pressure, Pref
* of one of the species. The species index is used
* to reference into the cp_R, h_RT, and s_R arrays.
* Given temperature T in K, this method updates the values of the non-
* dimensional heat capacity at constant pressure, enthalpy, and entropy,
* at the reference pressure, Pref of one of the species. The species
* index is used to reference into the cp_R, h_RT, and s_R arrays.
*
* Temperature Polynomial:
* tt[0] = t;
@ -171,12 +149,9 @@ public:
* tt[6] = std::log(t);
*
* @param temp Temperature (Kelvin)
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
* @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
* @param s_R Vector of Dimensionless entropies. (length m_kk).
*/
virtual void updatePropertiesTemp(const doublereal temp,
doublereal* cp_R, doublereal* h_RT,
@ -229,4 +204,3 @@ protected:
}
#endif

View file

@ -9,18 +9,15 @@
* This parameterization has one NASA temperature region.
*/
#ifndef CT_NASAPOLY1_H
#define CT_NASAPOLY1_H
// Copyright 2001 California Institute of Technology
#include "cantera/base/global.h"
#include "SpeciesThermoInterpType.h"
namespace Cantera
{
/**
* The NASA polynomial parameterization for one temperature range.
* This parameterization expresses the heat capacity as a
@ -49,15 +46,12 @@ namespace Cantera
*/
class NasaPoly1 : public SpeciesThermoInterpType
{
public:
//! Empty constructor
NasaPoly1()
: m_lowT(0.0), m_highT(0.0),
m_Pref(0.0), m_index(0), m_coeff(7, 0.0) {}
//! constructor used in templated instantiations
/*!
* @param n Species index
@ -112,46 +106,38 @@ public:
//! Destructor
virtual ~NasaPoly1() {}
//! duplicator
virtual SpeciesThermoInterpType*
duplMyselfAsSpeciesThermoInterpType() const {
NasaPoly1* np = new NasaPoly1(*this);
return (SpeciesThermoInterpType*) np;
}
//! Returns the minimum temperature that the thermo
//! parameterization is valid
virtual doublereal minTemp() const {
return m_lowT;
}
//! Returns the maximum temperature that the thermo
//! parameterization is valid
virtual doublereal maxTemp() const {
return m_highT;
}
//! Returns the reference pressure (Pa)
virtual doublereal refPressure() const {
return m_Pref;
}
//! Returns an integer representing the type of parameterization
virtual int reportType() const {
return NASA1;
}
//! Returns an integer representing the species index
virtual size_t speciesIndex() const {
return m_index;
}
//! Update the properties for this species, given a temperature polynomial
/*!
* This method is called with a pointer to an array containing the functions of
* temperature needed by this parameterization, and three pointers to arrays where the
* computed property values should be written. This method updates only one value in
* each array.
* This method is called with a pointer to an array containing the
* functions of temperature needed by this parameterization, and three
* pointers to arrays where the computed property values should be
* written. This method updates only one value in each array.
*
* Temperature Polynomial:
* tt[0] = t;
@ -162,16 +148,12 @@ public:
* tt[5] = std::log(t);
*
* @param tt vector of temperature polynomials
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
* @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
* @param s_R Vector of Dimensionless entropies. (length m_kk).
*/
virtual void updateProperties(const doublereal* tt,
doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const {
doublereal ct0 = m_coeff[2]; // a0
doublereal ct1 = m_coeff[3]*tt[0]; // a1 * T
doublereal ct2 = m_coeff[4]*tt[1]; // a2 * T^2
@ -194,23 +176,6 @@ public:
// fp2str(h)+"\n");
}
//! Compute the reference-state property of one species
/*!
* Given temperature T in K, this method updates the values of
* the non-dimensional heat capacity at constant pressure,
* enthalpy, and entropy, at the reference pressure, Pref
* of one of the species. The species index is used
* to reference into the cp_R, h_RT, and s_R arrays.
*
* @param temp Temperature (Kelvin)
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
*/
virtual void updatePropertiesTemp(const doublereal temp,
doublereal* cp_R, doublereal* h_RT,
doublereal* s_R) const {
@ -224,20 +189,6 @@ public:
updateProperties(tPoly, cp_R, h_RT, s_R);
}
//!This utility function reports back the type of
//! parameterization and all of the parameters for the
//! species, index.
/*!
* All parameters are output variables
*
* @param n Species index
* @param type Integer type of the standard type
* @param tlow output - Minimum temperature
* @param thigh output - Maximum temperature
* @param pref output - reference pressure (Pa).
* @param coeffs Vector of coefficients used to set the
* parameters for the standard state.
*/
virtual void reportParameters(size_t& n, int& type,
doublereal& tlow, doublereal& thigh,
doublereal& pref,
@ -316,9 +267,7 @@ protected:
size_t m_index;
//! array of polynomial coefficients
vector_fp m_coeff;
};
}
#endif

View file

@ -22,13 +22,10 @@ class VPSSMgr;
/**
* @defgroup spthermo Species Reference-State Thermodynamic Properties
*
* The %ThermoPhase object relies on classes to calculate
* the thermodynamic properties of the reference state for all
* of the species in the phase.
* This group describes the types and functionality of the classes
* that calculate the reference state thermodynamic functions
* within %Cantera.
*
* The %ThermoPhase object relies on classes to calculate the thermodynamic
* properties of the reference state for all of the species in the phase.
* This group describes the types and functionality of the classes that
* calculate the reference state thermodynamic functions within %Cantera.
*
* To compute the thermodynamic properties of multicomponent
* solutions, it is necessary to know something about the
@ -116,7 +113,7 @@ class VPSSMgr;
* the thermodynamic functions.
* .
*
* The most important member function for the %SpeciesThermoInterpType class
* The most important member function for the SpeciesThermoInterpType class
* is the member function
* \link SpeciesThermoInterpType::updatePropertiesTemp() updatePropertiesTemp()\endlink.
* The function calculates the values of Cp, H, and S for the specific
@ -155,13 +152,10 @@ class VPSSMgr;
* doublereal pref, const doublereal* coeffs)
* @endcode
*
* The constructor is used to instantiate the object.
*
* @ingroup spthermo
*/
class SpeciesThermoInterpType
{
public:
//! Constructor
@ -174,7 +168,6 @@ public:
virtual SpeciesThermoInterpType*
duplMyselfAsSpeciesThermoInterpType() const = 0;
//! Returns the minimum temperature that the thermo
//! parameterization is valid
virtual doublereal minTemp() const = 0;
@ -192,8 +185,7 @@ public:
//! Returns an integer representing the species index
virtual size_t speciesIndex() const = 0;
//! Update the properties for this species, given a temperature
//! polynomial
//! Update the properties for this species, given a temperature polynomial
/*!
* This method is called with a pointer to an array containing the functions of
* temperature needed by this parameterization, and three pointers to arrays where the
@ -204,12 +196,9 @@ public:
* parameterization.
*
* @param tempPoly vector of temperature polynomials
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
* @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
* @param s_R Vector of Dimensionless entropies. (length m_kk).
*/
virtual void updateProperties(const doublereal* tempPoly,
doublereal* cp_R, doublereal* h_RT,
@ -224,12 +213,9 @@ public:
* to reference into the cp_R, h_RT, and s_R arrays.
*
* @param temp Temperature (Kelvin)
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
* @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
* @param s_R Vector of Dimensionless entropies. (length m_kk).
*/
virtual void updatePropertiesTemp(const doublereal temp,
doublereal* cp_R,
@ -292,7 +278,6 @@ public:
//! Class for the thermodynamic manager for an individual species' reference state
//! which uses the PDSS base class to satisfy the requests.
/*!
*
* This class is a pass-through class for handling thermodynamics calls
* for reference state thermo to an pressure dependent standard state (PDSS)
* class. For some situations, it makes no sense to have a reference state
@ -305,15 +290,12 @@ public:
*/
class STITbyPDSS : public SpeciesThermoInterpType
{
public:
//! Constructor
STITbyPDSS();
//! Main Constructor
/*!
*
* @param speciesIndex species index for this object. Note, this must
* agree with what was internally set before.
*
@ -333,7 +315,6 @@ public:
//! Destructor
virtual ~STITbyPDSS();
//! duplicator
virtual SpeciesThermoInterpType* duplMyselfAsSpeciesThermoInterpType() const;
//! Initialize and/or Reinitialize all the pointers for this object
@ -349,7 +330,6 @@ public:
* that owns the PDSS object that will handle calls for this object
*
* @param PDSS_ptr Pointer to the PDSS object that handles calls for this object
*
*/
void initAllPtrs(size_t speciesIndex, VPSSMgr* vpssmgr_ptr, PDSS* PDSS_ptr);
@ -370,80 +350,23 @@ public:
//! Returns an integer representing the species index
virtual size_t speciesIndex() const;
//! Update the properties for this species, given a temperature
//! polynomial
/*!
* This method is called with a pointer to an array containing the functions of
* temperature needed by this parameterization, and three pointers to arrays where the
* computed property values should be written. This method updates only one value in
* each array.
*
* The form and length of the Temperature Polynomial may vary depending on the
* parameterization.
*
* @param tempPoly vector of temperature polynomials
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
*/
virtual void updateProperties(const doublereal* tempPoly,
doublereal* cp_R, doublereal* h_RT,
doublereal* s_R) const;
//! Compute the reference-state property of one species
/*!
* Given temperature T in K, this method updates the values of
* the non-dimensional heat capacity at constant pressure,
* enthalpy, and entropy, at the reference pressure, Pref
* of one of the species. The species index is used
* to reference into the cp_R, h_RT, and s_R arrays.
*
* @param temp Temperature (Kelvin)
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
*/
virtual void updatePropertiesTemp(const doublereal temp,
doublereal* cp_R,
doublereal* h_RT,
doublereal* s_R) const;
//!This utility function reports back the type of
//! parameterization and all of the parameters for the
//! species, index.
/*!
* All parameters are output variables
*
* @param index Species index
* @param type Integer type of the standard type
* @param minTemp output - Minimum temperature
* @param maxTemp output - Maximum temperature
* @param refPressure output - reference pressure (Pa).
* @param coeffs Vector of coefficients used to set the
* parameters for the standard state.
*/
virtual void reportParameters(size_t& index, int& type,
doublereal& minTemp, doublereal& maxTemp,
doublereal& refPressure,
doublereal* const coeffs) const;
//! Modify parameters for the standard state
/*!
* This is a stub routine, without functionality
*
* @param coeffs Vector of coefficients used to set the
* parameters for the standard state.
*/
virtual void modifyParameters(doublereal* coeffs);
private:
//! Pointer to the Variable pressure standard state manager
//! that owns the PDSS object that will handle calls for this object
VPSSMgr* m_vpssmgr_ptr;
@ -461,4 +384,3 @@ private:
}
#endif

View file

@ -6,15 +6,11 @@
*/
// Copyright 2001 California Institute of Technology
#include "ConstCpPoly.h"
#include <cmath>
namespace Cantera
{
ConstCpPoly::ConstCpPoly()
: m_t0(0.0),
m_cp0_R(0.0),
@ -168,5 +164,3 @@ void ConstCpPoly::modifyOneHf298(const size_t& k, const doublereal Hf298New)
#endif
}

View file

@ -42,14 +42,11 @@ namespace Cantera
* this class does.
*
* @see SimpleThermo
*
* @ingroup spthermo
*/
class ConstCpPoly: public SpeciesThermoInterpType
{
public:
//! empty constructor
ConstCpPoly();
@ -66,7 +63,6 @@ public:
* - c[1] = \f$ H_k^o(T_0, p_{ref}) \f$ (J/kmol)
* - c[2] = \f$ S_k^o(T_0, p_{ref}) \f$ (J/kmol K)
* - c[3] = \f$ {Cp}_k^o(T_0, p_{ref}) \f$ (J(kmol K)
*
*/
ConstCpPoly(size_t n, doublereal tlow, doublereal thigh,
doublereal pref,
@ -81,26 +77,17 @@ public:
//! Destructor
virtual ~ConstCpPoly();
//! Duplicator
virtual SpeciesThermoInterpType*
duplMyselfAsSpeciesThermoInterpType() const;
//! Returns the minimum temperature that the thermo
//! parameterization is valid
doublereal minTemp() const;
//! Returns the maximum temperature that the thermo
//! parameterization is valid
doublereal maxTemp() const;
//! Returns the reference pressure (Pa)
doublereal refPressure() const;
//! Returns an integer representing the type of parameterization
virtual int reportType() const {
return CONSTANT_CP;
}
//! Returns an integer representing the species index
virtual size_t speciesIndex() const {
return m_index;
}
@ -116,50 +103,17 @@ public:
* - m_t[0] = tt;
*
* @param tt Vector of temperature polynomials
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
* @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
* @param s_R Vector of Dimensionless entropies. (length m_kk).
*/
void updateProperties(const doublereal* tt,
doublereal* cp_R, doublereal* h_RT,
doublereal* s_R) const;
//! Compute the reference-state property of one species
/*!
* Given temperature T in K, this method updates the values of
* the non-dimensional heat capacity at constant pressure,
* enthalpy, and entropy, at the reference pressure, Pref
* of one of the species. The species index is used
* to reference into the cp_R, h_RT, and s_R arrays.
*
* @param temp Temperature (Kelvin)
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
*/
void updatePropertiesTemp(const doublereal temp,
doublereal* cp_R, doublereal* h_RT,
doublereal* s_R) const;
//!This utility function reports back the type of
//! parameterization and all of the parameters for the
//! species, index.
/*!
* All parameters are output variables
*
* @param n Species index
* @param type Integer type of the standard type
* @param tlow output - Minimum temperature
* @param thigh output - Maximum temperature
* @param pref output - reference pressure (Pa).
* @param coeffs Vector of coefficients used to set the
* parameters for the standard state.
*/
void reportParameters(size_t& n, int& type,
doublereal& tlow, doublereal& thigh,
doublereal& pref,
@ -172,11 +126,8 @@ public:
virtual void modifyParameters(doublereal* coeffs);
#ifdef H298MODIFY_CAPABILITY
virtual doublereal reportHf298(doublereal* const h298 = 0) const;
virtual void modifyOneHf298(const size_t& k, const doublereal Hf298New);
#endif
protected:
@ -198,9 +149,6 @@ protected:
doublereal m_Pref;
//! Species Index
size_t m_index;
private:
};
}

View file

@ -18,8 +18,6 @@ using namespace ctml;
namespace Cantera
{
Mu0Poly::Mu0Poly() : m_numIntervals(0),
m_H298(0.0),
m_lowT(0.0),
@ -29,23 +27,6 @@ Mu0Poly::Mu0Poly() : m_numIntervals(0),
{
}
/*
* Mu0Poly():
*
* In the constructor, we calculate and store the
* piecewise linear approximation to the thermodynamic
* functions.
*
* coeffs[0] = number of points (integer)
* 1 = H298(J/kmol)
* 2 = T1 (Kelvin)
* 3 = mu1 (J/kmol)
* 4 = T2 (Kelvin)
* 5 = mu2 (J/kmol)
* 6 = T3 (Kelvin)
* 7 = mu3 (J/kmol)
* ........
*/
Mu0Poly::Mu0Poly(size_t n, doublereal tlow, doublereal thigh,
doublereal pref,
const doublereal* coeffs) :
@ -56,11 +37,9 @@ Mu0Poly::Mu0Poly(size_t n, doublereal tlow, doublereal thigh,
m_Pref(pref),
m_index(n)
{
processCoeffs(coeffs);
}
Mu0Poly::Mu0Poly(const Mu0Poly& b)
: m_numIntervals(b.m_numIntervals),
m_H298(b.m_H298),
@ -120,20 +99,6 @@ doublereal Mu0Poly::refPressure() const
return m_Pref;
}
/*
* updateProperties is the main workhorse program.
* Given a temperature (*tt), it calculates the thermodynamic
* functions H/RT, S_R, and cp_R, and returns the answer.
*
* Note, it returns an answer by inserting the values into the
* index position, m_index in vectors of H/RT, S_R, and cp_R.
*
*
* Input
* -------
* *tt = Temperature (Kelvin)
*
*/
void Mu0Poly::
updateProperties(const doublereal* tt, doublereal* cp_R,
doublereal* h_RT, doublereal* s_R) const
@ -165,12 +130,6 @@ updatePropertiesTemp(const doublereal T,
updateProperties(&T, cp_R, h_RT, s_R);
}
/*
* report all of the parameters that make up this
* interpolation.
*
*
*/
void Mu0Poly::reportParameters(size_t& n, int& type,
doublereal& tlow, doublereal& thigh,
doublereal& pref,
@ -196,11 +155,6 @@ void Mu0Poly::modifyParameters(doublereal* coeffs)
processCoeffs(coeffs);
}
/*
* Install a Mu0 polynomial thermodynamic reference state property
* parameterization for species k into a SpeciesThermo instance,
* getting the information from an XML database.
*/
void installMu0ThermoFromXML(const std::string& speciesName,
SpeciesThermo& sp, size_t k,
const XML_Node* Mu0Node_ptr)
@ -287,26 +241,8 @@ void installMu0ThermoFromXML(const std::string& speciesName,
sp.install(speciesName, k, MU0_INTERP, &c[0], tmin, tmax, pref);
}
/*
* Mu0Poly():
*
* In the constructor, we calculate and store the
* piecewise linear approximation to the thermodynamic
* functions.
*
* coeffs[0] = number of points (integer)
* 1 = H298(J/kmol)
* 2 = T1 (Kelvin)
* 3 = mu1 (J/kmol)
* 4 = T2 (Kelvin)
* 5 = mu2 (J/kmol)
* 6 = T3 (Kelvin)
* 7 = mu3 (J/kmol)
* ........
*/
void Mu0Poly::processCoeffs(const doublereal* coeffs)
{
size_t i, iindex;
double T1, T2;
size_t nPoints = (size_t) coeffs[0];
@ -422,8 +358,3 @@ void Mu0Poly::processCoeffs(const doublereal* coeffs)
}
}

View file

@ -15,67 +15,10 @@
namespace Cantera
{
// The NASA 9 polynomial parameterization for one temperature range.
/*
* This parameterization expresses the heat capacity via a
* 7 coefficient polynomial.
*
* Note that this is the form used in the
* 2002 NASA equilibrium program
*
* "NASA Glenn Coefficients for Calculating Thermodynamic
* Properties of Individual Species,"
* B. J. McBride, M. J. Zehe, S. Gordon
* NASA/TP-2002-211556, Sept. 2002
*
*
* Nine coefficients \f$(a_0,\dots,a_6)\f$ are used to represent
* \f$ C_p^0(T)\f$, \f$ H^0(T)\f$, and \f$ S^0(T) \f$ as
* polynomials in \f$ T \f$ :
* \f[
* \frac{C_p^0(T)}{R} = a_0 T^{-2} + a_1 T^{-1} + a_2 + a_3 T
* + a_4 T^2 + a_5 T^3 + a_6 T^4
* \f]
*
* \f[
* \frac{H^0(T)}{RT} = - a_0 T^{-2} + a_1 \frac{\ln(T)}{T} + a_2
* + a_3 T + a_4 T^2 + a_5 T^3 + a_6 T^4 + \frac{a_7}{T}
* \f]
*
* \f[
* \frac{s^0(T)}{R} = - \frac{a_0}{2} T^{-2} - a_1 T^{-1} + a_2 \ln(T)
+ + a_3 T \frac{a_4}{2} T^2 + \frac{a_5}{3} T^3 + \frac{a_6}{4} T^4 + a_8
* \f]
*
* The standard state is assumed to be the ideal gas at the
* standard pressure of 1 bar, for gases.
* For condensed species, the standard state is the
* pure crystalline or liquid substance at the standard
* pressure of 1 atm.
*
* These NASA representations may have more than 2 temperature regions.
*
* @ingroup spthermo
*/
//! Empty constructor
Nasa9Poly1::Nasa9Poly1()
: m_lowT(0.0), m_highT(0.0),
m_Pref(1.0E5), m_index(0), m_coeff(vector_fp(9)) {}
// constructor used in templated instantiations
/*
* @param n Species index
* @param tlow Minimum temperature
* @param thigh Maximum temperature
* @param pref reference pressure (Pa).
* @param coeffs Vector of coefficients used to set the
* parameters for the standard state.
*/
Nasa9Poly1::Nasa9Poly1(size_t n, doublereal tlow, doublereal thigh,
doublereal pref,
const doublereal* coeffs) :
@ -88,10 +31,6 @@ Nasa9Poly1::Nasa9Poly1(size_t n, doublereal tlow, doublereal thigh,
std::copy(coeffs, coeffs + 9, m_coeff.begin());
}
// copy constructor
/*
* @param b object to be copied
*/
Nasa9Poly1::Nasa9Poly1(const Nasa9Poly1& b) :
m_lowT(b.m_lowT),
m_highT(b.m_highT),
@ -104,10 +43,6 @@ Nasa9Poly1::Nasa9Poly1(const Nasa9Poly1& b) :
m_coeff.begin());
}
// assignment operator
/*
* @param b object to be copied
*/
Nasa9Poly1& Nasa9Poly1::operator=(const Nasa9Poly1& b)
{
if (&b != this) {
@ -122,74 +57,41 @@ Nasa9Poly1& Nasa9Poly1::operator=(const Nasa9Poly1& b)
return *this;
}
// Destructor
Nasa9Poly1::~Nasa9Poly1()
{
}
// duplicator
SpeciesThermoInterpType*
Nasa9Poly1::duplMyselfAsSpeciesThermoInterpType() const
{
return new Nasa9Poly1(*this);
}
// Returns the minimum temperature that the thermo
// parameterization is valid
doublereal Nasa9Poly1::minTemp() const
{
return m_lowT;
}
// Returns the maximum temperature that the thermo
// parameterization is valid
doublereal Nasa9Poly1::maxTemp() const
{
return m_highT;
}
// Returns the reference pressure (Pa)
doublereal Nasa9Poly1::refPressure() const
{
return m_Pref;
}
// Returns an integer representing the type of parameterization
int Nasa9Poly1::reportType() const
{
return NASA9;
}
// Returns an integer representing the species index
size_t Nasa9Poly1::speciesIndex() const
{
return m_index;
}
// Update the properties for this species, given a temperature polynomial
/*
* This method is called with a pointer to an array containing the functions of
* temperature needed by this parameterization, and three pointers to arrays where the
* computed property values should be written. This method updates only one value in
* each array.
*
* Temperature Polynomial:
* tt[0] = t;
* tt[1] = t*t;
* tt[2] = t*t*t;
* tt[3] = t*t*t*t;
* tt[4] = 1.0/t;
* tt[5] = 1.0/(t*t);
* tt[6] = std::log(t);
*
* @param tt vector of temperature polynomials
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
*/
void Nasa9Poly1::updateProperties(const doublereal* tt,
doublereal* cp_R, doublereal* h_RT,
doublereal* s_R) const
@ -219,32 +121,6 @@ void Nasa9Poly1::updateProperties(const doublereal* tt,
// fp2str(h)+"\n");
}
// Compute the reference-state property of one species
/*
* Given temperature T in K, this method updates the values of
* the non-dimensional heat capacity at constant pressure,
* enthalpy, and entropy, at the reference pressure, Pref
* of one of the species. The species index is used
* to reference into the cp_R, h_RT, and s_R arrays.
*
* Temperature Polynomial:
* tt[0] = t;
* tt[1] = t*t;
* tt[2] = t*t*t;
* tt[3] = t*t*t*t;
* tt[4] = 1.0/t;
* tt[5] = 1.0/(t*t);
* tt[6] = std::log(t);
*
* @param temp Temperature (Kelvin)
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
*/
void Nasa9Poly1::updatePropertiesTemp(const doublereal temp,
doublereal* cp_R, doublereal* h_RT,
doublereal* s_R) const
@ -260,20 +136,6 @@ void Nasa9Poly1::updatePropertiesTemp(const doublereal temp,
updateProperties(tPoly, cp_R, h_RT, s_R);
}
//This utility function reports back the type of
// parameterization and all of the parameters for the
// species, index.
/*
* All parameters are output variables
*
* @param n Species index
* @param type Integer type of the standard type
* @param tlow output - Minimum temperature
* @param thigh output - Maximum temperature
* @param pref output - reference pressure (Pa).
* @param coeffs Vector of coefficients used to set the
* parameters for the standard state.
*/
void Nasa9Poly1::reportParameters(size_t& n, int& type,
doublereal& tlow, doublereal& thigh,
doublereal& pref,
@ -290,14 +152,8 @@ void Nasa9Poly1::reportParameters(size_t& n, int& type,
for (int i = 0; i < 9; i++) {
coeffs[i+3] = m_coeff[i];
}
}
// Modify parameters for the standard state
/*
* @param coeffs Vector of coefficients used to set the
* parameters for the standard state.
*/
void Nasa9Poly1::modifyParameters(doublereal* coeffs)
{
for (int i = 0; i < 9; i++) {
@ -305,6 +161,4 @@ void Nasa9Poly1::modifyParameters(doublereal* coeffs)
}
}
}

View file

@ -20,56 +20,6 @@ using namespace std;
namespace Cantera
{
// The NASA 9 polynomial parameterization for a single species
// encompassing multiple temperature regions.
/*
* This parameterization expresses the heat capacity via a
* 7 coefficient polynomial.
* Note that this is the form used in the
* 2002 NASA equilibrium program. A reference to the form is
* provided below:
*
* "NASA Glenn Coefficients for Calculating Thermodynamic
* Properties of Individual Species,"
* B. J. McBride, M. J. Zehe, S. Gordon
* NASA/TP-2002-211556, Sept. 2002
*
* Nine coefficients \f$(a_0,\dots,a_6)\f$ are used to represent
* \f$ C_p^0(T)\f$, \f$ H^0(T)\f$, and \f$ S^0(T) \f$ as
* polynomials in \f$ T \f$ :
* \f[
* \frac{c_p(T)}{R} = a_0 T^{-2} + a_1 T^{-1} + a_2 + a_3 T
* + a_4 T^2 + a_5 T^3 + a_6 T^4
* \f]
*
* \f[
* \frac{H^0(T)}{RT} = - a_0 T^{-2} + a_1 \frac{\ln(T)}{T} + a_2
* + a_3 T + a_4 T^2 + a_5 T^3 + a_6 T^4 + \frac{a_7}{T}
* \f]
*
* \f[
* \frac{s^0(T)}{R} = - \frac{a_0}{2} T^{-2} - a_1 T^{-1} + a_2 \ln(T)
+ + a_3 T \frac{a_4}{2} T^2 + \frac{a_5}{3} T^3
* + \frac{a_6}{4} T^4 + a_8
* \f]
*
* The standard state is assumed to be an ideal gas at the
* standard pressure of 1 bar, for gases.
* For condensed species, the standard state is the
* pure crystalline or liquid substance at the standard
* pressure of 1 atm.
*
* These NASA representations may have multiple temperature regions
* through the use of this %Nasa9PolyMultiTempRegion object, which uses
* multiple copies of the Nasa9Poly1 object to handle multiple temperature
* regions.
*
* @ingroup spthermo
*/
//! Empty constructor
Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion() :
m_lowT(0.0),
m_highT(0.0),
@ -80,16 +30,6 @@ Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion() :
{
}
// Constructor used in templated instantiations
/*
* @param regionPts Vector of pointers to Nasa9Poly1 objects. These
* objects all refer to the temperature regions for the
* same species. The vector must be in increasing
* temperature region format. Together they
* represent the reference temperature parameterization
* for a single species.
*/
Nasa9PolyMultiTempRegion::
Nasa9PolyMultiTempRegion(std::vector<Cantera::Nasa9Poly1*> &regionPts) :
m_lowT(0.0),
@ -131,10 +71,6 @@ Nasa9PolyMultiTempRegion(std::vector<Cantera::Nasa9Poly1*> &regionPts) :
}
}
// copy constructor
/*
* @param b object to be copied
*/
Nasa9PolyMultiTempRegion::
Nasa9PolyMultiTempRegion(const Nasa9PolyMultiTempRegion& b) :
m_lowT(b.m_lowT),
@ -152,10 +88,6 @@ Nasa9PolyMultiTempRegion(const Nasa9PolyMultiTempRegion& b) :
}
}
// assignment operator
/*
* @param b object to be copied
*/
Nasa9PolyMultiTempRegion&
Nasa9PolyMultiTempRegion::operator=(const Nasa9PolyMultiTempRegion& b)
{
@ -179,7 +111,6 @@ Nasa9PolyMultiTempRegion::operator=(const Nasa9PolyMultiTempRegion& b)
return *this;
}
// Destructor
Nasa9PolyMultiTempRegion::~Nasa9PolyMultiTempRegion()
{
for (size_t i = 0; i < m_numTempRegions; i++) {
@ -188,71 +119,37 @@ Nasa9PolyMultiTempRegion::~Nasa9PolyMultiTempRegion()
}
}
// duplicator
SpeciesThermoInterpType*
Nasa9PolyMultiTempRegion::duplMyselfAsSpeciesThermoInterpType() const
{
return new Nasa9PolyMultiTempRegion(*this);
}
// Returns the minimum temperature that the thermo
// parameterization is valid
doublereal Nasa9PolyMultiTempRegion::minTemp() const
{
return m_lowT;
}
// Returns the maximum temperature that the thermo
// parameterization is valid
doublereal Nasa9PolyMultiTempRegion::maxTemp() const
{
return m_highT;
}
// Returns the reference pressure (Pa)
doublereal Nasa9PolyMultiTempRegion::refPressure() const
{
return m_Pref;
}
// Returns an integer representing the type of parameterization
int Nasa9PolyMultiTempRegion::reportType() const
{
return NASA9MULTITEMP;
}
// Returns an integer representing the species index
size_t Nasa9PolyMultiTempRegion::speciesIndex() const
{
return m_index;
}
// Update the properties for this species, given a temperature polynomial
/*
* This method is called with a pointer to an array containing the functions of
* temperature needed by this parameterization, and three pointers to arrays where the
* computed property values should be written. This method updates only one value in
* each array.
*
* Temperature Polynomial:
* tt[0] = t;
* tt[1] = t*t;
* tt[2] = t*t*t;
* tt[3] = t*t*t*t;
* tt[4] = 1.0/t;
* tt[5] = 1.0/(t*t);
* tt[6] = std::log(t);
*
* @param tt vector of temperature polynomials
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
*/
void Nasa9PolyMultiTempRegion::updateProperties(const doublereal* tt,
doublereal* cp_R,
doublereal* h_RT,
@ -278,32 +175,6 @@ void Nasa9PolyMultiTempRegion::updateProperties(const doublereal* tt,
(m_regionPts[m_currRegion])->updateProperties(tt, cp_R, h_RT, s_R);
}
// Compute the reference-state property of one species
/*
* Given temperature T in K, this method updates the values of
* the non-dimensional heat capacity at constant pressure,
* enthalpy, and entropy, at the reference pressure, Pref
* of one of the species. The species index is used
* to reference into the cp_R, h_RT, and s_R arrays.
*
* Temperature Polynomial:
* tt[0] = t;
* tt[1] = t*t;
* tt[2] = t*t*t;
* tt[3] = t*t*t*t;
* tt[4] = 1.0/t;
* tt[5] = 1.0/(t*t);
* tt[6] = std::log(t);
*
* @param temp Temperature (Kelvin)
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
*/
void Nasa9PolyMultiTempRegion::updatePropertiesTemp(const doublereal temp,
doublereal* cp_R, doublereal* h_RT,
doublereal* s_R) const
@ -328,20 +199,6 @@ void Nasa9PolyMultiTempRegion::updatePropertiesTemp(const doublereal temp,
updateProperties(tPoly, cp_R, h_RT, s_R);
}
//This utility function reports back the type of
// parameterization and all of the parameters for the
// species, index.
/*
* All parameters are output variables
*
* @param n Species index
* @param type Integer type of the standard type
* @param tlow output - Minimum temperature
* @param thigh output - Maximum temperature
* @param pref output - reference pressure (Pa).
* @param coeffs Vector of coefficients used to set the
* parameters for the standard state.
*/
void Nasa9PolyMultiTempRegion::reportParameters(size_t& n, int& type,
doublereal& tlow, doublereal& thigh,
doublereal& pref,
@ -370,11 +227,6 @@ void Nasa9PolyMultiTempRegion::reportParameters(size_t& n, int& type,
}
// Modify parameters for the standard state
/*
* @param coeffs Vector of coefficients used to set the
* parameters for the standard state.
*/
void Nasa9PolyMultiTempRegion::modifyParameters(doublereal* coeffs)
{
int index = 3;

View file

@ -10,18 +10,15 @@
* This parameterization has multiple NASA temperature regions.
*/
#ifndef CT_NASA9POLYMULTITEMPREGION_H
#define CT_NASA9POLYMULTITEMPREGION_H
// Copyright 2007 Sandia National Laboratories
#include "cantera/base/global.h"
#include "cantera/thermo/Nasa9Poly1.h"
namespace Cantera
{
//! The NASA 9 polynomial parameterization for a single species
//! encompassing multiple temperature regions.
/*!
@ -69,9 +66,7 @@ namespace Cantera
*/
class Nasa9PolyMultiTempRegion : public SpeciesThermoInterpType
{
public:
//! Empty constructor
Nasa9PolyMultiTempRegion();
@ -104,33 +99,21 @@ public:
//! Destructor
virtual ~Nasa9PolyMultiTempRegion();
//! Duplicator
virtual SpeciesThermoInterpType*
duplMyselfAsSpeciesThermoInterpType() const;
//! Returns the minimum temperature that the thermo
//! parameterization is valid
virtual doublereal minTemp() const;
//! Returns the maximum temperature that the thermo
//! parameterization is valid
virtual doublereal maxTemp() const;
//! Returns the reference pressure (Pa)
virtual doublereal refPressure() const;
//! Returns an integer representing the type of parameterization
virtual int reportType() const;
//! Returns an integer representing the species index
virtual size_t speciesIndex() const;
//! Update the properties for this species, given a temperature polynomial
/*!
* This method is called with a pointer to an array containing the functions of
* temperature needed by this parameterization, and three pointers to arrays where the
* computed property values should be written. This method updates only one value in
* each array.
* This method is called with a pointer to an array containing the
* functions of temperature needed by this parameterization, and three
* pointers to arrays where the computed property values should be
* written. This method updates only one value in each array.
*
* Temperature Polynomial:
* tt[0] = t;
@ -142,18 +125,14 @@ public:
* tt[6] = std::log(t);
*
* @param tt vector of temperature polynomials
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
* @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
* @param s_R Vector of Dimensionless entropies. (length m_kk).
*/
virtual void updateProperties(const doublereal* tt,
doublereal* cp_R, doublereal* h_RT,
doublereal* s_R) const;
//! Compute the reference-state property of one species
/*!
* Given temperature T in K, this method updates the values of
@ -172,12 +151,9 @@ public:
* tt[6] = std::log(t);
*
* @param temp Temperature (Kelvin)
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
* @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
* @param s_R Vector of Dimensionless entropies. (length m_kk).
*/
virtual void updatePropertiesTemp(const doublereal temp,
doublereal* cp_R, doublereal* h_RT,
@ -244,4 +220,3 @@ protected:
}
#endif

View file

@ -9,7 +9,6 @@
*/
// Copyright 2001 California Institute of Technology
#ifndef CT_NASAPOLY2_H
#define CT_NASAPOLY2_H
@ -17,10 +16,7 @@
namespace Cantera
{
/**
*
*
* The NASA polynomial parameterization for two temperature ranges.
* This parameterization expresses the heat capacity as a
* fourth-order polynomial. Note that this is the form used in the
@ -50,9 +46,7 @@ namespace Cantera
*/
class NasaPoly2 : public SpeciesThermoInterpType
{
public:
//! Empty constructor
NasaPoly2()
: m_lowT(0.0),
@ -122,47 +116,38 @@ public:
//! destructor
virtual ~NasaPoly2() { }
//! duplicator
virtual SpeciesThermoInterpType*
duplMyselfAsSpeciesThermoInterpType() const {
NasaPoly2* np = new NasaPoly2(*this);
return (SpeciesThermoInterpType*) np;
}
//! Returns the minimum temperature that the thermo
//! parameterization is valid
doublereal minTemp() const {
return m_lowT;
}
//! Returns the maximum temperature that the thermo
//! parameterization is valid
doublereal maxTemp() const {
return m_highT;
}
//! Returns the reference pressure (Pa)
doublereal refPressure() const {
return m_Pref;
}
//! Returns an integer representing the type of parameterization
virtual int reportType() const {
return NASA2;
}
//! Returns an integer representing the species index
virtual size_t speciesIndex() const {
return m_index;
}
//! Update the properties for this species, given a temperature polynomial
/*!
* This method is called with a pointer to an array containing the functions of
* temperature needed by this parameterization, and three pointers to arrays where the
* computed property values should be written. This method updates only one value in
* each array.
* This method is called with a pointer to an array containing the
* functions of temperature needed by this parameterization, and three
* pointers to arrays where the computed property values should be
* written. This method updates only one value in each array.
*
* Temperature Polynomial:
* tt[0] = t;
@ -173,16 +158,12 @@ public:
* tt[5] = std::log(t);
*
* @param tt vector of temperature polynomials
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
* @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
* @param s_R Vector of Dimensionless entropies. (length m_kk).
*/
void updateProperties(const doublereal* tt,
doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const {
double T = tt[0];
if (T <= m_midT) {
mnp_low.updateProperties(tt, cp_R, h_RT, s_R);
@ -191,22 +172,6 @@ public:
}
}
//! Compute the reference-state property of one species
/*!
* Given temperature T in K, this method updates the values of
* the non-dimensional heat capacity at constant pressure,
* enthalpy, and entropy, at the reference pressure, Pref
* of one of the species. The species index is used
* to reference into the cp_R, h_RT, and s_R arrays.
*
* @param temp Temperature (Kelvin)
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
*/
void updatePropertiesTemp(const doublereal temp,
doublereal* cp_R,
doublereal* h_RT,
@ -218,20 +183,6 @@ public:
}
}
//!This utility function reports back the type of
//! parameterization and all of the parameters for the
//! species, index.
/*!
* All parameters are output variables
*
* @param n Species index
* @param type Integer type of the standard type
* @param tlow output - Minimum temperature
* @param thigh output - Maximum temperature
* @param pref output - reference pressure (Pa).
* @param coeffs Vector of coefficients used to set the
* parameters for the standard state.
*/
void reportParameters(size_t& n, int& type,
doublereal& tlow, doublereal& thigh,
doublereal& pref,
@ -295,12 +246,7 @@ protected:
size_t m_index;
//! array of polynomial coefficients
vector_fp m_coeff;
};
}
#endif

View file

@ -9,7 +9,6 @@
*/
// Copyright 2001 California Institute of Technology
#ifndef CT_SHOMATEPOLY1_H
#define CT_SHOMATEPOLY1_H
@ -17,12 +16,9 @@
namespace Cantera
{
//! The Shomate polynomial parameterization for one temperature range
//! for one species
/*!
*
* Seven coefficients \f$(A,\dots,G)\f$ are used to represent
* \f$ c_p^0(T)\f$, \f$ h^0(T)\f$, and \f$ s^0(T) \f$ as
* polynomials in the temperature, \f$ T \f$ :
@ -54,14 +50,11 @@ namespace Cantera
* Before being used within Cantera, the dimensions must be adjusted to those
* used by Cantera (i.e., Joules and kmol).
*
* @ingroup spthermo
*/
class ShomatePoly : public SpeciesThermoInterpType
{
public:
//! Empty constructor
ShomatePoly()
: m_lowT(0.0), m_highT(0.0),
@ -133,64 +126,52 @@ public:
//! Destructor
virtual ~ShomatePoly() {}
//! Duplicator from the base class
virtual SpeciesThermoInterpType*
duplMyselfAsSpeciesThermoInterpType() const {
ShomatePoly* sp = new ShomatePoly(*this);
return (SpeciesThermoInterpType*) sp;
}
//! Returns the minimum temperature that the thermo
//! parameterization is valid
virtual doublereal minTemp() const {
return m_lowT;
}
//! Returns the maximum temperature that the thermo
//! parameterization is valid
virtual doublereal maxTemp() const {
return m_highT;
}
//! Returns the reference pressure (Pa)
virtual doublereal refPressure() const {
return m_Pref;
}
//! Returns an integer representing the type of parameterization
virtual int reportType() const {
return SHOMATE;
}
//! Returns an integer representing the species index
virtual size_t speciesIndex() const {
return m_index;
}
//! Update the properties for this species, given a temperature polynomial
/*!
* This method is called with a pointer to an array containing the functions of
* temperature needed by this parameterization, and three pointers to arrays where the
* computed property values should be written. This method updates only one value in
* each array.
* This method is called with a pointer to an array containing the
* functions of temperature needed by this parameterization, and three
* pointers to arrays where the computed property values should be
* written. This method updates only one value in each array.
*
* tt is T/1000.
* m_t[0] = tt;
* m_t[1] = tt*tt;
* m_t[2] = m_t[1]*tt;
* m_t[3] = 1.0/m_t[1];
* m_t[4] = log(tt);
* m_t[5] = 1.0/GasConstant;
* m_t[6] = 1.0/(GasConstant * T);
* - `tt` is T/1000.
* - `m_t[0] = tt`
* - `m_t[1] = tt*tt`
* - `m_t[2] = m_t[1]*tt`
* - `m_t[3] = 1.0/m_t[1]`
* - `m_t[4] = log(tt)`
* - `m_t[5] = 1.0/GasConstant`
* - `m_t[6] = 1.0/(GasConstant * T)`
*
* @param tt Vector of temperature polynomials
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
* @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
* @param s_R Vector of Dimensionless entropies. (length m_kk).
*/
virtual void updateProperties(const doublereal* tt,
doublereal* cp_R, doublereal* h_RT,
@ -223,22 +204,6 @@ public:
s_R[m_index] = 1.e3 * s * tt[5];
}
//! Compute the reference-state property of one species
/*!
* Given temperature T in K, this method updates the values of
* the non-dimensional heat capacity at constant pressure,
* enthalpy, and entropy, at the reference pressure, Pref
* of one of the species. The species index is used
* to reference into the cp_R, h_RT, and s_R arrays.
*
* @param temp Temperature (Kelvin)
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
*/
virtual void updatePropertiesTemp(const doublereal temp,
doublereal* cp_R, doublereal* h_RT,
doublereal* s_R) const {
@ -254,20 +219,6 @@ public:
updateProperties(tPoly, cp_R, h_RT, s_R);
}
//!This utility function reports back the type of
//! parameterization and all of the parameters for the
//! species, index.
/*!
* All parameters are output variables
*
* @param n Species index
* @param type Integer type of the standard type
* @param tlow output - Minimum temperature
* @param thigh output - Maximum temperature
* @param pref output - reference pressure (Pa).
* @param coeffs Vector of coefficients used to set the
* parameters for the standard state.
*/
virtual void reportParameters(size_t& n, int& type,
doublereal& tlow, doublereal& thigh,
doublereal& pref,
@ -297,18 +248,7 @@ public:
#ifdef H298MODIFY_CAPABILITY
//! 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.
*
* @param h298 If this is nonnull, the current value of the Heat of Formation at 298K and 1 bar for
* species m_index is returned in h298[m_index].
* @return Returns the current value of the Heat of Formation at 298K and 1 bar for
* species m_index.
*/
virtual doublereal reportHf298(doublereal* const h298 = 0) const {
double tPoly[4];
doublereal tt = 1.e-3*298.15;
tPoly[0] = tt;
@ -332,14 +272,6 @@ public:
return hh;
}
//! Modify the value of the 298 K Heat of Formation 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.
*
* @param k Species k
* @param Hf298New Specify the new value of the Heat of Formation at 298K and 1 bar
*/
virtual void modifyOneHf298(const int k, const doublereal Hf298New) {
doublereal hnow = reportHf298();
doublereal delH = Hf298New - hnow;
@ -359,15 +291,11 @@ protected:
vector_fp m_coeff;
//! Species Index
size_t m_index;
private:
};
//! The Shomate polynomial parameterization for two temperature ranges
//! for one species
/*!
*
* Seven coefficients \f$(A,\dots,G)\f$ are used to represent
* \f$ c_p^0(T)\f$, \f$ h^0(T)\f$, and \f$ s^0(T) \f$ as
* polynomials in the temperature, \f$ T \f$, in one temperature region:
@ -404,13 +332,11 @@ private:
* therefore, in this representation. The first coefficient is the midrange
* temperature.
*
*
* @ingroup spthermo
*/
class ShomatePoly2 : public SpeciesThermoInterpType
{
public:
//! Empty constructor
ShomatePoly2()
: m_lowT(0.0),
@ -504,63 +430,51 @@ public:
delete msp_high;
}
//! duplicator
virtual SpeciesThermoInterpType*
duplMyselfAsSpeciesThermoInterpType() const {
ShomatePoly2* sp = new ShomatePoly2(*this);
return (SpeciesThermoInterpType*) sp;
}
//! Returns the minimum temperature that the thermo
//! parameterization is valid
virtual doublereal minTemp() const {
return m_lowT;
}
//! Returns the maximum temperature that the thermo
//! parameterization is valid
virtual doublereal maxTemp() const {
return m_highT;
}
//! Returns the reference pressure (Pa)
virtual doublereal refPressure() const {
return m_Pref;
}
//! Returns an integer representing the type of parameterization
virtual int reportType() const {
return SHOMATE2;
}
//! Returns an integer representing the species index
virtual size_t speciesIndex() const {
return m_index;
}
//! Update the properties for this species, given a temperature polynomial
/*!
* This method is called with a pointer to an array containing the functions of
* temperature needed by this parameterization, and three pointers to arrays where the
* computed property values should be written. This method updates only one value in
* each array.
* This method is called with a pointer to an array containing the
* functions of temperature needed by this parameterization, and three
* pointers to arrays where the computed property values should be
* written. This method updates only one value in each array.
*
* Temperature Polynomial:
* tt[0] = t;
* tt[1] = t*t;
* tt[2] = m_t[1]*t;
* tt[3] = m_t[2]*t;
* tt[4] = 1.0/t;
* tt[5] = std::log(t);
* - `tt[0] = t`
* - `tt[1] = t*t`
* - `tt[2] = m_t[1]*t`
* - `tt[3] = m_t[2]*t`
* - `tt[4] = 1.0/t`
* - `tt[5] = std::log(t)`
*
* @param tt vector of temperature polynomials
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
* @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
* @param s_R Vector of Dimensionless entropies. (length m_kk).
*/
virtual void updateProperties(const doublereal* tt,
doublereal* cp_R, doublereal* h_RT,
@ -571,25 +485,8 @@ public:
} else {
msp_high->updateProperties(tt, cp_R, h_RT, s_R);
}
}
//! Compute the reference-state property of one species
/*!
* Given temperature T in K, this method updates the values of
* the non-dimensional heat capacity at constant pressure,
* enthalpy, and entropy, at the reference pressure, Pref
* of one of the species. The species index is used
* to reference into the cp_R, h_RT, and s_R arrays.
*
* @param temp Temperature (Kelvin)
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
*/
virtual void updatePropertiesTemp(const doublereal temp,
doublereal* cp_R,
doublereal* h_RT,
@ -601,20 +498,6 @@ public:
}
}
//!This utility function reports back the type of
//! parameterization and all of the parameters for the
//! species, index.
/*!
* All parameters are output variables
*
* @param n Species index
* @param type Integer type of the standard type
* @param tlow output - Minimum temperature
* @param thigh output - Maximum temperature
* @param pref output - reference pressure (Pa).
* @param coeffs Vector of coefficients used to set the
* parameters for the standard state.
*/
virtual void reportParameters(size_t& n, int& type,
doublereal& tlow, doublereal& thigh,
doublereal& pref,
@ -631,8 +514,7 @@ public:
//! Modify parameters for the standard state
/*!
* Here, we take the tact that we will just regenerate the
* object.
* Here, we take the tact that we will just regenerate the object.
*
* @param coeffs Vector of coefficients used to set the
* parameters for the standard state.

View file

@ -44,9 +44,6 @@ void SpeciesThermoInterpType::modifyOneHf298(const int k, const doublereal Hf298
#endif
/***************************************************************************************************/
//! Constructor
STITbyPDSS::STITbyPDSS() :
m_speciesIndex(npos)
{
@ -66,19 +63,16 @@ STITbyPDSS::STITbyPDSS(const STITbyPDSS& b) :
{
}
//! Destructor
STITbyPDSS::~STITbyPDSS()
{
}
//! duplicator
SpeciesThermoInterpType*
STITbyPDSS::duplMyselfAsSpeciesThermoInterpType() const
{
return new STITbyPDSS(*this);
}
void STITbyPDSS::initAllPtrs(size_t speciesIndex, VPSSMgr* vpssmgr_ptr, PDSS* PDSS_ptr)
{
AssertThrow(speciesIndex == m_speciesIndex, "STITbyPDSS::initAllPtrs internal confusion");
@ -86,57 +80,31 @@ void STITbyPDSS::initAllPtrs(size_t speciesIndex, VPSSMgr* vpssmgr_ptr, PDSS* PD
m_PDSS_ptr = PDSS_ptr;
}
//! Returns the minimum temperature that the thermo
//! parameterization is valid
doublereal STITbyPDSS::minTemp() const
{
return m_PDSS_ptr->minTemp();
}
//! Returns the maximum temperature that the thermo
//! parameterization is valid
doublereal STITbyPDSS::maxTemp() const
{
return m_PDSS_ptr->maxTemp();
}
//! Returns the reference pressure (Pa)
doublereal STITbyPDSS::refPressure() const
{
return m_PDSS_ptr->refPressure();
}
//! Returns an integer representing the type of parameterization
int STITbyPDSS::reportType() const
{
return PDSS_TYPE;
}
//! Returns an integer representing the species index
size_t STITbyPDSS::speciesIndex() const
{
return m_speciesIndex;
}
//! Update the properties for this species, given a temperature
//! polynomial
/*!
* This method is called with a pointer to an array containing the functions of
* temperature needed by this parameterization, and three pointers to arrays where the
* computed property values should be written. This method updates only one value in
* each array.
*
* The form and length of the Temperature Polynomial may vary depending on the
* parameterization.
*
* @param tempPoly vector of temperature polynomials
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
*/
void STITbyPDSS::updateProperties(const doublereal* tempPoly,
doublereal* cp_R, doublereal* h_RT,
doublereal* s_R) const
@ -145,22 +113,6 @@ void STITbyPDSS::updateProperties(const doublereal* tempPoly,
updatePropertiesTemp(T, cp_R, h_RT, s_R);
}
//! Compute the reference-state property of one species
/*!
* Given temperature T in K, this method updates the values of
* the non-dimensional heat capacity at constant pressure,
* enthalpy, and entropy, at the reference pressure, Pref
* of one of the species. The species index is used
* to reference into the cp_R, h_RT, and s_R arrays.
*
* @param temp Temperature (Kelvin)
* @param cp_R Vector of Dimensionless heat capacities.
* (length m_kk).
* @param h_RT Vector of Dimensionless enthalpies.
* (length m_kk).
* @param s_R Vector of Dimensionless entropies.
* (length m_kk).
*/
void STITbyPDSS::updatePropertiesTemp(const doublereal temp,
doublereal* cp_R,
doublereal* h_RT,
@ -175,20 +127,6 @@ void STITbyPDSS::updatePropertiesTemp(const doublereal temp,
s_R[m_speciesIndex] = m_PDSS_ptr->entropy_R_ref();
}
//!This utility function reports back the type of
//! parameterization and all of the parameters for the
//! species, index.
/*!
* All parameters are output variables
*
* @param index Species index
* @param type Integer type of the standard type
* @param minTemp output - Minimum temperature
* @param maxTemp output - Maximum temperature
* @param refPressure output - reference pressure (Pa).
* @param coeffs Vector of coefficients used to set the
* parameters for the standard state.
*/
void STITbyPDSS::reportParameters(size_t& index, int& type,
doublereal& minTemp, doublereal& maxTemp,
doublereal& refPressure,
@ -201,14 +139,8 @@ void STITbyPDSS::reportParameters(size_t& index, int& type,
refPressure = m_PDSS_ptr->refPressure();
}
//! Modify parameters for the standard state
/*!
* @param coeffs Vector of coefficients used to set the
* parameters for the standard state.
*/
void STITbyPDSS::modifyParameters(doublereal* coeffs)
{
}
}