mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-25 15:10:09 -05:00
Add local_reduction_level gating to the autochoke target loop in getAutoChokeGroupProductionTargetRate(), preventing double-counting of reductions at intermediate groups with group-controlled-wells count of zero. Remove getGuideRate() from GroupStateHelper: the group path is dead code (only caller was isAutoChokeGroupUnderperforming_ which now uses guide_rate_ directly), and the well path is inlined into FractionCalculator::guideRate(). Improve isAutoChokeGroupUnderperforming_() to compute the control group guide rate as the sum of its FLD children's guide rates (matching how targets are distributed), and accumulate efficiency factors from the autochoke group up to the control group. This makes the formula correct for the common case where the control group is the immediate parent with no reductions. Rename getLocalReductionLevel_ to getLocalReductionLevel and make it public, as it is now called from WellGroupControls.cpp. Update test to verify the corrected target rate and remove references to the now-fixed double-counting issue.