Skip to content

[wip] refact: Fit ALM as LM in the Poromechanics hierarchy - #4101

Draft
jafranc wants to merge 45 commits into
feature/jhuang/thermalSinglePhaseALMfrom
jafranc/feat/proposal-01-thermalALM
Draft

jafranc wants to merge 45 commits into
feature/jhuang/thermalSinglePhaseALMfrom
jafranc/feat/proposal-01-thermalALM

Conversation

@jafranc

@jafranc jafranc commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

This PR is proposal to refacttor ALM as a Contact policy for Poromechanics classs to restrict code duplicaiton

Make MGR/Sequential support clear and loud:

  • GEOS_MGR_STRATEGY_NOT_SUPPORTED() MACRO to avoid code duplication while being temporary (until proper recipe is implemented and tested) [left aside SinglePhaseReservoirAndWells, CoupledReservoirAndWellsBase to focus on ALM]
  • forceSequential() to be explicit about this (also temporary) traits of this class [could be extended to PhaseField Models]

Fit ALM in PM hierarchy:

  • normalizing ALMSinglePhase to be a PoromechanicsConformingFractures and not a SinglePhasePoromechanics anymore (as done for LM)
  • moving up faceNodalArea and faceIntegral to ContactSolverBase
  • moving up constexpr maxNumNodes
  • temp patching hasStabilization/getStabilizationName while waiting for bubble to reframe as Stabilization

Make Bubble a stabilization in ALM Contact

Warning

WIP - Proposal - DO NOT MERGE

MelReyCG and others added 6 commits July 7, 2026 14:46
Allow to query statistics computation for solver (for reservoir reference pressure for wells), without needing an output statistics component. Statistics are no longer recomputed for each convergence step but only at iteration start.
- `RegionStatistics` classes for resulting data storages at different levels:
    - sub-regions mpi-local kernel compute read-backs,
    - (cell element) regions,
    - solver discretisation `MeshLevel`,
- `StatsAggregator` classes to compute & reduce the statistics to rank 0,
- `StatsTask` `Group`, the user component to schedule flow statistics computation & output to log & CSV.
)

* update publications

* fix error for doc build

* fix the failure for the button-ref directive

* switch to button-link

* add path

* fix links for reference

* Fixed hyperlinks

* address review comment

---------

Co-authored-by: DENEL Bertrand <bertrand.denel@total.com>
- normalizing ALMSinglePhase to be a PoromechanicsConformingFractures and not a SinglePhasePoromechanics anymore (as done for LM)
- moving up `faceNodalArea` and `faceIntegral` to ContactSolverBase
- moving up constexpr maxNumNodes
- temp patching `hasStabilization/getStabilizationName` while waiting for bubble to reframe as Stabilization
@jafranc jafranc changed the title Jafranc/feat/proposal 01 thermalALM [wip] refact: Fit ALM as LM in the Poromechanics hierarchy Jul 23, 2026
@jafranc jafranc self-assigned this Jul 23, 2026
@jafranc
jafranc marked this pull request as draft July 23, 2026 08:42
tjb-ltk and others added 14 commits July 31, 2026 13:57
This wommit introduces:

- An improved well schema layout and code refactor better suited for well modeling. The previous implementation primarily targeted Jacobian generation requirements for the coupled reservoir and well system.

- The well estimator is used to select the active well constraint by solving the well system assuming fixed reservoir conditions and selecting the constraint with the highest or lowest well flowing pressure.

the estimator is applied at beginning of Jacobian assembly of the coupled system frequency determined via input setting estimator is a data member of WellControl and a tailed version of PhysicsSolver for wells logic underpins future capability to replace the segmented well model with other formulations.
This is a breaking change, detailed migration instructions and migration script are posted at #4081
some changes that were needed to succesfully compile and pass unit tests in our environment (AOCC Compiler, AOCL).
1. Variable shadowing solved,
2. testSinglePhaseMFDPolyhedral failed intermittently during mesh initialization, crash solved by disabled FPE trapping.
Solved a bug where a shut well following a non-converged open well reset the max well residual to zero, letting the simulation falsely converge. Affected compositional models only (well segment flow residuals).
Fix a bug breaking determinism in numerical Jacobian tests, where iterate-dependent constitutive state persisted across Newton attempts.
Update CompositionalMultiphaseBase::resetStateToBeginningOfStep to explicitly discard warm-started state held by the fluid model by calling fluid.initializeState(). This guarantees that rolled-back steps start clean and do not inherit iterate-dependent state from failed Newton attempts.
* Revert "fix assignement check (#4046)"

This reverts commit e971774.

* Revert "reanable sccache using a legacy backup that uses existing GCP secret (#4045)"

This reverts commit 10ade7d.

* Revert "allow for forks in different orgs to have different CI specifications (#4032)"

