From d3d8e11e00118854c3b110a59f9a217faeaa6af8 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Fri, 16 Sep 2022 10:50:12 +0200 Subject: [PATCH] limiting the smallest injection rate to 1.e-7 for the injection phase. --- opm/simulators/wells/WellInterface_impl.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/opm/simulators/wells/WellInterface_impl.hpp b/opm/simulators/wells/WellInterface_impl.hpp index 4383b4cbb..f4413da2d 100644 --- a/opm/simulators/wells/WellInterface_impl.hpp +++ b/opm/simulators/wells/WellInterface_impl.hpp @@ -828,6 +828,13 @@ namespace Opm } } + // for wells with zero injection rate, if we assign exactly zero rate, + // we will have to assume some trivial composition in the wellbore. + // here, we use some small value (about 0.01 m^3/day ~= 1.e-7) to initialize + // the zero rate target, then we can use to retain the composition information + // within the wellbore from the previous result, and hopefully it is a good + // initial guess for the zero rate target. + ws.surface_rates[phasePos] = std::max(1.e-7, ws.surface_rates[phasePos]); } //Producer else