(420f) Predicting the Permeability of Porous Media Using Graph Neural Networks | AIChE

(420f) Predicting the Permeability of Porous Media Using Graph Neural Networks

Authors 

Simmons, M., University of Birmingham
Gallen, R., Johnson Matthey
Stitt, E. H., Johnson Matthey

Introduction

Understanding of the properties of porous media is beneficial for a range of important applications including fuel cells [1] and automotive exhaust treatment [2]. However, determining properties such as permeability can be difficult, both experimentally and via simulation. Typical approaches for numerically determining such properties involve some type of pore-scale simulation. Two common examples include traditional Computational Fluid Dynamics (CFD) [2] and the lattice Boltzmann method (LBM) [3]. These methods require significant computational cost, often requiring the use of high-performance computing (HPC) [4]. Alternatively, properties can be determined via experimentation, for example by driving flow through porous media and measuring pressure drop [5], or extracting pore network models from mercury porosimetry data [6]. These methods are useful for validating simulations, but require complex experimental set-ups, and more data can be gathered from simulations.

Various data-driven methods have been used for predicting porous media properties. A common method is to use a convolutional neural network (CNN), trained on images [7]. Using 2D image data is more computationally efficient, but often characteristics of 2D porous media, such as dead-end pores, are not present in 3D porous media [8]. However, 3D CNNs are computationally expensive and it may prove difficult when dealing with porous media samples that are representative of the structures from which they were extracted when trying to scale up the CNN. An alternative is to train a graph neural network (GNN) based on pore networks. Cai et al. [9] trained a graph isomorphism network, a type of GNN, to make predictions of porous media properties using Morse graphs extracted from porous media images.

While several methods have been used to predict the properties of porous media, it is important that they are scalable enough to handle representative samples. This work aims to solve this problem by training a GNN on representative pore networks extracted from the samples, coupled with some structure properties such as porosity, capable of generalised to new, unseen structures. The contents of this abstract and presentation are discussed in more detail by I’Anson et al. [10] (to be submitted for publication).

Methods

A summary of the development framework for producing a GNN to predict the permeability of porous media is shown in Figure 1.

Dataset Preparation

Training deep learning models to predict porous media properties typically requires thousands of samples [7]. However, creating a dataset based on real porous media samples is difficult because imaging techniques, such as X-ray tomography, are required. To overcome this, a dataset comprising randomly generated porous media was produced using fractal noise generated from PoreSpy. This allowed for realistic, binary structures with varying properties to be generated quickly when compared to the preparation of an experimental dataset with similar variance. Pore networks were extracted from the structures, providing information about the pore size and connectivity, and will be used to train the GNN.

The LBM was used to obtain the ground truth for the permeability of the porous media samples. The LBM was chosen because of its applicability to domains with complex geometries, such as porous media [11]. Flow was simulated through each structure and the resulting velocity and density fields were used to compute the permeability using Darcy’s law.

Performing the LBM simulations for the thousands of samples needed to train the GNN is infeasible due to the required computational costs. Therefore, a set of 250 ‘parent’ structures voxels in size were generated; the density and velocity fields were obtained for this set using the LBM and pore networks were extracted from each structure. Thousands of smaller, overlapping samples were extracted by sampling the voxel structure, the pore network, and the simulation results. A representative elementary volume (REV) scale analysis was performed on the structures based on the number of pores in the pore network, rather than the number of voxels in the structure. This leads to a scale-free metric for REV-scale, otherwise structures of varying pore size would require different REV-scale values. This led to a training dataset of around 250,000 representative samples which was used to train the GNN. Two additional independent datasets were generated from new ‘parent’ structures; one for validation during the hyperparameter selection and one for the final model testing.

Graph Neural Network

The GNN was developed and trained using the Python deep learning library PyTorch, which enables large models to be trained quickly. The GNN requires the pore network to be encoded into a feature matrix, which contains pore features such as pore volume and surface area, and the adjacency matrix which encodes each of the connections in the pore network. The GNN is split into two main sections: a set of message passing layers, and a set of fully connected layers. The message passing layers learn node embeddings from the feature matrix and the adjacency matrix. Following the message passing layers, the updated feature matrix is then flattened and passed to the fully connected layers, resulting in a single node prediction of the natural log of the permeability. The sample permeabilities span nearly five orders of magnitude, therefore predicting the log permeability allows samples with a large permeability to be weighted equally to samples with a low permeability during model training. The optimal hyperparameters for the GNN were found using the optimisation framework Optuna, which allowed the large hyperparameter space to be explored efficiently. The optimal model was then tested on a new set of structures and compared to a benchmark method, the Carman-Kozeny equation.

Results

Dataset Preparation

The LBM simulations were performed using a C++ LBM library, Palabos using a HPC cluster. The simulations took several hours to complete. Figure 2a and 2b shows a 2D slice of the density field in the direction of flow and the 3D velocity field obtained from the simulations. The structures had permeability values spanning several orders of magnitude, depending on porosity and pore size within the structures.

The maximum sized pore network in the dataset had over 8000 pores, but it was found that any sample with more than around 5000 pores in the pore network was an outlier, and therefore was removed from the dataset. The REV-scale analysis indicated that each sample structure needed a minimum of around 1500 pores in the pore network to be representative. This number is independent of the structure voxel count, porosity and permeability, allowing for a more consistent representative sample size for the GNN input. Most of the samples were within the range of 1500-5000 pores, leaving a large training dataset to be used for the GNN.

GNN Performance

The GNN with the optimal hyperparameters was trained for a total of 160 epochs on the training dataset. This was because the model performance on the testing dataset was not improving after 160 epochs, indicating the model was starting to overfit, lowering model generalisability. Figures 3a and 3b show the error plot during the training process and the parity plot showing a comparison of the LBM permeability and the predicted permeability for the training and testing datasets. To assess the performance of the GNN, the permeability was estimated using the Carman-Kozeny equation based on the porosity and the specific solid surface area. Figure 4 shows a comparison of the LBM to both the GNN and the Carman-Kozeny predictions. The GNN had a mean squared error (MSE) of 0.0373, compared to the Carman-Kozeny equation which had an MSE of 0.432 vs the LBM prediction.

Conclusions

In this work, a GNN was trained to predict the permeability of randomly generated, representative porous media samples. This method allows for rapid (near-real time) predictions of the permeability from 3D structure data. The REV-scale analysis indicated that the pore networks used to train the GNN should have at least 1500 pores, meaning structures of any size (in terms of voxels) could be passed to the GNN providing they contain enough pores. This is an important requirement for the model, as failure to be able to handle representative samples will lead to a less accurate model. The GNN was able to make near real-time and accurate predictions with a significantly lower MSE compared to the Carmen-Kozeny predictions when compared to the LBM simulations, which typically require hours to complete.

References

[1] Z. Niu et al., Energy Environ. Sci. 14, 2549 (2021).

[2] P. Kočí et al., Catal. Today 320, 165 (2019).

[3] A. Eshghinejadfard et al., Int. J. Heat Fluid Flow 62, 93 (2016).

[4] T. Yasuda et al., Chem. Eng. J. 420, 130069 (2021).

[5] A. Wagner et al., Transp. Porous Media 138, 1 (2021).

[6] Q. Xiong, T. G. Baychev, and A. P. Jivkov, J. Contam. Hydrol. 192, 101 (2016).

[7] H. Wang et al., Energy AI 2, 100035 (2020).

[8] H. J. Haugen and S. Bertoldi, in Characterization of Polymeric Biomaterials (Elsevier, 2017), pp. 21–53.

[9] C. Cai et al., Int. J. Multiscale Comput. Eng. (2021).

[10] J. I’Anson et al., (2024) (to be submitted).

[11] T. Krüger et al., in The Lattice Boltzmann Method: Principles and Practice (Springer International Publishing, Cham, 2017), pp. 31–58.