Classification of Oil-Gas-Water Three-Phase Flow in a Pipeline Based on BP Neural Network Analysis

Abstract

The flow pattern in a pipeline is a very important topic in petroleum exploitation. This paper is to classify the flow pattern of oil-gas-water flow in a pipeline by using BP neural network. The effects of different parameter combinations are investigated to find the most important ones. It is shown that BP neural network can be used in the analysis of the flow pattern of three-phase flow in pipelines. In most cases, the mean square error is large for the horizontal pipes. The optimized neuron number of the middle layer changes with conditions. So, we must changes the neuron number of the middle layer in simulation for any conditions to seek the best results. These conclusions can be taken as references for further study of the flow pattern of oil-gas-water in a pipeline.

Share and Cite:

Lu, W. , Li, P. and Zhang, X. (2022) Classification of Oil-Gas-Water Three-Phase Flow in a Pipeline Based on BP Neural Network Analysis. Journal of Data Analysis and Information Processing, 10, 185-197. doi: 10.4236/jdaip.2022.104012.

1. Introduction

The oil-gas-water three-phase flow in a pipeline is a practical topic in petroleum exploitation. The volume fraction of water in oil pipelines gradually increases with the production of oil in a field [1]. Accordingly, the flow pattern varies with the volume fraction of water. In the mean-time, concentration and pressure distribution are closely related to flow patterns. Sometimes the pipelines will be blocked due to the changes in flow pattern, which will greatly affect the normal operation of pipeline transport. Therefore, the understanding of flow patterns is a very practical and very important problem for evaluating the status of oilfield operations [2]. The water holdup is the key parameter determining flow patterns [3].

Studies show that flow patterns can be mainly divided into plug flow, slug flow, blocky flow, and annular flow in pipelines with the oil-gas-water flow. The flow pattern changes with the volume fraction, the velocity, configuration, etc. Some researchers observe flow patterns by the high-speed camera were investigated [4].

Keska et al. [5] carried out experiments to find appropriate ways, such as capacitive, resistive, optical, and pressure for identifying the flow pattern. It is shown that the best way of identifying the flow pattern is to use the capacitance or resistance fluctuation of the flow cross-section. Jones and Zuber [6] took the probability density function (PDF) of the fluctuations in the volume fraction as the statistical analysis method for flow pattern identification. The PDF is a function of signal amplitude and a method of measuring the probability that a signal has a range of values. Du et al. identified oil-water flow patterns in a pipe by using convolutional neural networks. The flow pattern images were collected by using a camera during oil-water flow experiments in a vertical 20 mm inner diameter Plexiglas pipe [7].

In the in-site oil pipeline layout, the horizontal pipelines are often combined with vertical pipes or even inclined pipes. However, few studies on flow patterns in a horizontal pipe combined with a vertical pipe have been carried out [3]. Generally, previous studies mainly focused on the effect of a single parameter, but in fact, the flow pattern is controlled by many factors. Hence, to understand the mechanisms of oil-water-gas flow, the effects of multiple factors on the flow pattern are required. Meanwhile, the classification and development of plow patterns by using non-determined methods such as statistics, neural networks, etc. have been rarely studied.

The oil-gas-water flow in pipelines is complex. The related parameters include geometries of the pipeline (e.g. inner pipe diameter, pipe angle), fluid properties (e.g. viscosity, density, and surface tension), and boundary conditions (e.g. superficial input velocities). Previous studies mainly focused on the effect of a single parameter, but not the coupled effect.

Thus, the aim of this paper is to classify the flow pattern in an oil-gas-water flow through a pipeline with horizontal and vertical parts by using BP neural network. The effects of different parameter combinations are investigated to find the most important ones.

The structure of this paper is arranged as follows: In Section 1, the background is introduced; In Section 2, the problem is simply introduced and the main controlling dimensionless parameters are obtained; In Section 3, the BP neural network is introduced simply; In Section 4, the results are described; In Section 5, the conclusions are introduced.

2. Problem Description and Dimensionless Controlling Parameters

2.1. Description of the Problem

