Opm::BlackOilPrimaryVariables< TypeTag > Class Template Reference

Represents the primary variables used by the black-oil model. More...

#include <blackoilprimaryvariables.hh>

Inheritance diagram for Opm::BlackOilPrimaryVariables< TypeTag >:
Inheritance graph

Public Types

enum class  WaterMeaning { Sw , Rvw , Rsw , Disabled }
 
enum class  PressureMeaning { Po , Pg , Pw }
 
enum class  GasMeaning { Sg , Rs , Rv , Disabled }
 
enum class  BrineMeaning { Cs , Sp , Disabled }
 
enum class  SolventMeaning { Ss , Rsolw , Disabled }
 

Public Member Functions

 BlackOilPrimaryVariables ()
 
 BlackOilPrimaryVariables (Scalar value)
 Constructor with assignment from scalar. More...
 
 BlackOilPrimaryVariables (const BlackOilPrimaryVariables &value)=default
 Copy constructor. More...
 
void setPressureScale (Scalar val)
 
Evaluation makeEvaluation (unsigned varIdx, unsigned timeIdx, LinearizationType linearizationType=LinearizationType()) const
 
void setPvtRegionIndex (unsigned value)
 Set the index of the region which should be used for PVT properties. More...
 
unsigned pvtRegionIndex () const
 Return the index of the region which should be used for PVT properties. More...
 
WaterMeaning primaryVarsMeaningWater () const
 Return the interpretation which should be applied to the switching primary variables. More...
 
void setPrimaryVarsMeaningWater (WaterMeaning newMeaning)
 Set the interpretation which should be applied to the switching primary variables. More...
 
PressureMeaning primaryVarsMeaningPressure () const
 Return the interpretation which should be applied to the switching primary variables. More...
 
void setPrimaryVarsMeaningPressure (PressureMeaning newMeaning)
 Set the interpretation which should be applied to the switching primary variables. More...
 
GasMeaning primaryVarsMeaningGas () const
 Return the interpretation which should be applied to the switching primary variables. More...
 
void setPrimaryVarsMeaningGas (GasMeaning newMeaning)
 Set the interpretation which should be applied to the switching primary variables. More...
 
BrineMeaning primaryVarsMeaningBrine () const
 
void setPrimaryVarsMeaningBrine (BrineMeaning newMeaning)
 Set the interpretation which should be applied to the switching primary variables. More...
 
SolventMeaning primaryVarsMeaningSolvent () const
 
void setPrimaryVarsMeaningSolvent (SolventMeaning newMeaning)
 Set the interpretation which should be applied to the switching primary variables. More...
 
template<class FluidState >
void assignMassConservative (const FluidState &fluidState, const MaterialLawParams &matParams, bool isInEquilibrium=false)
 Set the primary variables from an arbitrary fluid state in a mass conservative way. More...
 
template<class FluidState >
void assignNaive (const FluidState &fluidState)
 Directly retrieve the primary variables from an arbitrary fluid state. More...
 
bool adaptPrimaryVariables (const Problem &problem, unsigned globalDofIdx, Scalar swMaximum, Scalar thresholdWaterFilledCell, Scalar eps=0.0)
 Adapt the interpretation of the switching variables to be physically meaningful. More...
 
bool chopAndNormalizeSaturations ()
 
BlackOilPrimaryVariablesoperator= (const BlackOilPrimaryVariables &other)=default
 
BlackOilPrimaryVariablesoperator= (Scalar value)
 
void checkDefined () const
 Instruct valgrind to check the definedness of all attributes of this class. More...
 
template<class Serializer >
void serializeOp (Serializer &serializer)
 
bool operator== (const BlackOilPrimaryVariables &rhs) const
 

Static Public Member Functions

static BlackOilPrimaryVariables serializationTestObject ()
 
static void init ()
 
static void registerParameters ()
 

Detailed Description

template<class TypeTag>
class Opm::BlackOilPrimaryVariables< TypeTag >

Represents the primary variables used by the black-oil model.

Member Enumeration Documentation

◆ BrineMeaning

template<class TypeTag >
enum class Opm::BlackOilPrimaryVariables::BrineMeaning
strong
Enumerator
Cs 
Sp 
Disabled 

◆ GasMeaning

template<class TypeTag >
enum class Opm::BlackOilPrimaryVariables::GasMeaning
strong
Enumerator
Sg 
Rs 
Rv 
Disabled 

◆ PressureMeaning

template<class TypeTag >
enum class Opm::BlackOilPrimaryVariables::PressureMeaning
strong
Enumerator
Po 
Pg 
Pw 

◆ SolventMeaning

template<class TypeTag >
enum class Opm::BlackOilPrimaryVariables::SolventMeaning
strong
Enumerator
Ss 
Rsolw 
Disabled 

◆ WaterMeaning

template<class TypeTag >
enum class Opm::BlackOilPrimaryVariables::WaterMeaning
strong
Enumerator
Sw 
Rvw 
Rsw 
Disabled 

Constructor & Destructor Documentation

◆ BlackOilPrimaryVariables() [1/3]

template<class TypeTag >
Opm::BlackOilPrimaryVariables< TypeTag >::BlackOilPrimaryVariables ( )
inline

◆ BlackOilPrimaryVariables() [2/3]

template<class TypeTag >
Opm::BlackOilPrimaryVariables< TypeTag >::BlackOilPrimaryVariables ( Scalar  value)
inline

Constructor with assignment from scalar.

Parameters
valueThe scalar value to which all entries of the vector will be set.

◆ BlackOilPrimaryVariables() [3/3]

template<class TypeTag >
Opm::BlackOilPrimaryVariables< TypeTag >::BlackOilPrimaryVariables ( const BlackOilPrimaryVariables< TypeTag > &  value)
default

Copy constructor.

Parameters
valueThe primary variables that will be duplicated.

Member Function Documentation

◆ adaptPrimaryVariables()

template<class TypeTag >
bool Opm::BlackOilPrimaryVariables< TypeTag >::adaptPrimaryVariables ( const Problem &  problem,
unsigned  globalDofIdx,
Scalar  swMaximum,
Scalar  thresholdWaterFilledCell,
Scalar  eps = 0.0 
)
inline

Adapt the interpretation of the switching variables to be physically meaningful.

If the meaning of the primary variables changes, their values are also adapted in a meaningful manner. A Scalar eps can be passed to make the switching condition more strict. Useful for avoiding ocsilation in the primaryVarsMeaning.

Returns
true Iff the interpretation of one of the switching variables was changed

References Opm::BlackOilPrimaryVariables< TypeTag >::Cs, Opm::BlackOilPrimaryVariables< TypeTag >::Disabled, Opm::BlackOilBrineModule< TypeTag, enableBrineV >::hasPcfactTables(), Opm::BlackOilSolventModule< TypeTag, enableSolventV >::isSolubleInWater(), Opm::BlackOilBrineModule< TypeTag, enableBrineV >::pcfactTable(), Opm::BlackOilPrimaryVariables< TypeTag >::Pg, Opm::BlackOilPrimaryVariables< TypeTag >::Po, Opm::BlackOilPrimaryVariables< TypeTag >::primaryVarsMeaningBrine(), Opm::BlackOilPrimaryVariables< TypeTag >::primaryVarsMeaningGas(), Opm::BlackOilPrimaryVariables< TypeTag >::primaryVarsMeaningPressure(), Opm::BlackOilPrimaryVariables< TypeTag >::primaryVarsMeaningSolvent(), Opm::BlackOilPrimaryVariables< TypeTag >::primaryVarsMeaningWater(), Opm::BlackOilPrimaryVariables< TypeTag >::pvtRegionIndex(), Opm::BlackOilPrimaryVariables< TypeTag >::Pw, Opm::BlackOilExtboModule< TypeTag, enableExtboV >::rs(), Opm::BlackOilPrimaryVariables< TypeTag >::Rs, Opm::BlackOilPrimaryVariables< TypeTag >::Rsolw, Opm::BlackOilPrimaryVariables< TypeTag >::Rsw, Opm::BlackOilExtboModule< TypeTag, enableExtboV >::rv(), Opm::BlackOilPrimaryVariables< TypeTag >::Rv, Opm::BlackOilPrimaryVariables< TypeTag >::Rvw, Opm::BlackOilBrineModule< TypeTag, enableBrineV >::saltSol(), Opm::BlackOilPrimaryVariables< TypeTag >::setPrimaryVarsMeaningBrine(), Opm::BlackOilPrimaryVariables< TypeTag >::setPrimaryVarsMeaningGas(), Opm::BlackOilPrimaryVariables< TypeTag >::setPrimaryVarsMeaningPressure(), Opm::BlackOilPrimaryVariables< TypeTag >::setPrimaryVarsMeaningSolvent(), Opm::BlackOilPrimaryVariables< TypeTag >::setPrimaryVarsMeaningWater(), Opm::BlackOilPrimaryVariables< TypeTag >::Sg, Opm::BlackOilSolventModule< TypeTag, enableSolventV >::solubilityLimit(), Opm::BlackOilPrimaryVariables< TypeTag >::Sp, Opm::BlackOilPrimaryVariables< TypeTag >::Ss, and Opm::BlackOilPrimaryVariables< TypeTag >::Sw.

