Opm::PvsPrimaryVariables< TypeTag > Class Template Reference

Represents the primary variables used in the primary variable switching compositional model. More...

#include <pvsprimaryvariables.hh>

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

Public Member Functions

 PvsPrimaryVariables ()
 
 PvsPrimaryVariables (Scalar value)
 Constructor with assignment from scalar. More...
 
 PvsPrimaryVariables (const PvsPrimaryVariables &value)
 
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...
 
short phasePresence () const
 Return the fluid phases which are present in a given control volume. More...
 
void setPhasePresence (short value)
 Set which fluid phases are present in a given control volume. More...
 
void setPhasePresent (unsigned phaseIdx, bool yesno=true)
 Set whether a given indivividual phase should be present or not. More...
 
unsigned implicitSaturationIdx () const
 Returns the index of the phase with's its saturation is determined by the closure condition of saturation. More...
 
bool phaseIsPresent (unsigned phaseIdx) const
 Returns true iff a phase is present for the current phase presence. More...
 
unsigned lowestPresentPhaseIdx () const
 Returns the phase with the lowest index that is present. More...
 
ThisTypeoperator= (const Implementation &value)
 Assignment operator from an other primary variables object. More...
 
ThisTypeoperator= (Scalar value)
 Assignment operator from a scalar value. More...
 
Evaluation explicitSaturationValue (unsigned phaseIdx, unsigned timeIdx) const
 Returns an explcitly stored saturation for a given phase. More...
 
template<class FluidState >
void assignNaive (const FluidState &fluidState)
 Directly retrieve the primary variables from an arbitrary fluid state. More...
 
void print (std::ostream &os=std::cout) const
 Prints the names of the primary variables and their values. More...
 
Evaluation makeEvaluation (unsigned varIdx, unsigned timeIdx, LinearizationType linearizationType=LinearizationType()) const
 Return a primary variable intensive evaluation. More...
 
void checkDefined () const
 Instruct valgrind to check the definedness of all attributes of this class. More...
 

Static Public Member Functions

static bool phaseIsPresent (unsigned phaseIdx, short phasePresence)
 Returns true iff a phase is present for a given phase presence. More...
 
static void init ()
 
static void registerParameters ()
 

Detailed Description

template<class TypeTag>
class Opm::PvsPrimaryVariables< TypeTag >

Represents the primary variables used in the primary variable switching compositional model.

This class is basically a Dune::FieldVector which can retrieve its contents from an aribitatry fluid state.

Constructor & Destructor Documentation

◆ PvsPrimaryVariables() [1/3]

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

◆ PvsPrimaryVariables() [2/3]

template<class TypeTag >
Opm::PvsPrimaryVariables< TypeTag >::PvsPrimaryVariables ( Scalar  value)
inlineexplicit

Constructor with assignment from scalar.

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

◆ PvsPrimaryVariables() [3/3]

template<class TypeTag >
Opm::PvsPrimaryVariables< TypeTag >::PvsPrimaryVariables ( const PvsPrimaryVariables< TypeTag > &  value)
inline

Member Function Documentation

◆ assignMassConservative()

template<class TypeTag >
template<class FluidState >
void Opm::PvsPrimaryVariables< 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::PvsPrimaryVariables< TypeTag >::assignNaive().

◆ assignNaive()

template<class TypeTag >
template<class FluidState >
void Opm::PvsPrimaryVariables< 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::PvsPrimaryVariables< TypeTag >::lowestPresentPhaseIdx(), and Opm::PvsPrimaryVariables< TypeTag >::phaseIsPresent().

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

◆ checkDefined()

template<class TypeTag >
void Opm::FvBasePrimaryVariables< TypeTag >::checkDefined ( ) const
inlineinherited

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

◆ explicitSaturationValue()

template<class TypeTag >
Evaluation Opm::PvsPrimaryVariables< TypeTag >::explicitSaturationValue ( unsigned  phaseIdx,
unsigned  timeIdx 
) const
inline

Returns an explcitly stored saturation for a given phase.

(or 0 if the saturation is not explicitly stored.)

Parameters
phaseIdxThe index of the fluid phase of interest.

References Opm::PvsPrimaryVariables< TypeTag >::lowestPresentPhaseIdx(), and Opm::PvsPrimaryVariables< TypeTag >::phaseIsPresent().

