Skip to content

feat: Add MGR strategy for thermal single-phase flow with wells and poromechanics - #4006

Open
victorapm wants to merge 6 commits into
developfrom
feature/paludettomag1/thermalSinglePhasePoromechanicsReservoir
Open

feat: Add MGR strategy for thermal single-phase flow with wells and poromechanics#4006
victorapm wants to merge 6 commits into
developfrom
feature/paludettomag1/thermalSinglePhasePoromechanicsReservoir

Conversation

@victorapm

@victorapm victorapm commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

cc @castelletto1 @tjb-ltk @frankfeifan

Adds MGR strategy and fixes a formulation bug.

The FIM Jacobian was missing well–reservoir perforation couplings. That is now fixed in this PR. FIM assembleSystem already added perforation residuals (mass and energy), but setupSystem built the matrix pattern only from DofManager. Perforation off-diagonals are not in the DofManager graph; sequential flow+wells adds them in CoupledReservoirAndWellsBase::setSparsityPattern. In RelWithDebInfo, addToRowBinarySearchUnsorted can drop those Jacobian entries.

The well energy residual was assembled without a matching Jacobian, so the first Newton update blew it up and FIM looked unstable.

PoromechanicsSolver now takes the flow solver’s sparsity pattern, the same approach PoromechanicsConformingFractures already used. For ReservoirAndWells that includes perforation couplings; for standalone flow it is the same DofManager pattern as before.

@victorapm victorapm added flag: ready for review ci: run integrated tests Allows to run the integrated tests in GEOS CI ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run code coverage enables running of the code coverage CI jobs labels Mar 27, 2026
@victorapm victorapm self-assigned this Mar 27, 2026
@rrsettgast rrsettgast removed ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI labels Mar 27, 2026
@frankfeifan

Copy link
Copy Markdown
Contributor

cc @castelletto1 @tjb-ltk @frankfeifan

Would you be to help by adding a regression test? Thanks!

Thanks, Victor! I can add one based on the sequential case I made for thermoporomechanics reservoir solver.

@victorapm

Copy link
Copy Markdown
Contributor Author

Thanks, Frank! Feel free to push to this PR

@frankfeifan

frankfeifan commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

Thanks, Frank! Feel free to push to this PR

Hey Victor @victorapm, I've added a fim case for ReservoirThermoPoroElastic and moved both fim and sequential cases to thermoPoromechanics folder. I don't see critical issue in the linear solver for the fim case, and it runs well. The log file is attached.
output_fim.log

However, I found the solutions from the fim and sequential are quite different, e.g., see deltaPressure below (left is fim and right is sequential). And I see the fim case shows stability issue at early time. Maybe it can be mitigated by tuning some parameters in xml or mgr recipe? Please feel free to take a look.

Screenshot 2026-03-28 at 1 09 41 PM

@victorapm

Copy link
Copy Markdown
Contributor Author

Thanks Frank! Maybe it's an issue with the FIM formulation? @tjb-ltk do you know if all the Jacobian components are being computed correctly?

@tjb-ltk

tjb-ltk commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

@frankfeifan @victorapm I'll run the cases and check the well behavior.

@victorapm victorapm added ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI labels Aug 17, 2026
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 CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI flag: ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants