Add tests and fix autochoke group target rate#6835
Merged
totto82 merged 2 commits intoOPM:masterfrom Feb 19, 2026
Merged
Conversation
Contributor
Author
|
jenkins build this serial please |
Contributor
Author
|
Putting this in draft mode until #6833 has been merged |
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.
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.
9f976da to
9b98645
Compare
Contributor
Author
|
jenkins build this serial please |
Member
|
Thanks for the tests and the fix for the autochoke code. Especially the first test would be useful to ensure fixes in the main loop are carried over to the autochoke code. |
Contributor
Author
|
@totto82 Thanks for the review! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on #6833 which should be merged first.
Adds two tests and fixes autochoke group target rate:
Tests (commit 1)
getAutoChokeGroupProductionTargetRate():applyReductionsAndFractions_()when both are applicable.as_choke=YES) and lower well rates to naturally trigger underperformance detection. Verifies the correct target rate withlocal_reduction_levelgating.Bug fix and cleanup (commit 2)
Add
local_reduction_levelgating to the autochoke target loop ingetAutoChokeGroupProductionTargetRate(), preventing double-counting of reductions at intermediate groups with group-controlled-wells count of zero.Remove
getGuideRate()fromGroupStateHelper: the group path is dead code (only caller wasisAutoChokeGroupUnderperforming_()which now usesguide_rate_directly), and the well path is inlined intoFractionCalculator::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.