28 #ifndef OPM_BLACK_OIL_FLUID_STATE_HH 29 #define OPM_BLACK_OIL_FLUID_STATE_HH 31 #include <type_traits> 33 #include <opm/common/utility/gpuDecorators.hpp> 34 #include <opm/material/fluidsystems/BlackOilFluidSystem.hpp> 44 template <class FluidState>
45 OPM_HOST_DEVICE
unsigned getPvtRegionIndex_(typename
std::enable_if<HasMember_pvtRegionIndex<FluidState>::
value,
46 const FluidState&>::type fluidState)
47 {
return fluidState.pvtRegionIndex(); }
49 template <
class Flu
idState>
50 OPM_HOST_DEVICE
unsigned getPvtRegionIndex_(
typename std::enable_if<!HasMember_pvtRegionIndex<FluidState>::value,
51 const FluidState&>::type)
56 template <class FluidSystem, class FluidState, class LhsEval>
58 auto getInvB_(typename
std::enable_if<HasMember_invB<FluidState>::
value,
59 const FluidState&>::type fluidState,
62 [[maybe_unused]] const FluidSystem& fluidSystem = FluidSystem{})
63 -> decltype(decay<LhsEval>(fluidState.invB(phaseIdx)))
64 {
return decay<LhsEval>(fluidState.invB(phaseIdx)); }
66 template <
class Flu
idSystem,
class Flu
idState,
class LhsEval>
68 LhsEval getInvB_(
typename std::enable_if<!HasMember_invB<FluidState>::value,
69 const FluidState&>::type fluidState,
71 unsigned pvtRegionIdx,
72 const FluidSystem& fluidSystem = FluidSystem{})
74 const auto& rho = fluidState.density(phaseIdx);
75 const auto& Xsolvent =
76 fluidState.massFraction(phaseIdx, fluidSystem.solventComponentIndex(phaseIdx));
80 *decay<LhsEval>(Xsolvent)
81 /fluidSystem.referenceDensity(phaseIdx, pvtRegionIdx);
86 template <class FluidState>
87 OPM_HOST_DEVICE auto getSaltConcentration_(typename
std::enable_if<HasMember_saltConcentration<FluidState>::
value,
88 const FluidState&>::type fluidState)
89 {
return fluidState.saltConcentration(); }
91 template <
class Flu
idState>
92 OPM_HOST_DEVICE
auto getSaltConcentration_(
typename std::enable_if<!HasMember_saltConcentration<FluidState>::value,
93 const FluidState&>::type)
98 template <class FluidState>
99 OPM_HOST_DEVICE auto getSaltSaturation_(typename
std::enable_if<HasMember_saltSaturation<FluidState>::
value,
100 const FluidState&>::type fluidState)
101 {
return fluidState.saltSaturation(); }
104 template <
class Flu
idState>
105 OPM_HOST_DEVICE
auto getSaltSaturation_(
typename std::enable_if<!HasMember_saltSaturation<FluidState>::value,
106 const FluidState&>::type)
111 template <class FluidState>
112 OPM_HOST_DEVICE auto getSolventSaturation_(typename
std::enable_if<HasMember_solventSaturation<FluidState>::
value,
113 const FluidState&>::type fluidState)
114 {
return fluidState.solventSaturation(); }
116 template <
class Flu
idState>
117 OPM_HOST_DEVICE
auto getSolventSaturation_(
typename std::enable_if<!HasMember_solventSaturation<FluidState>::value,
118 const FluidState&>::type)
128 template <
class ValueT,
130 bool storeTemperature =
false,
131 bool storeEnthalpy =
false,
132 bool enableDissolution =
true,
133 bool enableVapwat =
false,
134 bool enableBrine =
false,
135 bool enableSaltPrecipitation =
false,
136 bool enableDissolutionInWater =
false,
137 bool enableSolvent =
false,
138 unsigned numStoragePhases = FluidSystemT::numPhases>
143 template <
class OtherScalarT,
144 class OtherFluidSystemT,
145 bool otherStoreTemperature,
146 bool otherStoreEnthalpy,
147 bool otherEnableDissolution,
148 bool otherEnableVapwat,
149 bool otherEnableBrine,
150 bool otherEnableSaltPrecipitation,
151 bool otherEnableDissolutionInWater,
152 bool otherEnableSolvent,
153 unsigned otherNumStoragePhases>
156 using FluidSystem = FluidSystemT;
157 using ValueType = ValueT;
159 static constexpr
int waterPhaseIdx = FluidSystem::waterPhaseIdx;
160 static constexpr
int gasPhaseIdx = FluidSystem::gasPhaseIdx;
161 static constexpr
int oilPhaseIdx = FluidSystem::oilPhaseIdx;
163 static constexpr
int waterCompIdx = FluidSystem::waterCompIdx;
164 static constexpr
int gasCompIdx = FluidSystem::gasCompIdx;
165 static constexpr
int oilCompIdx = FluidSystem::oilCompIdx;
167 static constexpr
int numPhases = FluidSystem::numPhases;
168 static constexpr
int numComponents = FluidSystem::numComponents;
170 static constexpr
bool fluidSystemIsStatic = std::is_empty_v<FluidSystem>;
179 if constexpr (!fluidSystemIsStatic) {
190 template<
class OtherFlu
idSystemType>
193 using FS = std::decay_t<OtherFluidSystemType>;
203 enableSaltPrecipitation,
204 enableDissolutionInWater,
220 static_assert(fluidSystemIsStatic);
234 Valgrind::CheckDefined(pvtRegionIdx_);
236 for (
unsigned storagePhaseIdx = 0; storagePhaseIdx < numStoragePhases; ++ storagePhaseIdx) {
237 Valgrind::CheckDefined(saturation_[storagePhaseIdx]);
238 Valgrind::CheckDefined(pressure_[storagePhaseIdx]);
239 Valgrind::CheckDefined(density_[storagePhaseIdx]);
240 Valgrind::CheckDefined(invB_[storagePhaseIdx]);
242 if constexpr (storeEnthalpy)
243 Valgrind::CheckDefined((*enthalpy_)[storagePhaseIdx]);
246 if constexpr (enableDissolution) {
247 Valgrind::CheckDefined(*Rs_);
248 Valgrind::CheckDefined(*Rv_);
251 if constexpr (enableVapwat) {
252 Valgrind::CheckDefined(*Rvw_);
255 if constexpr (enableDissolutionInWater) {
256 Valgrind::CheckDefined(*Rsw_);
259 if constexpr (enableBrine) {
260 Valgrind::CheckDefined(*saltConcentration_);
263 if constexpr (enableSaltPrecipitation) {
264 Valgrind::CheckDefined(*saltSaturation_);
267 if constexpr (enableSolvent) {
268 Valgrind::CheckDefined(*solventSaturation_);
269 Valgrind::CheckDefined(*solventDensity_);
270 Valgrind::CheckDefined(*solventInvB_);
271 Valgrind::CheckDefined(*rsSolw_);
274 if constexpr (storeTemperature)
275 Valgrind::CheckDefined(*temperature_);
283 template <
class Flu
idState>
284 OPM_HOST_DEVICE
void assign(
const FluidState& fs)
286 if constexpr (storeTemperature)
289 unsigned pvtRegionIdx = getPvtRegionIndex_<FluidState>(fs);
294 if constexpr (enableDissolution) {
295 setRs(BlackOil::getRs_<FluidSystem, FluidState, ValueType>(fs, pvtRegionIdx));
296 setRv(BlackOil::getRv_<FluidSystem, FluidState, ValueType>(fs, pvtRegionIdx));
298 if constexpr (enableVapwat) {
299 setRvw(BlackOil::getRvw_<FluidSystem, FluidState, ValueType>(fs, pvtRegionIdx));
301 if constexpr (enableDissolutionInWater) {
302 setRsw(BlackOil::getRsw_<FluidSystem, FluidState, ValueType>(fs, pvtRegionIdx));
304 if constexpr (enableBrine){
307 if constexpr (enableSaltPrecipitation){
308 setSaltSaturation(BlackOil::getSaltSaturation_<FluidSystem, FluidState, ValueType>(fs, pvtRegionIdx));
310 if constexpr (enableSolvent) {
312 setSolventDensity(BlackOil::getSolventDensity_<FluidState, ValueType>(fs, pvtRegionIdx));
313 setSolventInvB(BlackOil::getSolventInvB_<FluidState, ValueType>(fs, pvtRegionIdx));
314 setRsSolw(BlackOil::getRsSolw_<FluidState, ValueType>(fs, pvtRegionIdx));
316 for (
unsigned int storagePhaseIdx = 0; storagePhaseIdx < numStoragePhases; ++storagePhaseIdx) {
318 pressure_[storagePhaseIdx] = fs.pressure_[storagePhaseIdx];
319 saturation_[storagePhaseIdx] = fs.saturation_[storagePhaseIdx];
320 density_[storagePhaseIdx] = fs.density_[storagePhaseIdx];
321 invB_[storagePhaseIdx] = fs.invB_[storagePhaseIdx];
322 if constexpr (storeEnthalpy)
323 (*enthalpy_)[storagePhaseIdx] = (*fs.enthalpy_)[storagePhaseIdx];
334 { pvtRegionIdx_ =
static_cast<unsigned short>(newPvtRegionIdx); }
339 OPM_HOST_DEVICE
void setPressure(
unsigned phaseIdx,
const ValueType& p)
340 { pressure_[canonicalToStoragePhaseIndex_(phaseIdx,
fluidSystem())] = p; }
346 { saturation_[canonicalToStoragePhaseIndex_(phaseIdx,
fluidSystem())] = S; }
353 totalSaturation_ =
value;
364 assert(storeTemperature);
366 (*temperature_) =
value;
377 assert(storeEnthalpy);
379 (*enthalpy_)[canonicalToStoragePhaseIndex_(phaseIdx,
fluidSystem())] =
value;
385 OPM_HOST_DEVICE
void setInvB(
unsigned phaseIdx,
const ValueType& b)
386 { invB_[canonicalToStoragePhaseIndex_(phaseIdx,
fluidSystem())] = b; }
391 OPM_HOST_DEVICE
void setDensity(
unsigned phaseIdx,
const ValueType& rho)
392 { density_[canonicalToStoragePhaseIndex_(phaseIdx,
fluidSystem())] = rho; }
399 OPM_HOST_DEVICE
void setRs(
const ValueType& newRs)
407 OPM_HOST_DEVICE
void setRv(
const ValueType& newRv)
415 OPM_HOST_DEVICE
void setRvw(
const ValueType& newRvw)
423 OPM_HOST_DEVICE
void setRsw(
const ValueType& newRsw)
430 { *saltConcentration_ = newSaltConcentration; }
436 { *saltSaturation_ = newSaltSaturation; }
442 { *solventSaturation_ = newSolventSaturation; }
448 { *solventDensity_ = newSolventDensity; }
454 { *solventInvB_ = newSolventInvB; }
459 OPM_HOST_DEVICE
void setRsSolw(
const ValueType& newRsSolw)
460 { *rsSolw_ = newRsSolw; }
465 OPM_HOST_DEVICE
const ValueType&
pressure(
unsigned phaseIdx)
const 466 {
return pressure_[canonicalToStoragePhaseIndex_(phaseIdx,
fluidSystem())]; }
471 OPM_HOST_DEVICE
const ValueType&
saturation(
unsigned phaseIdx)
const 472 {
return saturation_[canonicalToStoragePhaseIndex_(phaseIdx,
fluidSystem())]; }
479 return totalSaturation_;
487 if constexpr (storeTemperature) {
488 return *temperature_;
490 return fluidSystem().reservoirTemperature(pvtRegionIdx_);
500 OPM_HOST_DEVICE
const ValueType&
invB(
unsigned phaseIdx)
const 501 {
return invB_[canonicalToStoragePhaseIndex_(phaseIdx,
fluidSystem())]; }
510 OPM_HOST_DEVICE ValueType
Rs()
const 512 if constexpr (enableDissolution) {
515 return ValueType{0.0};
526 OPM_HOST_DEVICE ValueType
Rv()
const 528 if constexpr (!enableDissolution) {
529 return ValueType{0.0};
542 OPM_HOST_DEVICE ValueType
Rvw()
const 544 if constexpr (enableVapwat) {
547 return ValueType{0.0};
558 OPM_HOST_DEVICE ValueType
Rsw()
const 560 if constexpr (enableDissolutionInWater) {
563 return ValueType{0.0};
572 if constexpr (enableBrine) {
573 return *saltConcentration_;
575 return ValueType{0.0};
584 if constexpr (enableSaltPrecipitation) {
585 return *saltSaturation_;
587 return ValueType{0.0};
596 if constexpr (enableSolvent) {
597 return *solventSaturation_;
599 return ValueType{0.0};
608 if constexpr (enableSolvent) {
609 return *solventDensity_;
611 return ValueType{0.0};
620 if constexpr (enableSolvent) {
621 return *solventInvB_;
623 return ValueType{0.0};
632 if constexpr (enableSolvent) {
635 return ValueType{0.0};
644 {
return pvtRegionIdx_; }
649 OPM_HOST_DEVICE ValueType
density(
unsigned phaseIdx)
const 650 {
return density_[canonicalToStoragePhaseIndex_(phaseIdx,
fluidSystem())]; }
658 OPM_HOST_DEVICE
const ValueType&
enthalpy(
unsigned phaseIdx)
const 659 {
return (*enthalpy_)[canonicalToStoragePhaseIndex_(phaseIdx,
fluidSystem())]; }
668 {
auto energy = (*enthalpy_)[canonicalToStoragePhaseIndex_(phaseIdx,
fluidSystem())];
684 const auto& rho =
density(phaseIdx);
686 if (phaseIdx == waterPhaseIdx)
687 return rho/
fluidSystem().molarMass(waterCompIdx, pvtRegionIdx_);
706 OPM_HOST_DEVICE ValueType
viscosity(
unsigned phaseIdx)
const 707 {
return fluidSystem().viscosity(*
this, phaseIdx, pvtRegionIdx_); }
712 OPM_HOST_DEVICE ValueType
massFraction(
unsigned phaseIdx,
unsigned compIdx)
const 716 if (compIdx == waterCompIdx)
721 if (compIdx == waterCompIdx)
723 else if (compIdx == oilCompIdx)
724 return 1.0 -
fluidSystem().convertRsToXoG(
Rs(), pvtRegionIdx_);
726 assert(compIdx == gasCompIdx);
732 if (compIdx == waterCompIdx)
734 else if (compIdx == oilCompIdx)
737 assert(compIdx == gasCompIdx);
738 return 1.0 -
fluidSystem().convertRvToXgO(
Rv(), pvtRegionIdx_);
743 OPM_THROW(std::logic_error,
"Invalid phase or component index!");
749 OPM_HOST_DEVICE ValueType
moleFraction(
unsigned phaseIdx,
unsigned compIdx)
const 753 if (compIdx == waterCompIdx)
758 if (compIdx == waterCompIdx)
760 else if (compIdx == oilCompIdx)
764 assert(compIdx == gasCompIdx);
771 if (compIdx == waterCompIdx)
773 else if (compIdx == oilCompIdx)
777 assert(compIdx == gasCompIdx);
784 OPM_THROW(std::logic_error,
"Invalid phase or component index!");
790 OPM_HOST_DEVICE ValueType
molarity(
unsigned phaseIdx,
unsigned compIdx)
const 798 ValueType result{0.0};
799 for (
unsigned compIdx = 0; compIdx < numComponents; ++ compIdx)
808 {
return fluidSystem().fugacityCoefficient(*
this, phaseIdx, compIdx, pvtRegionIdx_); }
813 OPM_HOST_DEVICE ValueType
fugacity(
unsigned phaseIdx,
unsigned compIdx)
const 842 if constexpr (fluidSystemIsStatic) {
843 static FluidSystem instance;
846 return **fluidSystemPtr_;
851 OPM_HOST_DEVICE
static unsigned storageToCanonicalPhaseIndex_(
unsigned storagePhaseIdx,
const FluidSystem&
fluidSystem)
853 if constexpr (numStoragePhases == 3)
854 return storagePhaseIdx;
856 return
fluidSystem.activeToCanonicalPhaseIdx(storagePhaseIdx);
859 OPM_HOST_DEVICE static
unsigned canonicalToStoragePhaseIndex_(
unsigned canonicalPhaseIdx, const FluidSystem&
fluidSystem)
861 if constexpr (numStoragePhases == 3)
862 return canonicalPhaseIdx;
864 return
fluidSystem.canonicalToActivePhaseIdx(canonicalPhaseIdx);
868 ConditionalStorage<storeEnthalpy, std::array<ValueType, numStoragePhases> > enthalpy_{};
869 ValueType totalSaturation_{};
870 std::array<ValueType, numStoragePhases> pressure_{};
871 std::array<ValueType, numStoragePhases> saturation_{};
872 std::array<ValueType, numStoragePhases> invB_{};
873 std::array<ValueType, numStoragePhases> density_{};
874 ConditionalStorage<enableDissolution,ValueType> Rs_{};
875 ConditionalStorage<enableDissolution, ValueType> Rv_{};
876 ConditionalStorage<enableVapwat,ValueType> Rvw_{};
877 ConditionalStorage<enableDissolutionInWater,ValueType> Rsw_{};
878 ConditionalStorage<enableBrine, ValueType> saltConcentration_{};
879 ConditionalStorage<enableSaltPrecipitation, ValueType> saltSaturation_{};
880 ConditionalStorage<enableSolvent, ValueType> solventSaturation_{};
881 ConditionalStorage<enableSolvent, ValueType> solventDensity_{};
882 ConditionalStorage<enableSolvent, ValueType> solventInvB_{};
883 ConditionalStorage<enableSolvent, ValueType> rsSolw_{};
885 unsigned short pvtRegionIdx_{};
889 ConditionalStorage<!fluidSystemIsStatic, FluidSystem const*> fluidSystemPtr_;
OPM_HOST_DEVICE void setSolventInvB(const ValueType &newSolventInvB)
Set the solvent inverse formation volume factor [-].
Definition: BlackOilFluidState.hpp:453
OPM_HOST_DEVICE void setDensity(unsigned phaseIdx, const ValueType &rho)
\ brief Set the density of a fluid phase
Definition: BlackOilFluidState.hpp:391
OPM_HOST_DEVICE const ValueType & invB(unsigned phaseIdx) const
Return the inverse formation volume factor of a fluid phase [-].
Definition: BlackOilFluidState.hpp:500
auto withOtherFluidSystem(const OtherFluidSystemType &other) const
Create a new fluid state object with a different fluid system.
Definition: BlackOilFluidState.hpp:191
OPM_HOST_DEVICE unsigned short pvtRegionIndex() const
Return the PVT region where the current fluid state is assumed to be part of.
Definition: BlackOilFluidState.hpp:643
OPM_HOST_DEVICE void setEnthalpy(unsigned phaseIdx, const ValueType &value)
Set the specific enthalpy [J/kg] of a given fluid phase.
Definition: BlackOilFluidState.hpp:375
OPM_HOST_DEVICE ValueType viscosity(unsigned phaseIdx) const
Return the dynamic viscosity of a fluid phase [Pa s].
Definition: BlackOilFluidState.hpp:706
OPM_HOST_DEVICE ValueType Rs() const
Return the gas dissolution factor of oil [m^3/m^3].
Definition: BlackOilFluidState.hpp:510
OPM_HOST_DEVICE void setRv(const ValueType &newRv)
Set the oil vaporization factor [m^3/m^3] of the gas phase.
Definition: BlackOilFluidState.hpp:407
A simple class which only stores a given member attribute if a boolean condition is true...
Definition: ConditionalStorage.hpp:49
OPM_HOST_DEVICE ValueType temperature(unsigned) const
Return the temperature [K].
Definition: BlackOilFluidState.hpp:485
OPM_HOST_DEVICE void setSolventSaturation(const ValueType &newSolventSaturation)
Set the solvent saturation.
Definition: BlackOilFluidState.hpp:441
OPM_HOST_DEVICE void setSaltConcentration(const ValueType &newSaltConcentration)
Set the salt concentration.
Definition: BlackOilFluidState.hpp:429
OPM_HOST_DEVICE void setRvw(const ValueType &newRvw)
Set the water vaporization factor [m^3/m^3] of the gas phase.
Definition: BlackOilFluidState.hpp:415
OPM_HOST_DEVICE void setSaltSaturation(const ValueType &newSaltSaturation)
Set the solid salt saturation.
Definition: BlackOilFluidState.hpp:435
#define OPM_GENERATE_HAS_MEMBER(MEMBER_NAME,...)
This macro generates a class HasMember_${MEMBER_NAME} which can be used for template specialization...
Definition: HasMemberGeneratorMacros.hpp:49
OPM_HOST_DEVICE BlackOilFluidState()
Construct a fluid state object.
Definition: BlackOilFluidState.hpp:218
OPM_HOST_DEVICE void setTemperature(const ValueType &value)
Set the temperature [K].
Definition: BlackOilFluidState.hpp:362
OPM_HOST_DEVICE ValueType Rvw() const
Return the water vaporization factor of gas [m^3/m^3].
Definition: BlackOilFluidState.hpp:542
OPM_HOST_DEVICE ValueType Rv() const
Return the oil vaporization factor of gas [m^3/m^3].
Definition: BlackOilFluidState.hpp:526
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
OPM_HOST_DEVICE ValueType massFraction(unsigned phaseIdx, unsigned compIdx) const
Return the mass fraction of a component in a fluid phase [-].
Definition: BlackOilFluidState.hpp:712
Implements a "tailor-made" fluid state class for the black-oil model.
Definition: BlackOilFluidState.hpp:139
OPM_HOST_DEVICE ValueType molarity(unsigned phaseIdx, unsigned compIdx) const
Return the partial molar density of a component in a fluid phase [mol / m^3].
Definition: BlackOilFluidState.hpp:790
OPM_HOST_DEVICE const ValueType & pressure(unsigned phaseIdx) const
Return the pressure of a fluid phase [Pa].
Definition: BlackOilFluidState.hpp:465
OPM_HOST_DEVICE BlackOilFluidState(const FluidSystem &fluidSystem)
Construct a fluid state object.
Definition: BlackOilFluidState.hpp:177
This macro generates a class HasMember_${MEMBER_NAME} which can be used for template specialization...
OPM_HOST_DEVICE ValueType solventSaturation() const
Return the solvent saturation [-].
Definition: BlackOilFluidState.hpp:594
OPM_HOST_DEVICE const ValueType & totalSaturation() const
Return the total saturation needed for sequential.
Definition: BlackOilFluidState.hpp:477
OPM_HOST_DEVICE ValueType density(unsigned phaseIdx) const
Return the density [kg/m^3] of a given fluid phase.
Definition: BlackOilFluidState.hpp:649
OPM_HOST_DEVICE ValueType averageMolarMass(unsigned phaseIdx) const
Return the partial molar density of a fluid phase [kg / mol].
Definition: BlackOilFluidState.hpp:796
OPM_HOST_DEVICE ValueType saltSaturation() const
Return the saturation of solid salt.
Definition: BlackOilFluidState.hpp:582
OPM_HOST_DEVICE const FluidSystem & fluidSystem() const
Return the fluid system used by this fluid state.
Definition: BlackOilFluidState.hpp:840
OPM_HOST_DEVICE ValueType Rsw() const
Return the gas dissolution factor of water [m^3/m^3].
Definition: BlackOilFluidState.hpp:558
OPM_HOST_DEVICE void setPvtRegionIndex(unsigned newPvtRegionIdx)
Set the index of the fluid region.
Definition: BlackOilFluidState.hpp:333
OPM_HOST_DEVICE void setRsSolw(const ValueType &newRsSolw)
Set the solvent dissolution factor in water [m^3/m^3].
Definition: BlackOilFluidState.hpp:459
OPM_HOST_DEVICE const ValueType & enthalpy(unsigned phaseIdx) const
Return the specific enthalpy [J/kg] of a given fluid phase.
Definition: BlackOilFluidState.hpp:658
A simple class which only stores a given member attribute if a boolean condition is true...
OPM_HOST_DEVICE void assign(const FluidState &fs)
Retrieve all parameters from an arbitrary fluid state.
Definition: BlackOilFluidState.hpp:284
OPM_HOST_DEVICE const ValueType & saturation(unsigned phaseIdx) const
Return the saturation of a fluid phase [-].
Definition: BlackOilFluidState.hpp:471
OPM_HOST_DEVICE ValueType saltConcentration() const
Return the concentration of salt in water.
Definition: BlackOilFluidState.hpp:570
OPM_HOST_DEVICE ValueType internalEnergy(unsigned phaseIdx) const
Return the specific internal energy [J/kg] of a given fluid phase.
Definition: BlackOilFluidState.hpp:667
Some templates to wrap the valgrind client request macros.
OPM_HOST_DEVICE ValueType moleFraction(unsigned phaseIdx, unsigned compIdx) const
Return the mole fraction of a component in a fluid phase [-].
Definition: BlackOilFluidState.hpp:749
OPM_HOST_DEVICE ValueType molarDensity(unsigned phaseIdx) const
Return the molar density of a fluid phase [mol/m^3].
Definition: BlackOilFluidState.hpp:682
OPM_HOST_DEVICE void setInvB(unsigned phaseIdx, const ValueType &b)
\ brief Set the inverse formation volume factor of a fluid phase
Definition: BlackOilFluidState.hpp:385
OPM_HOST_DEVICE void setSaturation(unsigned phaseIdx, const ValueType &S)
Set the saturation of a fluid phase [-].
Definition: BlackOilFluidState.hpp:345
OPM_HOST_DEVICE void setPressure(unsigned phaseIdx, const ValueType &p)
Set the pressure of a fluid phase [-].
Definition: BlackOilFluidState.hpp:339
OPM_HOST_DEVICE void setSolventDensity(const ValueType &newSolventDensity)
Set the solvent density [kg/m^3].
Definition: BlackOilFluidState.hpp:447
OPM_HOST_DEVICE void setRs(const ValueType &newRs)
Set the gas dissolution factor [m^3/m^3] of the oil phase.
Definition: BlackOilFluidState.hpp:399
OPM_HOST_DEVICE void setTotalSaturation(const ValueType &value)
Set the total saturation used for sequential methods.
Definition: BlackOilFluidState.hpp:351
void checkDefined() const
Make sure that all attributes are defined.
Definition: BlackOilFluidState.hpp:231
OPM_HOST_DEVICE bool phaseIsActive(int phaseIdx) const
Return if a phase is active (via the FluidSystem).
Definition: BlackOilFluidState.hpp:828
OPM_HOST_DEVICE ValueType fugacity(unsigned phaseIdx, unsigned compIdx) const
Return the fugacity of a component in a fluid phase [Pa].
Definition: BlackOilFluidState.hpp:813
OPM_HOST_DEVICE void setRsw(const ValueType &newRsw)
Set the gas dissolution factor [m^3/m^3] of the water phase.
Definition: BlackOilFluidState.hpp:423
OPM_HOST_DEVICE ValueType rsSolw() const
Return the solvent dissolution factor in water [m^3/m^3].
Definition: BlackOilFluidState.hpp:630
OPM_HOST_DEVICE ValueType molarVolume(unsigned phaseIdx) const
Return the molar volume of a fluid phase [m^3/mol].
Definition: BlackOilFluidState.hpp:700
OPM_HOST_DEVICE ValueType solventDensity() const
Return the solvent density [kg/m^3].
Definition: BlackOilFluidState.hpp:606
OPM_HOST_DEVICE ValueType solventInvB() const
Return the solvent inverse formation volume factor [-].
Definition: BlackOilFluidState.hpp:618
OPM_HOST_DEVICE ValueType fugacityCoefficient(unsigned phaseIdx, unsigned compIdx) const
Return the fugacity coefficient of a component in a fluid phase [-].
Definition: BlackOilFluidState.hpp:807