View Issue Details

IDProjectCategoryView StatusLast Update
0001329OpenFOAMBugpublic2014-06-19 15:27
Reporterdkxls Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
PlatformLinux x86_64OSopenSUSEOS Version12.2
Summary0001329: [PengRobinsonGas]: Bad mixture expression for critical pressure Pc
DescriptionA mole-fraction averaged mixture expression gives normally a good approximation for critical temperature, volume and acentric factor.
However, for the critical pressure, a mole-fraction average of pure-component critical pressures is normally unsatisfactory. This is because the critical pressure for most systems goes through a maximum or minimum with composition.

The simplest rule which can give acceptable Pc values for a cubic EOS is the modified rule of Prausnitz and Gunn (1958), as it is also implemented in the liquidMixtureProperties class.

For a more detailed discussion on this topic see Poling (2001); chapter 5-3.

The changes required for the mixing rule of Prausnitz and Gunn are small and a patch that implements them is attached.
Additional InformationKay, W. "Gases and Vapors At High Temperature and Pressure - Density of Hydrocarbon." Industrial & Engineering Chemistry 28, no. 9 (September 1, 1936): 1014–19. doi:10.1021/ie50321a008.

Prausnitz, J. M., and R. D. Gunn. "Volumetric Properties of Nonpolar Gaseous Mixtures." AIChE Journal 4, no. 4 (December 1, 1958): 430–35. doi:10.1002/aic.690040410.

Poling, B.E., J.M. Prausnitz, and J.P. O’Connell. The Properties of Gases and Liquids. McGraw-Hill, 2001.
TagsNo tags attached.

Activities

dkxls

2014-06-17 16:02

reporter  

PengRobinsonGas.patch (5,880 bytes)   
diff --git a/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGas.C b/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGas.C
index e2b99d0..c3fefab 100644
--- a/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGas.C
+++ b/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGas.C
@@ -33,6 +33,8 @@ Foam::PengRobinsonGas<Specie>::PengRobinsonGas(Istream& is)
 :
     Specie(is),
     Tc_(readScalar(is)),
+    Vc_(readScalar(is)),
+    Zc_(readScalar(is)),
     Pc_(readScalar(is)),
     omega_(readScalar(is))
 {
@@ -48,9 +50,13 @@ Foam::PengRobinsonGas<Specie>::PengRobinsonGas
 :
     Specie(dict),
     Tc_(readScalar(dict.subDict("equationOfState").lookup("Tc"))),
+    Vc_(readScalar(dict.subDict("equationOfState").lookup("Vc"))),
+    Zc_(1.0),
     Pc_(readScalar(dict.subDict("equationOfState").lookup("Pc"))),
     omega_(readScalar(dict.subDict("equationOfState").lookup("omega")))
-{}
+{
+    Zc_ = Pc_*Vc_/(specie::RR*Tc_);
+}
 
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
@@ -74,6 +80,8 @@ Foam::Ostream& Foam::operator<<
 {
     os  << static_cast<const Specie&>(pg)
         << token::SPACE << pg.Tc_
+        << token::SPACE << pg.Vc_
+        << token::SPACE << pg.Zc_
         << token::SPACE << pg.Pc_
         << token::SPACE << pg.omega_;
 
diff --git a/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGas.H b/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGas.H
index 7d1df11..568b35a 100644
--- a/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGas.H
+++ b/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGas.H
@@ -98,10 +98,16 @@ class PengRobinsonGas
         //- Critical Temperature [K]
         scalar Tc_;
 
+        //- Critical volume [m^3/kmol]
+        scalar Vc_;
+
+        //- Critical compression factor [-]
+        scalar Zc_;
+
         //- Critical Pressure [Pa]
         scalar Pc_;
 
-        //- Accentric factor [-]
+        //- Acentric factor [-]
         scalar omega_;
 
 
@@ -114,6 +120,8 @@ public:
         (
             const Specie& sp,
             const scalar& Tc,
+            const scalar& Vc,
+            const scalar& Zc,
             const scalar& Pc,
             const scalar& omega
         );
@@ -163,7 +171,7 @@ public:
             //- Return compressibility rho/p [s^2/m^2]
             inline scalar psi(scalar p, scalar T) const;
 
-            //- Return compression factor []
+            //- Return compression factor [-]
             inline scalar Z(scalar p, scalar T) const;
 
             //- Return (cp - cv) [J/(kmol K]
diff --git a/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGasI.H b/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGasI.H
index aae0b92..125ce88 100644
--- a/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGasI.H
+++ b/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGasI.H
@@ -34,12 +34,16 @@ inline Foam::PengRobinsonGas<Specie>::PengRobinsonGas
 (
     const Specie& sp,
     const scalar& Tc,
+    const scalar& Vc,
+    const scalar& Zc,
     const scalar& Pc,
     const scalar& omega
 )
 :
     Specie(sp),
     Tc_(Tc),
+    Vc_(Vc),
+    Zc_(Zc),
     Pc_(Pc),
     omega_(omega)
 {}
@@ -57,6 +61,8 @@ inline Foam::PengRobinsonGas<Specie>::PengRobinsonGas
     Specie(name, pg),
     Tc_(pg.Tc),
     Pc_(pg.Pc),
+    Vc_(pg.Vc),
+    Zc_(pg.Zc),
     omega_(pg.omega)
 {}
 
@@ -214,7 +220,9 @@ inline void Foam::PengRobinsonGas<Specie>::operator+=
     scalar molr2 = pg.nMoles()/this->nMoles();
 
     Tc_ = molr1*Tc_ + molr2*pg.Tc_;
-    Pc_ = molr1*Pc_ + molr2*pg.Pc_;
+    Vc_ = molr1*Vc_ + molr2*pg.Vc_;
+    Zc_ = molr1*Zc_ + molr2*pg.Zc_;
+    Pc_ = specie::RR*Zc_*Tc_/Vc_;
     omega_ = molr1*omega_ + molr2*pg.omega_;
 }
 
@@ -233,7 +241,9 @@ inline void Foam::PengRobinsonGas<Specie>::operator-=
     scalar molr2 = pg.nMoles()/this->nMoles();
 
     Tc_ = molr1*Tc_ - molr2*pg.Tc_;
-    Pc_ = molr1*Pc_ - molr2*pg.Pc_;
+    Vc_ = molr1*Vc_ - molr2*pg.Vc_;
+    Zc_ = molr1*Zc_ - molr2*pg.Zc_;
+    Pc_ = specie::RR*Zc_*Tc_/Vc_;
     omega_ = molr1*omega_ - molr2*pg.omega_;
 }
 
