Merge pull request #5281 from daavid00/immCO2

Summary for immobile free-phase at saturations for which the nonwetting relative permeability equals zero
This commit is contained in:
Bård Skaflestad 2024-04-12 17:06:21 +02:00 committed by GitHub
commit f71c652b0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 89 additions and 24 deletions

View File

@ -106,6 +106,12 @@ std::string EclString(const Opm::Inplace::Phase phase)
case Opm::Inplace::Phase::CO2InGasPhaseMob:
return "GCDM";
case Opm::Inplace::Phase::CO2InGasPhaseInMobKrg:
return "GKDI";
case Opm::Inplace::Phase::CO2InGasPhaseMobKrg:
return "GKDM";
case Opm::Inplace::Phase::WaterInGasPhase:
return "WIPG";
@ -127,6 +133,12 @@ std::string EclString(const Opm::Inplace::Phase phase)
case Opm::Inplace::Phase::CO2MassInGasPhaseMob:
return "GMMO";
case Opm::Inplace::Phase::CO2MassInGasPhaseInMobKrg:
return "GKTR";
case Opm::Inplace::Phase::CO2MassInGasPhaseMobKrg:
return "GKMO";
default:
throw std::logic_error {
fmt::format("Phase enum with integer value: "

View File

@ -948,29 +948,33 @@ fipUnitConvert_(std::unordered_map<Inplace::Phase, Scalar>& fip) const
const UnitSystem& units = eclState_.getUnits();
using M = UnitSystem::measure;
const auto unit_map = std::unordered_map<Inplace::Phase, M> {
{Inplace::Phase::WATER, M::liquid_surface_volume},
{Inplace::Phase::OIL, M::liquid_surface_volume},
{Inplace::Phase::OilInLiquidPhase, M::liquid_surface_volume},
{Inplace::Phase::OilInGasPhase, M::liquid_surface_volume},
{Inplace::Phase::GAS, M::gas_surface_volume},
{Inplace::Phase::GasInLiquidPhase, M::gas_surface_volume},
{Inplace::Phase::GasInGasPhase, M::gas_surface_volume},
{Inplace::Phase::PoreVolume, M::volume},
{Inplace::Phase::DynamicPoreVolume, M::volume},
{Inplace::Phase::WaterResVolume, M::volume},
{Inplace::Phase::OilResVolume, M::volume},
{Inplace::Phase::GasResVolume, M::volume},
{Inplace::Phase::SALT, M::mass},
{Inplace::Phase::CO2InWaterPhase, M::moles},
{Inplace::Phase::CO2InGasPhaseInMob, M::moles},
{Inplace::Phase::CO2InGasPhaseMob, M::moles},
{Inplace::Phase::WaterInWaterPhase, M::liquid_surface_volume},
{Inplace::Phase::WaterInGasPhase, M::liquid_surface_volume},
{Inplace::Phase::CO2Mass, M::mass},
{Inplace::Phase::CO2MassInWaterPhase, M::mass},
{Inplace::Phase::CO2MassInGasPhase, M::mass},
{Inplace::Phase::CO2MassInGasPhaseInMob, M::mass},
{Inplace::Phase::CO2MassInGasPhaseMob, M::mass},
{Inplace::Phase::WATER, M::liquid_surface_volume},
{Inplace::Phase::OIL, M::liquid_surface_volume},
{Inplace::Phase::OilInLiquidPhase, M::liquid_surface_volume},
{Inplace::Phase::OilInGasPhase, M::liquid_surface_volume},
{Inplace::Phase::GAS, M::gas_surface_volume},
{Inplace::Phase::GasInLiquidPhase, M::gas_surface_volume},
{Inplace::Phase::GasInGasPhase, M::gas_surface_volume},
{Inplace::Phase::PoreVolume, M::volume},
{Inplace::Phase::DynamicPoreVolume, M::volume},
{Inplace::Phase::WaterResVolume, M::volume},
{Inplace::Phase::OilResVolume, M::volume},
{Inplace::Phase::GasResVolume, M::volume},
{Inplace::Phase::SALT, M::mass},
{Inplace::Phase::CO2InWaterPhase, M::moles},
{Inplace::Phase::CO2InGasPhaseInMob, M::moles},
{Inplace::Phase::CO2InGasPhaseMob, M::moles},
{Inplace::Phase::CO2InGasPhaseInMobKrg, M::moles},
{Inplace::Phase::CO2InGasPhaseMobKrg, M::moles},
{Inplace::Phase::WaterInWaterPhase, M::liquid_surface_volume},
{Inplace::Phase::WaterInGasPhase, M::liquid_surface_volume},
{Inplace::Phase::CO2Mass, M::mass},
{Inplace::Phase::CO2MassInWaterPhase, M::mass},
{Inplace::Phase::CO2MassInGasPhase, M::mass},
{Inplace::Phase::CO2MassInGasPhaseInMob, M::mass},
{Inplace::Phase::CO2MassInGasPhaseMob, M::mass},
{Inplace::Phase::CO2MassInGasPhaseInMobKrg, M::mass},
{Inplace::Phase::CO2MassInGasPhaseMobKrg, M::mass},
};
for (auto& [phase, value] : fip) {

View File

@ -1441,7 +1441,11 @@ private:
!this->fip_[Inplace::Phase::CO2InGasPhaseMob].empty() ||
!this->fip_[Inplace::Phase::CO2MassInGasPhaseInMob].empty() ||
!this->fip_[Inplace::Phase::CO2MassInGasPhaseMob].empty() ||
!this->fip_[Inplace::Phase::CO2Mass].empty()))
!this->fip_[Inplace::Phase::CO2Mass].empty() ||
!this->fip_[Inplace::Phase::CO2InGasPhaseInMobKrg].empty() ||
!this->fip_[Inplace::Phase::CO2InGasPhaseMobKrg].empty() ||
!this->fip_[Inplace::Phase::CO2MassInGasPhaseInMobKrg].empty() ||
!this->fip_[Inplace::Phase::CO2MassInGasPhaseMobKrg].empty()))
{
this->updateCO2InGas(globalDofIdx, pv, fs);
}
@ -1619,6 +1623,24 @@ private:
this->fip_[Inplace::Phase::CO2InGasPhaseMob][globalDofIdx] = mobileGas;
}
if (!this->fip_[Inplace::Phase::CO2InGasPhaseInMobKrg].empty()) {
if (sgcr >= sg) {
const Scalar imMobileGasKrg = massGas / mM * sg;
this->fip_[Inplace::Phase::CO2InGasPhaseInMobKrg][globalDofIdx] = imMobileGasKrg;
} else {
this->fip_[Inplace::Phase::CO2InGasPhaseInMobKrg][globalDofIdx] = 0;
}
}
if (!this->fip_[Inplace::Phase::CO2InGasPhaseMobKrg].empty()) {
if (sg > sgcr) {
const Scalar mobileGasKrg = massGas / mM * sg;
this->fip_[Inplace::Phase::CO2InGasPhaseMobKrg][globalDofIdx] = mobileGasKrg;
} else {
this->fip_[Inplace::Phase::CO2InGasPhaseMobKrg][globalDofIdx] = 0;
}
}
if (!this->fip_[Inplace::Phase::CO2MassInGasPhaseInMob].empty()) {
const Scalar imMobileMassGas = massGas * std::min(sgcr , sg);
this->fip_[Inplace::Phase::CO2MassInGasPhaseInMob][globalDofIdx] = imMobileMassGas;
@ -1628,6 +1650,24 @@ private:
const Scalar mobileMassGas = massGas * std::max(0.0, sg - sgcr);
this->fip_[Inplace::Phase::CO2MassInGasPhaseMob][globalDofIdx] = mobileMassGas;
}
if (!this->fip_[Inplace::Phase::CO2MassInGasPhaseInMobKrg].empty()) {
if (sgcr >= sg) {
const Scalar imMobileMassGasKrg = massGas * sg;
this->fip_[Inplace::Phase::CO2MassInGasPhaseInMobKrg][globalDofIdx] = imMobileMassGasKrg;
} else {
this->fip_[Inplace::Phase::CO2MassInGasPhaseInMobKrg][globalDofIdx] = 0;
}
}
if (!this->fip_[Inplace::Phase::CO2MassInGasPhaseMobKrg].empty()) {
if (sg > sgcr) {
const Scalar mobileMassGasKrg = massGas * sg;
this->fip_[Inplace::Phase::CO2MassInGasPhaseMobKrg][globalDofIdx] = mobileMassGasKrg;
} else {
this->fip_[Inplace::Phase::CO2MassInGasPhaseMobKrg][globalDofIdx] = 0;
}
}
}
template <typename FluidState>

View File

@ -87,6 +87,15 @@ std::string initDamarisXmlFile()
<variable name="GIPG" layout="zonal_layout_usmesh" type="scalar" visualizable="true" mesh="#" unit="" centering="zonal" time-varying="true" select-file="GLOBAL_CELL_INDEX" store="#" script="#" />
<variable name="GIPL" layout="zonal_layout_usmesh" type="scalar" visualizable="true" mesh="#" unit="" centering="zonal" time-varying="true" select-file="GLOBAL_CELL_INDEX" store="#" script="#" />
<variable name="GIPR" layout="zonal_layout_usmesh" type="scalar" visualizable="true" mesh="#" unit="" centering="zonal" time-varying="true" select-file="GLOBAL_CELL_INDEX" store="#" script="#" />
<variable name="GKDI" layout="zonal_layout_usmesh" type="scalar" visualizable="true" mesh="#" unit="" centering="zonal" time-varying="true" select-file="GLOBAL_CELL_INDEX" store="#" script="#" />
<variable name="GKDM" layout="zonal_layout_usmesh" type="scalar" visualizable="true" mesh="#" unit="" centering="zonal" time-varying="true" select-file="GLOBAL_CELL_INDEX" store="#" script="#" />
<variable name="GKMO" layout="zonal_layout_usmesh" type="scalar" visualizable="true" mesh="#" unit="" centering="zonal" time-varying="true" select-file="GLOBAL_CELL_INDEX" store="#" script="#" />
<variable name="GKTR" layout="zonal_layout_usmesh" type="scalar" visualizable="true" mesh="#" unit="" centering="zonal" time-varying="true" select-file="GLOBAL_CELL_INDEX" store="#" script="#" />
<variable name="GMDS" layout="zonal_layout_usmesh" type="scalar" visualizable="true" mesh="#" unit="" centering="zonal" time-varying="true" select-file="GLOBAL_CELL_INDEX" store="#" script="#" />
<variable name="GMGP" layout="zonal_layout_usmesh" type="scalar" visualizable="true" mesh="#" unit="" centering="zonal" time-varying="true" select-file="GLOBAL_CELL_INDEX" store="#" script="#" />
<variable name="GMIP" layout="zonal_layout_usmesh" type="scalar" visualizable="true" mesh="#" unit="" centering="zonal" time-varying="true" select-file="GLOBAL_CELL_INDEX" store="#" script="#" />
<variable name="GMMO" layout="zonal_layout_usmesh" type="scalar" visualizable="true" mesh="#" unit="" centering="zonal" time-varying="true" select-file="GLOBAL_CELL_INDEX" store="#" script="#" />
<variable name="GMTR" layout="zonal_layout_usmesh" type="scalar" visualizable="true" mesh="#" unit="" centering="zonal" time-varying="true" select-file="GLOBAL_CELL_INDEX" store="#" script="#" />
<variable name="HTOF" layout="zonal_layout_usmesh" type="scalar" visualizable="true" mesh="#" unit="" centering="zonal" time-varying="true" select-file="GLOBAL_CELL_INDEX" store="#" script="#" />
<variable name="OIP" layout="zonal_layout_usmesh" type="scalar" visualizable="true" mesh="#" unit="" centering="zonal" time-varying="true" select-file="GLOBAL_CELL_INDEX" store="#" script="#" />
<variable name="OIPG" layout="zonal_layout_usmesh" type="scalar" visualizable="true" mesh="#" unit="" centering="zonal" time-varying="true" select-file="GLOBAL_CELL_INDEX" store="#" script="#" />