Merge pull request #7129 from totto82/fix_rsc

Guard FLD/NONE injection group constraint path
This commit is contained in:
Håkon Hægland authored and GitHub committed 2026-06-05 09:36:37 +02:00
commit 2ac3e7baad
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
+3 -1
View File
@@ -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;
}