## Abstract

We present a method that combines a physics-informed deep neural network and Stokes' second problem to estimate the porosity and the permeability of a porous medium. Particularly, we investigate the accuracy of physics-informed deep neural networks in predicting the hidden quantities of interest, such as velocity and unknown parameters, including permeability and porosity, by employing different network architectures and different sizes of input data sets. The employed neural network is jointly trained to match the essential class of physical laws governing fluid motion in porous media (Darcy's law and mass conservation) and the fluid velocities in the domain or region of interest. Therefore, the described approach allows the estimation of hidden quantities of interest. This strategy conditions the neural network to honor physical principles. Thus, the model adapts to fit best the data provided while striving to respect the governing physical laws. Results show that the proposed approach achieves significant accuracy in estimating the velocity, permeability, and porosity of the media, even when the neural network is trained by a relatively small input data-set. Also, results demonstrate that using the optimal neural network architecture is indispensable to increase the porosity and permeability prediction accuracy.

## 1 Introduction

Porous media is a widely analyzed topic because of its significant role in many branches of science and engineering applications including water and chemical flow along with soil [1], estimate the subsurface contamination [2], glass-fiber wicks [3], carbon dioxide sequestration in underground flows [4] and geological carbon dioxide storage [5].

Permeability and porosity are complicated character of a porous medium to measure, and it is momentous to estimate them accurately. Porosity and permeability can be measured theoretically, experimentally with laboratory-based techniques, and numerically. Direct methods to measure porosity include: determining the volume of solid part by crushing sample and removing the pores after measuring the bulk volume [6], the mercury injection method [7], the gas expansion method [8], gas injection porosimetry method [9]. Also, numerous mathematical permeability models exist in the literature, including Kozeny–Carman model [6], Davies model [10], Chen model [11], Tomadakis and Robertson model [12], Berdichevski and Cai model [13], Gebart model [14], Bruschke and Advani model [15], etc. These models are based on analytical expressions that make several assumptions including (i) porous media is equal to a bundle of equal-length fibers [6], (ii) a perfect unit cell arrangement of fibers (e.g., square unit-cell) [15], (iii) a specific direction of flow toward the fibers (e.g., flow axial or transverse to parallel fibers) [14]. Numerical simulations are another efficient approach in determining the permeability of porous media. The capability of various numerical simulations is investigated and compared to experimental results in many works [16–18].

Stokes' problems refer to a particular case of fluid dynamics in which a flow field experiences the effect of a boundary condition in constant movement [19,20]. Stokes' second problem considers a fluid domain with a bottom plate moving with an oscillating velocity. These particular problems are not only theoretically important in the field of fluid dynamics but they are also observed in many engineering applications. For instance, they have been studied in many research fields under several conditions for various flows [21–30]. Blending the porous media problem and Stokes' second problem could result in improved comprehension of this widely applied topic (porous media) and may contribute to a better understanding and promotion of Stokes' second problem, leading to an increment in performance of some common systems [31–35].

In this study, we employed a physics-informed neural network (PI-DNN) to estimate the porosity and permeability of a porous medium using as a basis Stokes' second problem. Contrary to other deep machine-learning methods that do not guarantee accuracy and convergence with a small data regime, PI-DNNs with prior knowledge of physical laws, as well as laws that have been experimentally proven as a regulatory factor, have a reinforced data information content. [36] The physics terms in the loss function are the constraints which impose flow physics inside the flow domain and limit the domain of neural network predictions to a controllable size. Constraining the training algorithm to obey the flow physics allows lessening the amount of training data [37]. Furthermore, the data fidelity terms evaluate the agreement and minimize the gap between predicted velocity data and the input velocity data [38]. This content causes the algorithm to converge quickly toward the correct solution. This approach enabled us to predict permeability and porosity without considering the boundary conditions of the problem. We applied this method to assimilate velocity, porosity, and permeability with the input fluid velocities. To verify the validity of the proposed data-assimilation approach, results obtained with PI-DNNs were compared against analytical solutions and simulated results with ansys-fluent. Also, a phantom experiment tested the accuracy to estimate the porosity and permeability values. In this phantom experiment, PI-DNNs are used to generate fluid velocities with various reference porosity and porosity values (forward problem). Then the generated velocities are feed to PI-DNN to predict porosity and porosity values (inverse problem). The predicted porosity and permeability values were compared against reference values.

## 2 Description of the Forward Problem, Inverse Problem, and Structure of the Physics-Informed Neural Network

