Calculate ROEW From External Per-Region Contributions - #5280
Draft
bska wants to merge 3 commits into
Draft
Conversation
Member
Author
|
I'm creating this PR in draft mode for two reasons:
I will keep the PR in a draft state until both requirements have been satisfied and this PR is ready for review and merging. |
bska
force-pushed
the
roew-no-copt
branch
13 times, most recently
from
August 14, 2026 09:16
33f392b to
7c89cdc
Compare
This commit introduces a new manager-style class
RegionVariableCollection
which aggregates region set descriptors and variable values and
distributes per-cell variable contributions to all pertinent region
sets. Client code is expected to create a single object of this
class and initialise it with a populated region variable mapping.
Then as needed, typically at the end of every converged time step,
client code is expected to perform a value accumulation as follows:
1. Prepare this object for accumulation (prepareValueAccumulation())
2. For each applicable variable and cell, include the per-cell
contribution (addCellValue()).
3. Commit those contributions to compute the new variable
values (commitValues()).
Once 'commitValues()' has completed, client code may retrieve those
new variable values through the regionVariableValues() member
function. The process of committing values may involve cross-rank
MPI communication in parallel and will add to or overwrite the
current values depending on whether the variable is declared
cumlative.
We also include two helper functions,
regionSetIndex()
variableIndex()
which essentially just forward a query to the variable mapping
object supplied as an argument. The one exception is that
regionSetIndex() knows that "FIELD" is a special region set
pertaining to field-level quantities and will act accordingly.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit adds a special purpose helper function,
populateRegVarMapping()
that, based on the run's configured summary vectors, populates an
object of type data::RegionVariableMapping.
In this initial implementation, we define a variable named
ConnOPT
if any of the *OEW* summary vectors are configured in the run's
SUMMARY section. Those OEW vectors require tracking the per-region
cumulative oil production from wells and it's easier to have a
dedicated variable for this than to introduce extra "COPT" summary
vectors that are visible to the user through the result set's
summary files (e.g., .SMSPEC and .UNSMRY).
This commit switches the ROEW calculation away from using the ad-hoc mechanism of defining additional "COPT" vectors and mapping these to region contributions using the RegionCache. Instead, we rely on client code to provide a dedicated "ConnOPT" region variable defined for all regions in all region sets and use that value, combined with the existing "initial in-place" container, to infer the ROEW recovery factor per region and region set. The practical benefit of this change is that users no longer see the COPT vectors that were added only as a means of calculating ROEW and which were not requested in the run's SUMMARY section.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR switches the
ROEWcalculation away from using the ad-hoc mechanism of defining additionalCOPTvectors and mapping these to region contributions using theRegionCache. Instead, we rely on client code to provide a dedicatedConnOPTregion variable (#5279, OPM/opm-simulators#7293) defined for all regions in all region sets and use that value, combined with the existing "initial in-place" container, to infer theROEWrecovery factor per region and region set.The practical benefit of this change is that users no longer see the
COPTvectors that were added only as a means of calculatingROEWand which were not requested in the run'sSUMMARYsection.