The Prediction of liquid holdup in horizontal pipe with BP neural network

Liquid holdup is one of the most critical factors for the formation of pipe effusion, which is closely related to the efficiency of pipe transportation. Nowadays, liquid holdup is mainly estimated according to empirical or semiempirical correlation. Besides, little has been done concerning the accurate prediction of liquid holdup. Therefore, to obtain more precise forecast, this paper proposed a prediction method concerning liquid holdup in horizontal pipe with BP neural network algorithm. Meanwhile, a sensitivity analysis on the key factors impacting liquid holdup was conducted by the combination of the forecast calculation and orthogonal experiment design. The results showed that compared with the empirical calculation (the smallest standard deviation 8.65%), the BP neural network prediction model had achieved more accurate estimation (the average relative error is 7.38%). In addition, the sensitivity analysis indicated that the main indexes including pipe diameter, gas‐ and liquid‐phase superficial velocities, and temperature have significant influence on the liquid holdup. Pipe diameter, liquid‐phase superficial velocity, temperature, and viscosity are positively correlated with the liquid holdup, while pressure and gas‐phase superficial velocity are negatively correlated with it.

the Taitel-Dukler correlation formula was simplified, 89 data points which tested in a horizontal pipe with 36m pipe length and 50.8mm pipe diameter using air-kerosene as the transmission medium, fitted the calculation formula of liquid holdup for turbulence and laminar flow, respectively, and gave the correction method of the results.
In recent years, experiments and models [5][6][7] were combined to estimate the liquid holdup. Based on the equilibrium relationship between liquid full flow energy and surface free energy, the calculation model of slug flow holdup was proposed and compared the calculated results of the model with the data of TUFFP database; it is proved that the model has good accuracy. Based on the dual-fluid model, the steady-state simulation method was studied of gas-liquid two-phase flow and proposed a simplified hydraulic model. The gas-liquid two-phase flow experiment on the multiphase flow experimental loop was conducted and studied the flow characteristics of low-liquid gas-liquid two-phase flow and proposed the calculation method of liquid holdup, and when solving the equation, it is necessary to assume the flexible value of liquid holdup first, then solve the value of pressure and flow rate, and then reverse the liquid holdup, repeated iteration until the liquid holdup reaches the accuracy requirement.
To some extent, the application of the above method is restricted by its less-satisfied outcome related to accuracy. With the rapid development of science and technology, the application of the artificial intelligence algorithms in the field of petroleum has been recognized. Artificial neural network (ANN) systems were proposed to predict corrosion rates. 8 A novel model based on least square support vector (LSSVM) was conducted for calculation of twophase flowing pressure drop in horizontal pipes. 9 A Radial basis function neural network (RBF-NN) model was presented to determine the pressure gradient. 10 Although deep learning algorithms such as LSTM and ESN have gain great popularity, as both a long-and short-term memory network, LSTM is a kind of temporal recursive neural network, suitable for processing and predicting important events with relatively long interval and delay in time series. 11,12 ESN requires a scale much larger than the node size of the general neural network, and the most mature application of ESN is still focused on the learning of time series. 13,14 Since supervised learning is unable be carried out, a longer training process is required due to the optimization of the training output weight by the genetic algorithm. Compared with other algorithms, BP neural network algorithm [15][16][17][18][19] is suitable for predicting liquid holdup in horizontal gas-liquid two-phase pipe with the characteristics of strong nonlinear mapping ability, wide application range (function approximation, pattern recognition, data compression, and prediction), and mature development.

ALGORITHM AND PREDICTION OF LIQUID HOLDUP
BP neural network is developed by the extension of Widrow-Hoff learning algorithm to multilayer neural network and nonlinear transformation function and proposed by Rumelhart and his coworkers. For example, a three-layer neural network is displayed in Figure 1. It includes input layer, hidden layer (intermediate layer), and output layer, which have n nodes, j nodes, and k nodes, respectively. All neurons in the upper and lower layers are fully connected. That is to say, the unit in the lower layer and that in the upper layer are fully connected, while there is no connection between neurons in each layer. When a pair of learning modes are provided to the network, the activation value of neurons propagates from the input layer through the intermediate layer to the output layer and responds to the input layer of each neuron or network in the output layer. After that, in the direction of reducing the error between the desired output and the actual output, the weights of each connection are corrected layer by layer from the output layer through the intermediate layer and finally back to the output layer again.
The sigmoid differential function adopted by BP neural network is strictly incremental, which better balanced between linear and nonlinear. As a result, nonlinear mapping between input and output could be achieved for medium and long-term prediction with better approximation, faster computation, and higher precision. Meanwhile, it also presented sound theoretical basis, rigorous derivation process, which enabled it to obtain much more symmetric and elegant formula with strong nonlinear fitting ability and better suitable for small data processing. MATLAB has a neural network toolbox, which provides sufficient commands and functions for simplifying artificial modeling. 20,21 The activation function is shown in Equation 1 and 2 The calculation process is shown in Figure 2.

| Establishment of BP neural network predictive model
The six biggest influencing factors on liquid holdup including the diameter of horizontal pipe, gas-phase superficial velocity, liquid-phase superficial velocity, pressure, viscosity, and temperature were figured out from the independent data of gas-liquid two-phase flow gained from the experiments conducted by Beggs, 2 Payn et al, 22 Nguyen et al, 23 Mukherjee, 24 Andritsos et al, 25 Minami et al, 3 Gueler-Quadir, 26 Abdul-Majeed, 4 Badie et al, 27 Wang Le, 28 Xu Jijun 29 etc A predictive model of liquid holdup of gas-liquid two-phase flow was established based on BP neural network algorithm (A total of 300 groups were employed as samples, among which 80 groups were selected as training samples, five groups as inspection samples, and 40 groups as test samples).
Since the hidden layer of BP network generally adopts Sigmoid transfer function, 30 the matrix P1 shall be got by preprocessing the original input. Firstly, the input value was supposed to be between 0 and 1. The maximum value of each column was gained by transposing the matrix P, each column in the matrix was required to be divided by its maximum value. The training data are filtered by itself, and the test and verification data are randomly selected through the code except the training samples.
The reduction in network errors and the improvement in the accuracy can be achieved by the increase in the number of hidden layers. However, it might lead to a more complex network demanding for more training time and a tendency of "overfitting." It is acknowledged that three-layer network (namely hidden layer) deserves first attention in the design of neural network due to the more easily achieved training effects to obtain a lower errors by the increase in the number of nodes in the hidden layer. In this paper, a BP network with three layers of multiple inputs and single outputs with one hidden layer is used to establish the prediction model. In the process of network design, the exact number of hidden layer neurons is of great significance, since too many hidden layer neurons will bring the heavy network calculation and the overfitting problem, while the opposite might lead to a poor network performance and unsatisfactory effects. The number of hidden layer neurons in the network is directly influenced by the complexity of the problem, the exact number of neurons in the input and output layer, and the setting of the expected errors. Since there is no definite formula for the determination of the number of neurons in the hidden layer except for some empirical ones, the exact number of neurons can be only determined by experience and repeated experiments. The empirical calculation formula is shown in Equation 3 ( Input layer Hidden layer Output layer where n is the number of neurons in the input layer, m is the number of neurons in the output layer, and a is the constant between 1 and 10. Set the maximum number of learning iterations of the network as 3000; Set the learning accuracy of the network to 0.01.
The design of this algorithm is judged as correlation design. The closer the correlation is to 1 after training, the more accurate the predictive model is. On the other hand, the closer to −1, the worse the accuracy is.
In this prediction modeling, in order to solve the local minimum problem, we use genetic algorithm to optimize the weights and thresholds of neural network.

| Establishment of predictive model
The establishment of BP neural network algorithm model generally requires to complete the following steps: The specific flowchart is shown in Figure 3.
In this model, the input layer has 6 parameters, which are diameter, gas-phase superficial velocity, liquid-phase superficial velocity, pressure, viscosity, and temperature. The hidden layer has 9 parameters. Since the output layer is liquid holdup, the output layer has only one parameter. After training by the algorithm, the correlation reaches 0.9837, and the data accuracy is high. The error analysis formula is shown in Equation 4 According to the comparison of inspection group data and prediction data in Figure 4 and Table 1, the maximum error of model error after training is 8.15%, and the average error is 5.61%.

| Verification of new predictive model
The accuracy of the liquid holdup predictive model of the algorithm was verified by using 180 groups of liquid holdup experimental data from 300 groups of statistical experimental data which were randomly selected. The results are shown in Figures 5 and 6. It can be seen from Figures 5 and 6 that the calculated value of the liquid holdup model is very close to the experimental value, and the absolute error is basically distributed within the range of ± 0.1, and the calculation has high precision.
In order to verify the accuracy of the prediction calculation model of liquid holdup established by BP neural network algorithm, the predictive model is compared with the related type of four commonly adopted liquid holdup calculation (see Table 2), including Eaton, 1,31 Lockhart-Martinelli, 32
Minami-Brill I, 1 and Minami-Brill II. 1 Forty groups of liquid holdup experimental data from 300 groups of statistical experimental data were randomly selected to conduct error analysis of calculated values and mean relative deviation ARD (Equation 5) and standard deviation SD (Equation 6) of experimental values. 33 The results are included in Table 3.
As can be seen from Table 3, the calculation accuracy of different calculation models varies greatly. The newly built predictive model of liquid holdup in this paper has the smallest average relative deviation (6.89%) and the smallest standard deviation (8.22%), indicating high calculation accuracy.

| The scope of application of new liquid holdup predictive model
The liquid holdup data selected by the model in this paper are large amounts of research data obtained from previous research experiments, and the data selection follows the principle of mutual independence, wide data coverage, and random selection, so as to provide accurate training data for later prediction.
According to the results of Coleman et al 34 and Grassi et al, 35 it can be seen that (1) When the pipe diameter is larger than 10mm, the increase in the pipe size has little influence on the flow pattern in the pipe. (2) When the length-diameter ratio of the pipe is greater than 200, the flow in the pipe belongs to the fully developed flow. Meanwhile, according to the research of DE et al, 36 as long as the Eo number is greater than 1, the two-phase flow in  Probability density distribution a pipe is fully developed flow. Combined with the experimental data conditions of statistics, it can be seen that the experimental data of liquid holdup selected in this paper are all gas-liquid twophase fully developed flow experiments in large pipe. Therefore, the calculation of liquid holdup of gas-liquid two-phase flow in pipe with any pipe diameter and pipe length is applicable. In addition, the two phases in pipe are affected by gravity, wall shear stress, and gas-liquid interface shear force, which are in line with the dynamic characteristics of actual production, and follow the similarity criterion of motion. Therefore, the calculation of liquid holdup is established by using BP neural network algorithm. The model is still applicable to the calculation of the liquid holdup ratio of the two-phase flow in the pipe under other pipe diameter and pipe length conditions.

OF INFLUENCING FACTORS OF LIQUID HOLDUP PREDICTIVE MODEL
In order to further study its predicting effects, the new prediction model will be tested to select the method for the sensitivity analysis with six main influencing factors. Saghafi 37 used a large database including nearly 1200 data points from all over the globe was collected for modeling. The performance of the new models was compared with correlations in the existing literature via several graphical and statistical paradigms. Variance approach analysis was implemented to determine the sensitivity of the target parameter as the output with respect to each input variable. However, the sensitivity analysis of the influencing factors with ANOVA requires the involvement of all data and complex calculation. Therefore, in order to achieve a reliable conclusion and reduce the number of tests, 38 orthogonal test design method is selected in this paper.

| Design of experimental data
This paper adopts BP neural network algorithm predictive model. All design data are collected by the author. Six factors by three levels are demonstrated in Table 4.

| Sensitivity analysis of predictive model
In order to analyze the effect of pipe diameter, gas-liquid apparent flow velocity, pressure, temperature, and viscosity on liquid holdup, this experiment adopts the orthogonal experiment design. The predictive model is employed here to calculate the values required in Table 5, which are used later for conducting sensitivity analysis of the six influencing factors. Table 6 shows the predicted values of the liquid holdup of the neural network at three levels.
As the value range of k in the orthogonal test determines the influence degree of each influencing factor, three levels are taken as the horizontal coordinate, k1, k2, and k3 as the vertical coordinate to draw a graph shown in Figure 7, and the influence effect of each factor is analyzed through the following broken line graph.
As shown in Figure 7, pipe diameter, liquid velocity, temperature, and viscosity are positively correlated with liquid holdup. Among them, liquid velocity, pipe diameter

CONFLICTS OF INTEREST
The authors declare no conflict of interest.