This section describes the models and conditions used to perform the prediction of the permeability and porosity using PI-DNNs. Section 2.1 describes the computational domain and boundary conditions related to Stoke's second problem. Section 2.2 shows the methods used to generate the data of the fluid velocities with forward and inverse problems. Section 2.3 gives details of the conditions used to solve the forward and inverse problems including the governing equations and the form of the residual losses in the training of the PI-DNN. Also, Sec. 2.3 gives details on the method used to perform the simulation in the simulation software ansys-fluent. Finally, Sec. 2.4 describes the structure of the PI-DNN including the inputs, outputs, number of layers, and the activation function.

### 2.1 Computational Domain and Boundary Conditions.

*ω*is the frequency and

*U*

_{0}is the amplitude of the plate velocity. The horizontal plate oscillates only in the

*x*-direction, which makes the fluid velocity change along the

*y*-direction only. The combination of Stokes' second problem and porous media has been previously adopted in several studies [32,33,39–41]. The effects of the initial conditions disappear after a few oscillations [42]. Therefore, the initial conditions can be neglected due to the assumption of the plate oscillating for a long period. The most general form of momentum balance equation for the Newtonian fluid flow through the isotropic porous media is as follow [43]:

*ε*,

*ρ*, $\u2329vf\u232a,\u2009\u2329pf\u232af$,

*μ*,

*K*,

*C*,

_{E}*Re*, and $\u2329bf\u232a$, respectively stand for the porosity, the fluid density, average velocity vector, pore-averaged pressure vector, the fluid dynamic viscosity, the permeability, Ergun constant, pore-level Reynolds number, and average body-force vector. Under the assumptions of a rigid and homogeneous porous medium with constant properties and negligible body forces [44], the Brinkman-Hazen-Dupuit-Darcy model [45] represents the general governing equations for a control volume via local volume averaging

_{p}*C*, respectively are the effective viscosity, and the inertia resistance factor. The effective viscosity and inertia resistance factor cannot be measured directly. However, there are models valid for all porous media, and these can relate these properties to measurable quantities [46]. Brinkman suggests that Einstein's formula can be used for effective viscosity in a highly porous medium

On the other hand, Ward [47] suggests that *C* can be mended by $CfK$ for an alternative form of the Brinkman-Hazen-Dupuit-Darcy model, where $Cf$ is often equal to 5.5.

### 2.2 Data Acquisition.

For the purposes of this study, we needed a dataset of fluid velocities that can be used as data fidelity to training a physics-informed neural network able to predict the unknown porosity and permeability. We decided to generate the input dataset of fluid velocities by employing a PI-DNN that considers the boundary conditions of Stokes' second problem as data fidelity and the Brinkman-Hazen-Dupuit-Darcy model as flow physics (forward problem).

In the next step, we employed a PI-DNN that considers the generated fluid velocities (from the forward problem) as data fidelity and the Brinkman-Hazen-Dupuit-Darcy model as flow physics (inverse problem). Figure 2 shows a flowchart of the methods used to solve the forward and inverse problems. The diagram at the top corresponds to the forward problem and indicates that the training of the PI-DNN is done with the velocity at all points inside the flow domain, which is resulted from prior knowledge on governing physics laws of flow, boundary conditions, and considering specific values of porosity and permeability (the output is the fluid velocities). The diagram at the bottom, which corresponds to the inverse problem, indicates that the PI-DNN is trained with the fluid velocities data (generated with the forward PI-DNN model) and enforcing the physics laws of flow by considering unknown porosity and permeability (outputs are the fluid velocities, the porosity, and the permeability).

### 2.3 Forward and Inverse Problems: Governing Equations and Estimation of Residual Losses for Training.

In the present study, both goals of generating data and predicting unknown porosity and permeability were achieved by minimizing the mean squared error of loss function and employing a fully connected, feed-forward PI-DNN with a hyperbolic tangent activation function. The mean squared loss function contains fidelity and physics loss terms. The mean squared fidelity loss term accounts for the boundary conditions in the forward problem and the fluid velocities in the inverse problem. Also, the mean squared physics loss function enforces the physical governing equations to the algorithm.

#### 2.3.1 Forward Problem: Obeying Governing Equations and Boundary Conditions With Known Parameters.

This section describes the methods used to solve the forward problem and the methods employed to perform the simulation in ansys-fluent for comparison purposes.

*f*(

*t*,

*y*). The mean squared error loss function to be minimized as part of the training of the PI-DNN, is expressed as

*MSE*, enforces the no-slip boundary condition on the oscillating plate and the zero velocity at infinity. The fidelity mean squared error loss is given by

_{f}where ${tpi,ypi}i=1Np$ corresponds to arbitrarily chosen spatio-temporal locations along the time and the flow domain regions, and $Np$ is the number of number of randomly sampled regularization points used to enforce Eq. (5) inside the solution domain. In Eqs. (8) and (9), $wi$ are the weights that balance out the magnitudes of each of the terms. The forward problem considered 5000 fidelity points ($Nf$) and 25,000 physics points ($Np$). The neural network consisted of five layers with 20 neurons per layer and, the Adam optimization algorithm was performed for 500,000 iterations.

For comparison purposes, the simulation of the Stokes' second problem in porous media was performed in the simulation software ansys-fluent. The simulation software was customized with user defined functions (UDFs) to account for the porous media effects and the boundary conditions. Also, a user-defined scalar (UDS) was adopted to model the Brinkman-Hazen-Dupuit-Darcy transport equation. The UDF DEFINE_UDS_UNSTEADY accounted for the effect of the porosity in the transient term, the UDF DEFINE_PROFILE defined the oscillating boundary condition, and the UDF DEFINE_SOURCE specified source terms to include the porous media effects. The discretization scheme QUICK was adopted to solve the UDS equation, and the convergence criterion in estimating the residual was set equal to 10^{– 6}.

#### 2.3.2 Inverse Problem: Estimating Porosity and Permeability.

The data fidelity loss term keeps the predicted data as close as possible to the resulting data from solving the forward problem, and it does not include any terms related to the boundary conditions. To approximate the velocity profile and to estimate the unknown parameters of porosity and permeability, we created a training data-set of fluid velocities by randomly sampling $Nf=10000,\u2009Nf=5000,\u2009Nf=1000,\u2009Nf=500$, and $Nf=50$ points from the results of the first step (forward problem), and used these as fidelity data. Increasing the number of fidelity data helps to improve the prediction; however, it may cause overfitting [48]. ${ufi}i=1Nf$ are the velocity values, corresponding to the randomly sampled collocation points, ${tfi,yfi}i=1Nf$. $Np=10,000$ randomly sampled collocation points, ${tpi,ypi}i=1Np$, were used to enforce Eq. (5) inside the solution domain. $wi$ are the weights that balance out the magnitudes of fidelity and physics loss terms.

### 2.4 Structure of the Physics-Informed Neural Network.

Based on the studies conducted by Raissi et al. [36,49,50], we propose physics-informed neural networks to achieve the objectives of both forward and inverse problems, which consider multiple unknown parameters embedded in the governing equations for the inverse problem. Figure 3 demonstrates the schematic diagram of the deep neural network used in this study. In the PI-DNN model, $\sigma =tanh()$ is the activation function and the bias is shown by the nodes with activation of 1. Also, each arrow represents an unknown weight which is calculated by training the neural network. The PI-DNN used to solve the forward problem takes the *y* coordinates of any location inside the flow domain at time equal to *t* and predicts the flow velocity at these spatial and temporal coordinates (*t*, *y*). The PI-DNN used to solve the inverse problem takes the *y* coordinates of any location inside the flow domain at time equal to *t*, and predicts the porosity and the permeability that best describe the input fluid velocity dataset used for training.

As illustrated in Fig. 3, the inverse PI-DNN considers the spatial and temporal locations (*y*, *t*) as inputs and the velocity at these locations *u*(*y*, *t*) as the output. The figure shows that such inputs and outputs are required to estimate the derivatives of *u*(*y*, *t*) respect *y* and *t*, using the neural network feature of back propagation or automatic differentiation. The inverse problem considers a governing equation with unknown permeability and porosity. Including a governing equation with unknown permeability and porosity in the minimization of the losses converts the training process into an optimization process. The inverse PI-DNN finds the permeability and porosity values that lead to a minimal loss value. Also, in the modeling with the inverse PI-DNN, it is not required to define a loss that directly relates to the permeability and porosity since these parameters are included in the governing equation and the corresponding minimizing loss.

We optimized all loss functions using the adaptive moment estimation (Adam) optimization algorithm, which is an extension of the stochastic gradient descent and a replacement optimization algorithm for the classic stochastic gradient descent procedure in deep-learning applications. Despite the classic stochastic gradient descent, the Adam optimization algorithm calculates individual adaptive learning rates for different network weights (parameters). [51] Adam combines the advantages of the adaptive gradient algorithm (AdaGrad) and the root-mean-square propagation (RMSProp) [51,52]. The network is derived by applying the chain rule for differentiating compositions of function using automatic differentiation, which is feasible because the derivatives of functions are known in the neural network [38,53]. We employed different architecture of the PI-DNNs (different number of layers with different number of neurons in each layer), and 400,000 iterations were performed for the Adam optimization algorithm for each PI-DNN.

## 3 Results

This section discusses the results of using PI-DNNs to solve the forward and the inverse Stokes' second problem. Section 3.1 shows a verification of the proposed technique of using PI-DNN to solve flow models of Stokes' second problem in a nonporous medium for which an analytical solution is known. Section 3.3 compares the fluid velocity profiles predicted by the PI-DNN and ansys-fluent for solving the forward Stokes' second problem. Section 3.4 shows the results of estimating the permeability and porosity with the inverse solution of the Stokes' second problem; this section, discusses the effect of the number of layers and neurons, the number of data fidelity points, and the effect of varying the permeability and the porosity values. Results assume water as the working fluid with a constant density of 998.2 $(kg/m3)$ and dynamic viscosity of $1.0\xd710\u22123$$(N.s/m2)$. The inverse problem considers porosity values of 0.1, 0.4, and 0.7, and permeability values of 0.1, 0.001, and 0.0001. the porosity values were defined based on the expected range of 0 to 1. The permeability values were defined on the basis of Emersleben's fiber theory from the typical pore diameters in commercial low-density foam metals [54]. The combination of these values of permeability and porosity captures an acceptable range of velocity fluid behaviors. The domain considered a time range of 0 to $4\u2009s$. Also, the frequency was defined as $\omega =\pi /4$$(rad/s)$ and the amplitude of the oscillating plate was set at $U0=1\u2009m/s$. We considered three cycles of oscillation to train the PI-DNNs of both forward and inverse problems, and the reported results correspond to the second cycle.

### 3.1 Verification of Proposed Approach That Employs Physics-Informed Neural Networks to Solve Stokes' Second Problem.

Figure 4 compares the velocity profiles resulting by using the PI-DNN approach to solve the partial differential equation and ansys-fluent simulation with the analytical solution of Navier–Stokes equation for Stokes' second problem. Figure 4(a) plots velocity profiles at different times. Figure 4(b) shows the scatter plot of the velocity distribution, simulated by ansys-fluent versus analytical solution, and Fig. 4(c) shows the comparison of the velocity distribution predicted by PI-DNN to the velocities obtained from the analytical solution. The straight solid line represents the ideal, in which the predicted velocities precisely match the reference. As can be seen in Figs. 4(b) and 4(c), both PI-DNN predictions and ansys-fluent simulations closely follow the ideal match line. Also, Fig. 4(a) evidences that the predicted velocity profiles satisfy both the no-slip boundary condition on the oscillating plate and the zero velocity boundary condition at the points with distance from the plate. Such that, at *y *=* *0, the fluid takes the oscillating velocity of the plate, and at *y* values larger than $8\u2009mm$, the fluid has zero velocity. Also, results show that the velocity profiles are given by the analytical solution, ansys-fluent simulation, and the PI-DNN model follow the same trend at different instances of time. The RMSE and coefficients of determination (R^{2}) of PI-DNN prediction, ansys-fluent simulation are listed in Table 1. The ansys-fluent simulation was done by employing adaptive mesh, with finer cells at the bottom boundary. We performed the simulation for 4000-time steps with the time-step size of $0.001\u2009s$. The total of 200 cells, with the maximum cell size of $0.5\u2009mm$ and the minimum cell size of $1.013\xd710\u22121\u2009mm$, were used and the residual convergence criteria were set to $10\u22127$. The predicted velocities by the PI-DNN are achieved using the same PI-DNN architecture and the same number of Adam optimizer iterations with the PI-DNN for solving the forward problem of the Stokes' second problem in a porous media.

### 3.2 Sensitivity Analysis.

Time and mesh sensitivity analyses were performed to identify the optimal time-step and number of computational cells in the numerical simulation. The sensitivity analyses considered simulations of oscillating plates with porous media effects were $\omega =\pi /4\u2009(rad/s),\u2009\epsilon =0.4,\u2009K=0.1\u2009(m2)$. The time steps were 10, 1, and 0.1 ms, and the number of computational cells along the *y*-axis was 20, 200, and 2000. Mesh was refined near the oscillating plate. The computational domain was 0.1 m height and 0.01 width. The time sensitivity analysis was done with 200 computational cells, and the grid sensitivity analysis was done with a 1 ms time-step. Figure 5 shows the results of the sensitivity analysis. Figure 5(a) shows the velocity variation at 4 s along the *y*-axis for a coarse time-step (10 ms), medium time-step (1 ms), and fine time-step (0.1 ms), and Fig. 5(b) shows the velocity variation at 0 s along the *y*-axis for a coarse grid (20 cells), medium grid (200 cells), and fine grid (2000 cells). Results in Fig. 5(a) indicate a small variation in the velocity profile when the time-step changes from 10 to 1 ms, and an almost null variation in the velocity profile when the time-step changes from 1 to 0.1 ms. Results in Fig. 5(b) show a significant variation in the velocity profile when the number of computational cells changes from 20 to 200, and an almost null variation in the velocity profile when the number of computational cells changes from 200 to 2000. These results indicate an optimal time-step of 0.1 ms and a grid of 200 cells; these optimal values were used to perform subsequent simulations. The requirement of only a few computational cells relates to the 1D nature of the problem with no fluid circulations.

