13#ifndef DUMUX_PENG_ROBINSON_MIXTURE_HH
14#define DUMUX_PENG_ROBINSON_MIXTURE_HH
27template <
class Scalar,
class StaticParameters>
30 enum { numComponents = StaticParameters::numComponents };
37 static const Scalar u;
38 static const Scalar w;
60 template <
class Flu
idState,
class Params>
69 Scalar Vm = params.molarVolume(phaseIdx);
72 Scalar bi_b = params.bPure(phaseIdx, compIdx) / params.b(phaseIdx);
76 Scalar p = fs.pressure(phaseIdx);
80 Scalar Astar = params.a(phaseIdx)*p/(RT*RT);
81 Scalar Bstar = params.b(phaseIdx)*p/(RT);
84 Scalar sumMoleFractions = 0.0;
85 for (
int compJIdx = 0; compJIdx < numComponents; ++compJIdx)
86 sumMoleFractions += fs.moleFraction(phaseIdx, compJIdx);
89 Scalar deltai = 2*sqrt(params.aPure(phaseIdx, compIdx))/params.a(phaseIdx);
91 for (
int compJIdx = 0; compJIdx < numComponents; ++compJIdx) {
93 fs.moleFraction(phaseIdx, compJIdx)
95 * sqrt(params.aPure(phaseIdx, compJIdx))
96 * (1.0 - StaticParameters::interactionCoefficient(compIdx, compJIdx));
101 (2*Z + Bstar*(u + sqrt(u*u - 4*w))) /
102 (2*Z + Bstar*(u - sqrt(u*u - 4*w)));
103 Scalar expo = Astar/(Bstar*sqrt(u*u - 4*w))*(bi_b - deltai);
110 exp(bi_b*(Z - 1))/max(1e-9, Z - Bstar) *
120 fugCoeff = min(1e10, fugCoeff);
125 fugCoeff = max(1e-10, fugCoeff);
128 if (!isfinite(fugCoeff)) {
129 std::cout <<
"Non finite phi: " << fugCoeff <<
"\n";
137template<
class Scalar,
class StaticParameters>
138const Scalar PengRobinsonMixture<Scalar, StaticParameters>::u = 2.0;
139template<
class Scalar,
class StaticParameters>
140const Scalar PengRobinsonMixture<Scalar, StaticParameters>::w = -1.0;
A central place for various physical constants occurring in some equations.
Definition: constants.hh:27
Implements the Peng-Robinson equation of state for liquids and gases.
Definition: pengrobinson.hh:48
Implements the Peng-Robinson equation of state for a mixture.
Definition: pengrobinsonmixture.hh:29
static Scalar computeFugacityCoefficient(const FluidState &fs, const Params ¶ms, int phaseIdx, int compIdx)
Returns the fugacity coefficient of an individual component in the phase.
Definition: pengrobinsonmixture.hh:61
A central place for various physical constants occurring in some equations.
Implements the Peng-Robinson equation of state for liquids and gases.