From b1c16e536b7c1d2462136a57244b3c1548d8136b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Fri, 14 Dec 2018 10:04:59 +0100 Subject: [PATCH] Avoid opening well that was shut on same time step. --- opm/autodiff/BlackoilWellModel_impl.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/opm/autodiff/BlackoilWellModel_impl.hpp b/opm/autodiff/BlackoilWellModel_impl.hpp index 52af8ac69..d1b6fdf87 100644 --- a/opm/autodiff/BlackoilWellModel_impl.hpp +++ b/opm/autodiff/BlackoilWellModel_impl.hpp @@ -503,8 +503,16 @@ namespace Opm { if ( wellTestState_.hasWell(well_name, WellTestConfig::Reason::PHYSICAL ) ) { // TODO: more checking here, to make sure this standard more specific and complete // maybe there is some WCON keywords will not open the well - if (well_state_.effectiveEventsOccurred(w) ) { - wellTestState_.openWell(well_name); + if (well_state_.effectiveEventsOccurred(w)) { + if (wellTestState_.lastTestTime(well_name) == ebosSimulator_.time()) { + // The well was shut this timestep, we are most likely retrying + // a timestep without the well in question, after it caused + // repeated timestep cuts. It should therefore not be opened, + // even if it was new or received new targets this report step. + well_state_.setEffectiveEventsOccurred(w, false); + } else { + wellTestState_.openWell(well_name); + } } }