23#ifndef DUMUX_PENG_ROBINSON_PARAMS_MIXTURE_HH
24#define DUMUX_PENG_ROBINSON_PARAMS_MIXTURE_HH
48template <
class Scalar,
class Flu
idSystem,
int phaseIdx,
bool useSpe5Relations=false>
52 enum { numComponents = FluidSystem::numComponents };
63 template <
class Flu
idState>
67 fluidState.pressure(phaseIdx));
83 for (
int i = 0; i < numComponents; ++i) {
84 Scalar pc = FluidSystem::criticalPressure(i);
85 Scalar omega = FluidSystem::acentricFactor(i);
86 Scalar Tr =
temperature/FluidSystem::criticalTemperature(i);
91 if (useSpe5Relations) {
92 if (omega < 0.49) f_omega = 0.37464 + omega*(1.54226 + omega*(-0.26992));
93 else f_omega = 0.379642 + omega*(1.48503 + omega*(-0.164423 + omega*0.016666));
96 f_omega = 0.37464 + omega*(1.54226 - omega*0.26992);
99 Scalar tmp = 1 + f_omega*(1 - sqrt(Tr));
102 Scalar
a = 0.4572355*RTc*RTc/pc * tmp;
103 Scalar
b = 0.0777961 * RTc / pc;
123 template <
class Flu
idState>
127 for (
int compIdx = 0; compIdx < numComponents; ++compIdx)
128 sumx += fs.moleFraction(phaseIdx, compIdx);
130 sumx = max(1e-10, sumx);
138 for (
int compIIdx = 0; compIIdx < numComponents; ++compIIdx) {
139 Scalar xi = fs.moleFraction(phaseIdx, compIIdx) / sumx;
140 using::std::isfinite;
141 for (
int compJIdx = 0; compJIdx < numComponents; ++compJIdx) {
142 Scalar xj = fs.moleFraction(phaseIdx, compJIdx) / sumx;
145 a += xi * xj * aCache_[compIIdx][compJIdx];
169 template <
class Flu
idState>
189 assert(0 <= compIdx && compIdx < numComponents);
199 for (
int compIIdx = 0; compIIdx < numComponents; ++ compIIdx) {
200 for (
int compJIdx = 0; compJIdx < numComponents; ++ compJIdx) {
202 Scalar Psi = FluidSystem::interactionCoefficient(compIIdx, compJIdx);
204 aCache_[compIIdx][compJIdx] =
205 sqrt(this->pureParams_[compIIdx].
a()
206 * this->pureParams_[compJIdx].
a())
212 Scalar aCache_[numComponents][numComponents];
A central place for various physical constants occurring in some equations.
Definition: constants.hh:27
Stores and provides access to the Peng-Robinson parameters.
Definition: pengrobinsonparams.hh:32
void setA(Scalar value)
Set the attractive parameter 'a' of the Peng-Robinson fluid.
Definition: pengrobinsonparams.hh:54
Scalar a() const
Returns the attractive parameter 'a' of the Peng-Robinson fluid.
Definition: pengrobinsonparams.hh:38
void setB(Scalar value)
Set the repulsive parameter 'b' of the Peng-Robinson fluid.
Definition: pengrobinsonparams.hh:62
Scalar b() const
Returns the repulsive parameter 'b' of the Peng-Robinson fluid.
Definition: pengrobinsonparams.hh:46
The mixing rule for the oil and the gas phases of the SPE5 problem.
Definition: pengrobinsonparamsmixture.hh:51
const PureParams & operator[](int compIdx) const
Returns the Peng-Robinson parameters for a pure component.
Definition: pengrobinsonparamsmixture.hh:187
void updateMix(const FluidState &fs)
Calculates the "a" and "b" Peng-Robinson parameters for the mixture.
Definition: pengrobinsonparamsmixture.hh:124
PureParams pureParams_[numComponents]
Definition: pengrobinsonparamsmixture.hh:194
const PureParams & pureParams(int compIdx) const
Return the Peng-Robinson parameters of a pure substance,.
Definition: pengrobinsonparamsmixture.hh:180
void updateSingleMoleFraction(const FluidState &fs, int compIdx)
Calculates the "a" and "b" Peng-Robinson parameters for the mixture provided that only a single mole ...
Definition: pengrobinsonparamsmixture.hh:170
void updatePure(Scalar temperature, Scalar pressure)
Peng-Robinson parameters for the pure components.
Definition: pengrobinsonparamsmixture.hh:76
void updatePure(const FluidState &fluidState)
Update Peng-Robinson parameters for the pure components.
Definition: pengrobinsonparamsmixture.hh:64
A central place for various physical constants occurring in some equations.
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:39
std::string pressure(int phaseIdx) noexcept
I/O name of pressure for multiphase systems.
Definition: name.hh:22
Base class for Peng-Robinson parameters of a single-component fluid or a mixture.