parsing for the keyword WELDRAW - #5305
Conversation
There was a problem hiding this comment.
Pull request overview
Adds schedule parsing and state support for WELDRAW limits, including serialization and control-mode reporting.
Changes:
- Introduces WELDRAW parsing, storage, UDA evaluation, and well integration.
- Reports drawdown-limited producers through WMCTL.
- Adds serialization and schedule parsing coverage plus restart warnings.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
CMakeLists_files.cmake |
Registers WELDRAW sources and headers. |
opm/input/eclipse/Schedule/ScheduleDeck.cpp |
Warns when restart processing skips WELDRAW. |
opm/input/eclipse/Schedule/Well/WELDRAW.cpp |
Implements WELDRAW parsing and evaluation. |
opm/input/eclipse/Schedule/Well/WELDRAW.hpp |
Defines the WELDRAW state API. |
opm/input/eclipse/Schedule/Well/Well.cpp |
Stores and exposes WELDRAW state. |
opm/input/eclipse/Schedule/Well/Well.hpp |
Declares WELDRAW integration. |
opm/input/eclipse/Schedule/Well/WellPropertiesKeywordHandlers.cpp |
Handles WELDRAW schedule records. |
opm/output/data/Wells.hpp |
Adds dynamic drawdown-control status. |
opm/output/eclipse/Summary.cpp |
Reports drawdown as the active control mode. |
opm/output/eclipse/VectorItems/well.hpp |
Defines the drawdown control code. |
tests/parser/ScheduleSerializeTest.cpp |
Enables WELDRAW schedule serialization coverage. |
tests/parser/ScheduleTests.cpp |
Tests parsed WELDRAW properties. |
tests/test_Serialization.cpp |
Adds WELDRAW serialization coverage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated no new comments.
Suppressed comments (1)
opm/input/eclipse/Schedule/eval_uda.cpp:71
- If the UDQ is absent,
output_valueremains the undefined sentinel and is then pressure-converted. In non-SI unit systems this changes the sentinel, so callers can no longer recognize it withSummaryState::is_undefined_value(). Returnudq_defaultdirectly when neither lookup succeeds, and convert only resolved UDQ values.
return value.get_dim().convertRawToSi(output_value);
|
jenkins build this please |
|
jenkins build this opm-simulators=7346 please |
|
jenkins build this opm-simulators=7346 please |
1 similar comment
|
jenkins build this opm-simulators=7346 please |
|
jenkins build this opm-simulators=7346 failure_report please |
|
jenkins build this opm-simulators=7346 failure_report please |
|
I am marking this PR and also the downstream OPM/opm-simulators#7346 as ready for review to invite reviewers. |
akva2
left a comment
There was a problem hiding this comment.
Only some nitpickery found, plus confusing around missing cc.
|
making this to be draft to amend the PR for agreed behavoir when the default item 2 is used. We should not support it. |
b8c48a1 to
81beb6d
Compare
|
the WELDRAW regression cases will not run before OPM/opm-tests#1573 getting merged. |
|
As the expected the regression tests with the WELDRAW keywords emits the following error message, https://ci.opm-project.org/job/opm-common-PR-builder/10203/ |
|
jenkins build this opm-simulators=7346 failure_report please |
|
jenkins build this failure_report please |
|
To make the PR build standalone needs to add WELDRAW.hpp to Well.hpp. It is needed in the serializer() in FlowGenericVanguard.cpp. |
But it will break the forward declaration pattern in the file. Please let me know if it is wanted. |
bska
left a comment
There was a problem hiding this comment.
I finally looked at the details here and I think it's fine for the most part. I do have a couple of reservations that should be addressed in some way before we merge this.
As for
To make the PR build standalone needs to add
WELDRAW.hpptoWell.hpp. It is needed in theserializer()in FlowGenericVanguard.cpp.
Right. In the past we've "just" added the requisite headers, e.g., WDFAC.hpp, to FlowGenericVanguard.cpp and ParallelSerialization.cpp. I think I'd prefer that we continue to do that. I haven't looked at the details of the downstream changes yet. Maybe that's exactly what it does.
3ea2e29 to
3f0fa8b
Compare
bska
left a comment
There was a problem hiding this comment.
Thanks a lot for the updates. This is getting close to ready as far as I can tell. The only remaining issue is the first-time construction of WELDRAW within a Well object created from WELSPECS or similar, i.e., not from a restart file.
There was a problem hiding this comment.
There should probably be an explicit WELDRAW::WELDRAW(const Dimension&) constructor too which properly constructs the UDAValue data member. That way, the normal Well constructor can use its UnitSystem argument to properly define the WELDRAW dimension from the start. The current initialisation in terms of the default constructor will not have appropriate unit conversion support configured from the start.
The constructor used at simulation restart is fine.
|
jenkins build this opm-simulators=7346 failure_report please |
Store the per-well maximum drawdown (value, target phase, AVG/MAX mode) on the Well object. A defaulted phase resolves from the preferred phase. The mode and use-in-potentials properties are retained for input round tripping even though OPM Flow rejects their non-default values at deck load.
A producer held back by its maximum allowable drawdown is under drawdown control, which is control mode 12, and not under the rate control which carries the converted limit. Add that mode to the well control mode values and a flag on the dynamic control record for the simulator to raise, and report it from WMCTL.
eval_well_uda() raises a symbolic value to at least the epsilon limit before converting it, because a zero rate target means no limit and a negative one is meaningless. Neither applies to the maximum allowable drawdown, which is a pressure, and where a non-positive value is how the caller is told that no limit applies. Evaluated through eval_well_uda(), a UDQ drawdown limit of zero became 1e-20 Pascal instead and all but shut the well. Add an evaluation which keeps the value as it is and use it for WELDRAW. Also make the CurrentControl serialization test object a producer, so that the round trip of the drawdown limited flag is covered rather than skipped by the injector branch of the comparison, and check the reported control mode of a drawdown limited well in the summary tests.
A restarted run discards the SCHEDULE keywords preceding the restart date and builds its wells from the restart file, so a WELDRAW limit set before that date was lost and the well produced at a higher rate than in an uninterrupted run until the next WELDRAW keyword. Write the maximum allowable drawdown to item 34 of SWEL and restore it when a well is built from the restart file. Zero records that no limit applies, which is also how a limit removed by defaulting item 2 is stored. The target phase is not part of the restart file and is resolved from the well's preferred phase, as a defaulted item 3 is, so a phase given explicitly is not recovered.
Item 2 has no default, so a record which leaves it out has no maximum allowable drawdown to apply. Reject it rather than guessing at what was meant.
|
jenkins build this opm-simulators=7346 failure_report please |
bska
left a comment
There was a problem hiding this comment.
Thanks a lot for the updates. This looks good to me now. I'll review the downstream companion PR before deciding how to proceed.
The downstream looks good so I'll create reference solutions for the new regression test cases and then I'll merge this and its companion PR. |
|
jenkins build this opm-simulators=7346 update_data please |
|
jenkins build this opm-simulators=7346 opm-tests=1577 please |
PR OPM/opm-simulators#7346 Reason: PR OPM/opm-common#5305 PR OPM/opm-simulators#7346 opm-common = d673cf5d0a5f7cee3008860ebcd1f929503ef3c9 opm-grid = 0f95d633d61058184576a2d795cd76482ef96daa opm-simulators = 8a20b18fa72b9198220b3027e5059d84c094d55f ### Changed Tests ### * weldraw_02_gas * weldraw_01 * weldraw_01_msw
…simulators_7346 Automatic Reference Data Update for PR OPM/opm-common#5305
|
Reference solutions for the new regression test cases have been installed on the CI system. I'll merge this and its downstream companion PR into the master branch. |
|
Some comments for the manual. @gdfldm WELDRAW is now supported in Flow. The behaviour, item by item:
The limit is converted at each time step into a maximum production rate |
Adds the WELDRAW keyword, which sets a maximum allowable drawdown for production wells.
The record is parsed into a WELDRAW object on the Well: the maximum drawdown (a UDA), the target phase of item 3, and the mode of item 5. A defaulted target phase resolves to the well's preferred phase.
A well held back by its drawdown limit reports control mode 12 in WMCTL. The limit is stored in item 34 of SWEL and restored when a well is built from a restart file, so a restarted run applies the same limit as an uninterrupted one; the target phase is not stored and is resolved from the preferred phase.
The conversion of the limit into a rate is in OPM/opm-simulators#7346.
Test cases in OPM/opm-tests#1571.