From 6716ca63c9fc5ccf3131cfbdd76cd0eb6ad35660 Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Wed, 23 Aug 2017 09:50:40 +0200 Subject: [PATCH] Force solvent saturation between [0,1] --- opm/autodiff/BlackoilModelEbos.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/opm/autodiff/BlackoilModelEbos.hpp b/opm/autodiff/BlackoilModelEbos.hpp index 83e80cdc6..d4e191200 100644 --- a/opm/autodiff/BlackoilModelEbos.hpp +++ b/opm/autodiff/BlackoilModelEbos.hpp @@ -706,6 +706,7 @@ namespace Opm { if (has_solvent_) { double& ss = priVars[Indices::solventSaturationIdx]; ss -= satScaleFactor * dss; + ss = std::min(std::max(ss, 0.0),1.0); } if (has_polymer_) { double& c = priVars[Indices::polymerConcentrationIdx];