Refactor GroupTreeRates to OPM style and integrate with updateWellControls#1
Draft
Refactor GroupTreeRates to OPM style and integrate with updateWellControls#1
Conversation
Implements the group-tree rate distribution algorithm as standalone functions: - distributeGroupTreeRates: Main iterative rate balancing - setSubRates: Top-down guide-rate based distribution - findWorstOffendingChild: Find worst limit violation in subtree - updateParentStatus: Bottom-up status propagation Includes comprehensive unit tests covering unconstrained trees, single-well limits, group limit violations, cascading violations, and deep tree hierarchies. Co-authored-by: steink <6746854+steink@users.noreply.github.com>
…variable Co-authored-by: steink <6746854+steink@users.noreply.github.com>
Co-authored-by: steink <6746854+steink@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add functionality to test group-tree convergence
Add standalone GroupTreeRates module for iterative group-tree rate distribution
Feb 28, 2026
…pdateWellControls - Wrap free functions into GroupTreeRates<Scalar> class with static methods - Rename to snake_case: distributeGroupTreeRates -> distribute, setSubRates -> set_sub_rates, findWorstOffendingChild -> find_worst_offending_child, updateParentStatus -> update_parent_status - Rename struct member: guideRate -> guide_rate - Use OPM-style include guard and Doxygen documentation - Add include and integration comment in BlackoilWellModel_impl.hpp showing how distribute() fits into updateWellControls - Update all tests to use new class-based API Co-authored-by: steink <6746854+steink@users.noreply.github.com>
…rder Co-authored-by: steink <6746854+steink@users.noreply.github.com>
Copilot
AI
changed the title
Add standalone GroupTreeRates module for iterative group-tree rate distribution
Refactor GroupTreeRates to OPM class-based style and show integration with updateWellControls
Mar 2, 2026
…al as updateWellControlsOriginal - Rename existing updateWellControls to updateWellControlsOriginal - New updateWellControls calls updateWellControlsOriginal, then: 1. Builds flat GroupTreeNode vector from the group hierarchy 2. Calls GroupTreeRates<Scalar>::distribute(tree) 3. Applies resulting rates back to well/group state - Add updateWellControlsOriginal declaration to BlackoilWellModel.hpp Co-authored-by: steink <6746854+steink@users.noreply.github.com>
Co-authored-by: steink <6746854+steink@users.noreply.github.com>
Copilot
AI
changed the title
Refactor GroupTreeRates to OPM class-based style and show integration with updateWellControls
Refactor GroupTreeRates to OPM style and integrate with updateWellControls
Mar 2, 2026
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.
The GroupTreeRates module used Matlab-style free functions and camelCase naming. The TODO in
updateWellControlsdescribed howdistributeGroupTreeRatesshould integrate but had no implementation.Style refactoring (GroupTreeRates.hpp/cpp)
GroupTreeRates<Scalar>class with static methods, matching OPM patterns likeBlackoilWellModelConstraintsdistributeGroupTreeRates→distribute,setSubRates→set_sub_rates,findWorstOffendingChild→find_worst_offending_child,updateParentStatus→update_parent_statusGroupTreeNode::guideRate→guide_rate\brief/\paramDoxygen tagsIntegration with updateWellControls (BlackoilWellModel_impl.hpp)
updateWellControlsOriginalupdateWellControlscalls original first, then implements the three TODO items:GroupTreeNodevector with rate limits (fromproductionControls), current rates (from well/group state), and guide ratesGroupTreeRates<Scalar>::distribute(tree)wellState().surface_ratesandgroupState().production_ratesOnly applies to single-phase rate controls (ORAT/WRAT/GRAT); skips LRAT/RESV/FLD where the simplified distribution doesn't apply.
Tests
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.