Skip to content

Network well without vfp - #7333

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

Network well without vfp#7333
GitPaean wants to merge 7 commits into
OPM:masterfrom
GitPaean:network-well-without-vfp

Conversation

@GitPaean

Copy link
Copy Markdown
Member

Fixes two problems for wells attached to a production network. A well whose THP limit and VFP table are defaulted (WCONPROD items 10 and 11) is no longer treated as THP-constrained, so it stays on its remaining controls instead of aborting the run with Nonexistent VFP table 0 referenced while its rates still enter the network pressure calculation. A well that leaves the network — for instance moved to a non-network group by WELSPECS — now keeps the THP limit last imposed by network balancing until the schedule re-specifies its THP limit or VFP table, instead of silently reverting to the static limit from the deck; the limit is stored in SingleWellState, so it also survives shut periods and is reconstructed at restart.

Also refreshes trivial_group_target when the well group target is recomputed: a value latched at a transient zero share previously suppressed THP constraint checks for the rest of the report step, letting network wells produce with their THP below the node pressure.

Depends on OPM/opm-common#5298 (WELL_THP_UPDATE event and SimulatorUpdate::thp_respec_wells), which is what detects re-specification even when the entered values are unchanged.

@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 2 times, most recently from ce1e43e to a127162 Compare August 20, 2026 09:11
@GitPaean
GitPaean force-pushed the network-well-without-vfp branch from a127162 to 0aa7012 Compare August 21, 2026 09:45
Without a VFP table a THP limit cannot be converted to a BHP, so the
well cannot operate under a THP constraint. Previously, a network well
with WCONPROD items 10 and 11 defaulted aborted the simulation with
"Nonexistent VFP table 0 referenced". The well now stays on its
remaining controls while its rates still enter the network pressure
calculation.
activeProductionConstraint() skipped the switch to THP control for
GRUP-controlled wells when ws.trivial_group_target was set. That flag
is only rewritten in updateWellStateWithTarget() when a well switches
control, so it can go stale - it is set at the initial ORAT->GRUP
switch while a sibling well still covers the whole group target - and
the veto then blocks the very switch that would refresh it. Network
wells could therefore keep flowing with a THP below the nodal pressure
of the node they feed, which Eclipse never does.

Both call paths into checkIndividualConstraints() already return early
for wells whose freshly evaluated group target is zero
(stoppedOrZeroRateTarget() and wellUnderZeroRateTarget()), so the veto
could only ever act on stale information and is removed.
The preceding commit removed the only reader of this flag, leaving
write-only state that was still computed, serialized and compared.
Wells with a trivial group rate target are recognised on demand by
stoppedOrZeroRateTarget() and wellUnderZeroRateTarget().

The else branch of the rate scaling only existed to set the flag and
goes with it; the scaling itself is unchanged.
The limit is stored in SingleWellState and stays in force, also across
shut periods, until the deck re-specifies the well THP limit or VFP
table (the WELL_THP_UPDATE event of the companion opm-common branch).
Previously a detached well silently reverted to the static THP limit
from the deck.
Report-step events do not reach the simulator for ACTIONX updates, so
the SimulatorUpdate::thp_respec_wells set of the companion opm-common
branch is used instead.
No restart array carries the retained limit yet, so it is reconstructed
for a detached THP-controlled producer whose restart THP differs from
the schedule THP limit (a well on its own, possibly UDA-driven, limit
is left untouched). A retained limit that is not active at the restart
time is lost; this limitation is documented in the code.
@GitPaean
GitPaean force-pushed the network-well-without-vfp branch from 0aa7012 to bc84522 Compare August 25, 2026 17:22
The network cannot put a well without a VFP table under THP control,
so it should neither impose a dynamic THP limit on such a well nor
record a retained network_thp_limit for it. Previously only
wellHasTHPConstraints() neutralized the imposed limit; guarding the
imposition sites as well keeps the retained state meaningful and
removes the reliance on every getTHPConstraint() caller checking
wellHasTHPConstraints() first. No result changes: the guarded paths
were inert for wells without a VFP table.
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.

1 participant