Skip to content

Fix refactoring and glift bugs#6932

Merged
bska merged 3 commits intoOPM:masterfrom
atgeirr:fix-refactoring-and-glift-bugs
Mar 13, 2026
Merged

Fix refactoring and glift bugs#6932
bska merged 3 commits intoOPM:masterfrom
atgeirr:fix-refactoring-and-glift-bugs

Conversation

@atgeirr
Copy link
Member

@atgeirr atgeirr commented Mar 12, 2026

This addresses three minor bugs (each of these is a separate commit).

  • Fix error introduced in refactoring in deciding "will we perform network balancing on the next Newton iteration".
  • Ensure same behaviour as before with regards to relaxation of well tolerances.
  • Avoid using (even writing to) nullopts in the gas lift optimization code.

The second one is arguably dubious. The change was introduced in #6880, which was intended as a refactoring, and therefore it is a "bug" to change, however the new behaviour is arguably more correct and should not be reverted. I may therefore remove the second commit.

The gas lift change should be verified by someone familiar with that code. @totto82 or @svenn-t perhaps?

@atgeirr atgeirr added the manual:irrelevant This PR is a minor fix and should not appear in the manual label Mar 12, 2026
@atgeirr
Copy link
Member Author

atgeirr commented Mar 12, 2026

jenkins build this please

Copy link
Member

@bska bska left a comment

Choose a reason for hiding this comment

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

I'll let others review the technical details concerning the indices here, so I have only minor comments on the implementation of the new willBalanceOnNextIteration() member function.

Comment on lines +135 to +139
// if network is not active, we do not need to balance the network
const auto& network = well_model_.schedule()[reportStepIdx].network();
if (!network.active()) {
return false;
}
Copy link
Member

Choose a reason for hiding this comment

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

Intentional or not, the network object isn't use for anything other than this conditional so you might as well write it as

if (! well_model_.schedule()[reportStepIdx].network().active()) {
    return false;
}

On another though, well_model_.schedule()[reportStepIdx] is accessed repeatedly so we might want to create an alias (reference) for that object.

Copy link
Member Author

Choose a reason for hiding this comment

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

Refactored as suggested.

@totto82
Copy link
Member

totto82 commented Mar 13, 2026

The changes to the gaslift part during well testing are fine. Thanks for the fix.

Atgeirr Flø Rasmussen added 3 commits March 13, 2026 10:05
One of them used to pass iteration + 1 to check if the next iteration
would balance the network. Replaced with separately named new method
to fix.
@atgeirr atgeirr force-pushed the fix-refactoring-and-glift-bugs branch from b8c1726 to ca50b2a Compare March 13, 2026 09:05
@atgeirr
Copy link
Member Author

atgeirr commented Mar 13, 2026

jenkins build this please

Copy link
Member

@bska bska 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 for the updates. This looks good to me now and as the gas lift aspects have been approved I'll merge into master.

@bska bska merged commit df2edac into OPM:master Mar 13, 2026
2 checks passed
@atgeirr atgeirr deleted the fix-refactoring-and-glift-bugs branch March 13, 2026 09:50
@atgeirr
Copy link
Member Author

atgeirr commented Mar 13, 2026

Thanks, now we still have the question of changing the behaviour restored in the middle commit: 842e7fc

Should it be modified or is it correct as is now?

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.

3 participants