Skip to content

fix: compute flow statistics on surface element regions - #4164

Merged
victorapm merged 5 commits into
developfrom
feature/statistics-surface-regions
Oct 28, 2026
Merged

victorapm merged 5 commits into
developfrom
feature/statistics-surface-regions

Conversation

@npillardou

@npillardou npillardou commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Since #3836, the flow statistics aggregators assume that every target region of the flow solver is a CellElementRegion. When the flow solver also targets a SurfaceElementRegion (e.g. faults in conforming-fracture poromechanics), CompositionalMultiphaseStatistics / SinglePhaseStatistics with computeRegionStatistics="1" crash at setup:

***** Message from Fault (...):
'elementRegionsGroup' was expected to be a 'geos::CellElementRegion'.

  • Frame 1: StatsAggregatorBase<...>::enableRegionStatisticsAggregation(...)

This PR restores the pre-#3836 behavior by iterating on ElementRegionBase / ElementSubRegionBase instead of CellElementRegion / 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 a float, which made the average drift by up to ~1e-7 relative (e.g. average pressure above the max pressure). It is now a real64.

Changes

  • StatisticsAggregatorBase(.hpp|Helpers.hpp): generic region / sub-region types in enableRegionStatisticsAggregation, forRegionStatistics and computeSubRegionRankStats.
  • CompositionalMultiphaseStatistics* / SinglePhaseStatistics*: signatures updated accordingly; float → real64 for the inverse pore volume.
  • ALM_multiphasePoromechanics_curvedFrac_smoke.xml: adds a CompositionalMultiphaseStatistics task with computeRegionStatistics="1" to cover the fracture case.

Testing

  • ALM_multiphasePoromechanics_curvedFrac_smoke.xml runs to completion (crashed before this fix when adding statistics) and reports statistics for the Fracture region alongside the cell regions; the mesh-level pore volume equals the sum of the regions.
  • Serial and 2-rank MPI runs give consistent fracture statistics.
  • After the real64 fix, 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_smoke gets new statistics groups in its restart output;
  • tests that use flow statistics may see small changes in average pressure / temperature due to the float → real64 fix.

@npillardou npillardou added type: bug Something isn't working flag: requires rebaseline Requires rebaseline branch in integratedTests ci: run integrated tests Allows to run the integrated tests in GEOS CI ci: run code coverage enables running of the code coverage CI jobs ci: run device builds Allows to run the device (CUDA/HIP) builds labels Oct 13, 2026
@jhuang2601

Copy link
Copy Markdown
Contributor

This was reported previously.
It should be fixed in the pending PR (#4005), right? @MelReyCG

@MelReyCG

Copy link
Copy Markdown
Contributor

No, this PR must come after the #4005

@MelReyCG MelReyCG removed their assignment Oct 26, 2026
@MelReyCG
MelReyCG requested a review from herve-gross as a code owner October 26, 2026 11:20
@victorapm
victorapm merged commit acb25b2 into develop Oct 28, 2026
22 checks passed
@victorapm
victorapm deleted the feature/statistics-surface-regions branch October 28, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci: run code coverage enables running of the code coverage CI jobs ci: run device builds Allows to run the device (CUDA/HIP) builds ci: run integrated tests Allows to run the integrated tests in GEOS CI flag: requires rebaseline Requires rebaseline branch in integratedTests type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants