26#ifndef OPM_THREECOMPONENTFLUIDSYSTEM_HH
27#define OPM_THREECOMPONENTFLUIDSYSTEM_HH
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;
60 static constexpr int oilPhaseIdx = 0;
61 static constexpr int gasPhaseIdx = 1;
63 static constexpr int Comp0Idx = 0;
64 static constexpr int Comp1Idx = 1;
65 static constexpr int Comp2Idx = 2;
72 template <
class ValueType>
88 default:
throw std::runtime_error(
"Illegal component index for acentricFactor");
102 default:
throw std::runtime_error(
"Illegal component index for criticalTemperature");
115 default:
throw std::runtime_error(
"Illegal component index for criticalPressure");
129 default:
throw std::runtime_error(
"Illegal component index for criticalVolume");
140 default:
throw std::runtime_error(
"Illegal component index for molarMass");
156 static const std::string_view name[] = {
"o",
159 assert(phaseIdx < 2);
160 return name[phaseIdx];
166 static const std::string_view name[] = {
173 return name[compIdx];
179 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
180 static LhsEval
density(
const FluidState& fluidState,
184 assert(phaseIdx == oilPhaseIdx || phaseIdx == gasPhaseIdx);
185 return decay<LhsEval>(fluidState.averageMolarMass(phaseIdx) / paramCache.
molarVolume(phaseIdx));
189 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
195 return decay<LhsEval>(ViscosityModel::LBC(fluidState, paramCache, phaseIdx));
199 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
205 assert(phaseIdx < numPhases);
206 assert(compIdx < numComponents);
214 assert(phaseIdx < numPhases);
222 assert(phaseIdx < numPhases);
230 assert(phaseIdx < numPhases);
232 return (phaseIdx == 0);
238 assert(phaseIdx < numPhases);
240 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.
Implements the Peng-Robinson equation of state for a mixture.
A simplistic class representing the fluid properties.
The base class for all fluid systems.
Definition BaseFluidSystem.hpp:47
Scalar Scalar
The type used for scalar quantities.
Definition BaseFluidSystem.hpp:52
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
Specifies the parameter cache used by the SPE-5 fluid system.
Definition PTFlashParameterCache.hpp:48
Scalar molarVolume(unsigned phaseIdx) const
Returns the molar volume of a phase [m^3/mol].
Definition PTFlashParameterCache.hpp:199
Implements the Peng-Robinson equation of state for a mixture.
Definition PengRobinsonMixture.hpp:41
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
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:200
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:180
static Scalar criticalPressure(unsigned compIdx)
Critical pressure of a component [Pa].
Definition ThreeComponentFluidSystem.hh:110
static std::string_view componentName(unsigned compIdx)
Return the human readable name of a component.
Definition ThreeComponentFluidSystem.hh:164
static Scalar criticalTemperature(unsigned compIdx)
Critical temperature of a component [K].
Definition ThreeComponentFluidSystem.hh:96
static bool isIdealMixture(unsigned phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition ThreeComponentFluidSystem.hh:220
static std::string_view phaseName(unsigned phaseIdx)
Return the human readable name of a fluid phase.
Definition ThreeComponentFluidSystem.hh:154
static Scalar molarMass(unsigned compIdx)
Return the molar mass of a component in [kg/mol].
Definition ThreeComponentFluidSystem.hh:134
static Scalar acentricFactor(unsigned compIdx)
The acentric factor of a component [].
Definition ThreeComponentFluidSystem.hh:82
static bool isCompressible(unsigned phaseIdx)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition ThreeComponentFluidSystem.hh:212
static bool isIdealGas(unsigned phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition ThreeComponentFluidSystem.hh:236
static Scalar interactionCoefficient(unsigned, unsigned)
Returns the interaction coefficient for two components.
Definition ThreeComponentFluidSystem.hh:148
static bool isLiquid(unsigned phaseIdx)
Return whether a phase is liquid.
Definition ThreeComponentFluidSystem.hh:228
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:190
static Scalar criticalVolume(unsigned compIdx)
Critical volume of a component [m3].
Definition ThreeComponentFluidSystem.hh:123
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30