◆ implicitSaturationIdx()

template<class TypeTag >
unsigned Opm::PvsPrimaryVariables< TypeTag >::implicitSaturationIdx ( ) const
inline

Returns the index of the phase with's its saturation is determined by the closure condition of saturation.

References Opm::PvsPrimaryVariables< TypeTag >::lowestPresentPhaseIdx().

◆ init()

template<class TypeTag >
static void Opm::FvBasePrimaryVariables< TypeTag >::init ( )
inlinestaticinherited

◆ lowestPresentPhaseIdx()

template<class TypeTag >
unsigned Opm::PvsPrimaryVariables< TypeTag >::lowestPresentPhaseIdx ( ) const
inline

◆ makeEvaluation()

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

Return a primary variable intensive evaluation.

i.e., the result represents the function f = x_i if the time index is zero, else it represents the a constant f = x_i. (the difference is that in the first case, the derivative w.r.t. x_i is 1, while it is 0 in the second case.

◆ operator=() [1/2]

template<class TypeTag >
ThisType & Opm::PvsPrimaryVariables< TypeTag >::operator= ( const Implementation &  value)
inline

Assignment operator from an other primary variables object.

References Opm::FvBasePrimaryVariables< TypeTag >::operator=().

◆ operator=() [2/2]

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

Assignment operator from a scalar value.

References Opm::FvBasePrimaryVariables< TypeTag >::operator=().

◆ phaseIsPresent() [1/2]

template<class TypeTag >
bool Opm::PvsPrimaryVariables< TypeTag >::phaseIsPresent ( unsigned  phaseIdx) const
inline

Returns true iff a phase is present for the current phase presence.

Parameters
phaseIdxThe index of the fluid phase of interest.

◆ phaseIsPresent() [2/2]

template<class TypeTag >
static bool Opm::PvsPrimaryVariables< TypeTag >::phaseIsPresent ( unsigned  phaseIdx,
short  phasePresence 
)
inlinestatic

Returns true iff a phase is present for a given phase presence.

Parameters
phaseIdxThe index of the phase which's presence is queried.
phasePresenceThe bit-map of present phases.

References Opm::PvsPrimaryVariables< TypeTag >::phasePresence().

Referenced by Opm::PvsPrimaryVariables< TypeTag >::assignNaive(), Opm::PvsPrimaryVariables< TypeTag >::explicitSaturationValue(), and Opm::PvsPrimaryVariables< TypeTag >::print().

◆ phasePresence()

template<class TypeTag >
short Opm::PvsPrimaryVariables< TypeTag >::phasePresence ( ) const
inline

Return the fluid phases which are present in a given control volume.

Referenced by Opm::PvsPrimaryVariables< TypeTag >::phaseIsPresent().

◆ print()

template<class TypeTag >
void Opm::PvsPrimaryVariables< TypeTag >::print ( std::ostream &  os = std::cout) const
inline

Prints the names of the primary variables and their values.

Parameters
osThe std::ostream which should be used for the output.

References Opm::PvsPrimaryVariables< TypeTag >::lowestPresentPhaseIdx(), and Opm::PvsPrimaryVariables< TypeTag >::phaseIsPresent().

◆ registerParameters()

template<class TypeTag >
static void Opm::FvBasePrimaryVariables< TypeTag >::registerParameters ( )
inlinestaticinherited

◆ setPhasePresence()

template<class TypeTag >
void Opm::PvsPrimaryVariables< TypeTag >::setPhasePresence ( short  value)
inline

Set which fluid phases are present in a given control volume.

Parameters
valueThe new phase presence. The phase with index i is present if the i-th bit of value is 1.

Referenced by Opm::PvsPrimaryVariables< TypeTag >::setPhasePresent().

◆ setPhasePresent()

template<class TypeTag >
void Opm::PvsPrimaryVariables< TypeTag >::setPhasePresent ( unsigned  phaseIdx,
bool  yesno = true 
)
inline

Set whether a given indivividual phase should be present or not.

Parameters
phaseIdxThe index of the phase which's presence ought to be set or reset.
yesnoIf true, the presence of the phase is set, else it is reset

References Opm::PvsPrimaryVariables< TypeTag >::setPhasePresence().


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