1. Introduction
A feature of unsteady flow problems is a description of hydrodynamic processes by a system of partial differential equations (PDEs). The numerical solution of such systems involves the application of complex integration methods, even for the one-dimensional case [
1,
2]. Accounting for the flow multidimensionality, the multiphase nature of the filtered fluids and the necessity of phase interaction considerations (taking into account the ongoing phase transitions and chemical reactions) significantly complicates the system [
3]. Paper [
4] provides an extensive overview of modern approaches to integrating systems of PDEs, including describing fluid flow in porous media with mass flows between phases. In classical approaches to integrating nonlinear systems, the finite difference method, the finite element method, the finite volume method and their various modifications are applied to solve both direct and inverse problems. As a rule, high-resolution structured grids are applied in calculations, which leads to a large amount of calculations. The construction of non-structured grids, for example, based on Voronoy diagrams, allows for a more detailed consideration of the flow geometry and increases the accuracy of calculations; however, they require the construction of special algorithms and do not eliminate the problem of the large amount of calculations [
5,
6].
Hydrodynamic modeling aims to solve the direct problem of non-steady fluid flow with specified reservoir properties (porosity, permeability and the physical properties of saturated reservoir phases) based on the data obtained from geological studies and well exploration analyses. The main goal is to obtain the time dependencies of the flow process parameters (density, viscosity, pressure, temperature, etc.).
To predict further reserve recovery developments (which last for decades in some fields), it is necessary to adjust the input data sets, determining the properties of the simulated saturated reservoir system at all stages of deposit development. In practice, this process is carried out by conducting well hydrodynamic studies and determining the current reservoir properties by analyzing changes in the pressure and temperature sensors obtained from sensors during start/stop of the well. Mathematically, the flow theory inverse problem solution is considered, which could be carried out in three ways. The classical (first) approach includes an iterative way to solve a conservation equation system written in finite-difference form with the initial and boundary conditions [
7,
8]. The main disadvantage of this method is that it uses large amounts of computing resources, especially for multidimensional flows.
The second approach applies basic machine learning (ML) algorithms. It is based on the analysis of the variety of direct problem solutions. In fact, it is similar to the approach of choosing a “suitable” solution within the hydrodynamic function domain based on “expert” assessments of previous options. The problem is solved by minimizing the quality functional between the defined and given parameters (hydrodynamic, filtration, capacitive), for example, according to the least squares criterion [
9]. The significant disadvantage of ML algorithm implementation is the availability of a substantial “training” data set (actual data or previously obtained solutions). This is impossible at the initial stage of a field development or during modification of an already existing field development scheme. Furthermore, when the details of the layer are not fully understood, error variance may arise, and its magnitude is strongly influenced by the choice of the deviation functional, the training data set content, and the choice of “expert” constraints.
The third method proposed in [
4,
10] is the physics-informed neural network (PINN), which considers (opposite to ML) the physics of the process, since the loss function contains a form of differential equations (for example, mass, momentum and energy conservation laws). The advantage of PINN application to non-steady flow problems is the uniformity of the algorithm when applied to numerical simulations of direct and inverse problems.
At the moment, there are many approaches based on the PINN concept. For example, there are variational PINNs (hp-VPINNs) [
11], which use a variational concept to construct the loss functional, and conservative PINNs [
12], where additional terms to the loss function are included, “penalizing” for the failure of the basic conservation laws. A conservative PINN is capable of increasing the accuracy of the solution, but it is only applicable to certain types of systems (conservation laws). In [
13], the X-PINN model was proposed, which expands the applicability of conservative PINNs by overcoming the equation type limitations. The authors of [
14] propose applying an adaptable algorithm for generating a training data set to improve the accuracy of such models. They consider the distribution of errors (according to the loss function) and increase the data set size in the vicinity of large errors. Since the initial data of the problem often contain some noise (a recognized fact in oil and gas problems), it is proposed to apply a Bayesian physics-informed neural network (B-PINN) to obtain more accurate solutions [
15]. Improving the accuracy of the solution is achieved due to their ability to avoid overtraining.
PINN algorithms have been successfully applied to solve practical problems in fluid mechanics, including in porous media. For example, in [
16], the problems of shock wave propagation are considered, which are popular in computational mechanics. In [
17], a PINN is applied to consider the classical formulation of two-phase flow according to Darcy’s law [
18] with the application of convolutional physics-informed neural networks. It is difficult to consistently solve a set of different equations using PINNs, as for each equation, it is necessary to manually redefine various program blocks (for example, the loss function). However, solvers for PINN automation are already being developed [
19,
20].
In most of the current tasks for developing hard-to-recover hydrocarbon reserves, it is important to consider the rheological properties of the fluids. Therefore, the PDE system becomes nonlinear. In this paper, the possibility of using PINN-based methods to obtain flow problem solutions which consider the description of the nonlinearities of the viscous properties of fluids is analyzed.
This paper is organized as follows: In
Section 2, the mathematical formulation of the proposed algorithm for solving the considered equation system type is consistently presented.
Section 3 contains the results of the formulated error function application to solving problems of nonlinear liquid filtration in a porous medium, validated by comparing the calculations with data obtained from one-dimensional physical experiments of two characteristic sizes of the analyzed object: several centimeters, using the example of core samples (
Section 3.1), and hundreds of meters, based on field measurements of indicators at a well (
Section 3.2).
2. Mathematical Approach
In parameterized model applications for solving differential equations, the solution obtaining problem is reduced to the minimization problem. Consider a differential equation depending on
p independent variables
written in operator mode and defined on domain
with boundaries
:
In Equation (
1), the differential operator
L, boundary operator
b and random functions
f and
g are known and hence the boundary value problem is correct. The problem of obtaining Equation (
1)’s solution using the Cauchy–Schwarz equation is reduced to the minimization problem [
20]:
Here, D is the Sobolev space induced from the space of basis functions with compact support.
In the next step, it is necessary to move from the analytical formulation of the minimization problem to the numerical one. Most numerical methods assume that the solution field is in a finite discrete subset of
in the form of a grid function (for simplicity and without generality loss, consider the case of
). Further, for an equation depending on two variables, the following functional representation is defined:
Without generality loss, we assume that the discretization of the field
is fixed in the process of solving the differential equation. The minimization problem of finding the solution field of Equation (
1) can be formulated as:
As a rule,
norms are applied in the implementation of this approach. However, it can be assumed that the solution of the equation can be more accurate when the norms associated with the original Sobolev space are applied. The parameters
and
act as regularization coefficients, and can be both functions and constant coefficients. In [
21], it is proposed to use the neural tangent kernel (NTK) to ensure better algorithm convergence by evaluating the parameters
and
in terms of their inverse contribution to the variance, which is calculated using the NTK eigenvalues. The parameters
and
are considered as constant and positive in this research. Since the solution of the equation is unknown, numerical differentiation methods are applied. They are implemented in the deep learning library
Pytorch to obtain the values of
for the solution and approximation at a specific iterative step. In practice, the differential
and boundary
operators are also approximations of continuous
L and
b operators with some error. Therefore, the minimization functional for solving a direct problem can be formulated as follows:
In Equation (
5), the differential
and boundary
operators are numerical discretizations of differential operators, and the field
X represents a grid covering the solution domain
. When solving the inverse problem, the additive component responsible for the convergence of the equation solution to the value set from physical observations should be added to Equation (
5); further, the functional for solving the direct and inverse problems will be written as follows:
In Equation (
6), the
field represents a set of points where the values of the desired function are measured. The parameter
is the regularization coefficient responsible for the “degree of importance” of the last component for the optimization algorithm. For the numerical implementation of the minimization algorithm, it is necessary to determine the parameterized model itself, which approximates the values of the desired solution. In physical-based algorithms, neural networks are applied with different architectures. The authors of this paper applied a multilayer neural network, where
was used as a function,
and
is the set of neural network parameters, which is determined from the minimization problem of the following functional:
Figure 1 shows the schematic algorithm for solving the differential equation using a parameterized model (neural network).
3. Flow Theory Direct and Inverse Problem Solution Results
The flow velocities are low during fluid filtration through porous media, and the velocity is often described by Darcy’s law (linear dependence of the velocity vector on the pressure gradient) [
22]. Nonlinear flow equations are used, as a rule, only for highly viscous fluids, for which non-Newtonian properties are established in the laboratory via rotary viscometers. It was noticed (in dynamic experiments on core samples) that the nonlinear behavior of the fluid also occurs in non-stationary modes in the area of small pressure gradients, including Newtonian liquids [
23]. At the same time, it is important to establish the type of dependence of viscosity on the pressure gradient, taking into account the experimental results. To simulate a physical experiment on a real core [
23], a system of isothermal flow equations on a space-time grid
was considered, including the fluid mass conservation law (oil), the flow velocity equation with apparent viscosity [
8], the elastic matrix porosity change equation, and the fluid state equation:
Here,
m and
k are, respectively, the porosity of the sample and its permeability (
k is set according to the core study data and depends on porosity) and
is the density of the fluid depending on the pressure
p; the viscosity function
depending on the pressure gradient is used in the form proposed in [
8]. The unknown constants
B and
G define the form of the rheological curve of the drop in oil viscosity from the initial high value
(also unknown) to the final value
recorded on a rotary viscometer;
and
, respectively, are the sample porosity and the oil density at initial pressure
;
and
are the compressibility coefficients of the porous matrix and oil, respectively; and
is the flow velocity vector (
) of the oil phase.
Due to the small size of the core sample, the flow can be simulated in a one-dimensional formulation. Further, after substituting the flow velocity law into the mass conservation equation and non-dimensioning (
,
,
) the system is written as follows:
The coefficient
sets the compressibility properties of the core sample and fluid in a complex way. System
9 is solved considering the initial and boundary conditions:
where
q is the oil flow rate related to the area of the inlet area.
3.1. Laboratory Experiment Interpretation
To assess the quality of solutions obtained via the proposed method, a direct test task (a series of launches) was initially solved and compared with solutions obtained by the finite difference method. The expression
was chosen as a quality assessment metric, where
and
are solutions obtained by the finite difference method and using a PINN, respectively. The loss function, defined in this case based on Equation (
7) (for
), is represented as:
This function is defined on a space-time grid
X.
is defined by a vector with components in the form of residuals according to initial and boundary conditions:
A fully connected neural network with four hidden layers of 100 neurons and a hyperbolic tangent as an activation function was applied; the weight coefficients in the loss function were set by the constants
and
. The Adam (Adaptive Moment Estimation) [
24] optimization algorithm was used in numerical experiments with an optimization step of lr = 1 × 10
−3, and the number of iterations was epoch = 35,000.
was covered by the uniform square grid
X, which consists of
collocation points. The input data of the problem are shown in
Table 1.
Figure 2a and
Figure 3 show the direct problem solution quality using the PINN in the form of a time–pressure profile according to the sample from the initial stage of injection
(upper line) to the moment of time
E = 86,000 s (bottom line) compared with the finite difference approach. Apparently the allocation of the PINN leads to a good solution quality for the direct problem. The rRMSE score corresponds to a 95% confidence interval for a set of 10 algorithms launches. From the series of experiments, it was obtained that the confidence interval is rRMSE = (0.001099, 0.001602) rRMSE = (0.001099, 0.001602). The reduction in loss function values during the training step is demonstrated in
Figure A1 (for the forward and inverse tasks).
A series of experiments was conducted to investigate the algorithm’s stability to changes in input parameters.
Figure 4 illustrates the stability of the solution while the input parameters are changed. Each box represents the variability of one parameter while the others remain constant, as shown in
Table 1. A grid of four values has been defined for each parameter, as shown in
Table 2. The distribution of error values (relative MSE
) indicates the algorithm’s stability to changes in the parameters responsible for the flow nonlinearity.
The inverse problem solution is the determination of the rheological properties of the fluid based on data obtained from laboratory experiments, where changes in the dynamics of the flow velocity at various pressure gradients were observed [
23]. The problem solution results are shown in
Figure 2b in the form of velocity dependencies on the pressure gradient modulus in comparison with experimental data, the values of which are reflected on the right scale.
The loss function in the case of the inverse problem solution is identical to expression (
11), but contains an additional term
, where
.
is the PINN-algorithm-calculated flow velocity,
is the experimentally measured velocity value,
are neural network parameters, and
Z is the set of dots (experimental data). Further, the optimization problem solution result is a parameterized function (neural network) corresponding to the solution of system (
9), (
10) and is in agreement with the experimental data. Also, coefficients
were assessed; they determine the function of viscosity on pressure gradient from which the optimal (according to the optimization algorithm) solution is obtained. The neural network applied to the direct problem solution was applied to the inverse problem solution as well. Adam was also selected as an optimizer with an optimization step of lr = 1 × 10
4, and the number of optimization steps was epoch = 26,000,
,
,
. The initial guess and final values of the searched parameters are demonstrated in
Table 3.
Figure 2b also shows the viscosity change function with the determined parameters (numerical viscosity values are displayed on the left scale).
3.2. Field Experiment Interpretation
As a second example, we considered the production task of hydrodynamic data interpretation [
7]. In an undisturbed circular reservoir (of thickness
H with a given reservoir radius
, where the pressure is close to the reservoir pressure
), the well initially has a constant flow rate
Q and a depth sensor is located at the bottom hole and records pressure values over time. According to hydrodynamic research, it is necessary to determine the current parameters of the reservoir system (permeability, reservoir porosity, fluid parameters). The mathematical formulation of the problem is represented by system (
8), but is written in a cylindrical symmetric formulation and supplemented with boundary conditions for a well of radius
, taking into account well imperfections, using a given coefficient
C [
22]:
By analogy with the transformation of system (
8) to system (
9) after non-dimensioning (
,
,
) a system including nonlinear flow equations, the initial and boundary conditions on the reservoir radius and well bottom are obtained. To create a grid condensing to
, a transition to logarithmic coordinates
was carried out:
To solve the direct problem, the loss function is based on Equation (
11) on the space-time grid
X.
is defined as a vector with components:
A fully connected neural network with four hidden layers of 200 neurons and hyperbolic tangents as an activation function was applied. The weighting coefficient
was set as a function [
25] of
,
. Adam was used as an optimizer with an optimization step of lr = 1 × 10
−3, and the number of iterations was epoch = 20,000.
was covered by a discrete rectangular grid
, which consisted of
and
collocation points. The uniform grid along the
u direction made it possible to reduce the grid step for the
direction in areas of large pressure gradients. The input data used to solve the problem are given in
Table 4.
Figure 5 and
Figure 6 show a comparison of the reservoir pressure distributions calculated by the PINN and finite difference approaches.
Figure 5 shows a comparison of reservoir pressure distributions (a) and well pressure drops (b) at various points in time calculated by the PINN (pinned points) and the finite difference (dotted lines) approaches. The rRMSE estimation was performed as a 95% confidence interval for a set of 10 algorithm launches. From the experiments series, it was found that the confidence interval rRMSE = (0.00687, 0.00779). The reduction in loss function values during the train step is demonstrated in
Figure A2 (for the forward and inverse tasks).
The pressure values obtained by the sensors at the well’s bottom hole were used as experimental data for solving the inverse problem (determining reservoir parameters based on log results). The loss function in the case of the inverse problem solution is identical to Equation (
11) with an additional term
. Here,
is the calculated pressure values at the bottom hole,
is experimentally measured downhole pressure value,
are neural network parameters and
Z is the set of dots where experimental data were changed. The numerical solution of the equation system (
14) was obtained, and the vector of coefficients
is defined as the inverse problem solution results. For the inverse problem, a fully connected neural network with nine hidden layers of 100 neurons was applied, and a hyperbolic tangent was used as the activation function. Adam was chosen as the optimizer with the optimization step of lr = 1 × 10
−3, and the number of optimization steps was epoch = 24,000.
,
and
. The initial guess and final values of the searched parameters are demonstrated in
Table 5.
Figure 7 shows that the inverse problem solution results in pressure changes at the bottom hole at various optimizer steps in comparison with the experimental data (marked with circles). The initial guess is indicated at
Figure 7 as a horizontal dotted line (epoch = 0).
4. Discussion
Considering the problems of increasing oil recovery, it is necessary to take into account a whole range of phenomena that affect the displacement characteristics and appear during the application of complex thermo-chemical methods to saturated reservoirs. Among these are the heterogeneity, as the initial distribution of the filtration-capacitance properties of the layers (porosity, permeability, pore distribution by size), as well as these properties’ changes over time, which occur mainly due to the pumped active agents’ interactions with both the formation liquid and the porous skeleton (phase transitions, chemical reactions, sorption/desorption processes) [
3,
26]. In addition, the unsteadiness of the development processes in combination with changes in the fluid properties’ dynamics leads to the necessity to modify the flow additive components (responsible for mass transfer and energy inflow) in the conservation equations (mass, momentum, energy) which describe the process, and also to modify the equation type, which leads to the necessity of changing the calculation algorithm while modeling.
In this paper, considering the change in the reservoir fluid’s rheology during a non-stationary process, which is expressed as a change in the equation of motion due to a decrease in fluid viscosity with a pressure gradient increase (due to structural failure), the solution of the filtration problem using the parameterized PINN function is shown. Based on the generalization of the latest/newest experiences of using PINNs in various tasks, the authors of this paper have formulated a deviation/error function that accounts for the physical conservation equations and initial and boundary conditions based on the data from laboratory and/or field experiments. The sensitivity of the parameterized model to changes in the set of input parameters is analyzed.
Pseudoplastic liquid flow simulations applying a PINN in the processing of laboratory experiments on real core samples in comparison with “classical” solving methods [
1], a similar “nonlinear” problem for PDEs, showed that PINN algorithms allowed for the obtention of a stable solution to both the direct and inverse problems of pseudoplastic filtration theory with lower resource costs.
Thus, the numerical studies carried out confirm the possibility of describing the specifics of an unsteady filtration process of non-Newtonian liquids in a porous medium with changing properties via the PINN approach. The results of laboratory experiments on core processing and the data from hydrodynamic studies of a real field were considered, and it was established that the convergence of the results obtained via the PINN and the results obtained using finite difference methods is good, with an rRMSE metric on the order of 1 × 10−3.
It should also be noted that PINNs are universally applicable when changing both the form of the equations and the type of initial boundary conditions. This makes it possible to unify algorithms of filtration theory for direct and inverse solution investigations, in contrast to finite-difference methods, where specification of the algorithm for each type of PDE system is required. The results of the inverse problem solution showed that the algorithm applied is stable to the choice of the initial approximation (for some parameters, the initial conditions were different by orders of magnitude), which reduces the role of the expert in the solution search process and improves the stability of the solution.
In the proposed formulation of the problem, the task of selecting hyperparameters (coefficient of regularization, choice of optimizers, step of gradient descent, etc.) remains relevant, which is typical for optimization problems. However, in recent studies, where algorithms for adaptive parameter selection are proposed [
27], it was shown that the application of parameterized models with a PINN is highly efficient and can potentially produce descriptions of the complex filtration processes of pseudoplastic liquids at the proper level.