opm-common
Loading...
Searching...
No Matches
Opm::BlackOilFluidState< ScalarT, FluidSystemT, enableTemperature, enableEnergy, enableDissolution, enableVapwat, enableBrine, enableSaltPrecipitation, enableDissolutionInWater, numStoragePhases > Class Template Reference

Implements a "tailor-made" fluid state class for the black-oil model. More...

#include <BlackOilFluidState.hpp>

Public Types

using FluidSystem = FluidSystemT
using Scalar = ScalarT

Public Member Functions

OPM_HOST_DEVICE BlackOilFluidState (const FluidSystem &fluidSystem)
 Construct a fluid state object.
OPM_HOST_DEVICE BlackOilFluidState ()
 Construct a fluid state object.
void checkDefined () const
 Make sure that all attributes are defined.
template<class FluidState>
OPM_HOST_DEVICE void assign (const FluidState &fs)
 Retrieve all parameters from an arbitrary fluid state.
OPM_HOST_DEVICE void setPvtRegionIndex (unsigned newPvtRegionIdx)
 Set the index of the fluid region.
OPM_HOST_DEVICE void setPressure (unsigned phaseIdx, const Scalar &p)
 Set the pressure of a fluid phase [-].
OPM_HOST_DEVICE void setSaturation (unsigned phaseIdx, const Scalar &S)
 Set the saturation of a fluid phase [-].
OPM_HOST_DEVICE void setTotalSaturation (const Scalar &value)
 Set the total saturation used for sequential methods.
OPM_HOST_DEVICE void setTemperature (const Scalar &value)
 Set the temperature [K].
OPM_HOST_DEVICE void setEnthalpy (unsigned phaseIdx, const Scalar &value)
 Set the specific enthalpy [J/kg] of a given fluid phase.
OPM_HOST_DEVICE void setInvB (unsigned phaseIdx, const Scalar &b)
 \ brief Set the inverse formation volume factor of a fluid phase
OPM_HOST_DEVICE void setDensity (unsigned phaseIdx, const Scalar &rho)
 \ brief Set the density of a fluid phase
OPM_HOST_DEVICE void setRs (const Scalar &newRs)
 Set the gas dissolution factor [m^3/m^3] of the oil phase.
OPM_HOST_DEVICE void setRv (const Scalar &newRv)
 Set the oil vaporization factor [m^3/m^3] of the gas phase.
OPM_HOST_DEVICE void setRvw (const Scalar &newRvw)
 Set the water vaporization factor [m^3/m^3] of the gas phase.
OPM_HOST_DEVICE void setRsw (const Scalar &newRsw)
 Set the gas dissolution factor [m^3/m^3] of the water phase.
OPM_HOST_DEVICE void setSaltConcentration (const Scalar &newSaltConcentration)
 Set the salt concentration.
OPM_HOST_DEVICE void setSaltSaturation (const Scalar &newSaltSaturation)
 Set the solid salt saturation.
OPM_HOST_DEVICE const Scalar & pressure (unsigned phaseIdx) const
 Return the pressure of a fluid phase [Pa].
OPM_HOST_DEVICE const Scalar & saturation (unsigned phaseIdx) const
 Return the saturation of a fluid phase [-].
OPM_HOST_DEVICE const Scalar & totalSaturation () const
 Return the total saturation needed for sequential.
OPM_HOST_DEVICE Scalar temperature (unsigned) const
 Return the temperature [K].
OPM_HOST_DEVICE const Scalar & invB (unsigned phaseIdx) const
 Return the inverse formation volume factor of a fluid phase [-].
OPM_HOST_DEVICE Scalar Rs () const
 Return the gas dissolution factor of oil [m^3/m^3].
OPM_HOST_DEVICE Scalar Rv () const
 Return the oil vaporization factor of gas [m^3/m^3].
OPM_HOST_DEVICE Scalar Rvw () const
 Return the water vaporization factor of gas [m^3/m^3].
OPM_HOST_DEVICE Scalar Rsw () const
 Return the gas dissolution factor of water [m^3/m^3].
OPM_HOST_DEVICE Scalar saltConcentration () const
 Return the concentration of salt in water.
OPM_HOST_DEVICE Scalar saltSaturation () const
 Return the saturation of solid salt.
OPM_HOST_DEVICE unsigned short pvtRegionIndex () const
 Return the PVT region where the current fluid state is assumed to be part of.
OPM_HOST_DEVICE Scalar density (unsigned phaseIdx) const
 Return the density [kg/m^3] of a given fluid phase.
OPM_HOST_DEVICE const Scalar & enthalpy (unsigned phaseIdx) const
 Return the specific enthalpy [J/kg] of a given fluid phase.
OPM_HOST_DEVICE Scalar internalEnergy (unsigned phaseIdx) const
 Return the specific internal energy [J/kg] of a given fluid phase.
OPM_HOST_DEVICE Scalar molarDensity (unsigned phaseIdx) const
 Return the molar density of a fluid phase [mol/m^3].
OPM_HOST_DEVICE Scalar molarVolume (unsigned phaseIdx) const
 Return the molar volume of a fluid phase [m^3/mol].
OPM_HOST_DEVICE Scalar viscosity (unsigned phaseIdx) const
 Return the dynamic viscosity of a fluid phase [Pa s].
OPM_HOST_DEVICE Scalar massFraction (unsigned phaseIdx, unsigned compIdx) const
 Return the mass fraction of a component in a fluid phase [-].
OPM_HOST_DEVICE Scalar moleFraction (unsigned phaseIdx, unsigned compIdx) const
 Return the mole fraction of a component in a fluid phase [-].
OPM_HOST_DEVICE Scalar molarity (unsigned phaseIdx, unsigned compIdx) const
 Return the partial molar density of a component in a fluid phase [mol / m^3].
OPM_HOST_DEVICE Scalar averageMolarMass (unsigned phaseIdx) const
 Return the partial molar density of a fluid phase [kg / mol].
OPM_HOST_DEVICE Scalar fugacityCoefficient (unsigned phaseIdx, unsigned compIdx) const
 Return the fugacity coefficient of a component in a fluid phase [-].
OPM_HOST_DEVICE Scalar fugacity (unsigned phaseIdx, unsigned compIdx) const
 Return the fugacity of a component in a fluid phase [Pa].
bool phaseIsActive (int phaseIdx) const
 Return if a phase is active (via the FluidSystem).
OPM_HOST_DEVICE const FluidSystem & fluidSystem () const
 Return the fluid system used by this fluid state.

Static Public Attributes

static constexpr int waterPhaseIdx = FluidSystem::waterPhaseIdx
static constexpr int gasPhaseIdx = FluidSystem::gasPhaseIdx
static constexpr int oilPhaseIdx = FluidSystem::oilPhaseIdx
static constexpr int waterCompIdx = FluidSystem::waterCompIdx
static constexpr int gasCompIdx = FluidSystem::gasCompIdx
static constexpr int oilCompIdx = FluidSystem::oilCompIdx
static constexpr int numPhases = FluidSystem::numPhases
static constexpr int numComponents = FluidSystem::numComponents
static constexpr bool fluidSystemIsStatic = std::is_empty_v<FluidSystem>

Detailed Description

template<class ScalarT, class FluidSystemT, bool enableTemperature = false, bool enableEnergy = false, bool enableDissolution = true, bool enableVapwat = false, bool enableBrine = false, bool enableSaltPrecipitation = false, bool enableDissolutionInWater = false, unsigned numStoragePhases = FluidSystemT::numPhases>
class Opm::BlackOilFluidState< ScalarT, FluidSystemT, enableTemperature, enableEnergy, enableDissolution, enableVapwat, enableBrine, enableSaltPrecipitation, enableDissolutionInWater, numStoragePhases >

Implements a "tailor-made" fluid state class for the black-oil model.

I.e., it uses exactly the same quantities which are used by the ECL blackoil model. Further quantities are computed "on the fly" and are accessing them is thus relatively slow.

Constructor & Destructor Documentation

◆ BlackOilFluidState() [1/2]

