Surrogate Model with a Deep Neural Network to Evaluate Gas–Liquid Flow in a Horizontal Pipe

This study developed a data-driven surrogate model based on a deep neural network (DNN) to evaluate gas–liquid multiphase flow occurring in horizontal pipes. It estimated the liquid holdup and pressure gradient under a slip condition and different flow patterns, i.e., slug, annular, stratified flow, etc. The inputs of the surrogate modelling were related to the fluid properties and the dynamic data, e.g., superficial velocities at the inlet, while the outputs were the liquid holdup and pressure gradient observed at the outlet. The case study determined the optimal number of hidden neurons by considering the processing time and the validation error. A total of 350 experimental data were used: 279 for supervised training, 31 for validating the training performance, and 40 unknown data, not used in training and validation, were examined to forecast the liquid holdup and pressure gradient. The liquid holdups were estimated within less than 8.08% of the mean absolute percentage error, while the error of the pressure gradient was 23.76%. The R2 values confirmed the reliability of the developed model, showing 0.89 for liquid holdups and 0.98 for pressure gradients. The DNN-based surrogate model can be applicable to estimate liquid holdup and pressure gradients in a more realistic manner with a small amount of computating resources.


Introduction
The accurate evaluation of multiphase flow has been essential not only for optimum facility designs, but also for the estimation of transport features in pre-installed pipes. The oil and natural gas industries require time-consuming experimental analyses, but the flow characteristics, e.g., flow patterns, liquid holdup, superficial velocities, and pressure gradient, are uncertain. These uncertain parameters are important for demonstrating transport phenomena but they are linked nonlinearly. A few analytical models implement closure relationships that depend on experimental data and therefore they have the limitation of the applicable ranges used in the experimental works. The experiments validated the numerical simulations with the closure relationships, as well as the mechanistic modules, e.g., OLGA (Schlumberger, Houston, USA) and Ledaflow (Kongsberg, Norway). However, the detailed designs of these numerical simulations become complicated, e.g., computational fluid dynamics, and require a large amount of computing resources and skillful user interactions [1,2].
Many works have validated their effectiveness using the experimental database, e.g., TUFFPDB (University of Tulsa Fluid Flow Projects Database) and the experimental database of the University of Amsterdam. The empirical interpretations proposed different interpolation rules within the experimental ranges [3][4][5][6][7][8][9]. Choi et al. [6] introduced a drift-flux closure relationship to interpolate the experimental results and estimate the liquid holdup. Their model estimated the liquid holdups of experimental data from 0.042 up to 0.156 of the mean absolute error. Lee et al. [7] examined the applicability of the minimum dissipated energy concept to explain the stratified gas-liquid flow in horizontal pipes and confirmed its usefulness by estimating liquid holdups and pressure gradients. Luo et al. [9] proposed an empirical power-law model not subject to the experimental ranges to predict the liquid holdup in vertical gas wells.
Machine learning methods have been actively implemented to predict the multiphase flow characteristics [10][11][12][13][14][15]: some studies implemented an artificial neural network [10][11][12] and Mask et al. [13] implemented dimensionless parameters to estimate the flow patterns. Kanin et al. [14] trained a machine learning algorithm to validate the mechanistic models. Mohammadi et al. [15] used a genetic algorithm to select closure relationships in multiphase flow models. These studies have focused on securing the most accurate ways to explain the nonlinearity more effectively between input and output data. Deep neural networks (DNNs), as a class of machine learning techniques, implement a few hierarchical hidden layers of non-linear transforms and improves the performances of a typical artificial neural network with one hidden layer [16][17][18][19]. The neural networks normalize the input data such that they can integrate different-scaled data. Added hidden layers reduce the number of calibrating parameters, thereby it can seek the non-linear relationships among the parameters more effectively, i.e., deep learning.
An objective of this paper was to develop a DNN framework, i.e., a data-driven surrogate (proxy) model, to estimate the liquid holdup and pressure gradient for a gas-liquid multiphase flow in horizontal pipes instead of using numerical simulations. DNN with multiple hidden layers was applied to secure an accurate empirical relationship between the experimental input factors and the estimating values. The experimental data were used to validate the reliability, to train the neural network, and to predict the flow-related parameters.

Methodology
The representative parameters used to explain gas-liquid flow characteristics are the liquid holdup and pressure gradient; the liquid holdup, i.e., the fraction of a part of pipe occupied by liquid, demonstrates the amount of liquid transported through pipes, while the pressure gradient, i.e., pressure drop divided by the given length of the horizontal pipe, is essential for designing the transport facilities. Various empirical correlations have been proposed to explain these parameters, e.g., Equations (1) and (2) for a horizontal pipe [20][21][22], but these correlations are challenging to use due to the complexity and the uncertainty of multiphase flow.
non-homogeneous flow (2) In Equations (1) and (2), the no-slip liquid holdup (λ L ) is the ratio of the liquid volumetric flow rate to the total volumetric flow rate [22]. A P represents the cross-sectional area of pipe and A L is the cross-sectional area occupied by liquid in the pipe. q L is the flow rate of liquid and q g is the flow rate of gas. v SL = q L A P is the liquid superficial velocity and v SG = q g A P is the gas superficial velocity. a 1 , a 2 , and a 3 are the coefficients for liquid holdup correlation, which are different for different flow patterns. f is the friction factor related to the pipe diameter (d) and roughness. N FR = v 2 m gd is the mixture Froude number, where v m = v SL + v SG (mixture velocity). E k is a dimensionless kinetic or acceleration energy term. ρ n is the no-slip density. The no-slip condition occurs where the input phase-superficial velocities are constant in the course of the gas-liquid flow, e.g., a typical stratified flow pattern. A homogeneous two-phase flow is defined as the flow structure in which the two phases travel at the same in-situ velocity while a non-homogeneous flow means the flow structure in which the mixture physical properties vary across the pipe's cross-sectional area [22].
The experimental data were from Gokcal [23,24], which considered a viscous oil-air mixed flow in horizontal pipes, where the viscous oil was Citgo sentry 220 oil with a density range from 833.6 to 884.5 kg/m 3 (Table 1). Gokcal [23] investigated various flow patterns while Gokcal [24] investigated slug flow. The experimental data showed a slip condition since the liquid holdups resulting from the multi-phase flow experiment were not equal to the no-slip liquid holdups (λ L ). The total number of available data was 350: 279 for the supervised training of the DNN, 31 for validating the training performance, and the other 40 data were for testing the predictability. A reason why 310 training data were divided into the training and validation sets was to examine any overfitting or underfitting problems. A data-shuffling process was implemented to split the data. A total of 40 experimental data that were not used in either training or validation were randomly selected for testing the predictability ( Table 2). Table 1. Summary of experimental data for the input and the output parameters in the deep neural network (DNN).

Experimental Data Parameters 1 Number of Data Points
Gokcal [23] Air and oil (Citgo sentry 220 oil)   Figure 1 explains how to establish empirical correlations using a backpropagation algorithm between the input and output data in multi-hidden-layered neural networks (Equation (3); [18,25]).
(3) Figure 1. DNN structure to establish the empirical relationship between the input and the output layer.
In Equation (3), a k i denotes the value of the ith neuron at the kth hidden layer. f a is an activation function. w is a weight and b is a bias. x is the value in the input layer andŷ is the estimated value at the output layer. Figure 2 depicts the DNN framework consisting of one input, one output, and two hidden layers in this study. The performance of estimating the output neurons depended on the design of hidden layers, e.g., the number of neurons in the hidden layers, the activation function, and the filters. The input layer (X) was composed of the normalized properties, such as the liquid superficial velocity, gas superficial velocity, liquid density, gas density, and temperature (see Equation (4)). On the other hand, the output layer (Ŷ) had the liquid holdup and pressure gradient. Two hidden layers were introduced and the effects of setting the number of neurons were examined as a result of changing the neurons in the hidden layers in terms of the computation cost, i.e., the processing time, and the validation loss, i.e., the mean square error between the estimated values and the true (experimental) data for cost function. The number of nodes in the second hidden layer (H DNN2 ) was assumed to be half of the node number in the first hidden layer (H DNN1 ).
In Equation (4), x norm in X represents the normalized x value, and the subscripts MIN and MAX are the minimum value and the maximum value of x. The Nesterov accelerated gradient was introduced as a momentum optimizer (Equation (5); [26]) and the rectified linear unit (ReLU) was used for the activation function. The training continued until the optimizer converged before 40 epochs. Some methods, e.g., dropout, batch normalization, and weight regularization, was used to try to fix the overfitting matter.
In Equation (5), w is the parameter to update, i.e., weight. θ t denotes the update vector of the current time, t. γ is the momentum term that this work set to 0.9. J is a loss function, i.e., cost function, and ∇ w J is a gradient vector of the loss function. η represents the learning rate that was assigned 0.001 in this study. He et al.'s scheme initializes the weights applicable to ReLU (Equation (6); [27]). W is a set of weights. σ 2 (W) is the variance of weights and n in is the number of nodes in the previous layer.
Three kinds of errors were applied: the root mean squared error (RMSE; Equation (7)), the percentage error (Equation (8)), and the mean absolute percentage error (MAPE; Equation (9)): In Equations (7)-(9), ε RMSE denotes RMSE, n is the number of output data points, Y i represents the actual experimental data, andŶ i are the values estimated using the DNN. The percentage error (ε PE ) measures the difference between the predicted and the experimental value, divided by the experimental value, and expresses the error as a percentage. The MAPE (ε MAPE ) is the arithmetic mean value of the percentage errors and is implemented for both the validation and testing sets. The optimum number of nodes in the hidden layers was determined using the results of the processing time, i.e., training time to construct the DNN model, and the MAPEs.

Design of the Deep Neural Network: The Number of Hidden Neurons
Both performances of training with validation loss and the predictability with the testing dataset were examined by changing the number of nodes in the hidden layers. Since the node number of the second hidden layer was set as half of that in the first hidden layer, the performances were observed in terms of the number of the first hidden layer from 10 to 1000. The processing time refers to the training time, i.e., time for constructing the DNN using supervised training. It was measured when the optimization scheme, i.e., the Nesterov accelerated gradient, converged until 40 epochs, thereby it can be different with the number of nodes in the hidden layers and the final epoch number. The measuring computer system was as follows: Intel Xeon CPU E5-1620v3 @3.50GHz, 64GB RAM, and NVIDIA GeForce GTX 1060 6GB. Table 3 summarizes the range of the validation loss to evaluate the DNN training performances. The RMSEs of the validation dataset ranged from 0.0632 to 0.0742 (unitless) for the liquid holdup and from 615.87 to 903.84 Pa/m for the pressure gradient. The predictability of the pressure gradient was less than that of liquid holdup; the reasons for this could be the high nonlinearity and complexity of the pressure gradient. The large range of the pressure gradient, e.g., from 6000 to 8000 Pa/m, caused a high RMSE such that both the RMSE and MAPE should be considered.  Figure 3 depicts the processing time and the MAPE (ε MAPE defined in Equation (9)) of liquid holdups estimated using the validation data (31 data not used in training). Figure 4 demonstrates those of the pressure gradient. Both overall trends of processing time increased as the number of nodes in hidden layers increased. The processing time for less than 100 nodes in the first hidden layer was not high, but if applying over 100 nodes, the processing time increased dramatically in the case of predicting the liquid holdup ( Figure 3). For the pressure gradient, the trend of processing time was similar to that of the liquid holdup but the errors fluctuated in the range of 30 to 100 for the number of nodes in the first hidden layer. The overall trend of errors, i.e., both for the liquid holdup and pressure gradient, converged after 70 nodes and decreased by up to 30% of the MAPE (Figures 3 and 4). The errors did not necessarily decrease even when the number of neurons in the hidden layer increased. This trend of processing time and error shows that the optimum conditions satisfying the acceptable training time and errors could be contentious because this study assumed several fixed constraints: the neuron number in the second hidden layer was half that in the first hidden layer and the converging criterion was limited until the given epoch. Figures 3 and 4 can be used to recommend 70 nodes in the first hidden layer and 35 nodes in the second hidden layer as the optimum DNN model with the consideration of the processing time and the training accuracy for both the results of validating the liquid holdup and pressure gradient.   Figure 5 compares the values predicted using the DNN with those of the experimental results; the proposed DNN implemented 70 nodes in the first hidden layer and 35 nodes in the second hidden layer. The MAPEs were 8.08% for the liquid holdup and 23.76% for the pressure gradient. The R 2 showed a high correlation, i.e., 0.89 for the liquid holdup and 0.98 for the pressure gradient, which was enough to confirm the robustness of the proposed DNN (Table 4). The predictability of the pressure gradients was reliable given the high R 2 value, notwithstanding that they had a wide range from 0 to near 8000 Pa/m in this study. The predictability of the liquid holdup was better or similar to the existing closure relationships [6,8,10,11], e.g., 3.7%-24.5% [6]. The errors of the pressure gradient were not less than the results of the previous works, e.g., around 4%-36% [5,7,8]. Since the available data and the methods in the previous works are different, a direct comparison of the results does not provide a reliable evaluation. Therefore, the errors and the R 2 values, i.e., the correlation between the true and the estimated values, must examine the reliability of the developed model.   Figure 6 depicts the percentage errors (Equation (8)) with the values estimated from the DNN. The largest percentage error was 67.23%, for the case of annular flow, with a 0.12 (relatively a small value) liquid holdup, while that of the pressure gradient was 167.0%, observed for slug flow, with 48 Pa/m (a small value). Given the definition of MAPE (Equation (9)), the smaller the value of the denominator, the more the error tends to increase. Five outliers, with percentage errors of 50% or more, influenced the MAPE; the number of outliers when predicting liquid holdups was 1 and that for pressure gradients was 4. All singular values were in the zone where the true values were small. Therefore, Figure 6 proves that the developed model could accurately estimate both the liquid holdup and the pressure gradient, except for the outliers. A notable result is that the DNN-based model can be applicable to reliably estimate the flow characteristics without time-consuming numerical simulations and user interactions, even though the flow patterns are various in horizontal pipes. The factors influencing the liquid holdup or pressure gradient can be different and thereby the separate model composed of different input parameters can improve the prediction performances. This study discusses the characteristics of gas-liquid multiphase flows that are easily identified using only five simple input parameters. Obtaining enough experimental data to improve the DNN workflow is challenging; the time-consuming work and the complexity of the experimental designs limit the ability to obtain big data suitable for training neural networks and for improving the predictability under various experimental conditions. This paper is limited for the case of horizontal flow and a few flow patterns. If the training and testing data with different flow patterns is enough, a more quantitative analysis would be available that is related to the effects of flow patterns on the prediction accuracy. Constructing the standard forms of neural networks, e.g., determination of the optimum activation functions and elements of the neural networks, is still challenging to obtain to improve the robustness of the deep learning. Enhancement of the neural network requires the intensive examinations of various activation functions and details of designing neural networks to yield more reliable predictions.

Conclusions
This study developed a noble machine learning approach based on a deep neural network to evaluate the liquid holdup and pressure gradient of a gas-liquid two-phase flow in a horizontal pipe. The optimal design of two hidden layers in the neural network was obtained from the comparison of the processing time and training accuracy. Experimental results with different flow patterns in a horizontal pipe examined the reliability of the proposed DNN-based surrogate model: the mean absolute percentage errors were 8.08% for the liquid holdup and 23.76% for the pressure gradient, while the R 2 values were 0.89 for the liquid holdup and 0.98 for the pressure gradient. This study developed the data-driven surrogate model to accurately estimate both the liquid holdup and pressure gradient without time-consuming numerical simulations.