[Thermo] Move common PDSS functions up to PDSS_Nondimensional
This commit is contained in:
parent
3a119381e8
commit
574462fd3c
8 changed files with 67 additions and 218 deletions
|
|
@ -536,6 +536,18 @@ public:
|
|||
virtual doublereal gibbs_mole() const;
|
||||
virtual doublereal cp_mole() const;
|
||||
|
||||
virtual double enthalpy_RT_ref() const;
|
||||
virtual double entropy_R_ref() const;
|
||||
virtual double gibbs_RT_ref() const;
|
||||
virtual double cp_R_ref() const;
|
||||
virtual double molarVolume_ref() const;
|
||||
virtual double enthalpy_RT() const;
|
||||
virtual double entropy_R() const;
|
||||
virtual double gibbs_RT() const;
|
||||
virtual double cp_R() const;
|
||||
virtual double molarVolume() const;
|
||||
virtual double density() const;
|
||||
|
||||
protected:
|
||||
double m_h0_RT; //!< Reference state enthalpy divided by RT
|
||||
double m_cp0_R; //!< Reference state heat capacity divided by R
|
||||
|
|
|
|||
|
|
@ -53,24 +53,8 @@ public:
|
|||
//! @{
|
||||
|
||||
// See PDSS.h for documentation of functions overridden from Class PDSS
|
||||
virtual doublereal enthalpy_RT() const;
|
||||
virtual doublereal intEnergy_mole() const;
|
||||
virtual doublereal entropy_R() const;
|
||||
virtual doublereal gibbs_RT() const;
|
||||
virtual doublereal cp_R() const;
|
||||
virtual doublereal cv_mole() const;
|
||||
virtual doublereal molarVolume() const;
|
||||
virtual doublereal density() const;
|
||||
|
||||
//! @}
|
||||
//! @name Properties of the Reference State of the Species in the Solution
|
||||
//! @{
|
||||
|
||||
virtual doublereal gibbs_RT_ref() const;
|
||||
virtual doublereal enthalpy_RT_ref() const;
|
||||
virtual doublereal entropy_R_ref() const;
|
||||
virtual doublereal cp_R_ref() const;
|
||||
virtual doublereal molarVolume_ref() const;
|
||||
|
||||
//! @}
|
||||
//! @name Mechanical Equation of State Properties
|
||||
|
|
|
|||
|
|
@ -55,24 +55,8 @@ public:
|
|||
|
||||
// See PDSS.h for documentation of functions overridden from Class PDSS
|
||||
|
||||
virtual doublereal enthalpy_RT() const;
|
||||
virtual doublereal intEnergy_mole() const;
|
||||
virtual doublereal entropy_R() const;
|
||||
virtual doublereal gibbs_RT() const;
|
||||
virtual doublereal cp_R() const;
|
||||
virtual doublereal cv_mole() const;
|
||||
virtual doublereal molarVolume() const;
|
||||
virtual doublereal density() const;
|
||||
|
||||
//! @}
|
||||
//! @name Properties of the Reference State of the Species in the Solution
|
||||
//! @{
|
||||
|
||||
virtual doublereal gibbs_RT_ref() const;
|
||||
virtual doublereal enthalpy_RT_ref() const;
|
||||
virtual doublereal entropy_R_ref() const;
|
||||
virtual doublereal cp_R_ref() const;
|
||||
virtual doublereal molarVolume_ref() const;
|
||||
|
||||
//! @}
|
||||
//! @name Mechanical Equation of State Properties
|
||||
|
|
@ -81,7 +65,6 @@ public:
|
|||
virtual doublereal pressure() const;
|
||||
virtual void setPressure(doublereal pres);
|
||||
virtual void setTemperature(doublereal temp);
|
||||
virtual doublereal temperature() const;
|
||||
virtual void setState_TP(doublereal temp, doublereal pres);
|
||||
virtual void setState_TR(doublereal temp, doublereal rho);
|
||||
|
||||
|
|
|
|||
|
|
@ -194,25 +194,10 @@ public:
|
|||
|
||||
// See PDSS.h for documentation of functions overridden from Class PDSS
|
||||
|
||||
virtual doublereal enthalpy_RT() const;
|
||||
virtual doublereal intEnergy_mole() const;
|
||||
virtual doublereal entropy_R() const;
|
||||
virtual doublereal gibbs_RT() const;
|
||||
virtual doublereal cp_R() const;
|
||||
virtual doublereal cv_mole() const;
|
||||
virtual doublereal molarVolume() const;
|
||||
virtual doublereal density() const;
|
||||
|
||||
//! @}
|
||||
//! @name Properties of the Reference State of the Species in the Solution
|
||||
//! @{
|
||||
|
||||
virtual doublereal gibbs_RT_ref() const;
|
||||
virtual doublereal enthalpy_RT_ref() const;
|
||||
virtual doublereal entropy_R_ref() const;
|
||||
virtual doublereal cp_R_ref() const;
|
||||
virtual doublereal molarVolume_ref() const;
|
||||
//! @}
|
||||
|
||||
private:
|
||||
//! Does the internal calculation of the volume
|
||||
|
|
|
|||
|
|
@ -294,4 +294,59 @@ doublereal PDSS_Nondimensional::cp_mole() const
|
|||
return cp_R() * GasConstant;
|
||||
}
|
||||
|
||||
double PDSS_Nondimensional::gibbs_RT_ref() const
|
||||
{
|
||||
return m_g0_RT;
|
||||
}
|
||||
|
||||
double PDSS_Nondimensional::enthalpy_RT_ref() const
|
||||
{
|
||||
return m_h0_RT;
|
||||
}
|
||||
|
||||
double PDSS_Nondimensional::entropy_R_ref() const
|
||||
{
|
||||
return m_s0_R;
|
||||
}
|
||||
|
||||
double PDSS_Nondimensional::cp_R_ref() const
|
||||
{
|
||||
return m_cp0_R;
|
||||
}
|
||||
|
||||
double PDSS_Nondimensional::molarVolume_ref() const
|
||||
{
|
||||
return m_V0;
|
||||
}
|
||||
|
||||
double PDSS_Nondimensional::enthalpy_RT() const
|
||||
{
|
||||
return m_hss_RT;
|
||||
}
|
||||
|
||||
double PDSS_Nondimensional::entropy_R() const
|
||||
{
|
||||
return m_sss_R;
|
||||
}
|
||||
|
||||
double PDSS_Nondimensional::gibbs_RT() const
|
||||
{
|
||||
return m_gss_RT;
|
||||
}
|
||||
|
||||
double PDSS_Nondimensional::cp_R() const
|
||||
{
|
||||
return m_cpss_R;
|
||||
}
|
||||
|
||||
double PDSS_Nondimensional::molarVolume() const
|
||||
{
|
||||
return m_Vss;
|
||||
}
|
||||
|
||||
double PDSS_Nondimensional::density() const
|
||||
{
|
||||
return m_mw / m_Vss;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,72 +70,17 @@ void PDSS_ConstVol::initThermo()
|
|||
m_Vss = m_constMolarVolume;
|
||||
}
|
||||
|
||||
doublereal PDSS_ConstVol::enthalpy_RT() const
|
||||
{
|
||||
return m_hss_RT;
|
||||
}
|
||||
|
||||
doublereal PDSS_ConstVol::intEnergy_mole() const
|
||||
{
|
||||
doublereal pV = (m_pres * m_Vss);
|
||||
return m_h0_RT * GasConstant * m_temp - pV;
|
||||
}
|
||||
|
||||
doublereal PDSS_ConstVol::entropy_R() const
|
||||
{
|
||||
return m_sss_R;
|
||||
}
|
||||
|
||||
doublereal PDSS_ConstVol::gibbs_RT() const
|
||||
{
|
||||
return m_gss_RT;
|
||||
}
|
||||
|
||||
doublereal PDSS_ConstVol::cp_R() const
|
||||
{
|
||||
return m_cpss_R;
|
||||
}
|
||||
|
||||
doublereal PDSS_ConstVol::cv_mole() const
|
||||
{
|
||||
return (cp_mole() - m_V0);
|
||||
}
|
||||
|
||||
doublereal PDSS_ConstVol::molarVolume() const
|
||||
{
|
||||
return m_Vss;
|
||||
}
|
||||
|
||||
doublereal PDSS_ConstVol::density() const
|
||||
{
|
||||
return m_mw / m_Vss;
|
||||
}
|
||||
|
||||
doublereal PDSS_ConstVol::gibbs_RT_ref() const
|
||||
{
|
||||
return m_g0_RT;
|
||||
}
|
||||
|
||||
doublereal PDSS_ConstVol::enthalpy_RT_ref() const
|
||||
{
|
||||
return m_h0_RT;
|
||||
}
|
||||
|
||||
doublereal PDSS_ConstVol::entropy_R_ref() const
|
||||
{
|
||||
return m_s0_R;
|
||||
}
|
||||
|
||||
doublereal PDSS_ConstVol::cp_R_ref() const
|
||||
{
|
||||
return m_cp0_R;
|
||||
}
|
||||
|
||||
doublereal PDSS_ConstVol::molarVolume_ref() const
|
||||
{
|
||||
return m_V0;
|
||||
}
|
||||
|
||||
void PDSS_ConstVol::setPressure(doublereal p)
|
||||
{
|
||||
m_pres = p;
|
||||
|
|
|
|||
|
|
@ -43,71 +43,16 @@ void PDSS_IdealGas::initThermo()
|
|||
m_maxTemp = m_spthermo->maxTemp(m_spindex);
|
||||
}
|
||||
|
||||
doublereal PDSS_IdealGas::enthalpy_RT() const
|
||||
{
|
||||
return m_h0_RT;
|
||||
}
|
||||
|
||||
doublereal PDSS_IdealGas::intEnergy_mole() const
|
||||
{
|
||||
return (m_h0_RT - 1.0) * GasConstant * m_temp;
|
||||
}
|
||||
|
||||
doublereal PDSS_IdealGas::entropy_R() const
|
||||
{
|
||||
return m_s0_R - log(m_pres/m_p0);
|
||||
}
|
||||
|
||||
doublereal PDSS_IdealGas::gibbs_RT() const
|
||||
{
|
||||
return m_g0_RT + log(m_pres/m_p0);
|
||||
}
|
||||
|
||||
doublereal PDSS_IdealGas::cp_R() const
|
||||
{
|
||||
return m_cp0_R;
|
||||
}
|
||||
|
||||
doublereal PDSS_IdealGas::molarVolume() const
|
||||
{
|
||||
return GasConstant * m_temp / m_pres;
|
||||
}
|
||||
|
||||
doublereal PDSS_IdealGas::density() const
|
||||
{
|
||||
return m_pres * m_mw / (GasConstant * m_temp);
|
||||
}
|
||||
|
||||
doublereal PDSS_IdealGas::cv_mole() const
|
||||
{
|
||||
return cp_mole() - GasConstant;
|
||||
}
|
||||
|
||||
doublereal PDSS_IdealGas::gibbs_RT_ref() const
|
||||
{
|
||||
return m_g0_RT;
|
||||
}
|
||||
|
||||
doublereal PDSS_IdealGas::enthalpy_RT_ref() const
|
||||
{
|
||||
return m_h0_RT;
|
||||
}
|
||||
|
||||
doublereal PDSS_IdealGas::entropy_R_ref() const
|
||||
{
|
||||
return m_s0_R;
|
||||
}
|
||||
|
||||
doublereal PDSS_IdealGas::cp_R_ref() const
|
||||
{
|
||||
return cp_R();
|
||||
}
|
||||
|
||||
doublereal PDSS_IdealGas::molarVolume_ref() const
|
||||
{
|
||||
return GasConstant * m_temp / m_p0;
|
||||
}
|
||||
|
||||
doublereal PDSS_IdealGas::pressure() const
|
||||
{
|
||||
throw CanteraError("PDSS_IdealGas::pressure()", "unimplemented");
|
||||
|
|
@ -120,11 +65,6 @@ void PDSS_IdealGas::setPressure(doublereal p)
|
|||
m_Vss = GasConstant * m_temp / m_pres;
|
||||
}
|
||||
|
||||
doublereal PDSS_IdealGas::temperature() const
|
||||
{
|
||||
return m_temp;
|
||||
}
|
||||
|
||||
void PDSS_IdealGas::setTemperature(doublereal temp)
|
||||
{
|
||||
m_temp = temp;
|
||||
|
|
|
|||
|
|
@ -93,72 +93,17 @@ void PDSS_SSVol::initThermo()
|
|||
m_Vss = m_constMolarVolume;
|
||||
}
|
||||
|
||||
doublereal PDSS_SSVol::enthalpy_RT() const
|
||||
{
|
||||
return m_hss_RT;
|
||||
}
|
||||
|
||||
doublereal PDSS_SSVol::intEnergy_mole() const
|
||||
{
|
||||
doublereal pV = m_pres * m_Vss;
|
||||
return m_h0_RT * GasConstant * m_temp - pV;
|
||||
}
|
||||
|
||||
doublereal PDSS_SSVol::entropy_R() const
|
||||
{
|
||||
return m_sss_R;
|
||||
}
|
||||
|
||||
doublereal PDSS_SSVol::gibbs_RT() const
|
||||
{
|
||||
return m_gss_RT;
|
||||
}
|
||||
|
||||
doublereal PDSS_SSVol::cp_R() const
|
||||
{
|
||||
return m_cpss_R;
|
||||
}
|
||||
|
||||
doublereal PDSS_SSVol::cv_mole() const
|
||||
{
|
||||
return (cp_mole() - m_V0);
|
||||
}
|
||||
|
||||
doublereal PDSS_SSVol::molarVolume() const
|
||||
{
|
||||
return m_Vss;
|
||||
}
|
||||
|
||||
doublereal PDSS_SSVol::density() const
|
||||
{
|
||||
return m_mw / m_Vss;
|
||||
}
|
||||
|
||||
doublereal PDSS_SSVol::gibbs_RT_ref() const
|
||||
{
|
||||
return m_g0_RT;
|
||||
}
|
||||
|
||||
doublereal PDSS_SSVol::enthalpy_RT_ref() const
|
||||
{
|
||||
return m_h0_RT;
|
||||
}
|
||||
|
||||
doublereal PDSS_SSVol::entropy_R_ref() const
|
||||
{
|
||||
return m_s0_R;
|
||||
}
|
||||
|
||||
doublereal PDSS_SSVol::cp_R_ref() const
|
||||
{
|
||||
return m_cp0_R;
|
||||
}
|
||||
|
||||
doublereal PDSS_SSVol::molarVolume_ref() const
|
||||
{
|
||||
return m_V0;
|
||||
}
|
||||
|
||||
void PDSS_SSVol::calcMolarVolume()
|
||||
{
|
||||
if (volumeModel_ == SSVolume_Model::constant) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue