27 #ifndef OPM_PENG_ROBINSON_MIXTURE_HPP 28 #define OPM_PENG_ROBINSON_MIXTURE_HPP 39 template <
class Scalar,
class StaticParameters>
42 enum { numComponents = StaticParameters::numComponents };
48 static const Scalar R;
51 static const Scalar u;
52 static const Scalar w;
73 template <
class Flu
idState,
class Params,
class LhsEval =
typename Flu
idState::ValueType>
82 LhsEval Vm = params.molarVolume(phaseIdx);
85 LhsEval bi_b = params.bPure(phaseIdx, compIdx) / params.b(phaseIdx);
88 LhsEval RT = R*fs.temperature(phaseIdx);
89 LhsEval p = fs.pressure(phaseIdx);
93 LhsEval Astar = params.a(phaseIdx)*p/(RT*RT);
94 LhsEval Bstar = params.b(phaseIdx)*p/(RT);
97 for (
unsigned compJIdx = 0; compJIdx < numComponents; ++compJIdx) {
98 A_s += params.aCache(phaseIdx, compIdx, compJIdx) * fs.moleFraction(phaseIdx, compJIdx) * p / (RT * RT);
110 m1 = 0.5*(u + std::sqrt(u*u - 4*w));
111 m2 = 0.5*(u - std::sqrt(u*u - 4*w));
113 alpha = -log(Z - Bstar) + bi_b * (Z - 1);
114 betta = log((Z + m2 * Bstar) / (Z + m1 * Bstar)) * Astar / ((m1 - m2) * Bstar);
115 gamma = (2 / Astar ) * A_s - bi_b;
116 ln_phi = alpha + (betta * gamma);
118 fugCoeff = exp(ln_phi);
126 fugCoeff = min(1e10, fugCoeff);
131 fugCoeff = max(1e-10, fugCoeff);
139 template <
class Scalar,
class StaticParameters>
141 template<
class Scalar,
class StaticParameters>
142 const Scalar PengRobinsonMixture<Scalar, StaticParameters>::u = 2.0;
143 template<
class Scalar,
class StaticParameters>
144 const Scalar PengRobinsonMixture<Scalar, StaticParameters>::w = -1.0;
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Implements the Peng-Robinson equation of state for liquids and gases.
static constexpr Scalar R
The ideal gas constant [J/(mol K)].
Definition: Constants.hpp:47
Implements the Peng-Robinson equation of state for a mixture.
Definition: PengRobinsonMixture.hpp:40
static LhsEval computeFugacityCoefficient(const FluidState &fs, const Params ¶ms, unsigned phaseIdx, unsigned compIdx)
Returns the fugacity coefficient of an individual component in the phase.
Definition: PengRobinsonMixture.hpp:74