Move getAutoChokeGroupProductionTargetRate() from
WellGroupControls (static method) to GroupStateHelper
(member method). The method has no well dependency and
manually reimplements chain iteration already available
as applyReductionsAndFractions_().
The moved implementation delegates to
applyReductionsAndFractions_() with do_addback=false
and the actual getLocalReductionLevel_() value, replacing
the manual reduction loop.
Make getLocalReductionLevel_() private again (reverting
the visibility change from the previous commit), since
its only external caller was the now-removed static
method in WellGroupControls.
Remove unused FractionCalculator.hpp include from
WellGroupControls.cpp and WellGroupControls.hpp include
from BlackoilWellModelNetwork_impl.hpp and the test file.
- Use its own fluidstate and Evaluation class to avoid having to add an extra derivative to the main equations
- Sotre the scaling factor to avoid calling the parameter all the time
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.
Add two test cases for getAutoChokeGroupProductionTargetRate():
- TestAutoChokeGroupProductionTargetRate: normal case with
MANI (autochoke, FLD) under intermediate group PLAT that
has a guide rate. Verifies the autochoke reduction loop
produces the same result as applyReductionsAndFractions_()
when both are applicable.
- TestAutoChokeGroupTargetRateDoubleCountingBug: uses a
NETWORK DATA file with NODEPROP (as_choke=YES) and lower
well rates to naturally trigger underperformance detection
(GCW=0). Documents the double-counting bug where missing
local_reduction_level gating causes reductions to be
subtracted at both FIELD and PLAT, producing a clamped-
to-zero target instead of the correct value.
Also adds GROUP_HIGHER_CONSTRAINTS_NETWORK.DATA with
BRANPROP/NODEPROP keywords and parameterizes the test
fixture with mani2_control, data_file, and well rates.
sumWellSurfaceRates() only returns rank-local rates, but
isAutoChokeGroupUnderperforming_() compared them directly against the
full group target. Add comm_.sum() to aggregate rates across all ranks
before the comparison.