The data used in the following analysis come from experiments reported in the literature [8]. The experiments were carried out by using an oil-water-gas three-phase flow loop, which consisted of a power system, a metering system, and a mixing pipeline. The mixing line includes a horizontal pipe and a vertical pipe. All the experiments were conducted using white mineral oil, distilled water, and air at the temperature of around 20˚C. Therefore, the problem considered in this paper is a horizontal pipe connected with a vertical pipe. At one end of the horizontal pipe, the mixed water, gas and oil with a given volume fraction are injected into the pipeline with a given velocity. The flow pattern of the mixed fluid will vary with distance. We will look for a method for predicting the pattern at different distances and different input parameters. In this paper, the experimental data are used to test whether BP neural network is suitable for predicting the flow pattern and what kind of structure and parameters of BP neural network are the most optimized. Because the unit volume of the pipeline is constant, when we know the volume of any two phases, the volume of the third phase is known. Therefore, in the following analysis, only the volumes of water and oil are considered.

2.2. Selection of the Characteristics of Flow in the Pipeline

The controlling parameters of the problem are as follows [3] [8]:

Oil: density ρ D , viscosity μ D , drop diameter dD, interfacial tension σ.

Water: density ρ C , viscosity μ C .

Geometric parameter: inner pipe diameter D, distance of the turning from the inlet d, the angle of the turning a, the position needed to consider the flow pattern of the horizontal pipe x.

Boundary condition: superficial input oil and water velocity usD,usC which is defined as u s D = Q D / A , u s C = Q C / A , where QD andQC are the volume flow rates of oil and water respectively, A is the cross-sectional area of the pipe, A = πD2/4.

Gravitational acceleration: g.

The flow pattern can be expressed as a function of the above controlling parameters:

Flowpattern = f ( ρ D , μ D , d D , u s D , σ , ρ C , μ C , u s C , D , g , d , α , x ) (1)

Equation (1) can be normalized as:

Flowpattern = f ( ρ D ρ C , μ D μ C , d D D , u s D u s C , | ρ C ρ D | g D 2 σ , ρ C u s C D μ C , u s C 2 g D , d D , α , x D ) (2)

where u s D u s C is the superficial velocity ratio, ρ C u s C D μ C is Reynolds number R e C , u s C 2 g D is Froude number F r c . | ρ C ρ D | g D 2 σ is Eo number which represents the ratio of buoyancy force to surface tension force. For a wholly developed mixed flow, the velocity difference between oil and water phases is minimal. So the dimensionless numbers are calculated instead of the superficial velocity usC with the total superficial velocity usm.

u s m = u s C + u s D (3)

Defining input water cut ε w as the ratio of the water flow rate to the mixture flow rate.

ε w = u s w u s m (4)

Assuring that the fluid properties and drop size remain constant, i.e., Eo number, density ratio ρD/ρC, viscosity ratio μD/μC, and the ratio of drop size to pipe diameter d/D are fixed. Therefore, Equation (4) can be modified as:

Flowpattern = f ( ε w , ρ C u s m D μ C , u s m 2 g D , d D , α , x D ) (5)

According to the above dimensional analysis, the parameters affecting the flow characteristics in a pipe mainly include the Froude number Fr, Reynolds number Re, volume ratio of oil to water, the distance and the angle of the turning. In the experimental data used in this study, the distance and the angle of the turning are fixed also, but these two parameters are considered in some conditions to investigate the effects on the prediction results. So six conditions are investigated in the following analysis: 1) Three input parameters (oil-to-water volume ratio, Fr, Re) are considered and the output parameters are flow patterns of only horizontal pipe. 2) Three input parameters (gas-to-water volume ratio, Fr, Re) are considered and the output parameters are flow patterns of only vertical pipe. 3) Three input parameters (gas-to-water volume ratio, Fr, Re) are considered and the output parameters are flow patterns of horizontal and vertical pipes. 4) Six input parameters (gas-to-water volume ratio, Fr, Re, d D , α , x D ) are considered and the output parameters are flow patterns of only vertical pipe. 5) Six input parameters (gas-to-water volume ratio, Fr, Re, d D , α , x D ) are considered and the output parameters are flow patterns of only vertical pipe. 6) Six input parameters (gas-to-water volume ratio, Fr, Re, d D , α , x D ) are considered and the output parameters are flow patterns of horizontal pipe and vertical pipe.

3. Introduction of BP Artificial Neural Network

A BP [9] network model is consisted of input layer, middle layers and output layer (Figure 3). The dependent variables are input in the input layer. The data outcome from the output layer is the independent variables. The layer locates between the input and output layers are called the middle/hidden layers.

The neuron is the basic unit and the processing element. A neuron, as shown in Figure 1, has many inputs Xi(n− 1) come from the neurons in the (n− 1)th layer, but only a single output Xj(n) that carries its information to the neurons in the (n+ 1)th layer. An adjustable weight, Wij(n), representing the connecting strength, lies between the jth input branch in the nth layer and the ith neuron in the (n− 1)th layer. The basic function (net sum) of a neuron is to sum up its inputs and by means of the transfer function to produce an output [10]. Usually, an internal threshold t is introduced and subtracted from the sum. Mathematically, the net sum netj(n) of the jth neuron in the nth layer can be expressed as Equation (6).

(The three hollow orange circles denote three neurons of the middle layer, +1 in the last circle means the neurons can be added if required. The number of the neurons in the three layers can be added if required.)

n e t j n = i W i j n x i n 1 t j n (6)

Then the output value x j n can be obtained as

x j n = f ( n e t j n ) = θ j n 1 + e β j n n e t j n (7)

in which f()is the transfer function which has several forms, such as the hyperbolic tangent, step, or sigmoid function. The sigmoid function is the most common in practical application.

The BP neural network is characterized by gaining possession of hidden layers. A BP neural network without a hidden layer is adequate to describe the system of the linearized relationship between inputs and outputs. Generally, a BP network with one hidden layer is enough for most applications. Therefore, the modified BP network model is adopted here which is a three-layer network with input layer, middle layer and output layer (Figure 1).

In the BP learning scheme, the calculated outputs in the output layer, x j q , are compared with the desired outputs, dj, to find the error, before the error signals are propagated backward through the network. The error function E is defined

Figure 1. Schematic diagram of BP network.

as [9]

E = 1 2 j = 1 p ( d j x j q ) 2 (8)

where q is the total number of layers in the network and p is the total number of the output neurons. The learning process is to adjust the learning parameters, W, t, β and θ, so that the error can be minimized and the mapping between inputs and outputs can be realized. In order to accomplish this, gradient descent technique is applied to calculate the gradient of the error with respect to each learning parameter. The basic idea of gradient descent method is that the function changes the fastest along its gradient direction. The main purpose of this method is to find the minimum value of the objective function through iteration, or converge to the minimum value as soon as possible. So it is often used in the weight calculation of neural network. The learning parameters are changed and adjusted in the direction of the steepest descent of the error. For example, the adjustment of the weight parameter is expressed as [9] [11]

Δ W i j n ( T + 1 ) = η Δ E Δ W i j n (9)

where η is the learning rate and T is the iteration. There are many methods to update the parameters of the networks. Generally, the pattern learning method is commonly used for its faster convergence speed. This method updates the parameters of the network whenever the input pattern differs from the target pattern. One of the major problems with the BP algorithm is the slow convergence speed. A momentum factor is recommended by Lippmann to accelerate the convergence speed. Thus, Equation (9) can be converted into Equation (10).

Δ W i j n ( T + 1 ) = η Δ E Δ W i j n + γ Δ W i j n ( T ) (10)

where γ is the momentum factor and γ ≥ 0. Once the partial derivative E with respect to W is obtained, it can be substituted into Equation (10) to arrive at the training formula for the adjustment of W as

Δ W i j n ( T + 1 ) = η δ j n Δ E Δ W i j n + γ Δ W i j n ( T ) (11)

Similarly, the training formulae to adjustt, β and θ can be obtained as

Δ t j n ( T + 1 ) = η δ j n + γ Δ δ j n ( T ) (12)

Δ β j n ( T + 1 ) = η ξ j n [ x j n ( 1 x j n ) n e t j n ] + γ Δ β j n ( T ) (13)

Δ θ j n ( T + 1 ) = η ξ j n ( x j n / θ j n ) + γ Δ θ j n ( T ) (14)

in which δ j n , ξ j n are adjustment coefficients.

4. Modeling of the Network

The network is set as a three-layer structure: the input layer, middle layer and output layer. The neuron number of input layer is 3 and 6 according to the analysis in the last section. The output layer is set as four types corresponding to the flow patterns: Type 1 (plug flow): 1 0 0 0; Type 2 (slug flow): 0 1 0 0; Type 3 (blocky flow): 0 0 1 0; Type 4 (annular flow): 0 0 0 1.

According to literature [8], the length of the monitoring part of horizontal pipe is 200D. The length of the monitoring part for flow pattern of vertical pipe is 240D (intersection of horizontal pipe and vertical pipe). The corner is 220D away from the inlet (D is the inner diameter of the pipe). The angle of the corner is 1.57 radian.

For each condition, the total samples are 242, in which 170 samples are used for training (70%); 36 samples are used for certification (15%); 36 samples are test (15%) (Part of the data is shown in the Appendix).

Here, we will use Condition (1) as example to show the training and test steps. To seek the optimized parameters network, different and the initial values of other parameters of network are chosen for simulation. The following is the results at the number of neurons of middle layer 15, the maximum allowable number of iterations is 2000, initial gradient is 1.04 and the acceleration coefficient is 0.001.

In fact, the real iteration number is 20, epoch = 26. The best results is at epoch = 20 (Figure 2). The validation performance is 0.0276. The gradient becomes from 1.04 at the beginning to 0.0032 at the last. The coefficient of error precision becomes from 0.001 at the first to 0.0001 at the end.

Figure 2 shows the mean square error change with Epochs. One Epoch indicates the whole data set is sent to the network to complete a forward calculation + back propagation process. According to Figure 2, the mean square error decreases at Epochs ≤ 20 for all data-sets. The minimum error occurs when Epoch

Figure 2. The relation between mean squared error and performance.

equals 20. The error precision (mu in Figure 3) arrives the smallest 10−5 and then increase to a stable value. It is clear that the validation checks (validation check indicates that in the process of training the network with training samples, consecutive iterations that the error of the verification samples does not decrease.) increase after Epoch = 20. That means, the best results are at Epoch = 20 (Figure 3).

From Figure 3, we can see that the minimum values of gradient and the coefficient of error precision occurs at Epoch near 20. It shows that the method used in the paper is appropriate. The gradient decreases very fast. At Epoch 10, it decreases to near zero. The standard error of training is 89.1%, the standard error of certification is 83.1%, and the standard error of test is 89.7% (Figure 4).

Figure 5 shows the correction rate of prediction with the neuron number of the middle layer in the considered six conditions. It is shown that for all conditions, the correction rate is higher than 82%. Obviously, the predicted data of vertical pipe are better than that of horizontal pipe. The reason may be that the horizontal part is nearer to the inlet and more difficult to be stable. The vertical part is farther away from the inlet and so the effects of disturbed factors can be neglected. If the vertical and horizontal parts are considered together, the precision lies in between the horizontal part only and vertical part only. In most conditions, when three parameters are used for training and prediction, the errors are smaller than that of six parameters. The correction rate is not linearly changed with the neuron number of the middle layer. For different conditions, the optimized neuron number of the middle layer is different. In the scope of our simulation, the best choice of the neuron number of the middle layer is 10 - 20. So we must change the neuron number of the middle layer in the simulation

Figure 3. Changes of parameters during training process.

Figure 4. The accuracy during different processes.

Figure 5. The correction rate of prediction with neuron number of middle layer.

for any conditions to seek the best results. The difference of the results when adopting either dimensional or dimensionless parameters is small. The accuracy when adopting dimensionless parameters is smaller than that of vertical pipes while larger than that of horizontal pipes. The results indicate that the flow pattern is

Figure 6. The mean square error of prediction with neuron number of middle layer.

affected by complex factors. Except the six factors considered in this paper, maybe other factors should be considered either.

It can be seen that the trend of the mean square error is opposite to that of the correction rate (Figure 6), that is, the accuracy rate is small when the mean square error is large. Therefore, both of them can be used to judge the reliability of the model prediction. In most cases, the mean square error is large for the horizontal pipes. The reason that the mean square error is larger when adopting six parameters may be that the three geometrical parameters ( d D , α , x D ) are fixed in the data set. In some cases, for example in Conditions (1) and (3), there is more than one minimum. It indicates that the effects of the neuron number of the middle layer on the training and predicted effects of the network are complex. It is affected by many factors and cannot be expressed by the neuron number of the middle layer in the form of a single-valued function.

5. Conclusion

The BP neural network is used in this paper to analyze the flow pattern of gas water in pipes. Firstly, the optimized structure and parameters of the neural network are studied; then the effects of the main dimensionless parameters of the problem are investigated. The correction rate of prediction is higher than 82%, which indicates that the BP neural network can be used in the analysis of the flow pattern of three-phase flow in pipes. The predicted data of vertical pipe are better than that of horizontal pipe. In most cases, the mean square error is large for the horizontal pipes. The optimized neuron number of the middle layer changes with conditions. So we must change the neuron number of the middle layer in the simulation for any conditions to seek the best results.

Appendix: Part of the Dimensionless Data Used in BP Analysis

Conflicts of Interest

The authors declare no conflicts of interest regarding the publication of this paper.

References

[1] Ghorai, S., Suri, V. and Nigam, K.D.P. (2005) Numerical Modeling of Three-Phase Stratified Flow in Pipes. Chemical Engineering Science, 60, 6637-6648.
https://doi.org/10.1016/j.ces.2005.05.050
[2] Ibarra, R., Nossen, J. and Tutkun, M. (2019) Two-Phase Gas-Liquid Flow in Concentric and Fully Eccentric Annuli. Part I: Flow Patterns, Holdup, Slip Ratio and Pressure Gradient. Chemical Engineering Science, 203, 489-500.
https://doi.org/10.1016/j.ces.2019.01.064
[3] Ren, G., Ge, D.K., Li, P., Chen, X.M., Zhang, X.H., Lu, X.B., Sun, K., Rui, F., Mi, L.F. and Su, F. (2021) The Flow Pattern Transition and Water Holdup of Gas-Liquid Flow in the Horizontal and Vertical Sections of A Continuous Transportation Pipe. Water, 13, Article 2077.
https://doi.org/10.3390/w13152077
[4] Wang, C.L., Tian, M.C., Zhang, J.Z. and Zhang, G.M. (2021) Experimental Study on Liquid-Liquid Two-Phase Flow Patterns and Plug Hydrodynamics in a Small Channel. Experimental Thermal and Fluid Science, 129, Article ID: 110455.
https://doi.org/10.1016/j.expthermflusci.2021.110455
[5] Keska, J.K., Smith, M.D. and Williams, B.E. (1999) Comparison Study of A Cluster of Four Dynamic Flow Pattern Discrimination Techniques for Multiphase Flow. Flow Measurement and Instrumentation, 10, 65-77.
https://doi.org/10.1016/S0955-5986(98)00048-X
[6] Jones, O.C. and Zuber, N. (1975) The Interrelation between Void Fraction Fluctuations and Flow Patterns in Two-Phase Flow. International Journal of Multiphase Flow, 2, 273-306.
https://doi.org/10.1016/0301-9322(75)90015-4
[7] Du, M., Yin, H.G., Chen, X.Y. and Wang, X.Q. (2019) Oil-In-Water Two-Phase Flow Pattern Identification from Experimental Snapshots Using Convolutional Neural Network. IEEE Access, 7, 6219-6225.
https://doi.org/10.1109/ACCESS.2018.2888733
[8] Yang, J.L., Zhang, X.H., Lu, X.B., Li, P. and Mi, L.F. (2021) Experimental Investigation of Oil-Water Flow in the Horizontal and Vertical Sections of A Continuous Transportation Pipe. Scientific Reports, 11, Article No. 20092.
https://doi.org/10.1038/s41598-021-996
[9] Fuh, K.H. and Wang, S.B. (1997) Force Modeling and Forecasting in Creep Feed Grinding Using Improved BP Neural Network. International Journal of Machine Tools and Manufacture, 37, 1167-1178.
https://doi.org/10.1016/S0890-6955(96)00012-0
[10] Wang, S.H., Jiang, J.L. and Lu, X.B. (2020) Study on the Classification of Pulse Signal Based on the BP Neural Network. Journal of Biosciences and Medicines, 8, 104-112.
https://doi.org/10.4236/jbm.2020.85010
[11] Zhu, S. (2016) Financial Classification of Listed Companies in China Based on BP Neural Network Method. Journal of Financial Risk Management, 5, 171-177.
https://doi.org/10.4236/jfrm.2016.53017

Copyright © 2024 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.