From c4b0a0d9e20e8c5e60052d787c6cfea8dc486f58 Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Fri, 26 Nov 2021 09:39:07 +0000 Subject: [PATCH] Fix in WTEST If a well is shut due to physical or economical reason the wellstate status is shut so we can not check the wellstate we instead check the well from the schedule to make sure we don't test wells that are shut by the user. --- opm/simulators/wells/BlackoilWellModel_impl.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index 276850230..88edd4dfa 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -384,16 +384,16 @@ namespace Opm { if (!wtest_config.empty()) { // there is a WTEST request const std::vector wellsForTesting = wellTestState() .test_wells(wtest_config, simulationTime); - for (const std::string& well_name : wellsForTesting) { - const auto& ws = this->wellState().well(well_name); - if (ws.status != Well::Status::OPEN) + + const Well& wellEcl = schedule().getWell(well_name, timeStepIdx); + if (wellEcl.getStatus() == Well::Status::SHUT) continue; WellInterfacePtr well = createWellForWellTest(well_name, timeStepIdx, deferred_logger); // some preparation before the well can be used well->init(&phase_usage_, depth_, gravity_, local_num_cells_, B_avg_); - const Well& wellEcl = schedule().getWell(well_name, timeStepIdx); + double well_efficiency_factor = wellEcl.getEfficiencyFactor(); WellGroupHelpers::accumulateGroupEfficiencyFactor(schedule().getGroup(wellEcl.groupName(), timeStepIdx), schedule(), timeStepIdx, well_efficiency_factor);