From 4e1cc5bd5bdcf24979942b6f29899287415683b6 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Tue, 13 Sep 2022 10:11:10 +0200 Subject: [PATCH] determining wells_active_ based on well_containers_ size instead of the information in wells_ecl_, which might include shut wells --- opm/simulators/wells/BlackoilWellModel_impl.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index e6a54f44e..71938d13e 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -198,11 +198,6 @@ namespace Opm { this->initializeWellPerfData(); this->initializeWellState(timeStepIdx, summaryState); - // Wells are active if they are active wells on at least - // one process. - wells_active_ = localWellsActive() ? 1 : 0; - wells_active_ = grid.comm().max(wells_active_); - // handling MS well related if (param_.use_multisegment_well_&& anyMSWellOpenLocal()) { // if we use MultisegmentWell model this->wellState().initWellStateMSWell(wells_ecl_, &this->prevWellState()); @@ -264,6 +259,11 @@ namespace Opm { // create the well container createWellContainer(reportStepIdx); + // Wells are active if they are active wells on at least one process. + const Grid& grid = ebosSimulator_.vanguard().grid(); + wells_active_ = !this->well_container_.empty(); + wells_active_ = grid.comm().max(wells_active_); + // do the initialization for all the wells // TODO: to see whether we can postpone of the intialization of the well containers to // optimize the usage of the following several member variables