20 #ifndef OPM_BLACKOILPHASES_HEADER_INCLUDED
21 #define OPM_BLACKOILPHASES_HEADER_INCLUDED
31 static const int MaxNumPhases = 3;
38 static const int NumCryptoPhases = 7;
41 enum PhaseIndex { Aqua = 0, Liquid = 1, Vapour = 2, Solvent = 3, Polymer = 4, Energy = 5, PolymerMW = 6, Foam = 7, Brine = 8, ZFraction = 9 };
46 std::array<int, MaxNumPhases + NumCryptoPhases> phase_used;
47 std::array<int, MaxNumPhases + NumCryptoPhases> phase_pos;
73 bool hasFreeWater()
const {
return present(BlackoilPhases::Aqua ); }
74 bool hasFreeOil ()
const {
return present(BlackoilPhases::Liquid); }
75 bool hasFreeGas ()
const {
return present(BlackoilPhases::Vapour); }
77 void setFreeWater() { insert(BlackoilPhases::Aqua ); }
78 void setFreeOil () { insert(BlackoilPhases::Liquid); }
79 void setFreeGas () { insert(BlackoilPhases::Vapour); }
81 bool operator==(
const PhasePresence& other)
const {
return present_ == other.present_; }
82 bool operator!=(
const PhasePresence& other)
const {
return !this->operator==(other); }
85 unsigned char present_;
87 bool present(
const BlackoilPhases::PhaseIndex i)
const
89 return present_ & (1 << i);
92 void insert(
const BlackoilPhases::PhaseIndex i)
Definition: BlackoilPhases.hpp:29
Check or assign presence of a formed, free phase.
Definition: BlackoilPhases.hpp:67
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: BlackoilPhases.hpp:26
Definition: BlackoilPhases.hpp:45