diff --git a/opm/simulators/utils/PartiallySupportedFlowKeywords.cpp b/opm/simulators/utils/PartiallySupportedFlowKeywords.cpp index 32bb03d68..36ff2c805 100644 --- a/opm/simulators/utils/PartiallySupportedFlowKeywords.cpp +++ b/opm/simulators/utils/PartiallySupportedFlowKeywords.cpp @@ -97,10 +97,10 @@ partiallySupported() "GCONPROD", { {2,{true, allow_values {"NONE", "FLD", "ORAT", "WRAT", "GRAT", "LRAT", "RESV"}, "GCONPROD(TARGET): valid option should be NONE/FLD/ORAT/WRAT/GRAT/LRAT or RESV"}}, // CONTROL_MODE - {7,{true, allow_values {"NONE", "RATE"}, "GCONPROD(ACTION): Only NONE and RATE is supported"}}, - {11,{true, allow_values {"NONE"}, "GCONPROD(ACTWAT): water violation procedure not implemented, item should be defaulted"}}, // WATER_EXCEED_PROCEDURE - {12,{true, allow_values {"NONE"}, "GCONPROD(ACTGAS): gas violation procedure not implemented, item should be defaulted"}}, // GAS_EXCEED_PROCEDURE - {13,{true, allow_values {"NONE"}, "GCONPROD(ACTLIQ): liquid violation procedure not implemented, item should be defaulted"}}, // LIQUID_EXCEED_PROCEDURE + {7,{true, allow_values {"NONE", "RATE"}, "GCONPROD(ACTION): Only NONE and RATE are supported"}}, + {11,{true, allow_values {"NONE", "RATE"}, "GCONPROD(ACTWAT): Only NONE and RATE are supported"}}, // WATER_EXCEED_PROCEDURE + {12,{true, allow_values {"NONE", "RATE"}, "GCONPROD(ACTGAS): Only NONE and RATE are supported"}}, // GAS_EXCEED_PROCEDURE + {13,{true, allow_values {"NONE", "RATE"}, "GCONPROD(ACTLIQ): Only NONE and RATE are supported"}}, // LIQUID_EXCEED_PROCEDURE {21,{true, allow_values {"NONE"}, "GCONPROD(COMBPROC): linearly combined procedure is not used and should be defaulted (1*)"}}, // LIN_TARGET_EXCEED_PROCEDURE }, }, diff --git a/opm/simulators/wells/BlackoilWellModelConstraints.cpp b/opm/simulators/wells/BlackoilWellModelConstraints.cpp index 0909d83f5..6a88e9813 100644 --- a/opm/simulators/wells/BlackoilWellModelConstraints.cpp +++ b/opm/simulators/wells/BlackoilWellModelConstraints.cpp @@ -402,7 +402,7 @@ actionOnBrokenConstraints(const Group& group, void BlackoilWellModelConstraints:: actionOnBrokenConstraints(const Group& group, - const Group::ExceedAction& exceed_action, + const Group::GroupLimitAction group_limit_action, const Group::ProductionCMode& newControl, GroupState& group_state, DeferredLogger& deferred_logger) const @@ -410,11 +410,23 @@ actionOnBrokenConstraints(const Group& group, const Group::ProductionCMode oldControl = wellModel_.groupState().production_control(group.name()); std::string ss; - switch(exceed_action) { + switch(group_limit_action.allRates) { case Group::ExceedAction::NONE: { if (oldControl != newControl && oldControl != Group::ProductionCMode::NONE) { - ss = fmt::format("Group production exceed action is NONE for group {}. Nothing happens.", - group.name()); + if ((group_limit_action.water == Group::ExceedAction::RATE && newControl == Group::ProductionCMode::WRAT) || + (group_limit_action.gas == Group::ExceedAction::RATE && newControl == Group::ProductionCMode::GRAT) || + (group_limit_action.liquid == Group::ExceedAction::RATE && newControl == Group::ProductionCMode::LRAT)) { + group_state.production_control(group.name(), newControl); + ss = fmt::format("Switching production control mode for group {} from {} to {}", + group.name(), + Group::ProductionCMode2String(oldControl), + Group::ProductionCMode2String(newControl)); + } + else { + ss = fmt::format("Procedure on exceeding {} limit is NONE for group {}. Nothing is done.", + Group::ProductionCMode2String(oldControl), + group.name()); + } } break; } @@ -500,7 +512,7 @@ updateGroupIndividualControl(const Group& group, Group::ProductionCMode2String(changed_this.first)); this->actionOnBrokenConstraints(group, - controls.exceed_action, + controls.group_limit_action, changed_this.first, group_state, deferred_logger); WellGroupHelpers::updateWellRatesFromGroupTargetScale(changed_this.second, diff --git a/opm/simulators/wells/BlackoilWellModelConstraints.hpp b/opm/simulators/wells/BlackoilWellModelConstraints.hpp index f84948fc0..ced16501d 100644 --- a/opm/simulators/wells/BlackoilWellModelConstraints.hpp +++ b/opm/simulators/wells/BlackoilWellModelConstraints.hpp @@ -61,7 +61,7 @@ public: //! \brief Execute action on broken constraint for a production well group. void actionOnBrokenConstraints(const Group& group, - const Group::ExceedAction& exceed_action, + const Group::GroupLimitAction group_limit_action, const Group::ProductionCMode& newControl, GroupState& group_state, DeferredLogger& deferred_logger) const; diff --git a/opm/simulators/wells/BlackoilWellModelGeneric.cpp b/opm/simulators/wells/BlackoilWellModelGeneric.cpp index 2ba88720e..cbafd08d1 100644 --- a/opm/simulators/wells/BlackoilWellModelGeneric.cpp +++ b/opm/simulators/wells/BlackoilWellModelGeneric.cpp @@ -607,9 +607,9 @@ checkGroupHigherConstraints(const Group& group, deferred_logger); if (is_changed) { switched_prod_groups_.insert_or_assign(group.name(), Group::ProductionCMode2String(Group::ProductionCMode::FLD)); - const auto exceed_action = group.productionControls(summaryState_).exceed_action; + const auto group_limit_action = group.productionControls(summaryState_).group_limit_action; BlackoilWellModelConstraints(*this). - actionOnBrokenConstraints(group, exceed_action, + actionOnBrokenConstraints(group, group_limit_action, Group::ProductionCMode::FLD, this->groupState(), deferred_logger);