diff --git a/opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp b/opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp index 227de193f..cb149ae1d 100644 --- a/opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp +++ b/opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp @@ -189,8 +189,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 ];