mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
take into account trapped saturation from hysteresis
This commit is contained in:
parent
525cc76d62
commit
3dad2c909b
@ -1166,28 +1166,33 @@ private:
|
|||||||
if (!this->fip_[Inplace::Phase::GAS].empty())
|
if (!this->fip_[Inplace::Phase::GAS].empty())
|
||||||
this->fip_[Inplace::Phase::GAS][globalDofIdx] += gasInPlaceWater;
|
this->fip_[Inplace::Phase::GAS][globalDofIdx] += gasInPlaceWater;
|
||||||
}
|
}
|
||||||
const auto& scaledDrainageInfo
|
|
||||||
= simulator_.problem().materialLawManager()->oilWaterScaledEpsInfoDrainage(globalDofIdx);
|
|
||||||
const Scalar& sgcr = scaledDrainageInfo.Sgcr;
|
if (FluidSystem::phaseIsActive(gasPhaseIdx) &&
|
||||||
if (FluidSystem::phaseIsActive(gasPhaseIdx) && !this->fip_[Inplace::Phase::CO2InGasPhaseInMob].empty()) {
|
(!this->fip_[Inplace::Phase::CO2InGasPhaseInMob].empty() || !this->fip_[Inplace::Phase::CO2InGasPhaseMob].empty())) {
|
||||||
|
|
||||||
|
const auto& scaledDrainageInfo
|
||||||
|
= simulator_.problem().materialLawManager()->oilWaterScaledEpsInfoDrainage(globalDofIdx);
|
||||||
|
Scalar sgcr = scaledDrainageInfo.Sgcr;
|
||||||
|
if(simulator_.problem().materialLawManager()->enableHysteresis()) {
|
||||||
|
const MaterialLawParams& matParams = simulator_.problem().materialLawParams(globalDofIdx);
|
||||||
|
sgcr = MaterialLaw::trappedGasSaturation(matParams);
|
||||||
|
}
|
||||||
|
|
||||||
const double sg = getValue(fs.saturation(gasPhaseIdx));
|
const double sg = getValue(fs.saturation(gasPhaseIdx));
|
||||||
const double rhog = getValue(fs.density(gasPhaseIdx));
|
const double rhog = getValue(fs.density(gasPhaseIdx));
|
||||||
const double xgW = FluidSystem::phaseIsActive(waterPhaseIdx)?
|
const double xgW = FluidSystem::phaseIsActive(waterPhaseIdx)?
|
||||||
FluidSystem::convertRvwToXgW(getValue(fs.Rvw()), fs.pvtRegionIndex()):
|
FluidSystem::convertRvwToXgW(getValue(fs.Rvw()), fs.pvtRegionIndex()):
|
||||||
FluidSystem::convertRvToXgO(getValue(fs.Rv()), fs.pvtRegionIndex());
|
FluidSystem::convertRvToXgO(getValue(fs.Rv()), fs.pvtRegionIndex());
|
||||||
Scalar mM = FluidSystem::molarMass(gasCompIdx, fs.pvtRegionIndex());
|
Scalar mM = FluidSystem::molarMass(gasCompIdx, fs.pvtRegionIndex());
|
||||||
Scalar imMobileGas = (1 - xgW) * pv * rhog * std::min(sgcr , sg) / mM;
|
if (!this->fip_[Inplace::Phase::CO2InGasPhaseInMob].empty()) {
|
||||||
this->fip_[Inplace::Phase::CO2InGasPhaseInMob][globalDofIdx] = imMobileGas;
|
Scalar imMobileGas = (1 - xgW) * pv * rhog / mM * std::min(sgcr , sg);
|
||||||
}
|
this->fip_[Inplace::Phase::CO2InGasPhaseInMob][globalDofIdx] = imMobileGas;
|
||||||
if (FluidSystem::phaseIsActive(gasPhaseIdx) && !this->fip_[Inplace::Phase::CO2InGasPhaseMob].empty()) {
|
}
|
||||||
const double rhog = getValue(fs.density(gasPhaseIdx));
|
if (!this->fip_[Inplace::Phase::CO2InGasPhaseMob].empty()) {
|
||||||
const double sg = getValue(fs.saturation(gasPhaseIdx));
|
Scalar mobileGas = (1 - xgW) * pv * rhog / mM * std::max(0.0, sg - sgcr);
|
||||||
const double xgW = FluidSystem::phaseIsActive(waterPhaseIdx)?
|
this->fip_[Inplace::Phase::CO2InGasPhaseMob][globalDofIdx] = mobileGas;
|
||||||
FluidSystem::convertRvwToXgW(getValue(fs.Rvw()), fs.pvtRegionIndex()):
|
}
|
||||||
FluidSystem::convertRvToXgO(getValue(fs.Rv()), fs.pvtRegionIndex());
|
|
||||||
Scalar mM = FluidSystem::molarMass(gasCompIdx, fs.pvtRegionIndex());
|
|
||||||
Scalar mobileGas = (1 - xgW) * pv * rhog * std::max(0.0, sg - sgcr) / mM;
|
|
||||||
this->fip_[Inplace::Phase::CO2InGasPhaseMob][globalDofIdx] = mobileGas*mM;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FluidSystem::phaseIsActive(waterPhaseIdx) && !this->fip_[Inplace::Phase::CO2InWaterPhase].empty()) {
|
if (FluidSystem::phaseIsActive(waterPhaseIdx) && !this->fip_[Inplace::Phase::CO2InWaterPhase].empty()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user