OpenFPM  5.2.0
Project that contain the implementation of distributed structures
Inhomogeneous diffusion in a CaCO3 particle packed bed

Simulate inhomogeneous diffusion in a CaCO\f$_3\f$ particle packed bed

In this example, we simulate inhomogeneous diffusion in the fluid phase of a CaCO \(_3\) particle packed bed. For the complete image-based simulation pipeline and performance of this simulation, we refer to J. Stark, I. F. Sbalzarini "An open-source pipeline for solving continuous reaction-diffusion models in image-based geometries of porous media", Journal of Computational Science (2023).

The geometry of the fluid phase is reconstructed based on \textmuCT images kindly provided by Prof. Jörg Petrasch (Michigan State University, College of Engineering) (see: S. Haussener et al., “Tomographic characterization of a semitransparent-particle packed bed and determination of its thermal radiative properties”. In: Journal of Heat Transfer 131.7 (2009)). The folder containing the input files for this example (3D dense grid with level-set signed-distance function of the particle packed bed's fluid phase plus textfiles to initialize grid size and dimensions) can be downloaded from our git-repository. Please adapt the INPUT_PATH in this code example accordingly.

For image based reconstruction and redistancing, see Images 3D.

Include

We start with inluding header files, setting some paths and indices:

Initialization and output folder

We start with

  • Initializing OpenFPM
  • Setting the output path and creating an output folder

Create a dense grid and load redistancing result

Create a sparse grid of fluid phase

Obtain sparse grid by placing grid points inside the fluid phase only using the signed distance function

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Defining the inhomogeneous diffusion coefficient

The inhomogeneous diffusion coefficient is smoothed around the interface by a sigmoidal function that depends on the signed distance function

Defining the functor for the inhomogeneous diffusion

The functor contains the forward time central space discretization of the inhomogeneous diffusion equation. The stencil size is 1. It will be passed to the GPU and convolved with the sparse grid.

Run inhomogeneous diffusion

Terminate

We end with terminating OpenFPM.

Full code