From 6ecabdbd7b41181743dbcb33ed9fd9a00ad5efa0 Mon Sep 17 00:00:00 2001 From: Stein Krogstad Date: Tue, 4 Jul 2023 15:17:10 +0200 Subject: [PATCH] Add access to injection controls --- .../Schedule/Well/WellInjectionControls.hpp | 16 ++++++++++++++++ .../Schedule/Well/WellProductionControls.hpp | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/opm/input/eclipse/Schedule/Well/WellInjectionControls.hpp b/opm/input/eclipse/Schedule/Well/WellInjectionControls.hpp index bee84043b..33fdd4f06 100644 --- a/opm/input/eclipse/Schedule/Well/WellInjectionControls.hpp +++ b/opm/input/eclipse/Schedule/Well/WellInjectionControls.hpp @@ -37,6 +37,22 @@ public: return (this->controls & static_cast(cmode_arg)) != 0; } + void skipControl(WellInjectorCMode cmode_arg) { + auto int_arg = static_cast(cmode_arg); + if ((this->controls & int_arg) != 0) + this->controls -= int_arg; + } + + void addControl(WellInjectorCMode cmode_arg) { + auto int_arg = static_cast(cmode_arg); + if ((this->controls & int_arg) == 0) + this->controls += int_arg; + } + + void clearControls(){ + this->controls = 0; + } + double bhp_limit; double thp_limit; diff --git a/opm/input/eclipse/Schedule/Well/WellProductionControls.hpp b/opm/input/eclipse/Schedule/Well/WellProductionControls.hpp index 7a3671b76..28bcb3ebc 100644 --- a/opm/input/eclipse/Schedule/Well/WellProductionControls.hpp +++ b/opm/input/eclipse/Schedule/Well/WellProductionControls.hpp @@ -50,6 +50,10 @@ public: this->controls += int_arg; } + void clearControls(){ + this->controls = 0; + } + bool operator==(const WellProductionControls& other) const { return this->cmode == other.cmode &&