A fluid system which uses the black-oil model assumptions to calculate termodynamically meaningful quantities. More...
#include <BlackOilFluidSystem.hpp>
Classes | |
struct | ParameterCache |
Public Types | |
typedef Opm::GasPvtMultiplexer < Scalar > | GasPvt |
typedef Opm::OilPvtMultiplexer < Scalar > | OilPvt |
typedef Opm::WaterPvtMultiplexer < Scalar > | WaterPvt |
Static Public Member Functions | |
static void | initBegin (size_t numPvtRegions) |
Begin the initialization of the black oil fluid system. | |
static void | setEnableDissolvedGas (bool yesno) |
Specify whether the fluid system should consider that the gas component can dissolve in the oil phase. | |
static void | setEnableVaporizedOil (bool yesno) |
Specify whether the fluid system should consider that the oil component can dissolve in the gas phase. | |
static void | setGasPvt (std::shared_ptr< GasPvt > pvtObj) |
Set the pressure-volume-saturation (PVT) relations for the gas phase. | |
static void | setOilPvt (std::shared_ptr< OilPvt > pvtObj) |
Set the pressure-volume-saturation (PVT) relations for the oil phase. | |
static void | setWaterPvt (std::shared_ptr< WaterPvt > pvtObj) |
Set the pressure-volume-saturation (PVT) relations for the water phase. | |
static void | setReferenceDensities (Scalar rhoOil, Scalar rhoWater, Scalar rhoGas, unsigned regionIdx) |
Initialize the values of the reference densities. | |
static void | initEnd () |
Finish initializing the black oil fluid system. | |
static bool | isInitialized () |
static const char * | phaseName (unsigned phaseIdx) |
static bool | isLiquid (unsigned phaseIdx) |
static unsigned | numActivePhases () |
Returns the number of active fluid phases (i.e., usually three). | |
static unsigned | phaseIsActive (unsigned phaseIdx) |
Returns whether a fluid phase is active. | |
static constexpr unsigned | solventComponentIndex (unsigned phaseIdx) |
returns the index of "primary" component of a phase (solvent) | |
static constexpr unsigned | soluteComponentIndex (unsigned phaseIdx) |
returns the index of "secondary" component of a phase (solute) | |
static const char * | componentName (unsigned compIdx) |
static Scalar | molarMass (unsigned compIdx, unsigned regionIdx=0) |
static bool | isIdealMixture (unsigned) |
static bool | isCompressible (unsigned) |
static bool | isIdealGas (unsigned) |
static size_t | numRegions () |
Returns the number of PVT regions which are considered. | |
static bool | enableDissolvedGas () |
Returns whether the fluid system should consider that the gas component can dissolve in the oil phase. | |
static bool | enableVaporizedOil () |
Returns whether the fluid system should consider that the oil component can dissolve in the gas phase. | |
static Scalar | referenceDensity (unsigned phaseIdx, unsigned regionIdx) |
Returns the density of a fluid phase at surface pressure [kg/m^3]. | |
template<class FluidState , class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval> | |
static LhsEval | density (const FluidState &fluidState, const ParameterCache< ParamCacheEval > ¶mCache, unsigned phaseIdx) |
template<class FluidState , class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval> | |
static LhsEval | fugacityCoefficient (const FluidState &fluidState, const ParameterCache< ParamCacheEval > ¶mCache, unsigned phaseIdx, unsigned compIdx) |
template<class FluidState , class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval> | |
static LhsEval | viscosity (const FluidState &fluidState, const ParameterCache< ParamCacheEval > ¶mCache, unsigned phaseIdx) |
template<class FluidState , class LhsEval = typename FluidState::Scalar> | |
static LhsEval | density (const FluidState &fluidState, unsigned phaseIdx, unsigned regionIdx) |
template<class FluidState , class LhsEval = typename FluidState::Scalar> | |
static LhsEval | saturatedDensity (const FluidState &fluidState, unsigned phaseIdx, unsigned regionIdx) |
Compute the density of a saturated fluid phase. | |
template<class FluidState , class LhsEval = typename FluidState::Scalar> | |
static LhsEval | inverseFormationVolumeFactor (const FluidState &fluidState, unsigned phaseIdx, unsigned regionIdx) |
Returns the formation volume factor ![]() | |
template<class FluidState , class LhsEval = typename FluidState::Scalar> | |
static LhsEval | saturatedInverseFormationVolumeFactor (const FluidState &fluidState, unsigned phaseIdx, unsigned regionIdx) |
Returns the formation volume factor ![]() | |
template<class FluidState , class LhsEval = typename FluidState::Scalar> | |
static LhsEval | fugacityCoefficient (const FluidState &fluidState, unsigned phaseIdx, unsigned compIdx, unsigned regionIdx) |
template<class FluidState , class LhsEval = typename FluidState::Scalar> | |
static LhsEval | viscosity (const FluidState &fluidState, unsigned phaseIdx, unsigned regionIdx) |
template<class FluidState , class LhsEval = typename FluidState::Scalar> | |
static LhsEval | saturatedDissolutionFactor (const FluidState &fluidState, unsigned phaseIdx, unsigned regionIdx, Scalar maxOilSaturation) |
Returns the dissolution factor ![]() | |
template<class FluidState , class LhsEval = typename FluidState::Scalar> | |
static LhsEval | saturatedDissolutionFactor (const FluidState &fluidState, unsigned phaseIdx, unsigned regionIdx) |
Returns the dissolution factor ![]() | |
template<class FluidState , class LhsEval = typename FluidState::Scalar> | |
static LhsEval | bubblePointPressure (const FluidState &fluidState, unsigned regionIdx) |
Returns the bubble point pressure $P_b$ using the current Rs. | |
template<class FluidState , class LhsEval = typename FluidState::Scalar> | |
static LhsEval | dewPointPressure (const FluidState &fluidState, unsigned regionIdx) |
Returns the dew point pressure $P_d$ using the current Rv. | |
template<class FluidState , class LhsEval = typename FluidState::Scalar> | |
static LhsEval | saturationPressure (const FluidState &fluidState, unsigned phaseIdx, unsigned regionIdx) |
Returns the saturation pressure of a given phase [Pa] depending on its composition. | |
template<class LhsEval > | |
static LhsEval | convertXoGToRs (const LhsEval &XoG, unsigned regionIdx) |
Convert the mass fraction of the gas component in the oil phase to the corresponding gas dissolution factor. | |
template<class LhsEval > | |
static LhsEval | convertXgOToRv (const LhsEval &XgO, unsigned regionIdx) |
Convert the mass fraction of the oil component in the gas phase to the corresponding oil vaporization factor. | |
template<class LhsEval > | |
static LhsEval | convertRsToXoG (const LhsEval &Rs, unsigned regionIdx) |
Convert a gas dissolution factor to the the corresponding mass fraction of the gas component in the oil phase. | |
template<class LhsEval > | |
static LhsEval | convertRvToXgO (const LhsEval &Rv, unsigned regionIdx) |
Convert an oil vaporization factor to the corresponding mass fraction of the oil component in the gas phase. | |
template<class LhsEval > | |
static LhsEval | convertXoGToxoG (const LhsEval &XoG, unsigned regionIdx) |
Convert a gas mass fraction in the oil phase the corresponding mole fraction. | |
template<class LhsEval > | |
static LhsEval | convertxoGToXoG (const LhsEval &xoG, unsigned regionIdx) |
Convert a gas mole fraction in the oil phase the corresponding mass fraction. | |
template<class LhsEval > | |
static LhsEval | convertXgOToxgO (const LhsEval &XgO, unsigned regionIdx) |
Convert a oil mass fraction in the gas phase the corresponding mole fraction. | |
template<class LhsEval > | |
static LhsEval | convertxgOToXgO (const LhsEval &xgO, unsigned regionIdx) |
Convert a oil mole fraction in the gas phase the corresponding mass fraction. | |
static const GasPvt & | gasPvt () |
Return a reference to the low-level object which calculates the gas phase quantities. | |
static const OilPvt & | oilPvt () |
Return a reference to the low-level object which calculates the oil phase quantities. | |
static const WaterPvt & | waterPvt () |
Return a reference to the low-level object which calculates the water phase quantities. | |
static Scalar | reservoirTemperature (unsigned pvtRegionIdx OPM_UNUSED=0) |
Set the temperature of the reservoir. | |
static void | setReservoirTemperature (Scalar value) |
Return the temperature of the reservoir. | |
Static Public Attributes | |
static const unsigned | numPhases = 3 |
static const unsigned | waterPhaseIdx = 0 |
Index of the water phase. | |
static const unsigned | oilPhaseIdx = 1 |
Index of the oil phase. | |
static const unsigned | gasPhaseIdx = 2 |
Index of the gas phase. | |
static const Scalar | surfacePressure = 101325.0 |
The pressure at the surface. | |
static const Scalar | surfaceTemperature = 273.15 + 15.56 |
The temperature at the surface. | |
static const unsigned | numComponents = 3 |
static const unsigned | oilCompIdx = 0 |
Index of the oil component. | |
static const unsigned | waterCompIdx = 1 |
Index of the water component. | |
static const unsigned | gasCompIdx = 2 |
Index of the gas component. | |
Static Protected Attributes | |
static const int | phaseToSolventCompIdx_ [3] |
static const int | phaseToSoluteCompIdx_ [3] |
static unsigned char | numActivePhases_ |
static bool | phaseIsActive_ [numPhases] |
A fluid system which uses the black-oil model assumptions to calculate termodynamically meaningful quantities.
Scalar | The type used for scalar floating point values |
static const char* Opm::FluidSystems::BlackOil< Scalar >::componentName | ( | unsigned | compIdx | ) | [inline, static] |
Return the human readable name of a component.
Reimplemented from Opm::BaseFluidSystem< Scalar, BlackOil< Scalar > >.
static LhsEval Opm::FluidSystems::BlackOil< Scalar >::density | ( | const FluidState & | fluidState, | |
unsigned | phaseIdx, | |||
unsigned | regionIdx | |||
) | [inline, static] |
Calculate the density [kg/m^3] of a fluid phase.
static LhsEval Opm::FluidSystems::BlackOil< Scalar >::density | ( | const FluidState & | fluidState, | |
const ParameterCache< ParamCacheEval > & | paramCache, | |||
unsigned | phaseIdx | |||
) | [inline, static] |
Calculate the density [kg/m^3] of a fluid phase.
static bool Opm::FluidSystems::BlackOil< Scalar >::enableDissolvedGas | ( | ) | [inline, static] |
Returns whether the fluid system should consider that the gas component can dissolve in the oil phase.
By default, dissolved gas is considered.
static bool Opm::FluidSystems::BlackOil< Scalar >::enableVaporizedOil | ( | ) | [inline, static] |
Returns whether the fluid system should consider that the oil component can dissolve in the gas phase.
By default, vaporized oil is not considered.
static LhsEval Opm::FluidSystems::BlackOil< Scalar >::fugacityCoefficient | ( | const FluidState & | fluidState, | |
unsigned | phaseIdx, | |||
unsigned | compIdx, | |||
unsigned | regionIdx | |||
) | [inline, static] |
Calculate the fugacity coefficient [Pa] of an individual component in a fluid phase. The fugacity coefficient is connected to the fugacity
and the component's molarity
by means of the relation
static LhsEval Opm::FluidSystems::BlackOil< Scalar >::fugacityCoefficient | ( | const FluidState & | fluidState, | |
const ParameterCache< ParamCacheEval > & | paramCache, | |||
unsigned | phaseIdx, | |||
unsigned | compIdx | |||
) | [inline, static] |
Calculate the fugacity coefficient [Pa] of an individual component in a fluid phase. The fugacity coefficient is connected to the fugacity
and the component's molarity
by means of the relation
static const GasPvt& Opm::FluidSystems::BlackOil< Scalar >::gasPvt | ( | ) | [inline, static] |
Return a reference to the low-level object which calculates the gas phase quantities.
static void Opm::FluidSystems::BlackOil< Scalar >::initBegin | ( | size_t | numPvtRegions | ) | [inline, static] |
Begin the initialization of the black oil fluid system.
After calling this method the reference densities, all dissolution and formation volume factors, the oil bubble pressure, all viscosities and the water compressibility must be set. Before the fluid system can be used, initEnd() must be called to finalize the initialization.
static LhsEval Opm::FluidSystems::BlackOil< Scalar >::inverseFormationVolumeFactor | ( | const FluidState & | fluidState, | |
unsigned | phaseIdx, | |||
unsigned | regionIdx | |||
) | [inline, static] |
Returns the formation volume factor of an "undersaturated" fluid phase.
For the oil (gas) phase, "undersaturated" means that the concentration of the gas (oil) component is not assumed to be at the thermodynamically possible maximum at the given temperature and pressure.
static bool Opm::FluidSystems::BlackOil< Scalar >::isCompressible | ( | unsigned | ) | [inline, static] |
Returns true if and only if a fluid phase is assumed to be compressible. Compressible means that the partial derivative of the density to the fluid pressure is always larger than zero.
Reimplemented from Opm::BaseFluidSystem< Scalar, BlackOil< Scalar > >.
static bool Opm::FluidSystems::BlackOil< Scalar >::isIdealGas | ( | unsigned | ) | [inline, static] |
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Reimplemented from Opm::BaseFluidSystem< Scalar, BlackOil< Scalar > >.
static bool Opm::FluidSystems::BlackOil< Scalar >::isIdealMixture | ( | unsigned | ) | [inline, static] |
Returns true if and only if a fluid phase is assumed to be an ideal mixture. We define an ideal mixture as a fluid phase where the fugacity coefficients of all components times the pressure of the phase are independent on the fluid composition. This assumption is true if Henry's law and Rault's law apply. If you are unsure what this function should return, it is safe to return false. The only damage done will be (slightly) increased computation times in some cases.
Reimplemented from Opm::BaseFluidSystem< Scalar, BlackOil< Scalar > >.
static bool Opm::FluidSystems::BlackOil< Scalar >::isLiquid | ( | unsigned | phaseIdx | ) | [inline, static] |
Return whether a phase is liquid.
Reimplemented from Opm::BaseFluidSystem< Scalar, BlackOil< Scalar > >.
static Scalar Opm::FluidSystems::BlackOil< Scalar >::molarMass | ( | unsigned | compIdx, | |
unsigned | regionIdx = 0 | |||
) | [inline, static] |
Return the molar mass of a component in [kg/mol].
static size_t Opm::FluidSystems::BlackOil< Scalar >::numRegions | ( | ) | [inline, static] |
Returns the number of PVT regions which are considered.
By default, this is 1.
static const OilPvt& Opm::FluidSystems::BlackOil< Scalar >::oilPvt | ( | ) | [inline, static] |
Return a reference to the low-level object which calculates the oil phase quantities.
static const char* Opm::FluidSystems::BlackOil< Scalar >::phaseName | ( | unsigned | phaseIdx | ) | [inline, static] |
Return the human readable name of a fluid phase.
Reimplemented from Opm::BaseFluidSystem< Scalar, BlackOil< Scalar > >.
static Scalar Opm::FluidSystems::BlackOil< Scalar >::referenceDensity | ( | unsigned | phaseIdx, | |
unsigned | regionIdx | |||
) | [inline, static] |
Returns the density of a fluid phase at surface pressure [kg/m^3].
static Scalar Opm::FluidSystems::BlackOil< Scalar >::reservoirTemperature | ( | unsigned pvtRegionIdx | OPM_UNUSED = 0 |
) | [inline, static] |
Set the temperature of the reservoir.
This method is black-oil specific and only makes sense for isothermal simulations.
static LhsEval Opm::FluidSystems::BlackOil< Scalar >::saturatedDensity | ( | const FluidState & | fluidState, | |
unsigned | phaseIdx, | |||
unsigned | regionIdx | |||
) | [inline, static] |
Compute the density of a saturated fluid phase.
This means the density of the given fluid phase if the dissolved component (gas for the oil phase and oil for the gas phase) is at the thermodynamically possible maximum. For the water phase, there's no difference to the density() method.
static LhsEval Opm::FluidSystems::BlackOil< Scalar >::saturatedDissolutionFactor | ( | const FluidState & | fluidState, | |
unsigned | phaseIdx, | |||
unsigned | regionIdx | |||
) | [inline, static] |
Returns the dissolution factor of a saturated fluid phase.
For the oil (gas) phase, this means the R_s and R_v factors, for the water phase, it is always 0. The difference of this method compared to the previous one is that this method does not prevent dissolving a given component if the corresponding phase's saturation is small-
static LhsEval Opm::FluidSystems::BlackOil< Scalar >::saturatedDissolutionFactor | ( | const FluidState & | fluidState, | |
unsigned | phaseIdx, | |||
unsigned | regionIdx, | |||
Scalar | maxOilSaturation | |||
) | [inline, static] |
Returns the dissolution factor of a saturated fluid phase.
For the oil (gas) phase, this means the R_s and R_v factors, for the water phase, it is always 0.
static LhsEval Opm::FluidSystems::BlackOil< Scalar >::saturatedInverseFormationVolumeFactor | ( | const FluidState & | fluidState, | |
unsigned | phaseIdx, | |||
unsigned | regionIdx | |||
) | [inline, static] |
Returns the formation volume factor of a "saturated" fluid phase.
For the oil phase, this means that it is gas saturated, the gas phase is oil saturated and for the water phase, there is no difference to formationVolumeFactor()
static LhsEval Opm::FluidSystems::BlackOil< Scalar >::saturationPressure | ( | const FluidState & | fluidState, | |
unsigned | phaseIdx, | |||
unsigned | regionIdx | |||
) | [inline, static] |
Returns the saturation pressure of a given phase [Pa] depending on its composition.
In the black-oil model, the saturation pressure it the pressure at which the fluid phase is in equilibrium with the gas phase, i.e., it is the inverse of the "dissolution factor". Note that a-priori this quantity is undefined for the water phase (because water is assumed to be immiscible with everything else). This method here just returns 0, though.
static void Opm::FluidSystems::BlackOil< Scalar >::setEnableDissolvedGas | ( | bool | yesno | ) | [inline, static] |
Specify whether the fluid system should consider that the gas component can dissolve in the oil phase.
By default, dissolved gas is considered.
static void Opm::FluidSystems::BlackOil< Scalar >::setEnableVaporizedOil | ( | bool | yesno | ) | [inline, static] |
Specify whether the fluid system should consider that the oil component can dissolve in the gas phase.
By default, vaporized oil is not considered.
static void Opm::FluidSystems::BlackOil< Scalar >::setReferenceDensities | ( | Scalar | rhoOil, | |
Scalar | rhoWater, | |||
Scalar | rhoGas, | |||
unsigned | regionIdx | |||
) | [inline, static] |
Initialize the values of the reference densities.
rhoOil | The reference density of (gas saturated) oil phase. | |
rhoWater | The reference density of the water phase. | |
rhoGas | The reference density of the gas phase. |
static void Opm::FluidSystems::BlackOil< Scalar >::setReservoirTemperature | ( | Scalar | value | ) | [inline, static] |
Return the temperature of the reservoir.
This method is black-oil specific and only makes sense for isothermal simulations.
static LhsEval Opm::FluidSystems::BlackOil< Scalar >::viscosity | ( | const FluidState & | fluidState, | |
unsigned | phaseIdx, | |||
unsigned | regionIdx | |||
) | [inline, static] |
Calculate the dynamic viscosity of a fluid phase [Pa*s].
static LhsEval Opm::FluidSystems::BlackOil< Scalar >::viscosity | ( | const FluidState & | fluidState, | |
const ParameterCache< ParamCacheEval > & | paramCache, | |||
unsigned | phaseIdx | |||
) | [inline, static] |
Calculate the dynamic viscosity of a fluid phase [Pa*s].
static const WaterPvt& Opm::FluidSystems::BlackOil< Scalar >::waterPvt | ( | ) | [inline, static] |
Return a reference to the low-level object which calculates the water phase quantities.
const unsigned Opm::FluidSystems::BlackOil< Scalar >::numComponents = 3 [static] |
Number of chemical species in the fluid system.
Reimplemented from Opm::BaseFluidSystem< Scalar, BlackOil< Scalar > >.
const unsigned Opm::FluidSystems::BlackOil< Scalar >::numPhases = 3 [static] |
Number of fluid phases in the fluid system.
Reimplemented from Opm::BaseFluidSystem< Scalar, BlackOil< Scalar > >.
const int Opm::FluidSystems::BlackOil< Scalar >::phaseToSoluteCompIdx_ [inline, static, protected] |
{ -1, gasCompIdx, oilCompIdx }
const int Opm::FluidSystems::BlackOil< Scalar >::phaseToSolventCompIdx_ [inline, static, protected] |
{ waterCompIdx, oilCompIdx, gasCompIdx }