Roberto Lange, Gabriel M. Magalhães, Franciane F. Rocha, Hélio Ribeiro Neto
{"title":"An advanced fully-implicit solver for heterogeneous porous media based on foam-extend","authors":"Roberto Lange, Gabriel M. Magalhães, Franciane F. Rocha, Hélio Ribeiro Neto","doi":"10.1016/j.cpc.2025.109842","DOIUrl":null,"url":null,"abstract":"<div><div>Multiphase flow in porous media is present in many engineering applications, including hydrogeology, oil recovery, and CO<sub>2</sub> sequestration. Accurate predictions of fluid behavior in these systems can improve process efficiency while mitigating environmental and health risks. Commercial simulators and open source software, such as the <span>porousMultiphaseFoam</span> repository based on the OpenFOAM framework, have been developed to model this type of problem. However, simulating heterogeneous porous media with heterogeneous porosity and permeability distributions poses significant numerical challenges. We introduce <span>coupledMatrixFoam</span>, an OpenFOAM-based solver designed for enhanced numerical stability and robustness. <span>coupledMatrixFoam</span> integrates the Eulerian multi-fluid formulation for phase fractions with Darcy's law for porous media flow, applying a fully implicit, block-coupled solution for pressure and phase fractions. The solver is based on foam-extend 5.0, leveraging the latest <span>fvBlockMatrix</span> developments to improve computational efficiency. This approach enables a significant increase in time step sizes, particularly in cases involving capillary pressure effects and other complex physical interactions. This work details the formulation, implementation and validation of <span>coupledMatrixFoam</span>, including comparisons with <span>porousMultiphaseFoam</span> that uses a segregated approach, to assess performance improvements. Additionally, a scalability analysis is conducted, demonstrating the solver's ability for high-performance computing (HPC) applications, which are essential for large-scale, real-world simulations.</div></div><div><h3>Program summary</h3><div><em>Program Title:</em> coupledMatrixFoam</div><div><em>CPC Library link to program files:</em> <span><span>https://doi.org/10.17632/3d3xdh4x89.1</span><svg><path></path></svg></span></div><div><em>Developer's repository link:</em> <span><span>https://gitlab.com/wikki.brasil/porousmedia</span><svg><path></path></svg></span></div><div><em>Licensing provisions:</em> GPLv3</div><div><em>Programming language:</em> C++</div><div><em>Supplementary material:</em> Available in the repository <span><span>porousMedia</span><svg><path></path></svg></span>.</div><div><em>Nature of problem:</em> This software solves multiphase flow in porous media.</div><div><em>Solution method:</em> Fully implicit solver based on the Euler-Euler multifluid formulation combined with Darcy's law developed in the OpenFOAM framework, that is based on the Finite Volume Method (FVM). Implicit coupling of phase fraction and pressure equations allowing significantly larger time steps. Complex physical phenomena are accounted for, including capillary pressure effects, gravitational forces, compressibility, and heterogeneous media properties. The porous medium is modeled as a stationary phase, and nonlinear terms are linearized using Taylor series expansions. Parallel computation is supported through OpenFOAM's standard domain decomposition approach.</div><div><em>Additional comments including restrictions and unusual features:</em> Compatibility with foam-extend (OpenFOAM) version 5.0.</div></div>","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"317 ","pages":"Article 109842"},"PeriodicalIF":3.4000,"publicationDate":"2025-09-09","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Computer Physics Communications","FirstCategoryId":"101","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0010465525003443","RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"COMPUTER SCIENCE, INTERDISCIPLINARY APPLICATIONS","Score":null,"Total":0}
引用次数: 0
Abstract
Multiphase flow in porous media is present in many engineering applications, including hydrogeology, oil recovery, and CO2 sequestration. Accurate predictions of fluid behavior in these systems can improve process efficiency while mitigating environmental and health risks. Commercial simulators and open source software, such as the porousMultiphaseFoam repository based on the OpenFOAM framework, have been developed to model this type of problem. However, simulating heterogeneous porous media with heterogeneous porosity and permeability distributions poses significant numerical challenges. We introduce coupledMatrixFoam, an OpenFOAM-based solver designed for enhanced numerical stability and robustness. coupledMatrixFoam integrates the Eulerian multi-fluid formulation for phase fractions with Darcy's law for porous media flow, applying a fully implicit, block-coupled solution for pressure and phase fractions. The solver is based on foam-extend 5.0, leveraging the latest fvBlockMatrix developments to improve computational efficiency. This approach enables a significant increase in time step sizes, particularly in cases involving capillary pressure effects and other complex physical interactions. This work details the formulation, implementation and validation of coupledMatrixFoam, including comparisons with porousMultiphaseFoam that uses a segregated approach, to assess performance improvements. Additionally, a scalability analysis is conducted, demonstrating the solver's ability for high-performance computing (HPC) applications, which are essential for large-scale, real-world simulations.
Program summary
Program Title: coupledMatrixFoam
CPC Library link to program files:https://doi.org/10.17632/3d3xdh4x89.1
Supplementary material: Available in the repository porousMedia.
Nature of problem: This software solves multiphase flow in porous media.
Solution method: Fully implicit solver based on the Euler-Euler multifluid formulation combined with Darcy's law developed in the OpenFOAM framework, that is based on the Finite Volume Method (FVM). Implicit coupling of phase fraction and pressure equations allowing significantly larger time steps. Complex physical phenomena are accounted for, including capillary pressure effects, gravitational forces, compressibility, and heterogeneous media properties. The porous medium is modeled as a stationary phase, and nonlinear terms are linearized using Taylor series expansions. Parallel computation is supported through OpenFOAM's standard domain decomposition approach.
Additional comments including restrictions and unusual features: Compatibility with foam-extend (OpenFOAM) version 5.0.
期刊介绍:
The focus of CPC is on contemporary computational methods and techniques and their implementation, the effectiveness of which will normally be evidenced by the author(s) within the context of a substantive problem in physics. Within this setting CPC publishes two types of paper.
Computer Programs in Physics (CPiP)
These papers describe significant computer programs to be archived in the CPC Program Library which is held in the Mendeley Data repository. The submitted software must be covered by an approved open source licence. Papers and associated computer programs that address a problem of contemporary interest in physics that cannot be solved by current software are particularly encouraged.
Computational Physics Papers (CP)
These are research papers in, but are not limited to, the following themes across computational physics and related disciplines.
mathematical and numerical methods and algorithms;
computational models including those associated with the design, control and analysis of experiments; and
algebraic computation.
Each will normally include software implementation and performance details. The software implementation should, ideally, be available via GitHub, Zenodo or an institutional repository.In addition, research papers on the impact of advanced computer architecture and special purpose computers on computing in the physical sciences and software topics related to, and of importance in, the physical sciences may be considered.