mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-25 07:07:42 -05:00
Merge pull request #7129 from totto82/fix_rsc
Guard FLD/NONE injection group constraint path
This commit is contained in:
2 files changed
+9
-1
No files matched your search
@@ -341,6 +341,12 @@ getGroupConstraintNoGuideRate(const Group& group)
|
||||
// to the slave group. Alternatively, we could also throw an error here for that case
|
||||
if (this->isInjectionConstraint()) {
|
||||
const auto& control_mode = this->groupState().injection_control(group.name(), this->injectionPhase_());
|
||||
// FLD/NONE means no own local constraint for this phase.
|
||||
// Let the caller use a higher-level distributed target instead.
|
||||
if (control_mode == Group::InjectionCMode::FLD ||
|
||||
control_mode == Group::InjectionCMode::NONE) {
|
||||
return std::nullopt;
|
||||
}
|
||||
return ConstraintInfo{
|
||||
this->groupStateHelper().getInjectionGroupTarget(group, this->injectionPhase_(), this->resvCoeffsInj()),
|
||||
control_mode
|
||||
|
||||
@@ -2028,7 +2028,9 @@ getInjectionGroupTargetForMode_(
|
||||
}
|
||||
default:
|
||||
OPM_DEFLOG_THROW(std::logic_error,
|
||||
"Invalid Group::InjectionCMode in getInjectionGroupTargetForMode_",
|
||||
fmt::format("Invalid Group::InjectionCMode in getInjectionGroupTargetForMode_ for {} cmode: {}",
|
||||
group.name(),
|
||||
Group::InjectionCMode2String(cmode)),
|
||||
this->deferredLogger());
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user