Repository navigation
fix: compute flow statistics on surface element regions - #4164
Merged
Merged
Conversation
npillardou
requested review from
MelReyCG,
OmarDuran,
bd713,
dkachuma,
jhuang2601,
joshua-white,
rrsettgast and
tjb-ltk
as code owners
October 13, 2026 10:31
Contributor
Contributor
|
No, this PR must come after the #4005 |
MelReyCG
approved these changes
Oct 23, 2026
jhuang2601
approved these changes
Oct 26, 2026
herve-gross
approved these changes
Oct 27, 2026
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.
Since #3836, the flow statistics aggregators assume that every target region of the flow solver is a
CellElementRegion. When the flow solver also targets aSurfaceElementRegion(e.g. faults in conforming-fracture poromechanics),CompositionalMultiphaseStatistics/SinglePhaseStatisticswithcomputeRegionStatistics="1"crash at setup:***** Message from Fault (...):
'elementRegionsGroup' was expected to be a 'geos::CellElementRegion'.
This PR restores the pre-#3836 behavior by iterating on
ElementRegionBase/ElementSubRegionBaseinstead ofCellElementRegion/CellElementSubRegion. Fractures are now included in the region statistics (and in the mesh-level aggregate). The sub-region kernel already only relies on fields and constitutive models that are available on face element sub-regions (element volume, pressure,coupled solid, fluid, relperm).
It also fixes a precision issue in
postAggregateStats(both single-phase and compositional): the inverse pore volume used to compute the average pressure and temperature was stored in afloat, which made the average drift by up to ~1e-7 relative (e.g. average pressure above the max pressure). It is now areal64.Changes
StatisticsAggregatorBase(.hpp|Helpers.hpp): generic region / sub-region types inenableRegionStatisticsAggregation,forRegionStatisticsandcomputeSubRegionRankStats.CompositionalMultiphaseStatistics*/SinglePhaseStatistics*: signatures updated accordingly;float→real64for the inverse pore volume.ALM_multiphasePoromechanics_curvedFrac_smoke.xml: adds aCompositionalMultiphaseStatisticstask withcomputeRegionStatistics="1"to cover the fracture case.Testing
ALM_multiphasePoromechanics_curvedFrac_smoke.xmlruns to completion (crashed before this fix when adding statistics) and reports statistics for theFractureregion alongside the cell regions; the mesh-level pore volume equals the sum of the regions.real64fix, averages stay within [min, max] (e.g. uniform 10 MPa initial state: average = 10000000 Pa instead of 10000000.47 Pa).Rebaseline
Requires a rebaseline:
ALM_multiphasePoromechanics_curvedFrac_smokegets new statistics groups in its restart output;float→real64fix.