template<class ScalarT, class FluidSystemT, bool enableTemperature = false, bool enableEnergy = false, bool enableDissolution = true, bool enableVapwat = false, bool enableBrine = false, bool enableSaltPrecipitation = false, bool enableDissolutionInWater = false, unsigned numStoragePhases = FluidSystemT::numPhases>
OPM_HOST_DEVICE Opm::BlackOilFluidState< ScalarT, FluidSystemT, enableTemperature, enableEnergy, enableDissolution, enableVapwat, enableBrine, enableSaltPrecipitation, enableDissolutionInWater, numStoragePhases >::BlackOilFluidState ( const FluidSystem & fluidSystem)
inlineexplicit

Construct a fluid state object.

Parameters
fluidSystemThe fluid system which is used to compute various quantities

◆ BlackOilFluidState() [2/2]

template<class ScalarT, class FluidSystemT, bool enableTemperature = false, bool enableEnergy = false, bool enableDissolution = true, bool enableVapwat = false, bool enableBrine = false, bool enableSaltPrecipitation = false, bool enableDissolutionInWater = false, unsigned numStoragePhases = FluidSystemT::numPhases>
OPM_HOST_DEVICE Opm::BlackOilFluidState< ScalarT, FluidSystemT, enableTemperature, enableEnergy, enableDissolution, enableVapwat, enableBrine, enableSaltPrecipitation, enableDissolutionInWater, numStoragePhases >::BlackOilFluidState ( )
inline

Construct a fluid state object.

The fluid system used is assumed to be stateless.

Member Function Documentation

◆ checkDefined()

template<class ScalarT, class FluidSystemT, bool enableTemperature = false, bool enableEnergy = false, bool enableDissolution = true, bool enableVapwat = false, bool enableBrine = false, bool enableSaltPrecipitation = false, bool enableDissolutionInWater = false, unsigned numStoragePhases = FluidSystemT::numPhases>
void Opm::BlackOilFluidState< ScalarT, FluidSystemT, enableTemperature, enableEnergy, enableDissolution, enableVapwat, enableBrine, enableSaltPrecipitation, enableDissolutionInWater, numStoragePhases >::checkDefined ( ) const
inline

Make sure that all attributes are defined.

This method does not do anything if the program is not run under valgrind. If it is, then valgrind will print an error message if some attributes of the object have not been properly defined.

◆ enthalpy()

template<class ScalarT, class FluidSystemT, bool enableTemperature = false, bool enableEnergy = false, bool enableDissolution = true, bool enableVapwat = false, bool enableBrine = false, bool enableSaltPrecipitation = false, bool enableDissolutionInWater = false, unsigned numStoragePhases = FluidSystemT::numPhases>
OPM_HOST_DEVICE const Scalar & Opm::BlackOilFluidState< ScalarT, FluidSystemT, enableTemperature, enableEnergy, enableDissolution, enableVapwat, enableBrine, enableSaltPrecipitation, enableDissolutionInWater, numStoragePhases >::enthalpy ( unsigned phaseIdx) const
inline

Return the specific enthalpy [J/kg] of a given fluid phase.

If the EnableEnergy property is not set to true, this method will throw an exception!

◆ fluidSystem()

template<class ScalarT, class FluidSystemT, bool enableTemperature = false, bool enableEnergy = false, bool enableDissolution = true, bool enableVapwat = false, bool enableBrine = false, bool enableSaltPrecipitation = false, bool enableDissolutionInWater = false, unsigned numStoragePhases = FluidSystemT::numPhases>
OPM_HOST_DEVICE const FluidSystem & Opm::BlackOilFluidState< ScalarT, FluidSystemT, enableTemperature, enableEnergy, enableDissolution, enableVapwat, enableBrine, enableSaltPrecipitation, enableDissolutionInWater, numStoragePhases >::fluidSystem ( ) const
inline

Return the fluid system used by this fluid state.

If the fluid system is static (i.e., if the fluid system has no state), this method will always return a reference to the same static object.

◆ internalEnergy()

template<class ScalarT, class FluidSystemT, bool enableTemperature = false, bool enableEnergy = false, bool enableDissolution = true, bool enableVapwat = false, bool enableBrine = false, bool enableSaltPrecipitation = false, bool enableDissolutionInWater = false, unsigned numStoragePhases = FluidSystemT::numPhases>
OPM_HOST_DEVICE Scalar Opm::BlackOilFluidState< ScalarT, FluidSystemT, enableTemperature, enableEnergy, enableDissolution, enableVapwat, enableBrine, enableSaltPrecipitation, enableDissolutionInWater, numStoragePhases >::internalEnergy ( unsigned phaseIdx) const
inline

Return the specific internal energy [J/kg] of a given fluid phase.

If the EnableEnergy property is not set to true, this method will throw an exception!

◆ invB()

template<class ScalarT, class FluidSystemT, bool enableTemperature = false, bool enableEnergy = false, bool enableDissolution = true, bool enableVapwat = false, bool enableBrine = false, bool enableSaltPrecipitation = false, bool enableDissolutionInWater = false, unsigned numStoragePhases = FluidSystemT::numPhases>
OPM_HOST_DEVICE const Scalar & Opm::BlackOilFluidState< ScalarT, FluidSystemT, enableTemperature, enableEnergy, enableDissolution, enableVapwat, enableBrine, enableSaltPrecipitation, enableDissolutionInWater, numStoragePhases >::invB ( unsigned phaseIdx) const
inline

Return the inverse formation volume factor of a fluid phase [-].

This factor expresses the change of density of a pure phase due to increased pressure and temperature at reservoir conditions compared to surface conditions.

◆ molarVolume()

template<class ScalarT, class FluidSystemT, bool enableTemperature = false, bool enableEnergy = false, bool enableDissolution = true, bool enableVapwat = false, bool enableBrine = false, bool enableSaltPrecipitation = false, bool enableDissolutionInWater = false, unsigned numStoragePhases = FluidSystemT::numPhases>
OPM_HOST_DEVICE Scalar Opm::BlackOilFluidState< ScalarT, FluidSystemT, enableTemperature, enableEnergy, enableDissolution, enableVapwat, enableBrine, enableSaltPrecipitation, enableDissolutionInWater, numStoragePhases >::molarVolume ( unsigned phaseIdx) const
inline

Return the molar volume of a fluid phase [m^3/mol].

This is equivalent to the inverse of the molar density.

◆ phaseIsActive()

template<class ScalarT, class FluidSystemT, bool enableTemperature = false, bool enableEnergy = false, bool enableDissolution = true, bool enableVapwat = false, bool enableBrine = false, bool enableSaltPrecipitation = false, bool enableDissolutionInWater = false, unsigned numStoragePhases = FluidSystemT::numPhases>
bool Opm::BlackOilFluidState< ScalarT, FluidSystemT, enableTemperature, enableEnergy, enableDissolution, enableVapwat, enableBrine, enableSaltPrecipitation, enableDissolutionInWater, numStoragePhases >::phaseIsActive ( int phaseIdx) const
inline

Return if a phase is active (via the FluidSystem).

Note: this could be a static function, but for future GPU usage we must avoid static, so making it a regular member function to simplify future refactoring.

◆ Rs()

template<class ScalarT, class FluidSystemT, bool enableTemperature = false, bool enableEnergy = false, bool enableDissolution = true, bool enableVapwat = false, bool enableBrine = false, bool enableSaltPrecipitation = false, bool enableDissolutionInWater = false, unsigned numStoragePhases = FluidSystemT::numPhases>
OPM_HOST_DEVICE Scalar Opm::BlackOilFluidState< ScalarT, FluidSystemT, enableTemperature, enableEnergy, enableDissolution, enableVapwat, enableBrine, enableSaltPrecipitation, enableDissolutionInWater, numStoragePhases >::Rs ( ) const
inline

Return the gas dissolution factor of oil [m^3/m^3].

I.e., the amount of gas which is present in the oil phase in terms of cubic meters of gas at surface conditions per cubic meter of liquid oil at surface conditions. This method is specific to the black-oil model.

◆ Rsw()

template<class ScalarT, class FluidSystemT, bool enableTemperature = false, bool enableEnergy = false, bool enableDissolution = true, bool enableVapwat = false, bool enableBrine = false, bool enableSaltPrecipitation = false, bool enableDissolutionInWater = false, unsigned numStoragePhases = FluidSystemT::numPhases>
OPM_HOST_DEVICE Scalar Opm::BlackOilFluidState< ScalarT, FluidSystemT, enableTemperature, enableEnergy, enableDissolution, enableVapwat, enableBrine, enableSaltPrecipitation, enableDissolutionInWater, numStoragePhases >::Rsw ( ) const
inline

Return the gas dissolution factor of water [m^3/m^3].

I.e., the amount of gas which is present in the water phase in terms of cubic meters of gas at surface conditions per cubic meter of water at surface conditions. This method is specific to the black-oil model.

◆ Rv()

template<class ScalarT, class FluidSystemT, bool enableTemperature = false, bool enableEnergy = false, bool enableDissolution = true, bool enableVapwat = false, bool enableBrine = false, bool enableSaltPrecipitation = false, bool enableDissolutionInWater = false, unsigned numStoragePhases = FluidSystemT::numPhases>
OPM_HOST_DEVICE Scalar Opm::BlackOilFluidState< ScalarT, FluidSystemT, enableTemperature, enableEnergy, enableDissolution, enableVapwat, enableBrine, enableSaltPrecipitation, enableDissolutionInWater, numStoragePhases >::Rv ( ) const
inline

Return the oil vaporization factor of gas [m^3/m^3].

I.e., the amount of oil which is present in the gas phase in terms of cubic meters of liquid oil at surface conditions per cubic meter of gas at surface conditions. This method is specific to the black-oil model.

◆ Rvw()

template<class ScalarT, class FluidSystemT, bool enableTemperature = false, bool enableEnergy = false, bool enableDissolution = true, bool enableVapwat = false, bool enableBrine = false, bool enableSaltPrecipitation = false, bool enableDissolutionInWater = false, unsigned numStoragePhases = FluidSystemT::numPhases>
OPM_HOST_DEVICE Scalar Opm::BlackOilFluidState< ScalarT, FluidSystemT, enableTemperature, enableEnergy, enableDissolution, enableVapwat, enableBrine, enableSaltPrecipitation, enableDissolutionInWater, numStoragePhases >::Rvw ( ) const
inline

Return the water vaporization factor of gas [m^3/m^3].

I.e., the amount of water which is present in the gas phase in terms of cubic meters of liquid water at surface conditions per cubic meter of gas at surface conditions. This method is specific to the black-oil model.

◆ setEnthalpy()

template<class ScalarT, class FluidSystemT, bool enableTemperature = false, bool enableEnergy = false, bool enableDissolution = true, bool enableVapwat = false, bool enableBrine = false, bool enableSaltPrecipitation = false, bool enableDissolutionInWater = false, unsigned numStoragePhases = FluidSystemT::numPhases>
OPM_HOST_DEVICE void Opm::BlackOilFluidState< ScalarT, FluidSystemT, enableTemperature, enableEnergy, enableDissolution, enableVapwat, enableBrine, enableSaltPrecipitation, enableDissolutionInWater, numStoragePhases >::setEnthalpy ( unsigned phaseIdx,
const Scalar & value )
inline

Set the specific enthalpy [J/kg] of a given fluid phase.

If the enableEnergy template argument is not set to true, this method will throw an exception!

◆ setPvtRegionIndex()

template<class ScalarT, class FluidSystemT, bool enableTemperature = false, bool enableEnergy = false, bool enableDissolution = true, bool enableVapwat = false, bool enableBrine = false, bool enableSaltPrecipitation = false, bool enableDissolutionInWater = false, unsigned numStoragePhases = FluidSystemT::numPhases>
OPM_HOST_DEVICE void Opm::BlackOilFluidState< ScalarT, FluidSystemT, enableTemperature, enableEnergy, enableDissolution, enableVapwat, enableBrine, enableSaltPrecipitation, enableDissolutionInWater, numStoragePhases >::setPvtRegionIndex ( unsigned newPvtRegionIdx)
inline

Set the index of the fluid region.

This determines which tables are used to compute the quantities that are computed on the fly.

◆ setRs()

template<class ScalarT, class FluidSystemT, bool enableTemperature = false, bool enableEnergy = false, bool enableDissolution = true, bool enableVapwat = false, bool enableBrine = false, bool enableSaltPrecipitation = false, bool enableDissolutionInWater = false, unsigned numStoragePhases = FluidSystemT::numPhases>
OPM_HOST_DEVICE void Opm::BlackOilFluidState< ScalarT, FluidSystemT, enableTemperature, enableEnergy, enableDissolution, enableVapwat, enableBrine, enableSaltPrecipitation, enableDissolutionInWater, numStoragePhases >::setRs ( const Scalar & newRs)
inline

Set the gas dissolution factor [m^3/m^3] of the oil phase.

This quantity is very specific to the black-oil model.

◆ setRsw()

template<class ScalarT, class FluidSystemT, bool enableTemperature = false, bool enableEnergy = false, bool enableDissolution = true, bool enableVapwat = false, bool enableBrine = false, bool enableSaltPrecipitation = false, bool enableDissolutionInWater = false, unsigned numStoragePhases = FluidSystemT::numPhases>
OPM_HOST_DEVICE void Opm::BlackOilFluidState< ScalarT, FluidSystemT, enableTemperature, enableEnergy, enableDissolution, enableVapwat, enableBrine, enableSaltPrecipitation, enableDissolutionInWater, numStoragePhases >::setRsw ( const Scalar & newRsw)
inline

Set the gas dissolution factor [m^3/m^3] of the water phase.

This quantity is very specific to the black-oil model.

◆ setRv()

template<class ScalarT, class FluidSystemT, bool enableTemperature = false, bool enableEnergy = false, bool enableDissolution = true, bool enableVapwat = false, bool enableBrine = false, bool enableSaltPrecipitation = false, bool enableDissolutionInWater = false, unsigned numStoragePhases = FluidSystemT::numPhases>
OPM_HOST_DEVICE void Opm::BlackOilFluidState< ScalarT, FluidSystemT, enableTemperature, enableEnergy, enableDissolution, enableVapwat, enableBrine, enableSaltPrecipitation, enableDissolutionInWater, numStoragePhases >::setRv ( const Scalar & newRv)
inline

Set the oil vaporization factor [m^3/m^3] of the gas phase.

This quantity is very specific to the black-oil model.

◆ setRvw()

template<class ScalarT, class FluidSystemT, bool enableTemperature = false, bool enableEnergy = false, bool enableDissolution = true, bool enableVapwat = false, bool enableBrine = false, bool enableSaltPrecipitation = false, bool enableDissolutionInWater = false, unsigned numStoragePhases = FluidSystemT::numPhases>
OPM_HOST_DEVICE void Opm::BlackOilFluidState< ScalarT, FluidSystemT, enableTemperature, enableEnergy, enableDissolution, enableVapwat, enableBrine, enableSaltPrecipitation, enableDissolutionInWater, numStoragePhases >::setRvw ( const Scalar & newRvw)
inline

Set the water vaporization factor [m^3/m^3] of the gas phase.

This quantity is very specific to the black-oil model.

◆ setTemperature()

template<class ScalarT, class FluidSystemT, bool enableTemperature = false, bool enableEnergy = false, bool enableDissolution = true, bool enableVapwat = false, bool enableBrine = false, bool enableSaltPrecipitation = false, bool enableDissolutionInWater = false, unsigned numStoragePhases = FluidSystemT::numPhases>
OPM_HOST_DEVICE void Opm::BlackOilFluidState< ScalarT, FluidSystemT, enableTemperature, enableEnergy, enableDissolution, enableVapwat, enableBrine, enableSaltPrecipitation, enableDissolutionInWater, numStoragePhases >::setTemperature ( const Scalar & value)
inline

Set the temperature [K].

If neither the enableTemperature nor the enableEnergy template arguments are set to true, this method will throw an exception!


The documentation for this class was generated from the following file: