Files
opm-simulators/opm
Håkon Hægland 7db04dbf30 Fix crash for NONE/FLD production cmode in RC
Master groups with GCONPROD cmode NONE and guide rate caused a crash in
getProductionGroupTargetForMode_(), which only handles rate-specific
cmodes (ORAT, WRAT, GRAT, LRAT, RESV).

The crash path: TopToBottomCalculator falls through to
getGroupConstraintNoGuideRate() when the bottom group has zero or
negative production (first time step on RC master with no local wells).
That function passes the group's NONE cmode to
getProductionGroupTargetForMode(), which throws.

Two fixes in GroupConstraintCalculator.cpp:

1. getGroupConstraintNoGuideRate(): return std::nullopt when the
   production cmode is FLD or NONE, since these groups have no own
   target.

2. TopToBottomCalculator::calculateGroupConstraint() fallback: when
   the bottom group has no own constraint (nullopt from fix 1), return
   the guide-rate-distributed target from above, capped by any limit
   the bottom group defines for the top-level control mode.
2026-03-27 12:30:18 +01:00
..