From 83ed0f01e543fc947c70ab1de457e6cc844bdef8 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Wed, 11 Oct 2023 13:15:57 +0200 Subject: [PATCH] use the REQUEST_OPEN_WELL event to open closed wells --- opm/simulators/wells/BlackoilWellModel_impl.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index 78c4d0f96..86301b767 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -794,17 +794,17 @@ namespace Opm { // TODO: more checking here, to make sure this standard more specific and complete // maybe there is some WCON keywords will not open the well auto& events = this->wellState().well(w).events; - if (events.hasEvent(WellState::event_mask)) { + if (events.hasEvent(ScheduleEvents::REQUEST_OPEN_WELL)) { 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. - events.clearEvent(WellState::event_mask); } else { wellTestState().open_well(well_name); wellTestState().open_completions(well_name); } + events.clearEvent(ScheduleEvents::REQUEST_OPEN_WELL); } } @@ -2258,6 +2258,10 @@ namespace Opm { // so next time step, the well does not consider to have effective events anymore. events.clearEvent(WellState::event_mask); } + // these events only work for the first time step within the report step + if (events.hasEvent(ScheduleEvents::REQUEST_OPEN_WELL)) { + events.clearEvent(ScheduleEvents::REQUEST_OPEN_WELL); + } // solve the well equation initially to improve the initial solution of the well model if (param_.solve_welleq_initially_ && well->isOperableAndSolvable()) { try {