### 3.3 Comparison of the Forward Problem Results Obtained From the Physics-Informed Neural Network and ansys-fluent.

Figure 6 demonstrates the predicted *u*(*t*, *y*) from solving Stokes' second problem in a porous media with a porosity of 0.4 and the permeability of $0.1\u2009(m2)$, using the PI-DNN and ansys-fluent simulation. Figure 6(a) plots the obtained velocity profiles at different times, and Fig. 6(b) compares the distribution of the predicted velocities by PI-DNN with ansys-fluent simulated velocities. The straight solid line indicates the perfect match. A comparison between the velocity trends in Fig. 4(a) and the velocity trend in Fig. 6(a) shows that the porosity and permeability affect the length of the influence region of the oscillating plate (compare the values of the y-axis in Fig. 6(a) with those in Fig. 4(a)). The influence region has increased from 10 to $25\u2009mm$. The increase in the influence region is due to the high permeability value of $0.1\u2009m2$ used in the present work. As apparent in this figure, the predicted velocity profiles follow the same pattern at different time steps, and the difference between predicted velocity profiles is minimal. The similarity between the velocity predictions can be seen more clearly in Fig. 6(b), where the PI-DNN prediction scatter plot has a low deviation from the perfect match line. RMSE and coefficients of determination of predicted velocities in modeling forward problem by implementing PI-DNN, considering velocities given by ansys-fluent simulation as references, are, respectively, 0.02790 and 0.98442. These values indicate the similarity of the predicted velocities by the PI-DNN and ansys-fluent. The minor difference between the two predictions might be related to the different numerical approaches that the PI-DNN and ansys-fluent have for solving the partial differential equations.

### 3.4 Result of Inverse Problem: Estimating Porosity and Permeability.

This section presents the results of the predicted porosity, permeability, and fluid velocities given by the inverse problem.

Figure 7 displays the results of *u*(*t*, *y*) for solving Stokes' second problem in a porous media without indicating values of porosity and permeability, and compares the predicted fluid velocities to the input velocity data. Figure 7(a) shows the velocity profiles at different times, and Fig. 7(b) plots the velocity distributions as a scatter plot. It is evident in a comparison between the velocity results obtained from solving the inverse and the forward problem that the PI-DNN accurately predicted the velocity profiles. RMSE and coefficients of determination of 0.0004 and 0.99999, respectively, are achieved in predicting the velocities by PI-DNN for the inverse problem. Achieved values indicate a close agreement between the predicted velocities and the reference velocities. This agreement is also evident in Fig. 7(b), where the PI-DNN prediction scatter plot precisely follows the perfect match line with an insignificant scatter.

In our study, the results of 0.400114 and 0.102650 were achieved, respectively, for the porosity and the permeability, by employing a PI-DNN with 4 layers and 20 neurons per each layer and using 10,000 fidelity points for training the network (the predicted values are close to the values used to solve the forward problem 0.4 for porosity and 0.1 for permeability). The errors in estimating porosity and permeability are, respectively, 0.028% and 2.65%. These results were plotted after running the Adam optimizer for 400,000 iterations and achieving the total loss value of $9.192\xd710\u22127$. These results demonstrate that PI-DNNs can predict the unknown parameters of porosity and permeability with high accuracy.

It is worth to mention that selecting the best neural network architecture (number of layers and number of neuron) is an important factor to achieve accurate predictions of the permeability and porosity. To observe the effect of different neural network structures on results and the capability of the network in estimating the parameters with having different number of unknown parameters in the governing equation, we repeated the simulation for different cases. We employed PI-DNNs with different number of layers as well as different number of neurons to compare the results of different network architectures for estimating the porosity and the permeability as unknown parameters of the governing partial differential equation, and to discover the effect of using more or less layers/neurons. 10,000 fidelity and physics points were used to conduct the analysis. Table 2 shows the obtained results for PI-DNNs with different number of layers and 20 neurons per each layer.

PI-DNN architecture | Pred. ε (rel. error) | Pred. K (rel. error) | Total loss |
---|---|---|---|

3 Layers, 20 Neurons each | 4003.28 × 10^{−4} (0.082%) | 1073.59 × 10^{−4} (7.359%) | 2.397 × 10^{−6} |