◆ assignMassConservative()

template<class TypeTag >
template<class FluidState >
void Opm::BlackOilPrimaryVariables< TypeTag >::assignMassConservative ( const FluidState &  fluidState,
const MaterialLawParams &  matParams,
bool  isInEquilibrium = false 
)
inline

Set the primary variables from an arbitrary fluid state in a mass conservative way.

If an energy equation is included, the fluid temperatures are the same as the one given in the fluid state, not the enthalpy.

Parameters
fluidStateThe fluid state which should be represented by the primary variables. The temperatures, pressures, compositions and densities of all phases must be defined.
matParamsThe capillary pressure law parameters
isInEquilibriumIf true, the fluid state expresses thermodynamic equilibrium assuming the relations expressed by the fluid system. This implies that in addition to the quantities mentioned above, the fugacities are also defined.

References Opm::BlackOilPrimaryVariables< TypeTag >::assignNaive().

◆ assignNaive()

template<class TypeTag >
template<class FluidState >
void Opm::BlackOilPrimaryVariables< TypeTag >::assignNaive ( const FluidState &  fluidState)
inline

Directly retrieve the primary variables from an arbitrary fluid state.

This method retrieves all primary variables from an abitrary fluid state without careing whether the state which is represented by the resulting primary variables features the equivalent mass as the given fluid state. This method is massively cheaper and simpler than assignMassConservative() but it should be used with care!

Parameters
fluidStateThe fluid state which should be represented by the primary variables. The temperatures, pressures, compositions and densities of all phases must be defined.

References Opm::BlackOilEnergyModule< TypeTag, enableEnergyV >::assignPrimaryVars(), Opm::BlackOilPrimaryVariables< TypeTag >::Cs, Opm::BlackOilPrimaryVariables< TypeTag >::Disabled, Opm::BlackOilPrimaryVariables< TypeTag >::Pg, Opm::BlackOilPrimaryVariables< TypeTag >::Po, Opm::BlackOilPrimaryVariables< TypeTag >::primaryVarsMeaningGas(), Opm::BlackOilPrimaryVariables< TypeTag >::primaryVarsMeaningPressure(), Opm::BlackOilPrimaryVariables< TypeTag >::primaryVarsMeaningWater(), Opm::BlackOilPrimaryVariables< TypeTag >::Pw, Opm::BlackOilPrimaryVariables< TypeTag >::Rs, Opm::BlackOilPrimaryVariables< TypeTag >::Rsw, Opm::BlackOilPrimaryVariables< TypeTag >::Rv, Opm::BlackOilPrimaryVariables< TypeTag >::Rvw, Opm::BlackOilPrimaryVariables< TypeTag >::Sg, Opm::BlackOilPrimaryVariables< TypeTag >::Sp, and Opm::BlackOilPrimaryVariables< TypeTag >::Sw.

Referenced by Opm::BlackOilPrimaryVariables< TypeTag >::assignMassConservative().

◆ checkDefined()

template<class TypeTag >
void Opm::BlackOilPrimaryVariables< TypeTag >::checkDefined ( ) const
inline

Instruct valgrind to check the definedness of all attributes of this class.

We cannot simply check the definedness of the whole object because there might be "alignedness holes" in the memory layout which are caused by the pseudo primary variables.

◆ chopAndNormalizeSaturations()

◆ init()

template<class TypeTag >
static void Opm::BlackOilPrimaryVariables< TypeTag >::init ( )
inlinestatic

◆ makeEvaluation()

template<class TypeTag >
Evaluation Opm::BlackOilPrimaryVariables< TypeTag >::makeEvaluation ( unsigned  varIdx,
unsigned  timeIdx,
LinearizationType  linearizationType = LinearizationType() 
) const
inline

◆ operator=() [1/2]

template<class TypeTag >
BlackOilPrimaryVariables & Opm::BlackOilPrimaryVariables< TypeTag >::operator= ( const BlackOilPrimaryVariables< TypeTag > &  other)
default

◆ operator=() [2/2]

template<class TypeTag >
BlackOilPrimaryVariables & Opm::BlackOilPrimaryVariables< TypeTag >::operator= ( Scalar  value)
inline

◆ operator==()

