OutputBlackoilModule: move updateInplaceVolumesReservoir to FIPContainer

This commit is contained in:
Arne Morten Kvarving
2025-01-30 16:37:05 +01:00
parent 3ffd6594f2
commit be86ef16c5
3 changed files with 40 additions and 32 deletions

View File

@@ -221,6 +221,39 @@ assignVolumesSurface(const unsigned globalDofIdx,
}
}
template<class FluidSystem>
void
FIPContainer<FluidSystem>::
assignVolumesReservoir(const unsigned globalDofIdx,
const Scalar saltConcentration,
const std::array<Scalar, numPhases>& fipr)
{
if (FluidSystem::phaseIsActive(oilPhaseIdx) &&
!this->fip_[Inplace::Phase::OilResVolume].empty())
{
this->fip_[Inplace::Phase::OilResVolume][globalDofIdx] = fipr[oilPhaseIdx];
}
if (FluidSystem::phaseIsActive(gasPhaseIdx) &&
!this->fip_[Inplace::Phase::GasResVolume].empty())
{
this->fip_[Inplace::Phase::GasResVolume][globalDofIdx] = fipr[gasPhaseIdx];
}
if (FluidSystem::phaseIsActive(waterPhaseIdx) &&
!this->fip_[Inplace::Phase::WaterResVolume].empty())
{
this->fip_[Inplace::Phase::WaterResVolume][globalDofIdx] = fipr[waterPhaseIdx];
}
if (FluidSystem::phaseIsActive(waterPhaseIdx) &&
!this->fip_[Inplace::Phase::SALT].empty())
{
this->fip_[Inplace::Phase::SALT][globalDofIdx] =
fipr[waterPhaseIdx] * saltConcentration;
}
}
template<class T> using FS = BlackOilFluidSystem<T,BlackOilDefaultIndexTraits>;
#define INSTANTIATE_TYPE(T) \

View File

@@ -81,6 +81,10 @@ public:
void assignVolumesSurface(const unsigned globalDofIdx,
const std::array<Scalar, numPhases>& fip);
void assignVolumesReservoir(const unsigned globalDofIdx,
const Scalar saltConcentration,
const std::array<Scalar, numPhases>& fipr);
private:
FIPMap& fip_;
std::size_t bufferSize_ = 0;

View File

@@ -1484,7 +1484,9 @@ private:
}
this->fipC_.assignVolumesSurface(globalDofIdx, fip);
this->updateInplaceVolumesReservoir(globalDofIdx, fs, fipr);
this->fipC_.assignVolumesReservoir(globalDofIdx,
fs.saltConcentration().value(),
fipr);
if (FluidSystem::phaseIsActive(oilPhaseIdx) &&
FluidSystem::phaseIsActive(gasPhaseIdx))
@@ -1527,37 +1529,6 @@ private:
}
}
template <typename FluidState, typename FIPArray>
void updateInplaceVolumesReservoir(const unsigned globalDofIdx,
const FluidState& fs,
const FIPArray& fipr)
{
if (FluidSystem::phaseIsActive(oilPhaseIdx) &&
!this->fip_[Inplace::Phase::OilResVolume].empty())
{
this->fip_[Inplace::Phase::OilResVolume][globalDofIdx] = fipr[oilPhaseIdx];
}
if (FluidSystem::phaseIsActive(gasPhaseIdx) &&
!this->fip_[Inplace::Phase::GasResVolume].empty())
{
this->fip_[Inplace::Phase::GasResVolume][globalDofIdx] = fipr[gasPhaseIdx];
}
if (FluidSystem::phaseIsActive(waterPhaseIdx) &&
!this->fip_[Inplace::Phase::WaterResVolume].empty())
{
this->fip_[Inplace::Phase::WaterResVolume][globalDofIdx] = fipr[waterPhaseIdx];
}
if (FluidSystem::phaseIsActive(waterPhaseIdx) &&
!this->fip_[Inplace::Phase::SALT].empty())
{
this->fip_[Inplace::Phase::SALT][globalDofIdx] =
fipr[waterPhaseIdx] * fs.saltConcentration().value();
}
}
template <typename FluidState, typename FIPArray>
void updateOilGasDistribution(const unsigned globalDofIdx,
const FluidState& fs,