4 Layers, 20 Neurons each | 4001.14 × 10^{−4} (0.028%) | 1026.50 × 10^{−4} (2.65%) | 9.192 × 10^{−7} |

5 Layers, 20 Neurons each | 3998.39 × 10^{−4} (0.040%) | 1012.78 × 10^{−4} (1.278%) | 1.259 × 10^{−6} |

PI-DNN architecture | Pred. ε (rel. error) | Pred. K (rel. error) | Total loss |
---|---|---|---|

3 Layers, 20 Neurons each | 4003.28 × 10^{−4} (0.082%) | 1073.59 × 10^{−4} (7.359%) | 2.397 × 10^{−6} |

4 Layers, 20 Neurons each | 4001.14 × 10^{−4} (0.028%) | 1026.50 × 10^{−4} (2.65%) | 9.192 × 10^{−7} |

5 Layers, 20 Neurons each | 3998.39 × 10^{−4} (0.040%) | 1012.78 × 10^{−4} (1.278%) | 1.259 × 10^{−6} |

Results in Table 2 indicate that the number of layers plays an essential role in predicting the permeability; results indicate that the relative error in the permeability decreases from 7.3% with three layers to 1.27% with five layers. Also, results show that the relative error of porosity prediction increases comparing achieved results by employing a PI-DNN with five hidden layers to a PI-DNN with four hidden layers. These results show that PI-DNNs with a different number of layers can accurately estimate the porosity (the maximum relative error with only three layers is only 0.082%).

Table 3 evaluates the effect of the number of neurons in the prediction of the output parameters. Results show that having more neurons in each layer leads to a smaller relative error in the prediction of the porosity. The PI-DNN with 10 neurons per hidden layer predicts the porosity with a 0.65% relative error and the PI-DNN with 50 neurons per hidden layer predicts the porosity with a 0.012% relative error. However, results show that the number of neurons in the hidden layers has a stronger influence in the prediction of the permeability. Table 3 shows that increasing the number of neurons in each hidden layer leads to a significant increase in the accuracy of the permeability prediction. The relative error in estimating the permeability decreased from 97.2% with 10 neurons to 3.9% with 50 neurons per each hidden layer. Nevertheless, the relative error in prediction of the permeability, predicted by a PI-DNN with 4 layers and 20 neurons per layer, is 2.65% (see results in Table 2). These results show the existence of an optimal number of hidden layers and neurons. The identification of this optimal PI-DNN structure may be crucial to achieve a high level of accuracy in the prediction of the output parameters and to avoid the under-fitting and over-fitting issues.

PI-DNN architecture | Pred. ε (rel. error) | Pred. K (rel. error) | Total loss |
---|---|---|---|

4 Layers, 10 Neurons each | 4025.98 × 10^{−4} (0.649%) | 1972.37 × 10^{−4} (97.237%) | 2.365 × 10^{−5} |

4 Layers, 30 Neurons each | 4001.70 × 10^{−4} (0.042%) | 1058.03 × 10^{−4} (5.803%) | 3.556 × 10^{−6} |

4 Layers, 50 Neurons each | 4000.47 × 10^{−4} (0.012%) | 1038.99 × 10^{−4} (3.889%) | 1.259 × 10^{−6} |

PI-DNN architecture | Pred. ε (rel. error) | Pred. K (rel. error) | Total loss |
---|---|---|---|

4 Layers, 10 Neurons each | 4025.98 × 10^{−4} (0.649%) | 1972.37 × 10^{−4} (97.237%) | 2.365 × 10^{−5} |

4 Layers, 30 Neurons each | 4001.70 × 10^{−4} (0.042%) | 1058.03 × 10^{−4} (5.803%) | 3.556 × 10^{−6} |

4 Layers, 50 Neurons each | 4000.47 × 10^{−4} (0.012%) | 1038.99 × 10^{−4} (3.889%) | 1.259 × 10^{−6} |

In order to evaluate the ability of our PI-DNN to predict the unknown parameters of the porosity and the permeability, using different sizes of input dataset as fidelity points, we repeated the training of the PI-DNN for 50, 500, 1000, and 5000 fidelity points, by employing 4 layers and 20 neurons per each layer. Table 4 lists the achieved results for using different fidelity points (input velocity dataset).

Number of fidelity points | Pred. ε (rel. error) | Pred. K (rel. error) | Total loss |
---|---|---|---|

10,000 | 4001.14 × 10^{−4} (0.028%) | 1026.50 × 10^{−4} (2.65%) | 9.192 × 10^{−7} |

5000 | 3999.09 × 10^{−4} (0.023%) | 1022.94 × 10^{−4} (2.294%) | 1.387 × 10^{−6} |

1000 | 4006.15 × 10^{−4} (0.154%) | 1095.61 × 10^{−4} (9.561%) | 1.784 × 10^{−6} |

500 | 3991.15 × 10^{−4} (0.221%) | 1324.47 × 10^{−4} (32.447%) | 4.118 × 10^{−5} |

50 | 4120.33 × 10^{−4} (3.008%) | 1853.08 × 10^{−4} (85.308%) | 1.365 × 10^{−7} |

Number of fidelity points | Pred. ε (rel. error) | Pred. K (rel. error) | Total loss |
---|---|---|---|

10,000 | 4001.14 × 10^{−4} (0.028%) | 1026.50 × 10^{−4} (2.65%) | 9.192 × 10^{−7} |

5000 | 3999.09 × 10^{−4} (0.023%) | 1022.94 × 10^{−4} (2.294%) | 1.387 × 10^{−6} |

1000 | 4006.15 × 10^{−4} (0.154%) | 1095.61 × 10^{−4} (9.561%) | 1.784 × 10^{−6} |

500 | 3991.15 × 10^{−4} (0.221%) | 1324.47 × 10^{−4} (32.447%) | 4.118 × 10^{−5} |

50 | 4120.33 × 10^{−4} (3.008%) | 1853.08 × 10^{−4} (85.308%) | 1.365 × 10^{−7} |

From comparing the error of estimation of porosity or permeability, we observe that the PI-DNN can predict the porosity with a low relative error, even if the training is done with a small number of flow velocity data points input (3.01% for a PI-DNN trained by only 50 fidelity points). However, the effect of using fewer fidelity points reflects in the prediction of permeability. The relative error in estimating the permeability increases when a small size of the velocity dataset is employed. This number is 2.65% for a PI-DNN trained by 10,000 fidelity points and increases to 85.31% when 50 fidelity points are used.

The estimated velocity profile at $t=3\u2009s$, by PI-DNNs with 4 layers and 20 neurons per layer, using different number of fidelity points are demonstrated in Fig. 8. As it is apparent from the visual comparison of the estimated velocity profiles at $t=3\u2009s$, PI-DNNs can accurately predict the velocity profiles, even training by a small velocity input dataset. It can be seen in Fig. 8 that a PI-DNN, which is trained only with 50 fidelity points, accurately predicts the velocity profile.

Table 5 shows the performance of the PI-DNN to predict different values of porosity and permeability with four hidden layers and 20 neurons per each layer, for different input fluid velocities. The input dataset for each training of the PI-DNN is the results of solving the forward problem by employing 5 hidden layers and 20 neurons per layer for different input values of porosity and permeability in Eq. (5) as the physics term in the loss function. As it is clear in these results, the error of porosity and permeability predictions increases when the input data is generated with greater porosity values and smaller permeability values. Porosity and permeability represent the main factors that strongly influence the velocity trends. As the permeability decreases and the porosity increases, the amount of flow which is affected by the oscillating boundary conditions (influence region) dwindles in the same space domain, and the velocity profiles swiftly converge to zero velocity. This condition results in an emerging larger number of zero velocity in the input dataset which is used as training data in the inverse problem, which leads the neural net to get biased on zero velocity inputs and impact the error of prediction of unknown parameters. Nevertheless, the prediction error of porosity drops below 0.015% and the prediction error of permeability drops below 0.56%, for the smaller porosity values ($\epsilon =0.1$) and the larger permeability values (*K *=* *0.1) in the same space domain. For the training of the inverse PI-DNN the data does not take into account noise coming from the experiments. Adding noise requires modifying the inverse PI-DNN with convolutional layers that consider noise filters.

Exact values of ε and K | Pred. ε (rel. error) | Pred. K (rel. error) | Total loss |
---|---|---|---|

ε = 0.1, K = 0.1 | 999.95 × 10^{−4} (0.015%) | 1005.59 × 10^{−4} (0.559%) | 6.308 × 10^{−8} |

ε = 0.7, K = 0.1 | 7035.14 × 10^{−4} (0.502%) | 1302.17 × 10^{−4} (30.217%) | 9.901 × 10^{−6} |

ε = 0.1, K = 0.01 | 999.85 × 10^{−4} (0.015%) | 100.49 × 10^{−4} (0.49%) | 1.714 × 10^{−7} |

ε = 0.4, K = 0.01 | 4005.93 × 10^{−4} (0.148%) | 106.31 × 10^{−4} (1.0%) | 8.245 × 10^{−6} |

ε = 0.1, K = 0.001 | 1000.64 × 10^{−4} (0.064%) | 10.11 × 10^{−4} (1.1%) | 7.962 × 10^{−7} |

ε = 0.4, K = 0.001 | 4175.49 × 10^{−4} (4.387%) | 14.30 × 10^{−4} (43.0%) | 8.195 × 10^{−6} |

Exact values of ε and K | Pred. ε (rel. error) | Pred. K (rel. error) | Total loss |
---|---|---|---|

ε = 0.1, K = 0.1 | 999.95 × 10^{−4} (0.015%) | 1005.59 × 10^{−4} (0.559%) | 6.308 × 10^{−8} |

ε = 0.7, K = 0.1 | 7035.14 × 10^{−4} (0.502%) | 1302.17 × 10^{−4} (30.217%) | 9.901 × 10^{−6} |

ε = 0.1, K = 0.01 | 999.85 × 10^{−4} (0.015%) | 100.49 × 10^{−4} (0.49%) | 1.714 × 10^{−7} |

ε = 0.4, K = 0.01 | 4005.93 × 10^{−4} (0.148%) | 106.31 × 10^{−4} (1.0%) | 8.245 × 10^{−6} |

ε = 0.1, K = 0.001 | 1000.64 × 10^{−4} (0.064%) | 10.11 × 10^{−4} (1.1%) | 7.962 × 10^{−7} |

ε = 0.4, K = 0.001 | 4175.49 × 10^{−4} (4.387%) | 14.30 × 10^{−4} (43.0%) | 8.195 × 10^{−6} |

## 4 Conclusions

This study presents a PI-DNN approach for data assimilation for estimating the porosity and permeability of a porous medium in Stokes' second problem. In this approach, all the parameters of the PI-DNN are jointly trained by minimizing the loss function, which contains the fluid velocities data and the associated governing partial-differential equation (Brinkman-Hazen-Dupuit-Darcy equation). The first part of the study revealed that PI-DNNs can be used efficiently to solve the governing partial-differential equations of transport in porous media by minimizing a loss function consisting of boundary conditions, as well as underlying governing physical laws. The second part demonstrated that PI-DNNs can predict the porosity, permeability, velocity, and other quantities of interest highly accurately without taking any specific boundary conditions into consideration, even when using relatively little input data of fluid velocities.

The comparison of PI-DNNs against analytical solutions and ansys-fluent results indicated that the PI-DNNs can efficiently solve the transport governing partial-differential equations. PI-DNNs do not require discretization schemes and accurately predict permeability and porosity without making assumptions related to the porous media structure. Also, results indicated that the architecture of the PI-DNN has a marginal impact on the porosity prediction. The relative error slightly changed from 0.082% to 0.04% by increasing the number of layers from 3 to 5; similarly, the error changed from 0.649% to 0.012% by increasing the number of neurons from 10 to 50. Moreover, results have shown that the number of layers and neurons used for training plays a primary role in permeability prediction. Results revealed relative errors of 97% with 10 neurons and 4 layers and 7% with 20 neurons and 3 layers. Moreover, the study gave evidence of an optimal number of layers and neurons that lead to the lowest relative errors of 0.012% in predicting the porosity and 1.278% in predicting permeability. The results in the present study demonstrate that PI-DNNs can effectively predict the values of multiple intrinsic parameters (or properties) simultaneously by using data of the flow transport variations and the physics governing equations as part of its training.

## Nomenclature

*C*=inertial resistance factor (m

^{−1})*C*=_{E}Ergun constant

*K*=permeability (m

^{2})*MSE*=mean square loss function

- $MSEf$ =
fidelity mean square loss function

- $MSEp$ =
physics mean square loss function

- $Nf$ =
number of fidelity points

- $Np$ =
number of physics regularization points

*Re*=_{p}pore-level Reynolds number

*t*=time (s)

- u =
fluid flow velocity (m s

^{−1}) *U*_{0}=maximum velocity of the plate (m s

^{−1})- $wi$ =
weights of fidelity and physics loss functions

- $\u2329bf\u232a$ =
average body-force

- $\u2329pf\u232af$ =
pore-averaged pressure vector

- $\u2329vf\u232a$ =
average velocity vector

*ε*=porosity

*μ*=fluid dynamic viscosity (kg s m

^{−2})*ρ*=density (kg m

^{−3})*σ*=activation function

*ω*=frequency (rad s)

- $\mu eff$ =
effective viscosity (kg s m

^{−2}) - $\mu w$ =
dynamic viscosity of water (kg s m

^{−2}) - $\rho w$ =
density of water (kg m

^{−3})

## References

_{2}Storage Conditions: Petrographical and Chemical Evidence