Skip to content

Commit 37409c0

Browse files
committed
[Thermo] Add real gas compressibility functions
Add `isothermalCompressibility` and `thermalExpansionCoeff` definitions to the `RedlichKwongMFTP` and `PengRobinson` models
1 parent f807a01 commit 37409c0

File tree

4 files changed

+57
-1
lines changed

4 files changed

+57
-1
lines changed

include/cantera/thermo/PengRobinson.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,22 @@ class PengRobinson : public MixtureFugacityTP
205205

206206
public:
207207

208+
//! Returns the isothermal compressibility (\f$\beta_T\f$). Units: 1/Pa.
209+
/*!
210+
* \f[
211+
* \beta_T = -\frac{1}{v} \left(\frac{\partial v}{\partial p}\right)_T
212+
* \f]
213+
*/
214+
virtual double isothermalCompressibility() const;
215+
216+
//! Return the volumetric thermal expansion coefficient (\f$\alpha_V\f$). Units: 1/K.
217+
/*!
218+
* \f[
219+
* \alpha_V = \frac{1}{v} \left(\frac{\partial v}{\partial T}\right)_p
220+
* \f]
221+
*/
222+
virtual double thermalExpansionCoeff() const;
223+
208224
//! Calculate \f$dp/dV\f$ and \f$dp/dT\f$ at the current conditions
209225
/*!
210226
* These are stored internally.
@@ -248,7 +264,7 @@ class PengRobinson : public MixtureFugacityTP
248264
*/
249265
double m_a;
250266

251-
//! Value of \f$\alpha\f$ in the equation of state
267+
//! Value of \f$a \alpha\f$ in the equation of state
252268
/*!
253269
* `m_aAlpha_mix` is a function of the temperature and the mole fractions.
254270
*/

include/cantera/thermo/RedlichKwongMFTP.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,22 @@ class RedlichKwongMFTP : public MixtureFugacityTP
173173
virtual doublereal densSpinodalGas() const;
174174
virtual doublereal dpdVCalc(doublereal TKelvin, doublereal molarVol, doublereal& presCalc) const;
175175

176+
//! Returns the isothermal compressibility (\f$\beta_T\f$). Units: 1/Pa.
177+
/*!
178+
* \f[
179+
* \beta_T = -\frac{1}{v} \left(\frac{\partial v}{\partial p}\right)_T
180+
* \f]
181+
*/
182+
virtual double isothermalCompressibility() const;
183+
184+
//! Return the volumetric thermal expansion coefficient (\f$\alpha_V\f$). Units: 1/K.
185+
/*!
186+
* \f[
187+
* \alpha_V = \frac{1}{v} \left(\frac{\partial v}{\partial T}\right)_p
188+
* \f]
189+
*/
190+
virtual double thermalExpansionCoeff() const;
191+
176192
//! Calculate dpdV and dpdT at the current conditions
177193
/*!
178194
* These are stored internally.

src/thermo/PengRobinson.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,18 @@ double PengRobinson::dpdVCalc(double T, double molarVol, double& presCalc) const
630630
return -GasConstant * T / (vmb * vmb) + 2 * m_aAlpha_mix * vpb / (denom*denom);
631631
}
632632

633+
double PengRobinson::isothermalCompressibility() const
634+
{
635+
calculatePressureDerivatives();
636+
return -1 / (molarVolume() * m_dpdV);
637+
}
638+
639+
double PengRobinson::thermalExpansionCoeff() const
640+
{
641+
calculatePressureDerivatives();
642+
return -m_dpdT / (molarVolume() * m_dpdV);
643+
}
644+
633645
void PengRobinson::calculatePressureDerivatives() const
634646
{
635647
double T = temperature();

src/thermo/RedlichKwongMFTP.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,18 @@ doublereal RedlichKwongMFTP::dpdVCalc(doublereal TKelvin, doublereal molarVol, d
707707
return dpdv;
708708
}
709709

710+
double RedlichKwongMFTP::isothermalCompressibility() const
711+
{
712+
pressureDerivatives();
713+
return -1 / (molarVolume() * dpdV_);
714+
}
715+
716+
double RedlichKwongMFTP::thermalExpansionCoeff() const
717+
{
718+
pressureDerivatives();
719+
return -dpdT_ / (molarVolume() * dpdV_);
720+
}
721+
710722
void RedlichKwongMFTP::pressureDerivatives() const
711723
{
712724
doublereal TKelvin = temperature();

0 commit comments

Comments
 (0)