35#ifndef DUMUX_PENG_ROBINSON_PARAMS_MIXTURE_HH
36#define DUMUX_PENG_ROBINSON_PARAMS_MIXTURE_HH
60template <
class Scalar,
class Flu
idSystem,
int phaseIdx,
bool useSpe5Relations=false>
64 enum { numComponents = FluidSystem::numComponents };
75 template <
class Flu
idState>
79 fluidState.pressure(phaseIdx));
98 for (
int i = 0; i < numComponents; ++i) {
99 Scalar pc = FluidSystem::criticalPressure(i);
100 Scalar omega = FluidSystem::acentricFactor(i);
101 Scalar Tr =
temperature/FluidSystem::criticalTemperature(i);
106 if (useSpe5Relations) {
107 if (omega < 0.49) f_omega = 0.37464 + omega*(1.54226 + omega*(-0.26992));
108 else f_omega = 0.379642 + omega*(1.48503 + omega*(-0.164423 + omega*0.016666));
111 f_omega = 0.37464 + omega*(1.54226 - omega*0.26992);
116 Scalar tmp = 1 + f_omega*(1 - sqrt(Tr));
119 Scalar
a = 0.4572355*RTc*RTc/pc * tmp;
120 Scalar
b = 0.0777961 * RTc / pc;
142 template <
class Flu
idState>
146 for (
int compIdx = 0; compIdx < numComponents; ++compIdx)
147 sumx += fs.moleFraction(phaseIdx, compIdx);
149 sumx = max(1e-10, sumx);
157 for (
int compIIdx = 0; compIIdx < numComponents; ++compIIdx) {
158 Scalar xi = fs.moleFraction(phaseIdx, compIIdx) / sumx;
160 using::std::isfinite;
161 for (
int compJIdx = 0; compJIdx < numComponents; ++compJIdx) {
162 Scalar xj = fs.moleFraction(phaseIdx, compJIdx) / sumx;
166 a += xi * xj * aCache_[compIIdx][compJIdx];
193 template <
class Flu
idState>
213 assert(0 <= compIdx && compIdx < numComponents);
224 for (
int i = 0; i < numComponents; ++i)
238 for (
int compIIdx = 0; compIIdx < numComponents; ++ compIIdx) {
239 for (
int compJIdx = 0; compJIdx < numComponents; ++ compJIdx) {
241 Scalar Psi = FluidSystem::interactionCoefficient(compIIdx, compJIdx);
243 aCache_[compIIdx][compJIdx] =
244 sqrt(this->pureParams_[compIIdx].
a()
245 * this->pureParams_[compJIdx].
a())
251 Scalar aCache_[numComponents][numComponents];
Base class for Peng-Robinson parameters of a single-component fluid or a mixture.
A central place for various physical constants occuring in some equations.
bool CheckDefined(const T &value)
Make valgrind complain if the object occupied by an object is undefined.
Definition: valgrind.hh:72
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:51
std::string pressure(int phaseIdx) noexcept
I/O name of pressure for multiphase systems.
Definition: name.hh:34
A central place for various physical constants occuring in some equations.
Definition: constants.hh:39
Stores and provides access to the Peng-Robinson parameters.
Definition: pengrobinsonparams.hh:46
void setA(Scalar value)
Set the attractive parameter 'a' of the Peng-Robinson fluid.
Definition: pengrobinsonparams.hh:80
Scalar a() const
Returns the attractive parameter 'a' of the Peng-Robinson fluid.
Definition: pengrobinsonparams.hh:52
void setB(Scalar value)
Set the repulsive parameter 'b' of the Peng-Robinson fluid.
Definition: pengrobinsonparams.hh:88
Scalar b() const
Returns the repulsive parameter 'b' of the Peng-Robinson fluid.
Definition: pengrobinsonparams.hh:60
The mixing rule for the oil and the gas phases of the SPE5 problem.
Definition: pengrobinsonparamsmixture.hh:63
const PureParams & operator[](int compIdx) const
Returns the Peng-Robinson parameters for a pure component.
Definition: pengrobinsonparamsmixture.hh:211
void updateMix(const FluidState &fs)
Calculates the "a" and "b" Peng-Robinson parameters for the mixture.
Definition: pengrobinsonparamsmixture.hh:143
PureParams pureParams_[numComponents]
Definition: pengrobinsonparamsmixture.hh:230
const PureParams & pureParams(int compIdx) const
Return the Peng-Robinson parameters of a pure substance,.
Definition: pengrobinsonparamsmixture.hh:204
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:194
void updatePure(Scalar temperature, Scalar pressure)
Peng-Robinson parameters for the pure components.
Definition: pengrobinsonparamsmixture.hh:88
void checkDefined() const
If run under valgrind, this method produces an warning if the parameters where not determined correct...
Definition: pengrobinsonparamsmixture.hh:221
void updatePure(const FluidState &fluidState)
Update Peng-Robinson parameters for the pure components.
Definition: pengrobinsonparamsmixture.hh:76