Reject a missing WCONPROD control mode when a well is first opened - #5259
Open
hnil wants to merge 1 commit into
Open
Reject a missing WCONPROD control mode when a well is first opened#5259hnil wants to merge 1 commit into
hnil wants to merge 1 commit into
Conversation
Item 3 of WCONPROD may legitimately be omitted: a well that is not being
opened needs no control mode, and a later record that only revises limits
keeps the mode the well already has. Opening a well that has never been
given one has no meaning, but was accepted in two different broken ways:
- '1*' left the mode undefined, and the simulator then failed every
time step with "Well control must be specified for well ...", chopped
to the minimum step and aborted;
- '' reached WellProducerCModeFromString(), whose std::invalid_argument
surfaced as "Internal error: Unknown enum state string:".
Reject both up front, with the keyword, file and line the user can act
on. Unknown and unsupported mode strings now report the same way rather
than as an internal error.
Covers wconprod/WCONPROD-01 .. -12 in opm-tests. WCONPROD-00, whose
second record defaults the mode to keep the first record's ORAT, still
runs.
hnil
marked this pull request as ready for review
August 2, 2026 17:22
vkip
approved these changes
Aug 3, 2026
vkip
left a comment
Member
There was a problem hiding this comment.
Makes sense and looks good to me.
Member
|
jenkins build this please |
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.
WCONPROD item 3 can legitimately be defaulted — a well that is not being opened needs no control mode, and a later record that only revises limits keeps the mode the well already has. Opening a well that never got one was accepted in two broken ways:
1*left the mode undefined and the simulator failed every time step withWell control must be specified for well ..., chopped to the minimum step and aborted;WellProducerCModeFromString()and surfaced as `Internal error: Unknown enum state string:`.Both are now rejected up front with keyword, file and line. Unknown/unsupported mode strings report the same way instead of as an internal error.
Covers
wconprod/WCONPROD-01 .. -12;WCONPROD-00(which defaults the mode in a later record) still runs. Test added.