Skip to content

Commit

Permalink
Deprecate unused methods of PDSS classes
Browse files Browse the repository at this point in the history
  • Loading branch information
speth authored and ischoegl committed Mar 14, 2023
1 parent ebf7cb6 commit adb49c3
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 25 deletions.
15 changes: 6 additions & 9 deletions include/cantera/thermo/PDSS.h
Expand Up @@ -247,18 +247,22 @@ class PDSS

//! Get the difference in the standard state enthalpy
//! between the current pressure and the reference pressure, p0.
//! @deprecated To be removed after Cantera 3.0
virtual doublereal enthalpyDelp_mole() const;

//! Get the difference in the standard state entropy between
//! the current pressure and the reference pressure, p0
//! @deprecated To be removed after Cantera 3.0
virtual doublereal entropyDelp_mole() const;

//! Get the difference in the standard state Gibbs free energy
//! between the current pressure and the reference pressure, p0.
//! @deprecated To be removed after Cantera 3.0
virtual doublereal gibbsDelp_mole() const;

//! Get the difference in standard state heat capacity
//! between the current pressure and the reference pressure, p0.
//! @deprecated To be removed after Cantera 3.0
virtual doublereal cpDelp_mole() const;

//! @}
Expand Down Expand Up @@ -360,18 +364,10 @@ class PDSS
/*!
* @param temp Temperature (Kelvin)
* @param rho Density (kg m-3)
* @deprecated To be removed after Cantera 3.0; renamed to setState_TD()
* @deprecated To be removed after Cantera 3.0
*/
virtual void setState_TR(doublereal temp, doublereal rho);

//! Set the internal temperature and density
/*!
* @param temp Temperature (Kelvin)
* @param rho Density (kg m-3)
* @since New in Cantera 3.0.
*/
virtual void setState_TD(double temp, double rho);

//! critical temperature
virtual doublereal critTemperature() const;