This reverts commit 0139435.

Preserve later CI image, CUDA, and CTest changes from #4043, code-rules checking from #3914, current action versions, authenticated live label checks, direct draft checks, and removal of environment dumps.
* Attempt 2: try migrating ATS python setup to docker setup

* disable pip upgrades

* Add crypto diagnostics

* Attempt to bypass fips.so requirement

* Make GCP upload optional; Try to re-enable local sccache optimization

* Fix sccache max size

* Set RUNS_ON: streak2 for defaulting sccache configurations

* Address concurrency issue by fixing NPROC and memory args

* Try fixing CTEST_PARALLEL args for slow unit tests

* Move unit tests from streak2 back to github

* Re-enable GCS sccache for gitub-runners

* Fix python issue

* Disable isothm_mass_inj_table_02 tests temporarily

* Use host networking for streak2 Docker CI jobs to avoid bridge DNS failures

* Restore Docker bridge networking for streak2 CI jobs; Fixes outbound issue, but breaks sccache with collisions

* Cleanup to remove debugging code / verbosity

* Update HPCReach submodule

* Aggressively trim PR; disable two super-slow tests

* Disable crazy slow (1, 1, 1) variants.  Keep much faster parallel versions.

* Temp disable yet another heavy test

* Fix test disabling

---------

Co-authored-by: Victor A. P. Magri <paludettomag1@llnl.gov>
* Guard VTK DIY mesh redistribution against SIGFPE.

The same XML-writer empty-array FPE that hits vtkRedistributeDataSetFilter also occurs in VTKMeshGeneratorTools::redistribute(), which ALM-singlephase already guarded.

* GCC -O3 can raise SIGFPE when comparing a matrix entry that is a signaling NaN during Dirichlet assembly.
* Load entries[j] into a volatile temporary before the min-diagonal check so the comparison does not trap.
* Leave the Dirichlet row treatment unchanged: clamp tiny diagonals to minDiagonal and zero off-diagonal entries.
* Update lc hostconfigs

* GEOS_TPL_TAG

* Update HPCReact submodule

* Disable hypredrive by default

* ATS jobs should not be dumping linear systems to file

* Update baseline notes

* Rebaseline integrated tests after dropping writeLinearSystem dumps.

---------

Co-authored-by: Victor A. P. Magri <paludettomag1@llnl.gov>
* Add a generic wrapper limits framework for supported scalar and numeric-array types, including a new is_limitable trait and is_limitable_v alias.
* Introduce WrapperLimits / WrapperBound to define min/max bounds, inclusive/exclusive behavior, and validation modes, with Error as the default mode.
* Implement and expose limit validation, including checks that min <= max and validation of input values against configured ranges.
* Improve validation diagnostics to include the data context and allowed range, with range-string construction centralized in WrapperLimits.
* Remove the old setMinValue() / setMaxValue() API and update getter/helper naming and organization.
* Add wrapper limits to generated documentation/schema output and improve related Doxygen documentation.
* Update existing code, including BCBakerRelPerm, to use the new limits API.
* Fix Conduit hierarchy handling by renaming the "root" node to "problem" so getDataContext() produces the expected context.
* Perform supporting cleanup/refactoring: namespace organization, file rename to WrapperLimits.hpp, include cleanup, GEOS_UNUSED_PARAM, removal of implicit conversions/static qualifiers, and formatting fixes.
* Add tests covering the new limit functionality.

---------

Co-authored-by: MelReyCG <122801580+MelReyCG@users.noreply.github.com>
* Remove extra placeholder in format
* Fix logic error exposed by uninitialized variable in 2 core run
* Time Advancement: Ensures that the time is properly advanced when a new collection is completed.
* Statistics Reset: Forces a reset of statistics prior to merging to prevent stale or cumulative data from corrupting the merge output.
* CSV File Handling: Updates the file-writing behaviour so the CSV file is appended to rather than overwritten each time, preserving historical collection data.
* Fix the element count to exclude ghost cells and add unit test.
* Add barrier call in testFlowStatistics setup
* Add comments explaining max() usage for period start time in SourceFluxStatistics

---------

