^{*}

In this article, a physics aware deep learning model is introduced for multiphase flow problems. The deep learning model is shown to be capable of capturing complex physics phenomena such as saturation front, which is even challenging for numerical solvers due to the instability. We display the preciseness of the solution domain delivered by deep learning models and the low cost of deploying this model for complex physics problems, showing the versatile character of this method and bringing it to new areas. This will require more allocation points and more careful design of the deep learning model architectures and residual neural network can be a potential candidate.

Physics problems are usually expressed in a succinct way by partial differential equations (PDEs). The study of many physics phenomena and the forecast of physics dynamics require solving those expressed PDEs with the specified initial and boundary conditions. This procedure is conventionally conducted by implementing different numerical methods such as central difference in space dimension [

The recent advance of deep learning technologies provides a potential alternative for researchers to obtain a quick understanding of the investigated physics problems. Those methods are developed to solve the PDES describing physics rules based on deep learning and avoid the need of numerical implementation. Those studies on the domains referred as physics informed neural network (PINN).

Khoo et al. [

Moreover, the theories of physics informed network have been extended on the discrete domains: Gao et al. [

In this study, we are particularly interested in investigating the applicability of PINNs on practical yet complex multi-phase flow problems. Despite the claimed success of PINNs on solving PDEs, the investigated PDES problems in existing literature are all simple, weakly coupled PDEs with relatively low nonlinearities. As far as we are concerned, no research has been conducted on the application of PINN for complex coupled flow problems.

In order to investigate the applicability of PINNs on practical yet complex multi-phase flow problems, the paper will proceed as follows. In Section 2, we present the model to the underground water physics problem, and how specifically our neural network model works. In Section 3, the general setup of the neural network, the data obtainment, and the process hyper-parameter tweaking. The results are presented in Section 3 and further insight and work in Section 4.

In this study, we are interested in a multi-phase flow system. The study of multi-phase flow problems is an important key to understand the subsurface flow phenomenon that are common in aquifers, oil, and gas reservoirs, as well as many CO_{2} sequestration fields. Specifically, here, we set up a two-phase oil water system described by two mass conservation equations:

− ∇ ⋅ ( ρ o u o ) − q o = ∂ ∂ t ( φ ρ o S o ) , for oil, (1)

And

− ∇ ⋅ ( ρ w u w ) − q w = ∂ ∂ t ( φ ρ w S w ) , for water, (2)

Here ∇ is the Laplace operator which calculates the divergence of gradient, ρ is the phase density, q is the source/sink term, φ is the rock porosity, S is the phase saturation which describes the proportion of the current phase in the porous media, and u is the phase velocity respectively and can be computed by Darcy’s law:

u j = − k k r j ( S j ) μ j ( ∇ p j − ρ j g ∇ z ) , j = o , w (3)

where k is the rock permeability that describes the rock capacity to transport fluids and k r j is the relative permeability that describes the additional capacity of the porous media to transport fluid with phase j, μ j is the viscosity of phase j, p j is the pressure, and ∇ z quantifies the depth change.

Pressure p and saturation S are the key variables that can describe the multi-phase flow dynamics and two extra equations are added here to conclude the mass conservation equations. First, the saturation of different phases ( S o represents the saturation of oil, S w represents the saturation of water) sums to be 1, i.e.,

S o + S w = 1 (4)

and the pressure of different phases ( p o represents the pressure of oil, p w represents the pressure of water) is constrained by capillary pressure P c which can be usually assumed to be 0:

p o − p w = P c ≈ 0 (5)

Traditionally, the above mass conservation equations are closed by saturation and pressure constraints are solved by numerical methods on meshed grids. In this study, we will investigate the deep learning methods for the above two-phase flow problems in a one-dimensional scenario.

Machine learning has had a splendid leap in the past few years, while deep learning, a sub-field of machine learning, has gradually reformed and enhanced the study of many research areas, including natural language processing and computer vision [

In a neural network, there are many neuron layers with neurons filled on each layer. The nonlinear activation functions applied on the matrix computation between adjacent layers result in a good approximation of complex nonlinear functions after combination of many connected layers. The Fully Connected Network (FCN), also named as multi-layer perceptron (MLP), is the most prominent architecture of this kind.

x l + 1 = f ( W l T x l + b l ) , (6)

where x l is the neuron values and b l is the bias at layer l, and f is the nonlinear activation function. There are many activation functions, the most prominent of which are sigmoid [

On the low level of the mechanics of FCN, the weights are calculated using a loss function (a metric quantifying the difference between the target data and the neural network’s output) and back propagation. In this process, the lost function is minimized using an optimizer: a stochastic mini-batch gradient decent [

The core idea of utilizing deep learning on approximating PDE solutions is formulating the PDE residuals, as well as the initial and boundary conditions as the training loss. The objective of training deep neural network models is minimizing the defined loss by back-propagation [

Code Block 1. Neural network.

Furthermore, to guide the constructed FCN to learn solving the target PDEs, the PDEs, along with its initial and boundary conditions, is reformulated in the residual form and treated as the training loss. The derivative terms in the PDE formulations are approximated by the gradient of the FCN output (p and S) with respect to the FCN input (x and t) and are computed by chain rule. We consider incompressible (fluid density is not a function of pressure) two phase flows and assume that the capillary pressure is 0. We also consider highly nonlinear problems with relative permeability defined as a nonlinear function of water saturation S_{w}. Viscosities of both oil and water are constant, and the absolute permeability k is assumed to be constant in this case. The code block below describes the formulation of PDE residuals using tensorflow, where “residuals” defines the two PDE residuals for mass conservation equations of two phase fluid (Equations (1) and (2)). (Code Block 2)

And the training objective will be the combination of three loss terms: mass conservation residuals, initial condition loss and boundary condition loss. The implementation of those losses can be as simple as what is shown in the code chunk. (Code Block 3)

In this section, we describe the detailed problem we are solving, data retrieving and model setup.

The specific problem studied here is a water displacing oil problem in a one-dimensional tube filled with oil in the initial state, where water is injected from the left side of the tube to displace oil out of the tube, due to the immiscibility of those two phases.

As shown in

Code Block 2. Neural network for PDE residual.

Code Block 3. Loss function.

0.6, meaning water fraction is 60% while oil fraction is 40% in the injected water phase, and the water saturation in the oil phase is 0.3, meaning that water fraction is 30% and oil fraction is 70% in the oil phase. Furthermore, we assume that the tube is filled up with oil phase, meaning that the initial water saturation in the tube is 0.3.

With Equations (1)-(3), the relative permeability of different phases is the square of the corresponding saturation. More implementation’s details can be referred to code block 2.

To prepare the data for the introduced deep learning model, we generate the data on the initial and boundary conditions as well as allocation points, which are the meshed data points in the domain of space and time. The one-dimension space and time are meshed with 500 and 200 grids respectively and therefore, we have 500 × 200 = 100,000 allocation points in total. Only the mass balance equation loss is enforced on those allocation points, meaning that the solved pressure and saturation should follow the mass balance equations at any of those allocation points. Meanwhile, on the boundary (space) locations and initial time, the solved pressure and saturation should also follow those constraints. It is worth noting that except for boundary and initial conditions where pressure (or the pressure gradient) and saturation have to follow the specified values, all the data are essentially just meshed grids over the space and time domain.

The model takes about 200 seconds to converge on a single K80 GPU for this 1D problem with 100,000 allocation points. The solution domain is presented in

Meanwhile, the pressure domain solution is displayed in

In

In this study, we introduce the PDE is aware deep learning models for complex coupled multiphase flow problems. The fundamentals are formulating the governing PDEs, as well as initial and boundary conditions, into the training objective of the deep learning models, which can guide the deep learning models to find the physics pattern behind the governing PDEs and deliver the PDE solution over the interesting domain. The introduced deep learning model is a fully connected neural network with input as the PDE variables such as space x and time t and output such as the PDE solution at that specific x and t. In this way, the trained PDE aware deep learning model can effectively solve the coupled PDEs and deliver reasonable solutions. The PDE aware deep learning model provides an effective method for researchers in various physics field to quickly evaluate PDE solutions of the problems that they are interested in without the need to access expensive numerical solvers, which can be a potential and useful tool to fill the gap between expensive commercial software tools and research groups with limited funding.

For future work, we will consider more complex multiphase problems with compressible fluid and extend it to 2D space domains. This will require more allocation points and more careful design of the deep learning model architectures and residual neural network can be a potential candidate. Moreover, it will also be interesting to combine with physics experiment data to invert the solid and fluid properties in the multiphase flow governing equations.

After learning differential equations and realizing that some of the equations couldn’t be solved numerically while the solution pattern is random, I started to think of a way to solve those equations in a common way. Later reading the papers on this topic and more about neural network, I learned the idea of using neural network and then applied it to a problem that no one had applied before.

I want to thank my school math and physics teacher Dr. Ryan Grove, who introduced me to the thoughts of deep learning and provided me a chance to study python library such as matplotlib and numpy, which are crucial in my research. He also guided me through differential equations in math class and encourages me to code solutions for unsolvable equations. In research paper, he advised me and proofread my research paper, which is entirely written on my own.

The open-sourced python libraries, such as numpy and matplotlib, are also crucial to this project. I want to thank all the contributors and the community, which not only provide substantial help to coders and also showed me the importance of community and collaboration, and also the open spirit of geek to help the world generously.

I also want to express my gratitude to the Yau High School Science Award which provides me a chance to discover my interested topics. My biggest interest is math, physics and computer science, where I learned who to view this world rationally and solved interesting problems. When learning the Laplace transform in differential equation and the concept of convectional neural network, I was fascinated by those works of art by scientists and resolve to do such contribution, starting from doing research here. When seeing the beautiful equations in AP Physics C mechanics, such as the linear momentum and also the circuits ones in AP Physics Electricity and Magnetism, I realized the beauty of this world and wanted to solve those equations.

Finally, it is never enough to fully express my thanks and love to my teacher Dr. Grove and my parents, who supported me on this route of discovery!

The author declares no conflicts of interest regarding the publication of this paper.

Lin, Z.P. (2021) Physics-Aware Deep Learning on Multiphase Flow Problems. Communications and Network, 13, 1-11. https://doi.org/10.4236/cn.2021.131001