Expand Down Expand Up @@ -440,6 +436,7 @@ class PDSS
* @param minTemp output - Minimum temperature
* @param maxTemp output - Maximum temperature
* @param refPressure output - reference pressure (Pa).
* @deprecated To be removed after Cantera 3.0. Use getParameters() instead.
*/
virtual void reportParams(size_t& kindex, int& type, doublereal* const c,
doublereal& minTemp, doublereal& maxTemp,
Expand Down
2 changes: 1 addition & 1 deletion include/cantera/thermo/PDSS_ConstVol.h
Expand Up @@ -39,7 +39,7 @@ class PDSS_ConstVol : public PDSS_Nondimensional
virtual void setPressure(doublereal pres);
virtual void setTemperature(doublereal temp);
virtual void setState_TP(doublereal temp, doublereal pres);
virtual void setState_TD(double temp, double rho);
virtual void setState_TR(double temp, double rho);
virtual doublereal satPressure(doublereal t);

//! @}
Expand Down
2 changes: 2 additions & 0 deletions include/cantera/thermo/PDSS_HKFT.h
Expand Up @@ -45,6 +45,7 @@ class PDSS_HKFT : public PDSS_Molar
* Note this is just an extra routine to check the arithmetic
*
* @returns the species standard state enthalpy in J kmol-1
* @deprecated To be removed after Cantera 3.0
*/
doublereal enthalpy_mole2() const;

Expand Down Expand Up @@ -160,6 +161,7 @@ class PDSS_HKFT : public PDSS_Molar
//! between the reference state at Tr, Pr and T,P
/*!
* This is an extra routine that was added to check the arithmetic
* @deprecated To be removed after Cantera 3.0
*/
doublereal deltaH() const;

Expand Down
2 changes: 1 addition & 1 deletion include/cantera/thermo/PDSS_IdealGas.h
Expand Up @@ -43,7 +43,7 @@ class PDSS_IdealGas : public PDSS_Nondimensional
virtual void setPressure(doublereal pres);
virtual void setTemperature(doublereal temp);
virtual void setState_TP(doublereal temp, doublereal pres);
virtual void setState_TD(double temp, double rho);
virtual void setState_TR(double temp, double rho);

//! @}
//! @name Initialization of the Object
Expand Down
2 changes: 1 addition & 1 deletion include/cantera/thermo/PDSS_Water.h
Expand Up @@ -94,7 +94,7 @@ class PDSS_Water : public PDSS_Molar
virtual void setPressure(doublereal pres);
virtual void setTemperature(doublereal temp);
virtual void setState_TP(doublereal temp, doublereal pres);
virtual void setState_TD(double temp, double rho);
virtual void setState_TR(double temp, double rho);

//! Set the density of the water phase
/*!
Expand Down
15 changes: 7 additions & 8 deletions src/thermo/PDSS.cpp
Expand Up @@ -102,21 +102,25 @@ doublereal PDSS::molarVolume_ref() const

doublereal PDSS::enthalpyDelp_mole() const
{
warn_deprecated("PDSS::enthalpyDelp_mole", "To be removed after Cantera 3.0");
return enthalpy_mole() - m_temp * GasConstant * enthalpy_RT_ref();
}

doublereal PDSS::entropyDelp_mole() const
{
warn_deprecated("PDSS::entropyDelp_mole", "To be removed after Cantera 3.0");
return entropy_mole() - GasConstant * entropy_R_ref();
}

doublereal PDSS::gibbsDelp_mole() const
{
warn_deprecated("PDSS::gibbsDelp_mole", "To be removed after Cantera 3.0");
return gibbs_mole() - m_temp * GasConstant * gibbs_RT_ref();
}

doublereal PDSS::cpDelp_mole() const
{
warn_deprecated("PDSS::cpDelp_mole", "To be removed after Cantera 3.0");
return cp_mole() - GasConstant * cp_R_ref();
}

Expand Down Expand Up @@ -176,14 +180,7 @@ void PDSS::setState_TP(doublereal temp, doublereal pres)

void PDSS::setState_TR(doublereal temp, doublereal rho)
{
warn_deprecated("PDSS::setState_TR",
"To be removed after Cantera 3.0. Renamed to setState_TD.");
setState_TD(temp, rho);
}

void PDSS::setState_TD(double temp, double rho)
{
throw NotImplementedError("PDSS::setState_TD");
throw NotImplementedError("PDSS::setState_TR");
}

doublereal PDSS::satPressure(doublereal t)
Expand All @@ -197,6 +194,8 @@ void PDSS::reportParams(size_t& kindex, int& type,
doublereal& maxTemp_,
doublereal& refPressure_) const
{
warn_deprecated("PDSS:reportParams", "To be removed after Cantera 3.0. "
"Use getParameters(AnyMap&) instead.");
kindex = npos;
type = 0;
minTemp_ = m_minTemp;
Expand Down
6 changes: 4 additions & 2 deletions src/thermo/PDSS_ConstVol.cpp
Expand Up @@ -9,6 +9,7 @@

#include "cantera/thermo/PDSS_ConstVol.h"
#include "cantera/thermo/VPStandardStateTP.h"
#include "cantera/base/global.h"

namespace Cantera
{
Expand Down Expand Up @@ -83,11 +84,12 @@ void PDSS_ConstVol::setState_TP(doublereal temp, doublereal pres)
setPressure(pres);
}

void PDSS_ConstVol::setState_TD(double temp, double rho)
void PDSS_ConstVol::setState_TR(double temp, double rho)
{
warn_deprecated("PDSS_ConstVol::setState_TR", "To be removed after Cantera 3.0");
double rhoStored = m_mw / m_constMolarVolume;
if (fabs(rhoStored - rho) / (rhoStored + rho) > 1.0E-4) {
throw CanteraError("PDSS_ConstVol::setState_TD",
throw CanteraError("PDSS_ConstVol::setState_TR",
"Inconsistent supplied density.");
}
setTemperature(temp);
Expand Down
2 changes: 2 additions & 0 deletions src/thermo/PDSS_HKFT.cpp
Expand Up @@ -35,6 +35,7 @@ doublereal PDSS_HKFT::enthalpy_mole() const

doublereal PDSS_HKFT::enthalpy_mole2() const
{
warn_deprecated("PDSS_HKFT::enthalpy_mole2", "To be removed after Cantera 3.0");
double enthTRPR = m_Mu0_tr_pr + 298.15 * m_units.convertTo(m_Entrop_tr_pr, "J/kmol");
return deltaH() + enthTRPR;
}
Expand Down Expand Up @@ -370,6 +371,7 @@ void PDSS_HKFT::getParameters(AnyMap& eosNode) const

doublereal PDSS_HKFT::deltaH() const
{
warn_deprecated("PDSS_HKFT::deltaH", "To be removed after Cantera 3.0");
doublereal pbar = m_pres * 1.0E-5;
doublereal c1term = m_c1 * (m_temp - 298.15);
doublereal a1term = m_a1 * (pbar - m_presR_bar);
Expand Down
4 changes: 3 additions & 1 deletion src/thermo/PDSS_IdealGas.cpp
Expand Up @@ -9,6 +9,7 @@

#include "cantera/thermo/PDSS_IdealGas.h"
#include "cantera/thermo/VPStandardStateTP.h"
#include "cantera/base/global.h"

namespace Cantera
{
Expand Down Expand Up @@ -68,8 +69,9 @@ void PDSS_IdealGas::setState_TP(doublereal temp, doublereal pres)
setTemperature(temp);
}

void PDSS_IdealGas::setState_TD(double temp, double rho)
void PDSS_IdealGas::setState_TR(double temp, double rho)
{
warn_deprecated("PDSS_IdealGas::setState_TR", "To be removed after Cantera 3.0");
m_pres = GasConstant * temp * rho / m_mw;
setTemperature(temp);
}
Expand Down
6 changes: 4 additions & 2 deletions src/thermo/PDSS_Water.cpp
Expand Up @@ -7,8 +7,9 @@

#include "cantera/thermo/PDSS_Water.h"
#include "cantera/thermo/WaterPropsIAPWS.h"
#include "cantera/base/stringUtils.h"
#include "cantera/thermo/Elements.h"
#include "cantera/base/stringUtils.h"
#include "cantera/base/global.h"

namespace Cantera
{
Expand Down Expand Up @@ -220,8 +221,9 @@ void PDSS_Water::setState_TP(doublereal temp, doublereal pres)
setPressure(pres);
}

void PDSS_Water::setState_TD(double temp, double dens)
void PDSS_Water::setState_TR(double temp, double dens)
{
warn_deprecated("PDSS_Water::setState_TR", "To be removed after Cantera 3.0");
m_temp = temp;
m_dens = dens;
m_sub.setState_TD(m_temp, m_dens);
Expand Down

0 comments on commit adb49c3

Please sign in to comment.