Skip to content

Commit 1829c14

Browse files
corykinneyspeth
authored andcommitted
[Thermo] Add real gas compressibility functions
Add `isothermalCompressibility` and `thermalExpansionCoeff` definitions to the `RedlichKwongMFTP` and `PengRobinson` models
1 parent a4e2abc commit 1829c14

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

include/cantera/thermo/PengRobinson.h

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

206206
public:
207207

208+
virtual double isothermalCompressibility() const;
209+
virtual double thermalExpansionCoeff() const;
210+
208211
//! Calculate \f$dp/dV\f$ and \f$dp/dT\f$ at the current conditions
209212
/*!
210213
* These are stored internally.
@@ -248,7 +251,7 @@ class PengRobinson : public MixtureFugacityTP
248251
*/
249252
double m_a = 0.0;
250253

251-
//! Value of \f$\alpha\f$ in the equation of state
254+
//! Value of \f$a \alpha\f$ in the equation of state
252255
/*!
253256
* `m_aAlpha_mix` is a function of the temperature and the mole fractions.
254257
*/

include/cantera/thermo/RedlichKwongMFTP.h

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

177+
virtual double isothermalCompressibility() const;
178+
virtual double thermalExpansionCoeff() const;
179+
177180
//! Calculate dpdV and dpdT at the current conditions
178181
/*!
179182
* These are stored internally.

src/thermo/PengRobinson.cpp

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

627+
double PengRobinson::isothermalCompressibility() const
628+
{
629+
calculatePressureDerivatives();
630+
return -1 / (molarVolume() * m_dpdV);
631+
}
632+
633+
double PengRobinson::thermalExpansionCoeff() const
634+
{
635+
calculatePressureDerivatives();
636+
return -m_dpdT / (molarVolume() * m_dpdV);
637+
}
638+
627639
void PengRobinson::calculatePressureDerivatives() const
628640
{
629641
double T = temperature();

src/thermo/RedlichKwongMFTP.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,18 @@ doublereal RedlichKwongMFTP::dpdVCalc(doublereal TKelvin, doublereal molarVol, d
700700
return dpdv;
701701
}
702702

703+
double RedlichKwongMFTP::isothermalCompressibility() const
704+
{
705+
pressureDerivatives();
706+
return -1 / (molarVolume() * dpdV_);
707+
}
708+
709+
double RedlichKwongMFTP::thermalExpansionCoeff() const
710+
{
711+
pressureDerivatives();
712+
return -dpdT_ / (molarVolume() * dpdV_);
713+
}
714+
703715
void RedlichKwongMFTP::pressureDerivatives() const
704716
{
705717
doublereal TKelvin = temperature();

0 commit comments

Comments
 (0)