Clean up formatting of SpeciesThermoInterpType
This commit is contained in:
parent
e5c3377dd2
commit
930bcceddc
2 changed files with 61 additions and 78 deletions
|
|
@ -1,8 +1,9 @@
|
||||||
/**
|
/**
|
||||||
* @file SpeciesThermoInterpType.h
|
* @file SpeciesThermoInterpType.h
|
||||||
* Pure Virtual Base class for individual species reference state
|
*
|
||||||
* thermodynamic managers and text for the spthermo module
|
* Pure Virtual Base class for individual species reference state thermodynamic
|
||||||
* (see \ref spthermo and class \link Cantera::SpeciesThermoInterpType SpeciesThermoInterpType \endlink).
|
* managers and text for the spthermo module (see \ref spthermo and class \link
|
||||||
|
* Cantera::SpeciesThermoInterpType SpeciesThermoInterpType \endlink).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Copyright 2001 California Institute of Technology
|
// Copyright 2001 California Institute of Technology
|
||||||
|
|
@ -157,24 +158,15 @@ class VPSSMgr;
|
||||||
class SpeciesThermoInterpType
|
class SpeciesThermoInterpType
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//! Constructor
|
|
||||||
SpeciesThermoInterpType();
|
SpeciesThermoInterpType();
|
||||||
|
|
||||||
//! Constructor
|
|
||||||
SpeciesThermoInterpType(size_t n, doublereal tlow,
|
SpeciesThermoInterpType(size_t n, doublereal tlow,
|
||||||
doublereal thigh, doublereal pref);
|
doublereal thigh, doublereal pref);
|
||||||
|
|
||||||
//! Constructor
|
|
||||||
/*!
|
|
||||||
* @param b Object to be copied
|
|
||||||
*/
|
|
||||||
SpeciesThermoInterpType(const SpeciesThermoInterpType& b);
|
SpeciesThermoInterpType(const SpeciesThermoInterpType& b);
|
||||||
|
|
||||||
//! Destructor
|
virtual ~SpeciesThermoInterpType() {}
|
||||||
virtual ~SpeciesThermoInterpType();
|
|
||||||
|
|
||||||
//! duplicator
|
|
||||||
virtual SpeciesThermoInterpType*
|
virtual SpeciesThermoInterpType*
|
||||||
duplMyselfAsSpeciesThermoInterpType() const = 0;
|
duplMyselfAsSpeciesThermoInterpType() const = 0;
|
||||||
|
|
||||||
|
|
@ -205,13 +197,13 @@ public:
|
||||||
|
|
||||||
//! 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
|
* This method is called with a pointer to an array containing the functions
|
||||||
* temperature needed by this parameterization, and three pointers to arrays where the
|
* of temperature needed by this parameterization, and three pointers to
|
||||||
* computed property values should be written. This method updates only one value in
|
* arrays where the computed property values should be written. This method
|
||||||
* each array.
|
* updates only one value in each array.
|
||||||
*
|
*
|
||||||
* The form and length of the Temperature Polynomial may vary depending on the
|
* The form and length of the Temperature Polynomial may vary depending on
|
||||||
* parameterization.
|
* the parameterization.
|
||||||
*
|
*
|
||||||
* @param tempPoly vector of temperature polynomials
|
* @param tempPoly vector of temperature polynomials
|
||||||
* @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
|
* @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
|
||||||
|
|
@ -266,25 +258,31 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual void modifyParameters(doublereal* coeffs) {}
|
virtual void modifyParameters(doublereal* coeffs) {}
|
||||||
|
|
||||||
//! 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
|
* The 298K Heat of Formation is defined as the enthalpy change to create
|
||||||
* of the species from its constituent elements in their standard states at 298 K and 1 bar.
|
* 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
|
* @param h298 If this is nonnull, the current value of the Heat of
|
||||||
* species m_speciesIndex is returned in h298[m_speciesIndex].
|
* Formation at 298K and 1 bar for species m_speciesIndex is
|
||||||
* @return Returns the current value of the Heat of Formation at 298K and 1 bar for
|
* returned in h298[m_speciesIndex].
|
||||||
* species m_speciesIndex.
|
* @return Returns the current value of the Heat of Formation at 298K
|
||||||
|
* and 1 bar for species m_speciesIndex.
|
||||||
*/
|
*/
|
||||||
virtual doublereal reportHf298(doublereal* const h298 = 0) const;
|
virtual doublereal reportHf298(doublereal* const h298 = 0) const;
|
||||||
|
|
||||||
//! Modify the value of the 298 K Heat of Formation of one species in the phase (J kmol-1)
|
//! 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
|
* The 298K heat of formation is defined as the enthalpy change to create
|
||||||
* of the species from its constituent elements in their standard states at 298 K and 1 bar.
|
* 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 k Species k
|
||||||
* @param Hf298New Specify the new value of the Heat of Formation at 298K and 1 bar
|
* @param Hf298New Specify the new value of the Heat of Formation at
|
||||||
|
* 298K and 1 bar
|
||||||
*/
|
*/
|
||||||
virtual void modifyOneHf298(const size_t k, const doublereal Hf298New);
|
virtual void modifyOneHf298(const size_t k, const doublereal Hf298New);
|
||||||
|
|
||||||
|
|
@ -299,15 +297,15 @@ protected:
|
||||||
size_t m_index;
|
size_t m_index;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Class for the thermodynamic manager for an individual species' reference state
|
//! Class for the thermodynamic manager for an individual species' reference
|
||||||
//! which uses the PDSS base class to satisfy the requests.
|
//! state which uses the PDSS base class to satisfy the requests.
|
||||||
/*!
|
/*!
|
||||||
* This class is a pass-through class for handling thermodynamics calls
|
* This class is a pass-through class for handling thermodynamics calls
|
||||||
* for reference state thermo to an pressure dependent standard state (PDSS)
|
* for reference state thermo to an pressure dependent standard state (PDSS)
|
||||||
* class. For some situations, it makes no sense to have a reference state
|
* class. For some situations, it makes no sense to have a reference state
|
||||||
* at all. One example of this is the real water standard state.
|
* at all. One example of this is the real water standard state.
|
||||||
*
|
*
|
||||||
* What this class does is just to pass through the calls for thermo at (T , p0)
|
* What this class does is just to pass through the calls for thermo at (T, p0)
|
||||||
* to the PDSS class, which evaluates the calls at (T, p0).
|
* to the PDSS class, which evaluates the calls at (T, p0).
|
||||||
*
|
*
|
||||||
* @ingroup spthermo
|
* @ingroup spthermo
|
||||||
|
|
@ -323,10 +321,12 @@ public:
|
||||||
* @param speciesIndex species index for this object. Note, this must
|
* @param speciesIndex species index for this object. Note, this must
|
||||||
* agree with what was internally set before.
|
* agree with what was internally set before.
|
||||||
*
|
*
|
||||||
* @param vpssmgr_ptr Pointer to the Variable pressure standard state manager
|
* @param vpssmgr_ptr Pointer to the Variable pressure standard state
|
||||||
* that owns the PDSS object that will handle calls for this object
|
* manager 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
|
* @param PDSS_ptr Pointer to the PDSS object that handles calls for
|
||||||
|
* this object
|
||||||
*/
|
*/
|
||||||
STITbyPDSS(size_t speciesIndex, VPSSMgr* vpssmgr_ptr, PDSS* PDSS_ptr);
|
STITbyPDSS(size_t speciesIndex, VPSSMgr* vpssmgr_ptr, PDSS* PDSS_ptr);
|
||||||
|
|
||||||
|
|
@ -341,16 +341,18 @@ public:
|
||||||
//! Initialize and/or Reinitialize all the pointers for this object
|
//! Initialize and/or Reinitialize all the pointers for this object
|
||||||
/*!
|
/*!
|
||||||
* This routine is needed because the STITbyPDSS object doesn't own the
|
* This routine is needed because the STITbyPDSS object doesn't own the
|
||||||
* underlying objects. Therefore, shallow copies during duplication operations
|
* underlying objects. Therefore, shallow copies during duplication
|
||||||
* may fail.
|
* operations may fail.
|
||||||
*
|
*
|
||||||
* @param speciesIndex species index for this object. Note, this must
|
* @param speciesIndex species index for this object. Note, this must
|
||||||
* agree with what was internally set before.
|
* agree with what was internally set before.
|
||||||
*
|
*
|
||||||
* @param vpssmgr_ptr Pointer to the Variable pressure standard state manager
|
* @param vpssmgr_ptr Pointer to the Variable pressure standard state
|
||||||
* that owns the PDSS object that will handle calls for this object
|
* manager 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
|
* @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);
|
void initAllPtrs(size_t speciesIndex, VPSSMgr* vpssmgr_ptr, PDSS* PDSS_ptr);
|
||||||
|
|
||||||
|
|
@ -382,7 +384,7 @@ public:
|
||||||
doublereal& refPressure,
|
doublereal& refPressure,
|
||||||
doublereal* const coeffs) const;
|
doublereal* const coeffs) const;
|
||||||
|
|
||||||
virtual void modifyParameters(doublereal* coeffs);
|
virtual void modifyParameters(doublereal* coeffs) {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//! Pointer to the Variable pressure standard state manager
|
//! Pointer to the Variable pressure standard state manager
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* @file SpeciesThermoInterpType.cpp
|
* @file SpeciesThermoInterpType.cpp
|
||||||
* Definitions for a
|
|
||||||
*/
|
*/
|
||||||
// Copyright 2007 Sandia National Laboratories
|
// Copyright 2007 Sandia National Laboratories
|
||||||
|
|
||||||
|
|
@ -11,7 +10,7 @@
|
||||||
|
|
||||||
namespace Cantera
|
namespace Cantera
|
||||||
{
|
{
|
||||||
//====================================================================================================
|
|
||||||
SpeciesThermoInterpType::SpeciesThermoInterpType() :
|
SpeciesThermoInterpType::SpeciesThermoInterpType() :
|
||||||
m_lowT(0.0),
|
m_lowT(0.0),
|
||||||
m_highT(0.0),
|
m_highT(0.0),
|
||||||
|
|
@ -19,16 +18,17 @@ SpeciesThermoInterpType::SpeciesThermoInterpType() :
|
||||||
m_index(0)
|
m_index(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
//====================================================================================================
|
|
||||||
SpeciesThermoInterpType::SpeciesThermoInterpType(size_t n, doublereal tlow,
|
SpeciesThermoInterpType::SpeciesThermoInterpType(size_t n, doublereal tlow,
|
||||||
doublereal thigh, doublereal pref) :
|
doublereal thigh,
|
||||||
|
doublereal pref) :
|
||||||
m_lowT(tlow),
|
m_lowT(tlow),
|
||||||
m_highT(thigh),
|
m_highT(thigh),
|
||||||
m_Pref(pref),
|
m_Pref(pref),
|
||||||
m_index(n)
|
m_index(n)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
//====================================================================================================
|
|
||||||
SpeciesThermoInterpType::SpeciesThermoInterpType(const SpeciesThermoInterpType &b) :
|
SpeciesThermoInterpType::SpeciesThermoInterpType(const SpeciesThermoInterpType &b) :
|
||||||
m_lowT(b.m_lowT),
|
m_lowT(b.m_lowT),
|
||||||
m_highT(b.m_highT),
|
m_highT(b.m_highT),
|
||||||
|
|
@ -36,38 +36,33 @@ SpeciesThermoInterpType::SpeciesThermoInterpType(const SpeciesThermoInterpType &
|
||||||
m_index(b.m_index)
|
m_index(b.m_index)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
//====================================================================================================
|
|
||||||
SpeciesThermoInterpType::~SpeciesThermoInterpType()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
//====================================================================================================
|
|
||||||
void SpeciesThermoInterpType::updateProperties(const doublereal* tempPoly,
|
void SpeciesThermoInterpType::updateProperties(const doublereal* tempPoly,
|
||||||
doublereal* cp_R, doublereal* h_RT,
|
doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const
|
||||||
doublereal* s_R) const
|
|
||||||
{
|
{
|
||||||
double T = tempPoly[0];
|
double T = tempPoly[0];
|
||||||
updatePropertiesTemp(T, cp_R, h_RT, s_R);
|
updatePropertiesTemp(T, cp_R, h_RT, s_R);
|
||||||
}
|
}
|
||||||
//====================================================================================================
|
|
||||||
doublereal SpeciesThermoInterpType::reportHf298(doublereal* const h298) const
|
doublereal SpeciesThermoInterpType::reportHf298(doublereal* const h298) const
|
||||||
{
|
{
|
||||||
throw CanteraError("SpeciesThermoInterpType::reportHf298",
|
throw CanteraError("SpeciesThermoInterpType::reportHf298",
|
||||||
"Not implemented");
|
"Not implemented");
|
||||||
}
|
}
|
||||||
//====================================================================================================
|
|
||||||
|
|
||||||
void SpeciesThermoInterpType::modifyOneHf298(const size_t k, const doublereal Hf298New)
|
void SpeciesThermoInterpType::modifyOneHf298(const size_t k,
|
||||||
|
const doublereal Hf298New)
|
||||||
{
|
{
|
||||||
throw CanteraError("SpeciesThermoInterpType::modifyOneHf298",
|
throw CanteraError("SpeciesThermoInterpType::modifyOneHf298",
|
||||||
"Not implemented");
|
"Not implemented");
|
||||||
}
|
}
|
||||||
//====================================================================================================
|
|
||||||
|
//=============================================================================
|
||||||
|
|
||||||
STITbyPDSS::STITbyPDSS()
|
STITbyPDSS::STITbyPDSS()
|
||||||
{
|
{
|
||||||
m_index = npos;
|
m_index = npos;
|
||||||
}
|
}
|
||||||
//====================================================================================================
|
|
||||||
|
|
||||||
STITbyPDSS::STITbyPDSS(size_t k, VPSSMgr* vpssmgr_ptr, PDSS* PDSS_ptr) :
|
STITbyPDSS::STITbyPDSS(size_t k, VPSSMgr* vpssmgr_ptr, PDSS* PDSS_ptr) :
|
||||||
SpeciesThermoInterpType(),
|
SpeciesThermoInterpType(),
|
||||||
|
|
@ -76,7 +71,6 @@ STITbyPDSS::STITbyPDSS(size_t k, VPSSMgr* vpssmgr_ptr, PDSS* PDSS_ptr) :
|
||||||
{
|
{
|
||||||
m_index = k;
|
m_index = k;
|
||||||
}
|
}
|
||||||
//====================================================================================================
|
|
||||||
|
|
||||||
STITbyPDSS::STITbyPDSS(const STITbyPDSS& b) :
|
STITbyPDSS::STITbyPDSS(const STITbyPDSS& b) :
|
||||||
SpeciesThermoInterpType(b),
|
SpeciesThermoInterpType(b),
|
||||||
|
|
@ -84,46 +78,41 @@ STITbyPDSS::STITbyPDSS(const STITbyPDSS& b) :
|
||||||
m_PDSS_ptr(b.m_PDSS_ptr)
|
m_PDSS_ptr(b.m_PDSS_ptr)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
//====================================================================================================
|
|
||||||
|
|
||||||
SpeciesThermoInterpType*
|
SpeciesThermoInterpType*
|
||||||
STITbyPDSS::duplMyselfAsSpeciesThermoInterpType() const
|
STITbyPDSS::duplMyselfAsSpeciesThermoInterpType() const
|
||||||
{
|
{
|
||||||
return new STITbyPDSS(*this);
|
return new STITbyPDSS(*this);
|
||||||
}
|
}
|
||||||
//====================================================================================================
|
|
||||||
|
|
||||||
void STITbyPDSS::initAllPtrs(size_t speciesIndex, VPSSMgr* vpssmgr_ptr, PDSS* PDSS_ptr)
|
void STITbyPDSS::initAllPtrs(size_t speciesIndex, VPSSMgr* vpssmgr_ptr,
|
||||||
|
PDSS* PDSS_ptr)
|
||||||
{
|
{
|
||||||
AssertThrow(speciesIndex == m_index, "STITbyPDSS::initAllPtrs internal confusion");
|
AssertThrow(speciesIndex == m_index,
|
||||||
|
"STITbyPDSS::initAllPtrs internal confusion");
|
||||||
m_vpssmgr_ptr = vpssmgr_ptr;
|
m_vpssmgr_ptr = vpssmgr_ptr;
|
||||||
m_PDSS_ptr = PDSS_ptr;
|
m_PDSS_ptr = PDSS_ptr;
|
||||||
}
|
}
|
||||||
//====================================================================================================
|
|
||||||
|
|
||||||
doublereal STITbyPDSS::minTemp() const
|
doublereal STITbyPDSS::minTemp() const
|
||||||
{
|
{
|
||||||
return m_PDSS_ptr->minTemp();
|
return m_PDSS_ptr->minTemp();
|
||||||
}
|
}
|
||||||
//====================================================================================================
|
|
||||||
|
|
||||||
doublereal STITbyPDSS::maxTemp() const
|
doublereal STITbyPDSS::maxTemp() const
|
||||||
{
|
{
|
||||||
return m_PDSS_ptr->maxTemp();
|
return m_PDSS_ptr->maxTemp();
|
||||||
}
|
}
|
||||||
//====================================================================================================
|
|
||||||
|
|
||||||
doublereal STITbyPDSS::refPressure() const
|
doublereal STITbyPDSS::refPressure() const
|
||||||
{
|
{
|
||||||
return m_PDSS_ptr->refPressure();
|
return m_PDSS_ptr->refPressure();
|
||||||
}
|
}
|
||||||
//====================================================================================================
|
|
||||||
|
|
||||||
int STITbyPDSS::reportType() const
|
int STITbyPDSS::reportType() const
|
||||||
{
|
{
|
||||||
return PDSS_TYPE;
|
return PDSS_TYPE;
|
||||||
}
|
}
|
||||||
//====================================================================================================
|
|
||||||
|
|
||||||
void STITbyPDSS::updateProperties(const doublereal* tempPoly,
|
void STITbyPDSS::updateProperties(const doublereal* tempPoly,
|
||||||
doublereal* cp_R, doublereal* h_RT,
|
doublereal* cp_R, doublereal* h_RT,
|
||||||
|
|
@ -132,7 +121,6 @@ void STITbyPDSS::updateProperties(const doublereal* tempPoly,
|
||||||
doublereal T = tempPoly[0];
|
doublereal T = tempPoly[0];
|
||||||
updatePropertiesTemp(T, cp_R, h_RT, s_R);
|
updatePropertiesTemp(T, cp_R, h_RT, s_R);
|
||||||
}
|
}
|
||||||
//====================================================================================================
|
|
||||||
|
|
||||||
void STITbyPDSS::updatePropertiesTemp(const doublereal temp,
|
void STITbyPDSS::updatePropertiesTemp(const doublereal temp,
|
||||||
doublereal* cp_R,
|
doublereal* cp_R,
|
||||||
|
|
@ -146,7 +134,6 @@ void STITbyPDSS::updatePropertiesTemp(const doublereal temp,
|
||||||
cp_R[m_index] = m_PDSS_ptr->cp_R_ref();
|
cp_R[m_index] = m_PDSS_ptr->cp_R_ref();
|
||||||
s_R[m_index] = m_PDSS_ptr->entropy_R_ref();
|
s_R[m_index] = m_PDSS_ptr->entropy_R_ref();
|
||||||
}
|
}
|
||||||
//====================================================================================================
|
|
||||||
|
|
||||||
void STITbyPDSS::reportParameters(size_t& index, int& type,
|
void STITbyPDSS::reportParameters(size_t& index, int& type,
|
||||||
doublereal& minTemp, doublereal& maxTemp,
|
doublereal& minTemp, doublereal& maxTemp,
|
||||||
|
|
@ -159,11 +146,5 @@ void STITbyPDSS::reportParameters(size_t& index, int& type,
|
||||||
maxTemp = m_vpssmgr_ptr->maxTemp(m_index);
|
maxTemp = m_vpssmgr_ptr->maxTemp(m_index);
|
||||||
refPressure = m_PDSS_ptr->refPressure();
|
refPressure = m_PDSS_ptr->refPressure();
|
||||||
}
|
}
|
||||||
//====================================================================================================
|
|
||||||
|
|
||||||
void STITbyPDSS::modifyParameters(doublereal* coeffs)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
//====================================================================================================
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue