feat: MGR strategy for single phase flow + ALM poromechanics - #4125
feat: MGR strategy for single phase flow + ALM poromechanics#4125victorapm wants to merge 44 commits into
Conversation
… into jafranc/feat/ALMreciepe
This reverts commit b877903.
…csConformingFracturesALM-FullyImplicit
…csConformingFracturesALM-FullyImplicit
…ciepe # Conflicts: # src/coreComponents/linearAlgebra/utilities/LinearSolverParameters.hpp
- 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
…phase' into jafranc/feat/ALMreciepe
- 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.
jafranc
left a comment
There was a problem hiding this comment.
Great work @victorapm 👍
Nice utilities introduced here in addition to the core enabling of MGR for 1p-ALM contact
jhuang2601
left a comment
There was a problem hiding this comment.
Thanks @victorapm for adding mgr recipe for ALM with FIM coupling.
It is working well for two analytical examples (slanted fault and vertical fault).
frankfeifan
left a comment
There was a problem hiding this comment.
Everything looks good. Thanks!
| void HydrofractureSolver< POROMECHANICS_SOLVER >::setUpDflux_dApertureMatrix( DomainPartition & domain, | ||
| DofManager const & dofManager, | ||
| CRSMatrix< real64, globalIndex > & localMatrix ) | ||
| void HydrofractureSolver< POROMECHANICS_SOLVER >::setUpDflux_dApertureMatrix( DomainPartition & domain ) |
There was a problem hiding this comment.
setUpDflux_dApertureMatrix now exists in three solvers, and their differences look small. I think it is possible to do some refactor (maybe in another PR) and pull into a share utility hearder at some point to save duplicated lines.
There was a problem hiding this comment.
Thanks Frank, good point. @jafranc is working on refactoring the LM/ALM codes, maybe your suggestion can go in?
There was a problem hiding this comment.
Thanks for letting me know! I'll port this comment there.
Completes the fully implicit single-phase poromechanics + conforming-fractures ALM path started in #3961 and the MGR recipe work in #3962.
On top of #3961 / #3962, this PR adds:
setSparsityPatternbuilds the exact union of flow and mechanics patterns (incl. well/perforation blocks for reservoir-and-wells)dR/dAperturerow offsets throughassembleHydrofracFluxTerms(fixes multi-body row aliasing); reject unsupported multi-target setupssinglePhasePoromechanicsConformingFracturesALMReservoirFVMMGR strategy that eliminates the well block on a third levelappendSparsityPatternutility and tighter ALM MGR field/thermal guards