From 1180ad26529a3ec58855d2e6d6a81b079ecf73a0 Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Tue, 10 Dec 2024 09:41:21 +0100 Subject: [PATCH] Allow for the third group switch --- opm/simulators/wells/BlackoilWellModelConstraints.cpp | 4 ++-- opm/simulators/wells/BlackoilWellModelGeneric.cpp | 4 ++-- opm/simulators/wells/BlackoilWellModel_impl.hpp | 3 --- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/opm/simulators/wells/BlackoilWellModelConstraints.cpp b/opm/simulators/wells/BlackoilWellModelConstraints.cpp index 471362f8d..7ec507228 100644 --- a/opm/simulators/wells/BlackoilWellModelConstraints.cpp +++ b/opm/simulators/wells/BlackoilWellModelConstraints.cpp @@ -581,7 +581,7 @@ updateGroupIndividualControl(const Group& group, if (auto groupPos = switched_inj.find(group.name()); groupPos != switched_inj.end()) { auto& ctrls = groupPos->second[static_cast>(phase)]; for (const auto& ctrl : ctrls) { - if (std::count(ctrls.begin(), ctrls.end(), ctrl) < max_number_of_group_switch) { + if (std::count(ctrls.begin(), ctrls.end(), ctrl) <= max_number_of_group_switch) { continue; } @@ -633,7 +633,7 @@ updateGroupIndividualControl(const Group& group, if (auto groupPos = switched_prod.find(group.name()); groupPos != switched_prod.end()) { auto& ctrls = groupPos->second; for (const auto& ctrl : ctrls) { - if (std::count(ctrls.begin(), ctrls.end(), ctrl) < max_number_of_group_switch) { + if (std::count(ctrls.begin(), ctrls.end(), ctrl) <= max_number_of_group_switch) { continue; } diff --git a/opm/simulators/wells/BlackoilWellModelGeneric.cpp b/opm/simulators/wells/BlackoilWellModelGeneric.cpp index 9df44e7a6..eede50019 100644 --- a/opm/simulators/wells/BlackoilWellModelGeneric.cpp +++ b/opm/simulators/wells/BlackoilWellModelGeneric.cpp @@ -631,7 +631,7 @@ checkGroupHigherConstraints(const Group& group, if (auto groupPos = switched_inj_groups_.find(group.name()); groupPos != switched_inj_groups_.end()) { auto& ctrls = groupPos->second[static_cast>(phase)]; for (const auto& ctrl : ctrls) { - if (std::count(ctrls.begin(), ctrls.end(), ctrl) < max_number_of_group_switch) { + if (std::count(ctrls.begin(), ctrls.end(), ctrl) <= max_number_of_group_switch) { continue; } @@ -705,7 +705,7 @@ checkGroupHigherConstraints(const Group& group, if (auto groupPos = switched_prod_groups_.find(group.name()); groupPos != switched_prod_groups_.end()) { auto& ctrls = groupPos->second; for (const auto& ctrl : ctrls) { - if (std::count(ctrls.begin(), ctrls.end(), ctrl) < max_number_of_group_switch) { + if (std::count(ctrls.begin(), ctrls.end(), ctrl) <= max_number_of_group_switch) { continue; } diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index 89cf3ae38..6da0117b0 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -761,10 +761,7 @@ namespace Opm { local_deferredLogger.info(msg); } } - for (const auto& [grname, grdata] : this->switched_inj_groups_) { - //const std::string& name = key.first; - //const Opm::Phase& phase = key.second; const Phase all[] = {Phase::WATER, Phase::OIL, Phase::GAS}; for (Phase phase : all) { const auto& ctrls = grdata[static_cast>(phase)];