My Project
Loading...
Searching...
No Matches
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 >:
Opm::FvBasePrimaryVariables< TypeTag >

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 (Scalar value)
 Constructor with assignment from scalar.
 
 BlackOilPrimaryVariables (const BlackOilPrimaryVariables &value)=default
 Copy constructor.
 
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.
 
unsigned pvtRegionIndex () const
 Return the index of the region which should be used for PVT properties.
 
WaterMeaning primaryVarsMeaningWater () const
 Return the interpretation which should be applied to the switching primary variables.
 
void setPrimaryVarsMeaningWater (WaterMeaning newMeaning)
 Set the interpretation which should be applied to the switching primary variables.
 
PressureMeaning primaryVarsMeaningPressure () const
 Return the interpretation which should be applied to the switching primary variables.
 
void setPrimaryVarsMeaningPressure (PressureMeaning newMeaning)
 Set the interpretation which should be applied to the switching primary variables.
 
GasMeaning primaryVarsMeaningGas () const
 Return the interpretation which should be applied to the switching primary variables.
 
void setPrimaryVarsMeaningGas (GasMeaning newMeaning)
 Set the interpretation which should be applied to the switching primary variables.
 
BrineMeaning primaryVarsMeaningBrine () const
 
void setPrimaryVarsMeaningBrine (BrineMeaning newMeaning)
 Set the interpretation which should be applied to the switching primary variables.
 
SolventMeaning primaryVarsMeaningSolvent () const
 
void setPrimaryVarsMeaningSolvent (SolventMeaning newMeaning)
 Set the interpretation which should be applied to the switching primary variables.
 
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.
 
template<class FluidState >
void assignNaive (const FluidState &fluidState)
 Directly retrieve the primary variables from an arbitrary fluid state.
 
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.
 
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.
 
template<class Serializer >
void serializeOp (Serializer &serializer)
 
bool operator== (const BlackOilPrimaryVariables &rhs) const
 
- Public Member Functions inherited from Opm::FvBasePrimaryVariables< TypeTag >
 FvBasePrimaryVariables (Scalar value)
 Construction from a scalar value.
 
 FvBasePrimaryVariables (const FvBasePrimaryVariables &value)=default
 Assignment from another primary variables object.
 
FvBasePrimaryVariablesoperator= (const FvBasePrimaryVariables &value)=default
 Assignment from another primary variables object.
 
Evaluation makeEvaluation (unsigned varIdx, unsigned timeIdx, LinearizationType linearizationType=LinearizationType()) const
 Return a primary variable intensive evaluation.
 
template<class FluidState >
void assignNaive (const FluidState &)
 Assign the primary variables "somehow" from a fluid state.
 
void checkDefined () const
 Instruct valgrind to check the definedness of all attributes of this class.
 

Static Public Member Functions

static BlackOilPrimaryVariables serializationTestObject ()
 
static void init ()
 
static void registerParameters ()
 
- Static Public Member Functions inherited from Opm::FvBasePrimaryVariables< TypeTag >
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.

Constructor & Destructor Documentation

◆ BlackOilPrimaryVariables() [1/2]

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() [2/2]

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

◆ 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.

◆ 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.

◆ 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.

◆ 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: