26#ifndef OPM_THREECOMPONENTFLUIDSYSTEM_HH
27#define OPM_THREECOMPONENTFLUIDSYSTEM_HH
29#include <opm/material/eos/CubicEOS.hpp>
50 template<
class Scalar>
55 static constexpr int numPhases=2;
56 static constexpr int numComponents = 3;
57 static constexpr int numMisciblePhases=2;
58 static constexpr int numMiscibleComponents = 3;
59 static constexpr bool waterEnabled =
false;
61 static constexpr int oilPhaseIdx = 0;
62 static constexpr int gasPhaseIdx = 1;
63 static constexpr int waterPhaseIdx = -1;
65 static constexpr int Comp0Idx = 0;
66 static constexpr int Comp1Idx = 1;
67 static constexpr int Comp2Idx = 2;
74 template <
class ValueType>
79 static bool phaseIsActive(
unsigned phaseIdx)
81 return phaseIdx == oilPhaseIdx || phaseIdx == gasPhaseIdx;
95 default:
throw std::runtime_error(
"Illegal component index for acentricFactor");
109 default:
throw std::runtime_error(
"Illegal component index for criticalTemperature");
122 default:
throw std::runtime_error(
"Illegal component index for criticalPressure");
136 default:
throw std::runtime_error(
"Illegal component index for criticalVolume");
147 default:
throw std::runtime_error(
"Illegal component index for molarMass");
163 static const std::string_view name[] = {
"o",
166 assert(phaseIdx < 2);
167 return name[phaseIdx];
173 static const std::string_view name[] = {
180 return name[compIdx];
186 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
187 static LhsEval
density(
const FluidState& fluidState,
191 assert(phaseIdx == oilPhaseIdx || phaseIdx == gasPhaseIdx);
192 return decay<LhsEval>(fluidState.averageMolarMass(phaseIdx) / paramCache.
molarVolume(phaseIdx));
196 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
202 return decay<LhsEval>(ViscosityModel::LBC(fluidState, paramCache, phaseIdx));
206 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
212 assert(phaseIdx < numPhases);
213 assert(compIdx < numComponents);
215 return decay<LhsEval>(CubicEOS::computeFugacityCoefficient(fluidState, paramCache, phaseIdx, compIdx));
221 assert(phaseIdx < numPhases);
229 assert(phaseIdx < numPhases);
237 assert(phaseIdx < numPhases);
239 return (phaseIdx == 0);
245 assert(phaseIdx < numPhases);
247 return (phaseIdx == 1);
The base class for all fluid systems.
Properties of pure molecular n-Decane .
Properties of pure molecular methane .
Specifies the parameter cache used by the SPE-5 fluid system.
A simplistic class representing the fluid properties.
The base class for all fluid systems.
Definition BaseFluidSystem.hpp:43
Scalar Scalar
The type used for scalar quantities.
Definition BaseFluidSystem.hpp:48
Properties of pure molecular n-Decane .
Definition C10.hpp:50
static Scalar criticalVolume()
Critical volume of [m3/kmol].
Definition C10.hpp:81
static std::string_view name()
A human readable name for NDecane.
Definition C10.hpp:57
static Scalar criticalPressure()
Returns the critical pressure of molecular n-Decane.
Definition C10.hpp:75
static Scalar criticalTemperature()
Returns the critical temperature of molecular n-Decane.
Definition C10.hpp:69
static Scalar molarMass()
The molar mass in of molecular n-Decane.
Definition C10.hpp:63
static Scalar acentricFactor()
Acentric factor of .
Definition C10.hpp:86
Properties of pure molecular methane .
Definition C1.hpp:51
static Scalar criticalPressure()
Returns the critical pressure of molecular methane.
Definition C1.hpp:76
static Scalar molarMass()
The molar mass in of molecular methane.
Definition C1.hpp:64
static Scalar criticalTemperature()
Returns the critical temperature of molecular methane.
Definition C1.hpp:70
static Scalar acentricFactor()
Acentric factor of .
Definition C1.hpp:87
static Scalar criticalVolume()
Critical volume of [m3/kmol].
Definition C1.hpp:82
static std::string_view name()
A human readable name for NDecane.
Definition C1.hpp:58
Definition CubicEOS.hpp:34
Specifies the parameter cache used by the SPE-5 fluid system.
Definition PTFlashParameterCache.hpp:51
Scalar molarVolume(unsigned phaseIdx) const
Returns the molar volume of a phase [m^3/mol].
Definition PTFlashParameterCache.hpp:283
A simplistic class representing the fluid properties.
Definition SimpleCO2.hpp:50
static Scalar criticalVolume()
Critical volume of [m2/kmol].
Definition SimpleCO2.hpp:93
static Scalar criticalTemperature()
Returns the critical temperature of .
Definition SimpleCO2.hpp:69
static Scalar acentricFactor()
Acentric factor of .
Definition SimpleCO2.hpp:87
static Scalar criticalPressure()
Returns the critical pressure of .
Definition SimpleCO2.hpp:75
static std::string_view name()
A human readable name for the component.
Definition SimpleCO2.hpp:57
static Scalar molarMass()
The molar mass in of the component.
Definition SimpleCO2.hpp:63
A two phase three component fluid system with components CO2, Methane and NDekan.
Definition ThreeComponentFluidSystem.hh:52
static LhsEval fugacityCoefficient(const FluidState &fluidState, const ParameterCache< ParamCacheEval > ¶mCache, unsigned phaseIdx, unsigned compIdx)
Calculate the fugacity coefficient [Pa] of an individual component in a fluid phase.
Definition ThreeComponentFluidSystem.hh:207
static LhsEval density(const FluidState &fluidState, const ParameterCache< ParamCacheEval > ¶mCache, unsigned phaseIdx)
Calculate the density [kg/m^3] of a fluid phase.
Definition ThreeComponentFluidSystem.hh:187
static Scalar criticalPressure(unsigned compIdx)
Critical pressure of a component [Pa].
Definition ThreeComponentFluidSystem.hh:117
static std::string_view componentName(unsigned compIdx)
Return the human readable name of a component.
Definition ThreeComponentFluidSystem.hh:171
static Scalar criticalTemperature(unsigned compIdx)
Critical temperature of a component [K].
Definition ThreeComponentFluidSystem.hh:103
static bool isIdealMixture(unsigned phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition ThreeComponentFluidSystem.hh:227
static std::string_view phaseName(unsigned phaseIdx)
Return the human readable name of a fluid phase.
Definition ThreeComponentFluidSystem.hh:161
static Scalar molarMass(unsigned compIdx)
Return the molar mass of a component in [kg/mol].
Definition ThreeComponentFluidSystem.hh:141
static Scalar acentricFactor(unsigned compIdx)
The acentric factor of a component [].
Definition ThreeComponentFluidSystem.hh:89
static bool isCompressible(unsigned phaseIdx)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition ThreeComponentFluidSystem.hh:219
static bool isIdealGas(unsigned phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition ThreeComponentFluidSystem.hh:243
static Scalar interactionCoefficient(unsigned, unsigned)
Returns the interaction coefficient for two components.
Definition ThreeComponentFluidSystem.hh:155
static bool isLiquid(unsigned phaseIdx)
Return whether a phase is liquid.
Definition ThreeComponentFluidSystem.hh:235
static LhsEval viscosity(const FluidState &fluidState, const ParameterCache< ParamCacheEval > ¶mCache, unsigned phaseIdx)
Calculate the dynamic viscosity of a fluid phase [Pa*s].
Definition ThreeComponentFluidSystem.hh:197
static Scalar criticalVolume(unsigned compIdx)
Critical volume of a component [m3].
Definition ThreeComponentFluidSystem.hh:130
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30