Co-authored-by: MelReyCG <122801580+MelReyCG@users.noreply.github.com>
Co-authored-by: Victor A. P. Magri <50467563+victorapm@users.noreply.github.com>
…t in parallel (#4118)

* ci: unbind ATS launches and run CTest in parallel

* re-enable integratedTests that were removed in order to avoid timeouts
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [codecov/codecov-action](https://github.com/codecov/codecov-action).


Updates `actions/checkout` from 6.0.3 to 7.0.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v6.0.3...v7.0.0)

Updates `codecov/codecov-action` from 6.0.1 to 7.0.0
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@v6.0.1...v7.0.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: codecov/codecov-action
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Co-authored-by: Randolph Settgast <randolph.settgast@earthflow.ai>
frankfeifan and others added 6 commits August 16, 2026 21:14
…#3884)

* fix effective stress for thermoporomechancis
* avoid hiding overloaded function
* added an integrated test
* move temperature derivative to DiscretizationOps
* remove thermal strain part from the avgPlasticStrain calculation
* added sequential version
* fixed the names and commas
* docs: update tutorial example for thermoporoelastic consolidation (#4110)
* update script for readthedocs CI error
* fix the NameError issue for readthedoc build
* rebaseline

---------

Co-authored-by: Nicolas Pillardou <71120126+npillardou@users.noreply.github.com>
Co-authored-by: Jian Huang <53012159+jhuang2601@users.noreply.github.com>
* Update LC hostconfigs for addition of hypredrive
* Remove unused host configs
* Default hypre and hypredrive paths provide exactly the same solver configurations

---------

Co-authored-by: Nicola Castelletto <castelletto1@llnl.gov>
Co-authored-by: Victor A. P. Magri <50467563+victorapm@users.noreply.github.com>
Co-authored-by: Victor A. P. Magri <paludettomag1@llnl.gov>
* Remove PVTPackage submodule from .gitmodules
* Remove pvt package references
* Remove cmake from code checks

---------

Co-authored-by: Sushma Yellapragada <sushmayellapragada3@gmail.com>
Co-authored-by: Dickson Kachuma <dickkachuma@googlemail.com>
Co-authored-by: Dickson Kachuma <81433670+dkachuma@users.noreply.github.com>
* Add script for running integrated tests

* Add option to generate baselines locally

* update LC images

* update TPL-TAG

---------

Co-authored-by: Randolph Settgast <randolph.settgast@earthflow.ai>
Co-authored-by: Nicola Castelletto <castelletto1@llnl.gov>
* Re-enable GCP upload flag

* Improve log readibility for users

* Modify log section nesting

* Make UPLOAD_TO_GCP conditional on PR and fork status
* Correct sign convention + hardcoded constitutive
* Add missing A^bp coupling term

---------

Co-authored-by: Jian Huang <53012159+jhuang2601@users.noreply.github.com>
Co-authored-by: Jacques Franc <49998870+jafranc@users.noreply.github.com>
victorapm and others added 19 commits August 27, 2026 14:59
* Support RAJA suite 2026 TPLs
* Add ROCm GEOS CI job
* Fix CUDA build with new TPLs
* Use shared device CI label
* Run Uncrustify on GEOS sources
* Remove DIY warning workaround
* Fix C++20 Clang CI builds
* Fix device test builds
* Fix CUDA event test
* Fix Clang warning compatibility
* Handle GCC 12 VTK warning
* Update TPL image and LvArray
* Fix CMake target warnings
* Fix VTK CI issues
* Fix VTK multiblock mesh loading
* Rebaseline
* Fix leaks found by sanitizer integrated tests
* Adapt hypre fixes to tpls-next
* Fix CI HypreDrive configuration
* Keep Hypredrive opt-in on tpls-next
* Fix Hypre legacy Krylov vector tags
* Fix CUDA build of Hypre regression test
* Apply CUDA compatibility source patches
* Update LC TPLs
* Add MGR strategy for SinglePhasePoromechanicsConformingFracturesALM
* Add MGR strategy bridge via hypredrive
* Fix bug in the fully coupled ALM + single-phase sparsity construction
  - The mechanics solver replaced the existing flow sparsity pattern, discarding flow and custom FIM couplings.
  - Pressure–bubble couplings checked for the nonexistent wrapper bubbleElementsList instead of the registered bubbleCells key.
 - Fixed both by unioning the flow and mechanics patterns before adding FIM couplings, and by using the correct wrapper key
* Complete the ALM conforming-fractures single-phase poromechanics solver
- Replace the solver's setupSystem override with a setSparsityPattern hook, and
  build the coupled pattern as the exact union of the flow and mechanics
  patterns in one resizeFromRowCapacities pass.
- Assemble the well and perforation blocks for the reservoir-and-wells
  instantiation, which previously left every well row empty.
- Give dR/dAperture per-mesh-body row offsets, threaded to the flow solver
  through assembleHydrofracFluxTerms, so several mesh bodies no longer share a
  single row space.
- Add the singlePhasePoromechanicsConformingFracturesALMReservoirFVM MGR
  strategy, which eliminates the well block on a third level rather than leaving
  well rate and BHP rows in the coarse grid.
- Restrict the well-free ALM MGR strategy to exactly three fields, and reject
  thermal input, which the single-component fracture assembly cannot represent.
- Supply rigid-body modes as the near-null space when hypredrive drives the
  solve, emitting one set of six vectors per mesh body.
- Reject multi-target setups in HydrofractureSolver and
  PoromechanicsConformingFractures, whose dR/dAperture indexing carries no
  per-mesh offset and silently aliased rows.
- Move dR/dAperture between host and device without touching it, so the
  immutable sparsity structure is not re-uploaded every Newton iteration.
- Collapse assembleHydrofracFluxTerms to a single virtual carrying the row
  offsets, removing the mutually forwarding seven- and eight-argument overloads.
- Extract appendSparsityPattern into linearAlgebra/utilities and use it for the
  five duplicated row-copy loops; move MGR block counting into MGRStrategyBase.
- Fix is_formattable_v under C++20, where probing with std::format reports every
  type as formattable, and add the formatter static_asserts back to LogPart and
  TableData.
- Merge the exact and coordinate-based 2D-to-3D neighbour lists in VTKUtilities
  instead of letting the coordinate result overwrite the exact one.

---------

Co-authored-by: jacques franc <jacquesfrancdev@gmail.com>
* Add kernelSpec.json
* Add relative permeability template
* Add hysteresis check
* Correct embedded documentation typos in kernelSpecs.json (#4086)
* Fix typos in kernelSpecs embedded docs
* Add 1D cooling tutorial to doc
* wordsmithing the example rest
* update wellbore thermal tutorials

---------

Co-authored-by: Jian Huang <53012159+jhuang2601@users.noreply.github.com>
Co-authored-by: Herve Gross <40979822+herve-gross@users.noreply.github.com>
* PhaseFieldFractureSolver, PhaseFieldPoromechanicsSolver, and PhaseFieldDamageFEM cleanup
* added a check for nucleation model to see if the dissipation option is linear
* move localDissipationoption to constitutive model and added FractureModelType option
* updated xmls
* renamed sed to crackDrivingForce
* apply Damage default field values after array allocation
* refactored and added spectral/vol-dev split test decks for all fracture-model types
* fix save history of crack driving force
* enabled multi-region run with certain defined regions have no damage dof
* register nodal damage as a field trait instead of an XML fieldName
* Add phase-field benchmark
* add viscous regularization
* removed fieldName in benchmarks, updated schemas
* use internal meshes for single notch examples and stop tracking lfs
* removed useless coeffField and call setConstitutiveNamesCallSuper
* Error out on unimplemented ExplicitTransient time integration
* moved fine mesh files to GEOSDATA, created coarse meshes for integrated tests
* fix a bug to save the crack driving force history also on the host
* rebaseline
* make the fracture model type and dissipation option clear in examples
* merged damage interpolation kernels
…4083)

* fix tetra scaling
* rough dispatch
* restore anisotropic box scaling
* wording style
* rebaseline

---------

Co-authored-by: Jian HUANG <jian.huang@totalenergies.com>
Co-authored-by: Jian Huang <53012159+jhuang2601@users.noreply.github.com>
* Removed phasePVTParaFiles and flashModelParaFile from CO2-Brine fluid models.
* Replaced parameter files with direct XML configuration.
* Added XML fields for pressure and temperature coordinates and intervals.
* All properties now use the same pressure and temperature discretization points.
* Pressure and temperature points can be explicitly listed for nonuniform spacing.
* Added salinity configuration, defaulting to 0.
* Added Ezrokhi density and viscosity coefficients, defaulting to 0.
* Added selectable solubility models: DuanSun by default, SpycherPruess, or Tables.
* Added support for externally generated solubility tables through solubilityTables.
* Introduced BrineFluidParameters to pass structured parameters when creating PVT models.
* Updated integrated tests and CO2-Brine documentation.
* Some simulation results changed because all property tables now share common ranges and points.
* This is a breaking change requiring input model updates. Migration instructions are available in issue #4022.

---------

Co-authored-by: Jian Huang <53012159+jhuang2601@users.noreply.github.com>
Co-authored-by: Jian HUANG <jian.huang@totalenergies.com>
* Add computeM to construct the primal mimetic inner-product matrix needed by the mixed saddle-point formulation.
* Implement computeM for TPFAInnerProduct, QuasiTPFAInnerProduct, BdVLMInnerProduct, and SimpleInnerProduct.
* Factor shared geometry/consistency computations into reusable mimetic inner-product helper routines.
* Update polyhedron centroid computation to be consistent with exact volume integration for planar polygonal facets.
* Add/extend unit tests for the new inner-product matrices, including consistency checks such as BdVLM reducing to TPFA on hexahedral cells.
* Clean up geometry variable naming and add documentation for the new computeM interfaces.
* Rebaseline integrated tests due to the corrected centroid computation.

---------

Co-authored-by: Nicola Castelletto <castelletto1@llnl.gov>
Co-authored-by: Omar Duran <oduran@stanford.edu>
Co-authored-by: Omar Duran <omaryesiduran@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.