@@ -259,12 +269,18 @@ Foam::PengRobinsonGas<Specie> Foam::operator+
     scalar molr1 = pg1.nMoles()/nMoles;
     scalar molr2 = pg2.nMoles()/nMoles;
 
+    const scalar Tc = molr1*pg1.Tc_ + molr2*pg2.Tc_;
+    const scalar Vc = molr1*pg1.Vc_ + molr2*pg2.Vc_;
+    const scalar Zc = molr1*pg1.Zc_ + molr2*pg2.Zc_;
+
     return PengRobinsonGas<Specie>
     (
         static_cast<const Specie&>(pg1)
       + static_cast<const Specie&>(pg2),
-        molr1*pg1.Tc_ + molr2*pg2.Tc_,
-        molr1*pg1.Pc_ + molr2*pg2.Pc_,
+        Tc,
+        Vc,
+        Zc,
+        specie::RR*Zc*Tc/Vc,
         molr1*pg1.omega_ + molr2*pg2.omega_
     );
 }
@@ -281,12 +297,18 @@ Foam::PengRobinsonGas<Specie> Foam::operator-
     scalar molr1 = pg1.nMoles()/nMoles;
     scalar molr2 = pg2.nMoles()/nMoles;
 
+    const scalar Tc = molr1*pg1.Tc_ + molr2*pg2.Tc_;
+    const scalar Vc = molr1*pg1.Vc_ + molr2*pg2.Vc_;
+    const scalar Zc = molr1*pg1.Zc_ + molr2*pg2.Zc_;
+
     return PengRobinsonGas<Specie>
     (
         static_cast<const Specie&>(pg1)
       - static_cast<const Specie&>(pg2),
-        molr1*pg1.Tc_ - molr2*pg2.Tc_,
-        molr1*pg1.Pc_ - molr2*pg2.Pc_,
+        Tc,
+        Vc,
+        Zc,
+        specie::RR*Zc*Tc/Vc,
         molr1*pg1.omega_ - molr2*pg2.omega_
     );
 }
@@ -303,6 +325,8 @@ Foam::PengRobinsonGas<Specie> Foam::operator*
     (
         s*static_cast<const Specie&>(pg),
         pg.Tc_,
+        pg.Vc_,
+        pg.Zc_,
         pg.Pc_,
         pg.omega_
     );
PengRobinsonGas.patch (5,880 bytes)   

henry

2014-06-19 15:25

manager   ~0003136

Thanks for the excellent detailed bug-report and patch.
This is resolved by commit 372326bbfc081ff2df635c1a64ef529c0f60255f

Issue History

Date Modified Username Field Change
2014-06-17 16:02 dkxls New Issue
2014-06-17 16:02 dkxls File Added: PengRobinsonGas.patch
2014-06-19 15:25 henry Note Added: 0003136
2014-06-19 15:25 henry Status new => resolved
2014-06-19 15:25 henry Resolution open => fixed
2014-06-19 15:25 henry Assigned To => henry