Guard FLD/NONE injection group constraint path

This commit is contained in:
Tor Harald Sandve committed 2026-06-04 11:23:55 +02:00
1 parent e994a3acdb
commit 8f00abbfd3
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
@@ -2017,7 +2017,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;
}