Skip to content

Support wecon item14 and16 - #7297

Draft
GitPaean wants to merge 5 commits into
OPM:masterfrom
GitPaean:support_wecon_item14_16
Draft

Support wecon item14 and16#7297
GitPaean wants to merge 5 commits into
OPM:masterfrom
GitPaean:support_wecon_item14_16

Conversation

@GitPaean

@GitPaean GitPaean commented Aug 8, 2026

Copy link
Copy Markdown
Member

Supports items 14 (minimum liquid rate) and 16 (minimum reservoir fluid rate)
of the WECON keyword.

Item 14 was already checked, but it looked up the oil and water rates
unconditionally, so a run without one of those phases aborted with a
std::logic_error. The liquid rate is now summed over the active phases only,
and the same guard is applied to the minimum oil and gas rate limits.

Item 16 converts the surface rates, or the potentials when item 10 is POTN, to
a reservoir voidage rate and shuts the well when it falls below the limit.

Two commits improve the logging: the closing message names the limit
that was violated, and a well test that does not re-open a well says so.

A regression test based on WECON-02.DATA from opm-tests is added.

The minimum liquid rate limit was already checked, but it looked up the oil
and water rates unconditionally. PhaseUsageInfo::canonicalToActivePhaseIdx
throws for an inactive phase, so a run without one of those phases aborted
with a std::logic_error instead of applying the limit. Sum only the phases
the run actually has, and skip the check when it has neither.

The same guard is applied to the minimum oil and gas rate limits (items 2
and 3), which could abort the same way, and item 14 is no longer reported
as unsupported.
Convert the surface rates, or the potentials when item 10 is POTN, to a
reservoir voidage rate with the same rate converter used for the voidage
rates in the well state, and shut the well when it falls below the limit.
Replaces the warning that the limit was not supported.

The check is a further case in checkRateEconLimits(), so it inherits the
POTN double-check against the actual rates and the zero group target guard
that already apply to the surface rate limits.
The message only said that a rate economic limit was hit. Name the quantity
that fell below its limit and print both values, so the log says which of the
WECON limits closed the well.

The layout now matches the ratio-limit workover messages, and the "at time
... (date = ...)" clause those and the CECON messages build inline moves to
a shared helper.
to test the item 14 of WECON
@GitPaean GitPaean added the manual:enhancement This is an enhancement/improvent that needs to be documented in the manual label Aug 8, 2026
@GitPaean GitPaean changed the title Support wecon item14 16 Support wecon item14 and16 Aug 8, 2026
@GitPaean
GitPaean requested a balanced review from Copilot August 8, 2026 21:55
@GitPaean

GitPaean commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

jenkins build this please

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds full WECON minimum liquid and reservoir-fluid rate handling while improving economic-limit logging.

Changes:

  • Handles active phases safely for minimum-rate checks.
  • Converts surface rates or potentials to reservoir voidage for item 16.
  • Improves closure and WTEST outcome messages.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
regressionTests.cmake Registers the WECON regression case.
opm/simulators/wells/WellTest.hpp Defines rate-limit reporting interfaces.
opm/simulators/wells/WellTest.cpp Implements rate checks and closure messages.
opm/simulators/wells/WellInterfaceGeneric.hpp Extends well-test and voidage APIs.
opm/simulators/wells/WellInterfaceGeneric.cpp Forwards closure-reason reporting.
opm/simulators/wells/WellInterfaceFluidSystem.hpp Declares voidage-rate conversion.
opm/simulators/wells/WellInterfaceFluidSystem.cpp Implements total reservoir voidage calculation.
opm/simulators/wells/WellInterface_impl.hpp Reports WTEST reopening outcomes.
opm/simulators/wells/EconomicLimitsMessage.hpp Centralizes closure timestamp formatting.
opm/simulators/utils/PartiallySupportedFlowKeywords.cpp Marks WECON items 14 and 16 supported.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread regressionTests.cmake
Comment thread opm/simulators/wells/WellInterface_impl.hpp Outdated
@GitPaean
GitPaean force-pushed the support_wecon_item14_16 branch from 74946f1 to ba343cd Compare August 8, 2026 22:35
@GitPaean

GitPaean commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

jenkins build this please

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

@GitPaean
GitPaean force-pushed the support_wecon_item14_16 branch 3 times, most recently from 008abc5 to f298951 Compare August 9, 2026 22:09
A test that does not re-open the well discarded the tested state without a
word, so the log showed the well being tested and then nothing. Report the
outcome from every exit -- unsolvable, inoperable, potentials that could not
be computed, or a limit that closed the well again -- with the reason left
to the debug log. The exception text of a failed potential calculation was
also passed to a format string that had no placeholder for it, and was lost.

A shut well is re-tested every interval, so that message stays a plain line,
while the one-off re-opening is framed like the shut-in it reverses.

Log output only, the simulation results are unchanged.
@GitPaean
GitPaean force-pushed the support_wecon_item14_16 branch from f298951 to 14daa3a Compare August 9, 2026 22:16
@GitPaean

GitPaean commented Aug 9, 2026

Copy link
Copy Markdown
Member Author

jenkins build this please

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

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

Labels

manual:enhancement This is an enhancement/improvent that needs to be documented in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants