Skip to content

adding WELL_THP_UPDATE event. - #5298

Open
GitPaean wants to merge 4 commits into
OPM:masterfrom
GitPaean:network-well-without-vfp
Open

adding WELL_THP_UPDATE event. #5298
GitPaean wants to merge 4 commits into
OPM:masterfrom
GitPaean:network-well-without-vfp

Conversation

@GitPaean

@GitPaean GitPaean commented Aug 18, 2026

Copy link
Copy Markdown
Member

Adds a WELL_THP_UPDATE schedule event and a SimulatorUpdate::thp_respecified_wells set, raised whenever WCONPROD, WCONHIST, WELTARG THP/VFP or WTMULT THP (re)specifies a well THP limit or VFP table — also when the entered values are unchanged, which PRODUCTION_UPDATE does not cover.

@GitPaean GitPaean added the manual:irrelevant This PR is a minor fix and should not appear in the manual label Aug 18, 2026
@GitPaean
GitPaean force-pushed the network-well-without-vfp branch from 3898831 to f7dfc71 Compare August 18, 2026 08:58
@GitPaean

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 a new schedule event (WELL_THP_UPDATE) and simulator update tracking (SimulatorUpdate::thp_respec_wells) to detect when a well’s THP limit and/or VFP table is (re)specified via schedule keywords—even when the specified values are unchanged (a case not reliably covered by PRODUCTION_UPDATE).

Changes:

  • Introduces ScheduleEvents::WELL_THP_UPDATE with documentation explaining when it should be emitted.
  • Records THP/VFP (re)specification in handlers for WCONPROD, WCONHIST, WELTARG (THP/VFP), and WTMULT (THP), and tracks affected wells via HandlerContext::thp_respec_well() into SimulatorUpdate::thp_respec_wells.
  • Adds a parser/schedule regression test verifying WELL_THP_UPDATE behavior across several keyword scenarios.

Reviewed changes

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

Show a summary per file
File Description
tests/parser/ScheduleTests.cpp Adds coverage asserting WELL_THP_UPDATE is raised for THP/VFP re-specification scenarios, including unchanged values.
opm/input/eclipse/Schedule/Well/WellPropertiesKeywordHandlers.cpp Emits WELL_THP_UPDATE for WTMULT THP (currently only in producer branch).
opm/input/eclipse/Schedule/Well/WellKeywordHandlers.cpp Emits WELL_THP_UPDATE for WCONPROD, WCONHIST, and WELTARG THP/VFP cases.
opm/input/eclipse/Schedule/HandlerContext.hpp Declares HandlerContext::thp_respec_well() for tracking THP/VFP (re)specification.
opm/input/eclipse/Schedule/HandlerContext.cpp Implements thp_respec_well() to populate SimulatorUpdate::thp_respec_wells.
opm/input/eclipse/Schedule/Events.hpp Adds the WELL_THP_UPDATE enum value and updates event documentation.
opm/input/eclipse/Schedule/Action/SimulatorUpdate.hpp Adds/serializes/merges/resets/compares the new thp_respec_wells set.

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

Comment thread opm/input/eclipse/Schedule/Well/WellKeywordHandlers.cpp Outdated
Comment thread opm/input/eclipse/Schedule/Well/WellPropertiesKeywordHandlers.cpp Outdated
@GitPaean
GitPaean force-pushed the network-well-without-vfp branch 2 times, most recently from 35ccb76 to 33ea605 Compare August 18, 2026 09:23
@GitPaean
GitPaean requested a lite review from Copilot August 18, 2026 09:24

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 7 out of 7 changed files in this pull request and generated no new comments.

Suppressed comments (4)

opm/input/eclipse/Schedule/HandlerContext.cpp:56

  • Use the same pointer-check style as the surrounding methods (e.g. affected_well/record_tran_change) to keep HandlerContext consistent.
void HandlerContext::thp_respec_well(const std::string& well_name)
{
    if (sim_update != nullptr) {
        sim_update->thp_respec_wells.insert(well_name);
    }
}

opm/input/eclipse/Schedule/Events.hpp:117

  • Grammar: "THP limit and/or VFP table" is a plural subject, so this should be "have been (re)specified".
            /// The well THP limit and/or VFP table has been (re)specified

opm/input/eclipse/Schedule/Action/SimulatorUpdate.hpp:75

  • Grammar: "THP limit and/or VFP table" is plural, so this should be "have been (re)specified".
    /// Wells whose THP limit and/or VFP table has been (re)specified by

opm/input/eclipse/Schedule/HandlerContext.hpp:110

  • Grammar: the subject is plural ("THP limit and/or VFP table"), so this should use "have been".
    //! \brief Mark that the THP limit and/or VFP table of a well has been

@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this please

@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this opm-simulators=7333 please

@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this opm-simulators=7333 failure_report please

1 similar comment
@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this opm-simulators=7333 failure_report please

@GitPaean

Copy link
Copy Markdown
Member Author

https://ci.opm-project.org/job/opm-common-PR-builder/10164/

02_6_uda_model5_stdw looks fine, while 01_gsatprod6 needs to look into.

Build Artifacts
01_gsatprod6.pdf 954.89 KiB view
02_6_uda_model5_stdw.pdf 1.38 MiB view

@GitPaean

Copy link
Copy Markdown
Member Author

for the 01_gsatprod6, without tuning, it is difficult to see which one is better,

But if we turn the tuning on, this PR fixed the issue that the well THP can be lower than the nodal pressure,

master,

image

this PR,
image

Will check the version without tuning on more.

@GitPaean

GitPaean commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

https://ci.opm-project.org/job/opm-common-PR-builder/10164/

02_6_uda_model5_stdw looks fine, while 01_gsatprod6 needs to look into.

Build Artifacts 01_gsatprod6.pdf 954.89 KiB view 02_6_uda_model5_stdw.pdf 1.38 MiB view

At the end, the PR introduces more time step chopping at the first report step, but it is not because we are doing thing wrong in this PR, it is because the master branch uses a stale trivial_group_target (trivial_group_target is updated too infrequently, so it can be true while the scale != 0.) to skip checking. The behavior in the master branch is due to good/bad luck.

const bool dont_check = (currentControl == Well::ProducerCMode::GRUP && ws.trivial_group_target);

I suggest we probably should either enable tuning for the 01_gsatprod6.pdf or accept the extra chopping introduced by the PR.

@GitPaean
GitPaean force-pushed the network-well-without-vfp branch 2 times, most recently from 9736314 to e81d1f3 Compare August 25, 2026 17:13
@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this opm-simulators=7333 failure_report please

@GitPaean
GitPaean force-pushed the network-well-without-vfp branch 2 times, most recently from 66ce6c9 to 76a1e56 Compare August 27, 2026 09:30
@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this opm-simulators=7333 failure_report please

@GitPaean
GitPaean force-pushed the network-well-without-vfp branch from 76a1e56 to 19f052e Compare August 27, 2026 11:59
@GitPaean
GitPaean requested a balanced review from Copilot August 27, 2026 12:16
Copilot stopped reviewing on behalf of GitPaean due to an error August 27, 2026 12:20

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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 7 out of 7 changed files in this pull request and generated 2 comments.

Comment thread tests/parser/ScheduleTests.cpp
Comment thread opm/input/eclipse/Schedule/Events.hpp Outdated
@GitPaean
GitPaean force-pushed the network-well-without-vfp branch from 19f052e to 0ae140b Compare August 28, 2026 08:18
@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this opm-simulators=7333 failure_report please

Raised when the well THP limit and/or VFP table is (re)specified: by
WCONPROD or WCONHIST, by WELTARG with THP or VFP control, or by WTMULT
with THP control. Unlike PRODUCTION_UPDATE it is raised also when the
entered values are unchanged, since re-specifying either input cancels
a THP limit imposed dynamically by the simulator (e.g. by network
balancing).
The new thp_respecified_wells set carries the WELL_THP_UPDATE information
through ACTIONX processing, where report-step events do not reach the
simulator.
WCONINJE and WCONINJH, and WELTARG THP/VFP and WTMULT THP on injectors,
re-specify the injector THP limit and/or VFP table just like the
producer variants. Consumers gate on the well type where it matters.
@GitPaean
GitPaean force-pushed the network-well-without-vfp branch from 0ae140b to fbf7575 Compare August 28, 2026 08:29
@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this opm-simulators=7333 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 8 out of 8 changed files in this pull request and generated 2 comments.

Comment thread opm/input/eclipse/Schedule/Action/SimulatorUpdate.hpp
Comment thread opm/input/eclipse/Schedule/Well/WellKeywordHandlers.cpp
@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this opm-simulators=7333 failure_report please

@GitPaean

Copy link
Copy Markdown
Member Author

I am marking the PR and downstream PR OPM/opm-simulators#7333 as ready for review.

The downstream PR OPM/opm-simulators#7333 is the main PR, so I put the description of the issue there.

@GitPaean
GitPaean marked this pull request as ready for review August 28, 2026 12:45
@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this opm-simulators=7333 failure_report please

@GitPaean
GitPaean requested a review from bska August 28, 2026 12:45
@GitPaean

Copy link
Copy Markdown
Member Author

The main regression failure 01_gsatprod6.pdf I have analyzed with the following comment,

https://ci.opm-project.org/job/opm-common-PR-builder/10164/
02_6_uda_model5_stdw looks fine, while 01_gsatprod6 needs to look into.
Build Artifacts 01_gsatprod6.pdf 954.89 KiB view 02_6_uda_model5_stdw.pdf 1.38 MiB view

At the end, the PR introduces more time step chopping at the first report step, but it is not because we are doing thing wrong in this PR, it is because the master branch uses a stale trivial_group_target (trivial_group_target is updated too infrequently, so it can be true while the scale != 0.) to skip checking. The behavior in the master branch is due to good/bad luck.

const bool dont_check = (currentControl == Well::ProducerCMode::GRUP && ws.trivial_group_target);

I suggest we probably should either enable tuning for the 01_gsatprod6.pdf or accept the extra chopping introduced by the PR.

the other failure 02_6_uda_model5_stdw.pdf is possible due to the same cause, but I did not analyze it since the relative error are on the 1.e-05 level.

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