Add WCD, GCDI, GCDM, WIPG, WIPL summary for F and R

This commit is contained in:
Tor Harald Sandve 2023-02-22 12:24:00 +01:00
parent 49cca2ea62
commit d679ecd5a8
2 changed files with 51 additions and 0 deletions

View File

@ -70,6 +70,11 @@ std::string EclString(Opm::Inplace::Phase phase) {
case Opm::Inplace::Phase::OilResVolume: return "OIPR";
case Opm::Inplace::Phase::GasResVolume: return "GIPR";
case Opm::Inplace::Phase::SALT: return "SIP";
case Opm::Inplace::Phase::CO2InWaterPhase: return "WCD";
case Opm::Inplace::Phase::CO2InGasPhaseInMob: return "GCDI";
case Opm::Inplace::Phase::CO2InGasPhaseMob: return "GCDM";
case Opm::Inplace::Phase::WaterInGasPhase: return "WIPG";
case Opm::Inplace::Phase::WaterInWaterPhase: return "WIPL";
default: throw std::logic_error(fmt::format("Phase enum with integer value: {} not recognized", static_cast<int>(phase)));
}
}
@ -1285,6 +1290,11 @@ fipUnitConvert_(std::unordered_map<Inplace::Phase, Scalar>& fip) const
{Inplace::Phase::OilResVolume, M::volume},
{Inplace::Phase::GasResVolume, M::volume},
{Inplace::Phase::SALT, M::mass},
{Inplace::Phase::CO2InWaterPhase, M::gas_surface_volume},
{Inplace::Phase::CO2InGasPhaseInMob,M::gas_surface_volume},
{Inplace::Phase::CO2InGasPhaseMob, M::gas_surface_volume},
{Inplace::Phase::WaterInWaterPhase, M::liquid_surface_volume},
{Inplace::Phase::WaterInGasPhase, M::liquid_surface_volume},
};
for (auto& [phase, value] : fip) {

View File

@ -1032,6 +1032,7 @@ private:
if (this->computeFip_) {
Scalar fip[FluidSystem::numPhases];
Scalar fipr[FluidSystem::numPhases]; // at reservoir condition
for (unsigned phaseIdx = 0; phaseIdx < FluidSystem::numPhases; ++phaseIdx) {
fip[phaseIdx] = 0.0;
@ -1077,12 +1078,52 @@ private:
if (!this->fip_[Inplace::Phase::OilInGasPhase].empty())
this->fip_[Inplace::Phase::OilInGasPhase][globalDofIdx] = oilInPlaceGas;
// CO2STORE OIL + GAS
if (!this->fip_[Inplace::Phase::CO2InWaterPhase].empty())
this->fip_[Inplace::Phase::CO2InWaterPhase][globalDofIdx] = gasInPlaceLiquid;
// 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;
}
if (FluidSystem::phaseIsActive(waterPhaseIdx) && FluidSystem::phaseIsActive(gasPhaseIdx)) {
// Gas dissolved in water and vaporized water
Scalar gasInPlaceWater = getValue(fs.Rsw()) * fip[waterPhaseIdx];
Scalar waterInPlaceGas = getValue(fs.Rvw()) * fip[gasPhaseIdx];
if (!this->fip_[Inplace::Phase::CO2InWaterPhase].empty())
this->fip_[Inplace::Phase::CO2InWaterPhase][globalDofIdx] = gasInPlaceWater;
if (!this->fip_[Inplace::Phase::WaterInGasPhase].empty())
this->fip_[Inplace::Phase::WaterInGasPhase][globalDofIdx] = waterInPlaceGas;
if (!this->fip_[Inplace::Phase::WaterInWaterPhase].empty())
this->fip_[Inplace::Phase::WaterInWaterPhase][globalDofIdx] = fip[waterPhaseIdx];
// Add dissolved gas and vaporized water to total Fip
if (!this->fip_[Inplace::Phase::WATER].empty())
this->fip_[Inplace::Phase::WATER][globalDofIdx] += waterInPlaceGas;
if (!this->fip_[Inplace::Phase::GAS].empty())
this->fip_[Inplace::Phase::GAS][globalDofIdx] += gasInPlaceWater;
}
const auto& scaledDrainageInfo
= simulator_.problem().materialLawManager()->oilWaterScaledEpsInfoDrainage(globalDofIdx);
const Scalar& sgcr = scaledDrainageInfo.Sgcr;
if (FluidSystem::phaseIsActive(gasPhaseIdx) && !this->fip_[Inplace::Phase::CO2InGasPhaseInMob].empty()) {
const double bg = getValue(fs.invB(gasPhaseIdx));
const double sg = getValue(fs.saturation(gasPhaseIdx));
Scalar imMobileGas = pv * bg * std::min(sgcr , sg);
this->fip_[Inplace::Phase::CO2InGasPhaseInMob][globalDofIdx] = imMobileGas;
}
if (FluidSystem::phaseIsActive(gasPhaseIdx) && !this->fip_[Inplace::Phase::CO2InGasPhaseMob].empty()) {
const double bg = getValue(fs.invB(gasPhaseIdx));
const double sg = getValue(fs.saturation(gasPhaseIdx));
Scalar mobileGas = pv * bg * std::max(0.0, sg - sgcr);
this->fip_[Inplace::Phase::CO2InGasPhaseMob][globalDofIdx] = mobileGas;
}
}
}