opm-common
Opm::Inplace Class Reference

Public Types

enum  Phase {
  WATER = 0, OIL = 1, GAS = 2, OilInLiquidPhase = 3,
  OilInGasPhase = 4, GasInLiquidPhase = 5, GasInGasPhase = 6, PoreVolume = 7,
  PressurePV = 8, HydroCarbonPV = 9, PressureHydroCarbonPV = 10, DynamicPoreVolume = 11,
  WaterResVolume = 12, OilResVolume = 13, GasResVolume = 14, SALT = 15,
  CO2InWaterPhase = 16, CO2InGasPhaseInMob = 17, CO2InGasPhaseMob = 18, CO2InGasPhaseInMobKrg = 19,
  CO2InGasPhaseMobKrg = 20, WaterInGasPhase = 21, WaterInWaterPhase = 22, CO2Mass = 23,
  CO2MassInWaterPhase = 24, CO2MassInGasPhase = 25, CO2MassInGasPhaseInMob = 26, CO2MassInGasPhaseMob = 27,
  CO2MassInGasPhaseInMobKrg = 28, CO2MassInGasPhaseMobKrg = 29, CO2MassInGasPhaseEffectiveTrapped = 30, CO2MassInGasPhaseEffectiveUnTrapped = 31,
  CO2MassInGasPhaseMaximumTrapped = 32, CO2MassInGasPhaseMaximumUnTrapped = 33, MicrobialMass = 34, OxygenMass = 35,
  UreaMass = 36, BiofilmMass = 37, CalciteMass = 38, WaterMass = 39
}
 

Public Member Functions

void add (const std::string &region, Phase phase, std::size_t region_number, double value)
 Assign value of particular quantity in specific region of named region set. More...
 
void add (Phase phase, double value)
 Assign field-level value of particular quantity. More...
 
double get (const std::string &region, Phase phase, std::size_t region_number) const
 Retrieve numerical value of particular quantity in specific region of named region set. More...
 
double get (Phase phase) const
 Retrieve field-level value of particular quantity. More...
 
bool has (const std::string &region, Phase phase, std::size_t region_number) const
 Check existence of particular quantity in specific region of named region set. More...
 
bool has (Phase phase) const
 Check existence of specific field-level quantity. More...
 
std::size_t max_region () const
 Retrieve the maximum region ID registered across all quantities in all registered region sets. More...
 
std::size_t max_region (const std::string &region_name) const
 Retrieve the maximum region ID across all quantities registered for a specific region set. More...
 
std::vector< double > get_vector (const std::string &region, Phase phase) const
 Linearised per-region values for a given phase in a specific region set. More...
 
template<class Serializer >
void serializeOp (Serializer &serializer)
 Serialisation interface. More...
 
bool operator== (const Inplace &rhs) const
 Equality predicate. More...
 

Static Public Member Functions

static Inplace serializationTestObject ()
 Create non-defaulted object suitable for testing the serialisation operation. More...
 
static std::string EclString (const Phase phase)
 Converts phase enum to ECL textual representation.
 
static const std::vector< Phase > & phases ()
 Get iterable list of all quantities which can be handled/updated in a generic way. More...
 
static const std::vector< Phase > & mixingPhases ()
 Get iterable list of all quantities, other than "pure" phases, which can be handled/updated in a generic way. More...
 

Member Function Documentation

◆ add() [1/2]

void Opm::Inplace::add ( const std::string &  region,
const Inplace::Phase  phase,
std::size_t  region_number,
double  value 
)

Assign value of particular quantity in specific region of named region set.

Parameters
[in]regionRegion set name such as FIPNUM or FIPABC.
[in]phaseIn-place quantity.
[in]region_numberRegion ID for which to assign a new in-place quantity value.
[in]valueNumerical value of phase quantity in region_number region of region region set.

◆ add() [2/2]

void Opm::Inplace::add ( Inplace::Phase  phase,
double  value 
)

Assign field-level value of particular quantity.

Parameters
[in]phaseIn-place quantity.
[in]valueNumerical value of field-level phase quantity.

◆ get() [1/2]

double Opm::Inplace::get ( const std::string &  region,
const Inplace::Phase  phase,
std::size_t  region_number 
) const

Retrieve numerical value of particular quantity in specific region of named region set.

This function will throw an exception if the requested value has not been assigned in a previous call to add().

Parameters
[in]regionRegion set name such as FIPNUM or FIPABC.
[in]phaseIn-place quantity.
[in]region_numberRegion ID for which to retrieve a the in-place quantity value.
Returns
Numerical value of phase quantity in region_number region of region region set.

◆ get() [2/2]

double Opm::Inplace::get ( Inplace::Phase  phase) const

Retrieve field-level value of particular quantity.

This function will throw an exception if the requested value has not been assigned in a previous call to add().

Parameters
[in]phaseIn-place quantity.
Returns
Numerical value of field-level phase quantity.

◆ get_vector()

std::vector< double > Opm::Inplace::get_vector ( const std::string &  region,
Phase  phase 
) const

Linearised per-region values for a given phase in a specific region set.

Parameters
[in]regionRegion set name, e.g., "FIPNUM" or "FIPABC".
[in]phaseIn-place quantity.
Returns
Per-region values of requested quantity in the region set named by region. The get_vector functions return a vector of size max_region() which contains the values added with the add() function and is indexed by (region_number - 1).

◆ has() [1/2]

bool Opm::Inplace::has ( const std::string &  region,
Phase  phase,
std::size_t  region_number 
) const

Check existence of particular quantity in specific region of named region set.

Parameters
[in]regionRegion set name such as FIPNUM or FIPABC.
[in]phaseIn-place quantity.
[in]region_numberRegion ID for which to check existence of the in-place quantity value.
Returns
Whether or not a value of the specific quantity exists in the specific region of the named region set.

◆ has() [2/2]

bool Opm::Inplace::has ( Phase  phase) const

Check existence of specific field-level quantity.

Parameters
[in]phaseIn-place quantity.
Returns
Whether or not a value of the specific quantity exists at field level.

◆ max_region() [1/2]

std::size_t Opm::Inplace::max_region ( ) const

Retrieve the maximum region ID registered across all quantities in all registered region sets.

◆ max_region() [2/2]

std::size_t Opm::Inplace::max_region ( const std::string &  region_name) const

Retrieve the maximum region ID across all quantities registered for a specific region set.

Parameters
[in]region_nameRegion set name such as FIPNUM or FIPABC.
Returns
Maximum region ID across all quantities registered for region_name. Zero if region_name does not have any registered quantities in this in-place quantity collection.

◆ mixingPhases()

const std::vector< Inplace::Phase > & Opm::Inplace::mixingPhases ( )
static

Get iterable list of all quantities, other than "pure" phases, which can be handled/updated in a generic way.

◆ operator==()

bool Opm::Inplace::operator== ( const Inplace rhs) const

Equality predicate.

Parameters
[in]rhsObject against which *this will be compared for equality.
Returns
Whether or not *this equals rhs.

◆ phases()

const std::vector< Inplace::Phase > & Opm::Inplace::phases ( )
static

Get iterable list of all quantities which can be handled/updated in a generic way.

◆ serializationTestObject()

Inplace Opm::Inplace::serializationTestObject ( )
static

Create non-defaulted object suitable for testing the serialisation operation.

◆ serializeOp()

template<class Serializer >
void Opm::Inplace::serializeOp ( Serializer serializer)
inline

Serialisation interface.

Template Parameters
SerializerObject serialisation protocol implementation
Parameters
[in,out]serializerSerialisation object

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