From a217974f9de4609f7affc87c7c09ea72efadc9ed Mon Sep 17 00:00:00 2001 From: Paul Egberts Date: Sun, 1 Aug 2021 21:20:35 +0200 Subject: [PATCH] fix for gas-water system, set gas saturation --- opm/models/blackoil/blackoilintensivequantities.hh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/opm/models/blackoil/blackoilintensivequantities.hh b/opm/models/blackoil/blackoilintensivequantities.hh index bd745a15c..c1a50c0ff 100644 --- a/opm/models/blackoil/blackoilintensivequantities.hh +++ b/opm/models/blackoil/blackoilintensivequantities.hh @@ -96,8 +96,10 @@ class BlackOilIntensiveQuantities enum { dimWorld = GridView::dimensionworld }; enum { compositionSwitchIdx = Indices::compositionSwitchIdx }; - static const bool compositionSwitchEnabled = Indices::gasEnabled; + static const bool compositionSwitchEnabled = Indices::compositionSwitchIdx >= 0; static const bool waterEnabled = Indices::waterEnabled; + static const bool gasEnabled = Indices::gasEnabled; + static const bool oilEnabled = Indices::oilEnabled; using Toolbox = MathToolbox; using DimMatrix = Dune::FieldMatrix; @@ -167,6 +169,9 @@ public: Sg = 0.0; } } + if (gasEnabled && waterEnabled && !oilEnabled) { + Sg = 1.0 - Sw; + } Valgrind::CheckDefined(Sg); Valgrind::CheckDefined(Sw);