An open-source pipeline for solving continuous reaction-diffusion models in image-based geometries of porous media

Justina Stark, Ivo F. Sbalzarini

Abstract

We present a versatile open-source pipeline for simulating inhomogeneous reaction-diffusion processes in highly resolved, image-based geometries of porous media with reactive boundaries. Resolving realistic pore-scale geometries in numerical models is challenging and computationally demanding, as the scale differences between the sizes of the interstitia and the whole system can lead to prohibitive memory requirements. The present pipeline combines a level-set method with geometry-adapted sparse block grids on GPUs to efficiently simulate reaction-diffusion processes in image-based geometries. We showcase the method by applying it to fertilizer diffusion in soil, heat transfer in porous ceramics, and determining effective diffusion coefficients and tortuosity. The present approach enables solving reaction-diffusion partial differential equations in real-world geometries applicable to porous media across fields such as engineering, environmental science, and biology.

Introduction

Simulating the transport of fluids, heat, or chemical species through porous media is a fundamental challenge in computational physics. Whether investigating fertilizer leaching in agricultural soil or heat dissipation in ceramic catalysts, researchers face a significant scale mismatch. High-fidelity simulations must resolve micrometer-scale pore structures while capturing the behavior of systems that span centimeters or meters.

Traditional "dense" grid methods, which discretize the entire volume at the required resolution, often lead to astronomical memory requirements and computational costs. While homogenization techniques offer a simplified alternative, they frequently sacrifice the critical pore-scale details that drive the underlying physics. This paper introduces an end-to-end, open-source pipeline designed to maintain these details through memory-efficient sparse grids and GPU acceleration.

The Image-Based Simulation Pipeline

The developed workflow transforms raw 3D image data into high-performance physics simulations through a multi-step process.

The image-based simulation pipeline: from raw 3D images to GPU-accelerated physics results.
  1. Image Segmentation: Using the machine-learning tool ilastik, 3D $\mu$CT scans are segmented to classify voxels as either "solid" or "pore" space.
  2. Level-Set Representation: To avoid the artifacts of jagged, pixelated boundaries, the pipeline employs a Signed Distance Function (SDF). This provides a smooth, implicit mathematical description of the interface, allowing for more accurate boundary condition enforcement.
  3. Sparse Block Grids: Leveraging the OpenFPM library, the simulation utilizes geometry-adapted sparse block grids. This approach only allocates memory for the "active" regions (e.g., the pore space), effectively ignoring the solid phase and drastically reducing the memory footprint.
  4. GPU Acceleration: The solver is implemented in C++ and optimized for parallel execution across multiple GPUs, providing the throughput necessary for large-scale real-world geometries.

Validation and Applications

The pipeline's versatility was demonstrated across several distinct datasets:

  • $CaCO_3$ Packed Bed: $\mu$CT scans were used to simulate fertilizer diffusion and calculate tortuosity—the measure of the winding path molecules must traverse through the medium.
  • Reticulate Porous Ceramics (RPC): These highly sparse materials served as a testbed for heat conduction and surface dissipation simulations.
  • Synthetic Benchmarks: 2D disk geometries with known analytical solutions were used to verify the numerical accuracy of the reaction-diffusion solver.

Key Results and Performance

The integration of sparse grids and GPU acceleration yielded significant performance improvements, particularly in sparse geometries like the RPC, where the solid phase occupies only ~9% of the total volume.

Memory and Speed Efficiency: In the ceramic case, the sparse grid implementation reduced memory requirements by nearly 5x (from 20.3 GB to 4.2 GB) and increased computational speed by 76% compared to a dense grid. Even in denser geometries like the $CaCO_3$ bed, a 13% speedup was observed.

Scalability: The framework demonstrated near-perfect weak scaling up to 8 GPUs, indicating that the pipeline can handle increasingly complex problems by scaling hardware resources.

Visualization of solving reaction-diffusion PDEs in real-world geometry using multi-GPU acceleration.

Discussion and Future Work

While the current pipeline offers a robust solution for image-based simulation, several avenues for improvement remain. The boundary approximation is currently first-order, which could be elevated to higher-order accuracy for more sensitive surface physics. Additionally, the use of explicit time-stepping, while highly parallelizable, necessitates small time steps for stability; future iterations may explore implicit schemes to allow for larger temporal steps. Finally, moving the initial geometry setup (redistancing) entirely to the sparse GPU framework would enable the efficient simulation of dynamic geometries, such as those found in dissolving porous media.

Summary updated

BibTeX
@article{stark2023open,
  author = {Justina Stark and Ivo F. Sbalzarini},
  title = {{An open-source pipeline for solving continuous reaction-diffusion models in image-based geometries of porous media}},
  journal = {J. Comput. sci},
  year = {2023},
  doi = {10.1016/j.jocs.2023.102118},
}
Figure