mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-09-05 04:40:19 -05:00
Merge pull request #5293 from totto82/fixInitGW
Fix gas-water initialization with transision zone
This commit is contained in:
@@ -448,6 +448,13 @@ operator()(double s) const
|
||||
fluidState.setSaturation(FluidSystem::gasPhaseIdx, 0.0);
|
||||
fluidState.setSaturation(phase_, s);
|
||||
|
||||
// This code should only be called for water or gas phase
|
||||
assert(phase_ != FluidSystem::oilPhaseIdx);
|
||||
// The capillaryPressure code only uses the wetting phase saturation
|
||||
if (phase_ == FluidSystem::gasPhaseIdx) {
|
||||
fluidState.setSaturation(FluidSystem::waterPhaseIdx, 1.0 - s);
|
||||
fluidState.setSaturation(FluidSystem::oilPhaseIdx, 1.0 - s);
|
||||
}
|
||||
std::array<double, FluidSystem::numPhases> pc{0.0};
|
||||
using MaterialLaw = typename MaterialLawManager::MaterialLaw;
|
||||
MaterialLaw::capillaryPressures(pc, matParams, fluidState);
|
||||
|
||||
@@ -578,9 +578,11 @@ deriveSaturations(const Position& x,
|
||||
this->setEvaluationPoint(x, reg, ptable);
|
||||
this->initializePhaseQuantities();
|
||||
|
||||
if (ptable.waterActive()) { this->deriveWaterSat(); }
|
||||
if (ptable.gasActive()) { this->deriveGasSat(); }
|
||||
|
||||
if (ptable.waterActive()) { this->deriveWaterSat(); }
|
||||
|
||||
|
||||
if (this->isOverlappingTransition()) {
|
||||
this->fixUnphysicalTransition();
|
||||
}
|
||||
@@ -667,6 +669,12 @@ void PhaseSaturations<MaterialLawManager, FluidSystem, Region, CellID>::deriveWa
|
||||
{
|
||||
auto& sw = this->sat_.water;
|
||||
|
||||
const auto oilActive = this->evalPt_.ptable->oilActive();
|
||||
if (!oilActive) {
|
||||
// for 2p gas+water we set the water saturation to 1.0 - sg
|
||||
sw = 1.0 - this->sat_.gas;
|
||||
}
|
||||
else {
|
||||
const auto isIncr = false; // dPcow/dSw <= 0 for all Sw.
|
||||
|
||||
if (this->isConstCapPress(this->waterPos())) {
|
||||
@@ -700,6 +708,7 @@ void PhaseSaturations<MaterialLawManager, FluidSystem, Region, CellID>::deriveWa
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <class MaterialLawManager, class FluidSystem, class Region, typename CellID>
|
||||
|
||||
Reference in New Issue
Block a user