Skip to content

Conversation

@hakonhagland
Copy link
Contributor

Refactor TargetCalculator::groupTarget() and InjectionTargetCalculator::groupTarget() to
WellGroupHelper::getProductionGroupTarget(), and WellGroupHelper::getInjectionGroupTarget(). This will be used by reservoir coupling to compute master group targets. Also avoid passing Group::ProductionControls as a parameter to these methods. Since TargetCalculator is constructed with a single group in mind, passing control as a parameter is confusing and can be error prone if being passed a control for a different group than the TargetCalculator was constructed for. This means that TargetCalculator needs a WellGroupHelper reference, which led to a changes in 20 other files to support passing WellGroupHelper around to different methods that use TargetCalculator.

@hakonhagland hakonhagland added the manual:irrelevant This PR is a minor fix and should not appear in the manual label Nov 24, 2025
@hakonhagland
Copy link
Contributor Author

jenkins build this please

@hakonhagland
Copy link
Contributor Author

jenkins build this please

@hakonhagland
Copy link
Contributor Author

jenkins build this please

@hakonhagland
Copy link
Contributor Author

jenkins build this please

Copy link
Member

@blattms blattms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks a lot. Looks good. Just a few comments.

This needs a rebase before merging.

Comment on lines 1989 to 1993
GroupState<Scalar> empty_group_state;
auto& group_state = solving_with_zero_rate
Copy link
Member

@blattms blattms Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a reason to remove the const here. Please keep it. It might prevent unexpected changes

Comment on lines 178 to 179
const GroupStateHelperType& groupStateHelper,
DeferredLogger& deferred_logger) override; // should be const?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: Indentation is a bit off.

@hakonhagland
Copy link
Contributor Author

jenkins build this please

Refactor TargetCalculator::groupTarget() to
WellGroupHelper::getProductionGroupTarget(), and
don't pass Group::ProductionControls as a parameter. Since
TargetCalculator only works for a given group, passing control as a
parameter is confusing and can be error prone if being passed a control
for a different group than the TargetCalculator was constructed for.
Added a comment explaining why we cannot push a const
group state to GroupStateHelper
@hakonhagland
Copy link
Contributor Author

jenkins build this please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual:irrelevant This PR is a minor fix and should not appear in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants