Skip to content

Commit 7b35226

Browse files
authored
Merge pull request #800 from totto82/fix_onlywater_gw
fix gaswater case with only water
2 parents cec7082 + 4d73006 commit 7b35226

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

opm/models/blackoil/blackoilprimaryvariables.hh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,11 +548,16 @@ public:
548548

549549
// special case cells with almost only water
550550
// use both saturations (if the phase is enabled)
551-
if (sw >= thresholdWaterFilledCell) {
551+
// if dissolved gas in water is enabled we shouldn't enter
552+
// here but instead switch to Rsw as primary variable
553+
// as sw >= 1.0 -> gas <= 0 (i.e. gas phase disappears)
554+
if (sw >= thresholdWaterFilledCell && !FluidSystem::enableDissolvedGasInWater()) {
552555

553556
// make sure water saturations does not exceed 1.0
554-
if constexpr (waterEnabled)
557+
if constexpr (waterEnabled) {
555558
(*this)[Indices::waterSwitchIdx] = 1.0;
559+
assert(primaryVarsMeaningWater() == WaterMeaning::Sw);
560+
}
556561
// the hydrocarbon gas saturation is set to 0.0
557562
if constexpr (compositionSwitchEnabled)
558563
(*this)[Indices::compositionSwitchIdx] = 0.0;

0 commit comments

Comments
 (0)