move assignment of OilGasDistribution fip values into FIPContainer

This commit is contained in:
Arne Morten Kvarving 2025-01-31 09:19:32 +01:00
parent be86ef16c5
commit 58c1a16299
3 changed files with 30 additions and 16 deletions

View File

@ -254,6 +254,31 @@ assignVolumesReservoir(const unsigned globalDofIdx,
}
}
template<class FluidSystem>
void
FIPContainer<FluidSystem>::
assignOilGasDistribution(const unsigned globalDofIdx,
const Scalar gasInPlaceLiquid,
const Scalar oilInPlaceGas)
{
if (!this->fip_[Inplace::Phase::GasInLiquidPhase].empty()) {
this->fip_[Inplace::Phase::GasInLiquidPhase][globalDofIdx] = gasInPlaceLiquid;
}
if (!this->fip_[Inplace::Phase::OilInGasPhase].empty()) {
this->fip_[Inplace::Phase::OilInGasPhase][globalDofIdx] = oilInPlaceGas;
}
// Add dissolved gas and vaporized oil to total Fip
if (!this->fip_[Inplace::Phase::OIL].empty()) {
this->fip_[Inplace::Phase::OIL][globalDofIdx] += oilInPlaceGas;
}
if (!this->fip_[Inplace::Phase::GAS].empty()) {
this->fip_[Inplace::Phase::GAS][globalDofIdx] += gasInPlaceLiquid;
}
}
template<class T> using FS = BlackOilFluidSystem<T,BlackOilDefaultIndexTraits>;
#define INSTANTIATE_TYPE(T) \

View File

@ -78,6 +78,10 @@ public:
const Scalar gasInPlaceWater,
const Scalar waterInPlaceGas);
void assignOilGasDistribution(const unsigned globalDofIdx,
const Scalar gasInPlaceLiquid,
const Scalar oilInPlaceGas);
void assignVolumesSurface(const unsigned globalDofIdx,
const std::array<Scalar, numPhases>& fip);

View File

@ -1538,22 +1538,7 @@ private:
const auto gasInPlaceLiquid = getValue(fs.Rs()) * fip[oilPhaseIdx];
const auto oilInPlaceGas = getValue(fs.Rv()) * fip[gasPhaseIdx];
if (!this->fip_[Inplace::Phase::GasInLiquidPhase].empty()) {
this->fip_[Inplace::Phase::GasInLiquidPhase][globalDofIdx] = gasInPlaceLiquid;
}
if (!this->fip_[Inplace::Phase::OilInGasPhase].empty()) {
this->fip_[Inplace::Phase::OilInGasPhase][globalDofIdx] = oilInPlaceGas;
}
// Add dissolved gas and vaporized oil to total Fip
if (!this->fip_[Inplace::Phase::OIL].empty()) {
this->fip_[Inplace::Phase::OIL][globalDofIdx] += oilInPlaceGas;
}
if (!this->fip_[Inplace::Phase::GAS].empty()) {
this->fip_[Inplace::Phase::GAS][globalDofIdx] += gasInPlaceLiquid;
}
this->fipC_.assignOilGasDistribution(globalDofIdx, gasInPlaceLiquid, oilInPlaceGas);
}
template <typename FluidState, typename FIPArray>