File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments