From 8c17172f08648daf9888ed3c572770717a9972c6 Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Thu, 10 Dec 2020 16:40:10 +0100 Subject: [PATCH] Skip previously shut wells in WellState init --- opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp b/opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp index 21142a44e..6a491f9e5 100644 --- a/opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp +++ b/opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp @@ -188,8 +188,12 @@ namespace Opm auto it = prevState->wellMap().find(well.name()); if ( it != end ) { - const int oldIndex = (*it).second[ 0 ]; const int newIndex = w; + const int oldIndex = it->second[ 0 ]; + if (prevState->status_[oldIndex] == Well::Status::SHUT) { + // Well was shut in previous state, do not use its values. + continue; + } // bhp bhp()[ newIndex ] = prevState->bhp()[ oldIndex ];