25#ifndef DUMUX_PENG_ROBINSON_MIXTURE_HH
26#define DUMUX_PENG_ROBINSON_MIXTURE_HH
39template <
class Scalar,
class StaticParameters>
42 enum { numComponents = StaticParameters::numComponents };
49 static const Scalar u;
50 static const Scalar w;
62 template <
class MutableParams,
class Flu
idState>
64 const MutableParams ¶ms,
68 return PengRobinson::computeMolarVolumes(Vm, params, phaseIdx, fs);
89 template <
class Flu
idState,
class Params>
98 Scalar Vm = params.molarVolume(phaseIdx);
101 Scalar bi_b = params.bPure(phaseIdx, compIdx) / params.b(phaseIdx);
105 Scalar p = fs.pressure(phaseIdx);
109 Scalar Astar = params.a(phaseIdx)*p/(RT*RT);
110 Scalar Bstar = params.b(phaseIdx)*p/(RT);
113 Scalar sumMoleFractions = 0.0;
114 for (
int compJIdx = 0; compJIdx < numComponents; ++compJIdx)
115 sumMoleFractions += fs.moleFraction(phaseIdx, compJIdx);
118 Scalar deltai = 2*sqrt(params.aPure(phaseIdx, compIdx))/params.a(phaseIdx);
120 for (
int compJIdx = 0; compJIdx < numComponents; ++compJIdx) {
122 fs.moleFraction(phaseIdx, compJIdx)
124 * sqrt(params.aPure(phaseIdx, compJIdx))
125 * (1.0 - StaticParameters::interactionCoefficient(compIdx, compJIdx));
130 (2*Z + Bstar*(u + sqrt(u*u - 4*w))) /
131 (2*Z + Bstar*(u - sqrt(u*u - 4*w)));
132 Scalar expo = Astar/(Bstar*sqrt(u*u - 4*w))*(bi_b - deltai);
139 exp(bi_b*(Z - 1))/max(1e-9, Z - Bstar) *
149 fugCoeff = min(1e10, fugCoeff);
154 fugCoeff = max(1e-10, fugCoeff);
157 if (!isfinite(fugCoeff)) {
158 std::cout <<
"Non finite phi: " << fugCoeff <<
"\n";
166template<
class Scalar,
class StaticParameters>
167const Scalar PengRobinsonMixture<Scalar, StaticParameters>::u = 2.0;
168template<
class Scalar,
class StaticParameters>
169const Scalar PengRobinsonMixture<Scalar, StaticParameters>::w = -1.0;
Implements the Peng-Robinson equation of state for liquids and gases.
A central place for various physical constants occuring in some equations.
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
A central place for various physical constants occuring in some equations.
Definition: constants.hh:39
Implements the Peng-Robinson equation of state for liquids and gases.
Definition: pengrobinson.hh:57
Implements the Peng-Robinson equation of state for a mixture.
Definition: pengrobinsonmixture.hh:41
static int computeMolarVolumes(Scalar *Vm, const MutableParams ¶ms, int phaseIdx, const FluidState &fs)
Computes molar volumes where the Peng-Robinson EOS is true.
Definition: pengrobinsonmixture.hh:63
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:90