Added isothermalCompressibility functions to the water models.

Added a missing pressure dependence to the PDSS_HKFT object.
This commit is contained in:
Harry Moffat 2008-08-25 22:58:12 +00:00
parent 5479bcf10b
commit a25f41e605
7 changed files with 65 additions and 4 deletions

View file

@ -836,6 +836,12 @@ namespace Cantera {
return dfac1dT + dfac2dT + dfac3dT;
} else if (ifunc == 3) {
double beta = m_waterSS->isothermalCompressibility();
double dgdp = - bfunc * gval * dens * beta / (1.0 - dens);
return dgdp;
} else {
throw CanteraError("HKFT_PDSS::gg", "unimplemented");
}

View file

@ -431,6 +431,20 @@ namespace Cantera {
double ag(const double temp, const int ifunc = 0) const;
double bg(const double temp, const int ifunc = 0) const;
double g(const double temp, const double pres, const int ifunc = 0) const;
//! Difference function f appearing in the formulation
/*!
* Function f appearing in the Johnson et al formulation of omega_j
* Eqn. 33 ref
*
* @param temp Temperature kelvin
* @param pres Pressure (pascal)
* @param ifunc parameters specifying the desired information
* - 0 function value
* - 1 derivative wrt temperature
* - 2 2nd derivative wrt temperature
* - 3 derivative wrt pressure
*/
double f(const double temp, const double pres, const int ifunc = 0) const;
double gstar(const double temp, const double pres, const int ifunc = 0) const;

View file

@ -449,7 +449,12 @@ namespace Cantera {
doublereal val = (val2 - vald) / 0.04;
return val;
}
doublereal PDSS_Water::isothermalCompressibility() const {
doublereal pres = pressure();
doublereal val = m_sub->isothermalCompressibility(m_temp, pres);
return val;
}
/// critical temperature
doublereal PDSS_Water::critTemperature() const { return m_sub->Tcrit(); }
@ -480,7 +485,7 @@ namespace Cantera {
setPressure(pres);
}
/// saturation pressure
// saturation pressure
doublereal PDSS_Water::satPressure(doublereal t){
doublereal pp = m_sub->psat(t);
doublereal dens = m_dens;

View file

@ -335,6 +335,19 @@ namespace Cantera {
*/
virtual doublereal dthermalExpansionCoeffdT() const;
//! Returns the isothermal compressibility. Units: 1/Pa.
/*!
* The isothermal compressibility is defined as
* \f[
* \kappa_T = -\frac{1}{v}\left(\frac{\partial v}{\partial P}\right)_T
* \f]
* or
* \f[
* \kappa_T = \frac{1}{\rho}\left(\frac{\partial \rho}{\partial P}\right)_T
* \f]
*/
virtual doublereal isothermalCompressibility() const;
/**
* @}
* @name Miscellaneous properties of the standard state

View file

@ -873,6 +873,10 @@ namespace Cantera {
* \f[
* \kappa_T = -\frac{1}{v}\left(\frac{\partial v}{\partial P}\right)_T
* \f]
* or
* \f[
* \kappa_T = \frac{1}{\rho}\left(\frac{\partial \rho}{\partial P}\right)_T
* \f]
*/
virtual doublereal isothermalCompressibility() const {
err("isothermalCompressibility"); return -1.0;

View file

@ -513,7 +513,18 @@ namespace Cantera {
doublereal val = m_sub->coeffThermExp(T, pres);
return val;
}
doublereal WaterSSTP::dthermalExpansionCoeffdT() const {
doublereal pres = pressure();
double T = temperature();
double tt = T - 0.04;
doublereal vald = m_sub->coeffThermExp(tt, pres);
doublereal val2 = m_sub->coeffThermExp(T, pres);
doublereal val = (val2 - vald) / 0.04;
return val;
}
// critical temperature
doublereal WaterSSTP::critTemperature() const { return m_sub->Tcrit(); }

View file

@ -195,7 +195,15 @@ namespace Cantera {
*/
virtual doublereal thermalExpansionCoeff() const;
//! Return the derivative of the volumetric thermal expansion coefficient. Units: 1/K2.
/*!
* The thermal expansion coefficient is defined as
* \f[
* \beta = \frac{1}{v}\left(\frac{\partial v}{\partial T}\right)_P
* \f]
*/
virtual doublereal dthermalExpansionCoeffdT() const;
/**
* @}
* @name Potential Energy