[1] The finite element method (FEM) combined with unstructured meshes forms an elegant and versatile approach capable of dealing with the complexities of problems in Earth science. Practical applications often require high-resolution models that necessitate advanced computational strategies. We therefore developed ''Million a Minute'' (MILAMIN), an efficient MATLAB implementation of FEM that is capable of setting up, solving, and postprocessing two-dimensional problems with one million unknowns in one minute on a modern desktop computer. MILAMIN allows the user to achieve numerical resolutions that are necessary to resolve the heterogeneous nature of geological materials. In this paper we provide the technical knowledge required to develop such models without the need to buy a commercial FEM package, programming compiler-language code, or hiring a computer specialist. It has been our special aim that all the components of MILAMIN perform efficiently individually and as a package. While some of the components rely on readily available routines, we develop others from scratch and make sure that all of them work together efficiently. One of the main technical focuses of this paper is the optimization of the global matrix computations. The performance bottlenecks of the standard FEM algorithm are analyzed. An alternative approach is developed that sustains high performance for any system size. Applied optimizations eliminate Basic Linear Algebra Subprograms (BLAS) drawbacks when multiplying small matrices, reduce operation count and memory requirements when dealing with symmetric matrices, and increase data transfer efficiency by maximizing cache reuse. Applying loop interchange allows us to use BLAS on large matrices. In order to avoid unnecessary data transfers between RAM and CPU cache we introduce loop blocking. The optimization techniques are useful in many areas as demonstrated with our MILAMIN applications for thermal and incompressible flow (Stokes) problems. We use these to provide performance comparisons to other open source as well as commercial packages and find that MILAMIN is among the best performing solutions, in terms of both speed and memory usage. The corresponding MATLAB source code for the entire MILAMIN, including input generation, FEM solver, and postprocessing, is available from the authors (http://www.milamin.org) and can be downloaded as auxiliary material.
Cavities and fractures significantly affect the flow paths in carbonate reservoirs and should be accurately accounted for in numerical models. Herein, we consider the problem of computing the effective permeability of rock samples based on high-resolution 3D CT scans containing millions of voxels. We use the Stokes-Brinkman equations in the entire domain, covering regions of free flow governed by the Stokes equations, porous Darcy flow, and transitions between them. The presence of different length scales and large (ten orders of magnitude) contrasts in permeability leads to highly ill-conditioned linear systems of equations, which are difficult to solve. To obtain a problem that is computationally tractable, we first analyze the relative importance of the Stokes and Darcy terms for a set of idealized 2D models. We find that, in terms of effective permeability, the Stokes-Brinkman equations are only applicable for a special parameter set where the effective free-flow permeability is less than four orders of magnitude different from the matrix permeability. All other cases can be accurately modeled with either the Stokes or the Darcy end-member flows, depending on if there do or do not exist percolating free-flow regions. The insights obtained are used to perform a direct computation of the effective permeability of a rock sample model with more than 8 million cells.
Cavities and fractures can significantly affect the flow paths of carbonate reservoirs and should be accurately accounted for during flow simulation. Herein, our goal is to compute the effective permeability of rock samples based on high-resolution 3D CT-scans containing millions of voxels. To this end, we need a flow model that properly accounts for the effects of Darcy flow in the porous material and Stokes flow in the void volumes on all relevant scales. The presence of different length scales and large contrasts in the petrophysical parameters leads to highly ill-conditioned linear systems that make such a flow model very difficult to solve, even on large-scale parallel computers. To identify simplifications that render the problem computationally tractable, we analyze the relative importance of the Stokes and Darcy terms for a wide variety of parameter ranges on an idealized 2D model. We find that a system with a through-going free flow region surrounded by a low permeable matrix can be accurately modeled by ignoring the Darcy matrix and simulating only the Stokes flow. Using the obtained insight, we are able to compute the effective permeability of a specific model from a CT-scan that contains more than eight million voxels.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.