template<class TypeTag >
bool Opm::BlackOilPrimaryVariables< TypeTag >::operator== ( const BlackOilPrimaryVariables< TypeTag > &  rhs) const
inline

◆ primaryVarsMeaningBrine()

template<class TypeTag >
BrineMeaning Opm::BlackOilPrimaryVariables< TypeTag >::primaryVarsMeaningBrine ( ) const
inline

◆ primaryVarsMeaningGas()

template<class TypeTag >
GasMeaning Opm::BlackOilPrimaryVariables< TypeTag >::primaryVarsMeaningGas ( ) const
inline

◆ primaryVarsMeaningPressure()

template<class TypeTag >
PressureMeaning Opm::BlackOilPrimaryVariables< TypeTag >::primaryVarsMeaningPressure ( ) const
inline

Return the interpretation which should be applied to the switching primary variables.

Referenced by Opm::BlackOilPrimaryVariables< TypeTag >::adaptPrimaryVariables(), and Opm::BlackOilPrimaryVariables< TypeTag >::assignNaive().

◆ primaryVarsMeaningSolvent()

◆ primaryVarsMeaningWater()

template<class TypeTag >
WaterMeaning Opm::BlackOilPrimaryVariables< TypeTag >::primaryVarsMeaningWater ( ) const
inline

◆ pvtRegionIndex()

template<class TypeTag >
unsigned Opm::BlackOilPrimaryVariables< TypeTag >::pvtRegionIndex ( ) const
inline

Return the index of the region which should be used for PVT properties.

Referenced by Opm::BlackOilPrimaryVariables< TypeTag >::adaptPrimaryVariables().

◆ registerParameters()

template<class TypeTag >
static void Opm::BlackOilPrimaryVariables< TypeTag >::registerParameters ( )
inlinestatic

◆ serializationTestObject()

◆ serializeOp()

template<class TypeTag >
template<class Serializer >
void Opm::BlackOilPrimaryVariables< TypeTag >::serializeOp ( Serializer &  serializer)
inline

◆ setPressureScale()

template<class TypeTag >
void Opm::BlackOilPrimaryVariables< TypeTag >::setPressureScale ( Scalar  val)
inline

◆ setPrimaryVarsMeaningBrine()

template<class TypeTag >
void Opm::BlackOilPrimaryVariables< TypeTag >::setPrimaryVarsMeaningBrine ( BrineMeaning  newMeaning)
inline

Set the interpretation which should be applied to the switching primary variables.

Referenced by Opm::BlackOilPrimaryVariables< TypeTag >::adaptPrimaryVariables().

◆ setPrimaryVarsMeaningGas()

template<class TypeTag >
void Opm::BlackOilPrimaryVariables< TypeTag >::setPrimaryVarsMeaningGas ( GasMeaning  newMeaning)
inline

Set the interpretation which should be applied to the switching primary variables.

Referenced by Opm::BlackOilPrimaryVariables< TypeTag >::adaptPrimaryVariables().

◆ setPrimaryVarsMeaningPressure()

template<class TypeTag >
void Opm::BlackOilPrimaryVariables< TypeTag >::setPrimaryVarsMeaningPressure ( PressureMeaning  newMeaning)
inline

Set the interpretation which should be applied to the switching primary variables.

Referenced by Opm::BlackOilPrimaryVariables< TypeTag >::adaptPrimaryVariables().

◆ setPrimaryVarsMeaningSolvent()

template<class TypeTag >
void Opm::BlackOilPrimaryVariables< TypeTag >::setPrimaryVarsMeaningSolvent ( SolventMeaning  newMeaning)
inline

Set the interpretation which should be applied to the switching primary variables.

Referenced by Opm::BlackOilPrimaryVariables< TypeTag >::adaptPrimaryVariables().

◆ setPrimaryVarsMeaningWater()

template<class TypeTag >
void Opm::BlackOilPrimaryVariables< TypeTag >::setPrimaryVarsMeaningWater ( WaterMeaning  newMeaning)
inline

Set the interpretation which should be applied to the switching primary variables.

Referenced by Opm::BlackOilPrimaryVariables< TypeTag >::adaptPrimaryVariables().

◆ setPvtRegionIndex()

template<class TypeTag >
void Opm::BlackOilPrimaryVariables< TypeTag >::setPvtRegionIndex ( unsigned  value)
inline

Set the index of the region which should be used for PVT properties.

PVT regions represent spatial variation of the composition decribed by the pseudo-components used by the black oil model (i.e., oil, gas and water). This introduce spatially varying pvt behaviour.


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