Skip to content

Add Group Structure Visualisation for RstState Objects - #5310

Draft
bska wants to merge 4 commits into
OPM:masterfrom
bska:rststate-wgstruct
Draft

Add Group Structure Visualisation for RstState Objects#5310
bska wants to merge 4 commits into
OPM:masterfrom
bska:rststate-wgstruct

Conversation

@bska

@bska bska commented Aug 23, 2026

Copy link
Copy Markdown
Member

This will enable extending the wellgraph utility to support visualising groups and wells loaded directly from a restart file
instead of having input decks as its only source of information.

@bska bska added the manual:irrelevant This PR is a minor fix and should not appear in the manual label Aug 23, 2026
@bska

bska commented Aug 23, 2026

Copy link
Copy Markdown
Member Author

I'm creating this PR in draft mode because it depends on, and contains, the earlier PR #5309. I will keep the PR in a draft state until such time as it is ready for review and merging.

@bska
bska force-pushed the rststate-wgstruct branch 3 times, most recently from c2ccd99 to ca7b723 Compare August 25, 2026 08:23
bska and others added 3 commits August 25, 2026 11:14
PRs OPM#2651 and OPM#2663 added a "Runspec" argument to the restart loader
as a means of inferring the maximum number of actions, the number of
conditions per action and other essential pieces of information
needed to correctly interpret the *ACT and *ACN restart file arrays.
While this practice has served us well in the interim, it's strictly
speaking somewhat fragile.  A restarted simulation run is allowed to
increase these dimensions compared to the base run and in that case
we'd be basing our offsets on out-of-bounds values.

This commit switches to loading the base run's action dimensions
directly from the pertinent INTEHEAD array items which, in turn,
enables removing the Runspec argument to RstState::load().  We still
need the run's number of tabulated PVT regions in order to correctly
load the oil vaporisation properties, but I want to push the
scattering to the client side at some point in the future.  For now
we add a new overload of RstState::load() function that takes the
number of PVT regions as an optional<int>--defaulting to nullopt
which we treat as a single PVT region--and make the overload taking
the Runspec argument call the other overload.  The Runspec overload
will be marked "deprecated" once all downstream users have been
converted to the new overload.

The one compromise that we have to add here is a floating-point
based derivation of each actions "start" time.  We would previously
infer this from the Runspec argument's START value, but this is no
longer available.  Instead we use a calculation based on the
RstHeader's "sim_time()" and the SimTim element of DOUBHEAD.  Other
derivations may be possible, but this appears sufficiently accurate
for now.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This is in preparation of adding support for emitting dot-style
graph output from well/group objects contained in an RstState object
loaded from a restart file.  We introduce a GroupHierarchy helper
structure that normalises the hierarchy information whether obtained
directly from a Schedule object (run's last report step) or from an
RstState object (follow-up work).  The existing dot-style output is
then generated from a GroupHierarchy instance.  For now we copy the
relevant names into this GroupHierarchy.  If that turns out to be a
bottleneck, then we'll rethink this choice.
This will enable extending the "wellgraph" utility to support
visualising groups and wells loaded directly from a restart file
instead of having input decks as its only source of information.
@bska
bska force-pushed the rststate-wgstruct branch from ca7b723 to f2d5d0b Compare August 25, 2026 09:15
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