Calculation method of production pressure drop based on BP neural network velocity pipe string production in CBM wells

In the stable production stage CBM wells have the characteristics of high gas production and low water production. The use of continuous velocity tube technology for drainage can achieve better drainage results. Accurate and rapid prediction of the pressure drop of velocity pipe string production in a coalbed methane well has become the key to the operation and management of velocity pipe technology. This paper uses the nonlinear mapping and prediction capabilities of the BP neural network to build a three-layer BP neural network to construct a velocity pipe string production pressure drop prediction model. The model is based on gas production, water production, bottom hole pressure, pipe string diameter, and well depth. The five factors are input, and the pressure drop of the pipe string is the output, which can quickly and accurately realize the pressure drop analysis and calculation of the speed pipe drainage. The analysis shows that it is feasible to use the BP neural network to calculate and analyse the pressure drop of the velocity string of coalbed methane wells.


Introduction
In recent years, the exploration and development of unconventional natural gas resources in coal-measure strata have continued to develop. Because CBM wells have the characteristics of high gas production and low water production during the stable production stage, and the artificial lift drainage gas recovery technology cannot adapt to the production law of CBM wells. Velocity string extraction technology has gradually become a choice of technology for coalbed methane wells during stable production stage. Velocity string technology can realize the drainage gas recovery (self-spray production) operation of low-pressure water-producing gas wells [1] , and can meet the drainage requirements of the stable production stage of coalbed methane wells [2] . Compared with the current manual lift drainage gas production, the speed String technology can more accurately adjust the bottom hole pressure. Considering the production law of coalbed methane wells [2] , in the design of velocity string production of coalbed methane wells, the pressure drop of the string section is a key factor affecting the design of velocity string [1,3] . In the process of coalbed methane production, the pressure drop of the pipe string in the wellbore is affected by many factors. Existing calculation models mostly use data fitting methods to obtain calculation parameters, which are far from the actual production wells, and the calculation process is complex, and the pressure drop calculation accuracy is poor [4] . Accurate and rapid acquisition of the string pressure drop can provide reference and basis for IOP Conf. Series: Earth and Environmental Science 619 (2020) 012044 IOP Publishing doi:10.1088/1755-1315/619/1/012044 2 judging the feasibility of applying the velocity string extraction technology in the target well and for reasonable string structure design. Therefore, the study of the calculation method for the pressure drop of the velocity string in the high-production stage of the CBM well is of great significance for popularizing the velocity string technology of the CBM well.
Velocity tubing string is a small diameter tubing string (usually 1-2 inches coiled tubing) that throttles downhole fluids and is suitable for low pressure and low production gas wells [1,5,6] . The production of coalbed methane wells reduces the formation pressure by draining the produced water from the formation, so that methane gas is desorbed from the coal matrix and flows to the surface. The velocity pipe string process is used to discharge liquid and gas, and the mixed fluid of gas and water flows upward in the pipe string. In the process of designing the velocity string of coalbed methane wells, the gas velocity is the key to whether it can carry liquid. The calculation and verification of the pressure drop along the production pipe string is the key to whether the gas can carry liquid effectively [6] . According to the relevant calculation model, considering the actual development of coalbed methane wells, the pressure condition calculation mainly considers the influence of five factors such as gas production, water production, bottom hole pressure, pipe string diameter, and well depth.
Neural network technology has high nonlinear mapping and parallel processing capabilities, can truly depict the nonlinear relationship between input variables and output variables, and has been widely used in engineering fields such as geology and control [7,8] .
In view of this, this paper aims at the calculation of the pressure drop of gas and water two-phase flow in the process of CBM well velocity string production design process, and constructs the BP neural network CBM well velocity string production pressure drop prediction model, which is designed for the field use of velocity string. The production dynamic adjustment provides a basis, can effectively avoid the error of the model itself, simplifies the pressure drop solving process in the design process, improves the accuracy of the pressure drop calculation and cumbersome code editing.

Current Research Status of Velocity String Pressure Drop Calculation
The velocity string production belongs to the gas and water two-phase vertical pipe flow. At present, the relevant scholars at home and abroad have conducted more in-depth research on the calculation of the pressure drop of the gas and water two-phase vertical pipe flow [4,[9][10][11][12] , obtained a series of calculation formulas for calculating liquid holdup, two-phase mixing density, pressure gradient, etc. According to whether to consider the change of the flow pattern in the two-phase flow process, it can be divided into two types. Among them, the commonly used methods are Hagedorn-Brown, Duns-Ros, Beggs-Brill, Orkiszewski, Hasan & Kabir, etc. According to the data [4,11] , the Hagedorn-Brown method has the smallest calculation error. The pressure drop calculation model proposed by Hagedorn-Brown is based on the single-phase airflow calculation model to obtain the stable flow energy equation of multiphase flow (1) Utilization Iterative calculation to solve. According to domestic data, using this model to solve the multiphase vertical pipe flow, the average error can be achieved within 6.06%. The model is as follows: In the formula: p is pressure, Pa; m ρ is the mixed density of gas and water in the pipe, kg/m 3 ; h is the length of the wellbore, in m; v m is the flow rate of the mixed fluid, in m/s; f m is the friction coefficient; d is the diameter of the pipe string, in m.
The relationship between gas and water in the vertical circular tube as follows: In the formula: Mt is the total mass of associated gas and water produced per cubic meter of water under standard conditions, kg/m 3 ; qL is the water produced, m 3 /d； As the current velocity string technology has not been applied to CBM wells, the Hagedorn-Brown model calculation is used as the original data for training.

BP neural network structure selection
The BP neural network structure consists of an input layer, a hidden layer and an output layer. The hidden layer can have multiple layers. In engineering prediction, a 3-layer BP neural network structure is usually used (Figure 1). The characteristics of this neural network structure are: there is no connection between neurons in each layer, and there are unidirectional connections between neurons in adjacent layers. The activation function of the hidden layer uses a nonlinear sigmoid function, and the output layer The activation function of is a linear function.

The basic principle of BP algorithm
The BP algorithm is a supervised learning algorithm, which refers to the n learning samples (x 1 , x 2 ,..., x n ) of the input layer of the neural network and the corresponding n output samples (y 1 , y 2 ,..., y n ). ), through the actual output of the network n data (z 1 , z 2 ,..., z n ), so that the network output data (z 1 , z 2 ,..., z n ) and the target sample (y 1 , y 2 ,..., y n ) as much as possible Close, the sum of squared errors between the two sets of data is minimized. Figure 1. A three-layer neural network structure diagram

Data preprocessing
The physical quantities of the input nodes of the BP network are different, and there may be several orders of magnitude difference between different sets of data. In order to prevent smaller values from being overwhelmed by larger values, preprocessing is performed before data input, and all data is normalized to between 0 and 1. Since the sigmoid function in the BP algorithm changes very slowly when the data is close to the two ends of the 0~1 interval, in order to effectively improve the calculation speed and reduce the learning time, this processing is to process all the training data through the interval [0.05, 0.95]. Can accelerate the speed of network learning. The conversion method is as follows: In the formula: a is the original data; a max is the maximum value in the original data, a min is the minimum value in the original data, and A is the processed data.

Hidden layer neuron design
For CBM well velocity string pressure drop prediction problem, a three-layer neural network structure-input layer, single hidden layer-output layer is selected. The number of neurons in the input layer is 5, and the number of neurons in the output layer is 1. There is a relationship between the design of the number of hidden layer neurons and the problem type, the number of input and output neurons, and the selection is generally based on the following formula: In the formula: n m is the number of neurons in the hidden layer; n i is the number of neurons in the input layer; n o is the number of neurons in the output layer; b is a constant between 1 and 10. The number of neurons in this network is 3~13. Through multiple times training and comparison, the number of hidden layer neurons in this model is selected as 13.

Neural network training and testing
In this paper, based on the BP neural network, the velocity and string pressure drop prediction of coalbed methane wells is carried out, and the modeling process is realized by programming with MATLAB.

Selection of training data
Considering the different pressure drop calculation models, the main factors affecting the gas and water pressure drop are the diameter of the pipe string, the penetration depth, the gas-water ratio and the bottom hole pressure. The selection of BP neural network training data is carried out in the following way: according to the actual situation of the drainage parameters of the high-yield coalbed methane wells in the stable production stage in the Qinshui Basin, considering the calculation cost and other factors, the value range of each variable in the training data is limited ( See Table 1).  Table 1 is brought into the solution to obtain the corresponding pressure drop value. The BP neural network is performed using the above input and the corresponding pressure drop value. After training, the training data was used to verify the training effect of the model. The relative error between the true value of the training data and the predicted value of the neural network model is shown in Figure 2. It can be seen from the figure that the relative error between the pressure drop value obtained by the BP neural network technology and the original data is within 0.35%, so the BP neural network training result can be considered as good.  The calculation results of other data are used for model testing, and the comparison between the real value and the predicted value is shown in Figures 3 and 4.
It can be seen from Figure 4 that the maximum relative error between the test value and the true value is 5.30%, and the average relative error is 2.48%, which is much smaller than the average relative error of the Hagedorn-Brown calculation method (6.60%). It can be seen that this calculation method is effective Improving the accuracy of solving the pressure drop of the velocity string can better meet the accuracy requirements of the design of the velocity string, and can simplify the programming process, eliminating the workload of writing a large number of intermediate variable calculation programs in the pressure drop calculation process. Therefore, the BP neural network prediction scheme is feasible in the velocity string pressure drop prediction of coalbed methane wells.

Conclusion
(1) Neural network has strong non-linear mapping and data prediction capabilities. It is feasible to apply to the velocity string pressure drop prediction process of coalbed methane wells, which can effectively avoid the complicated calculation of intermediate parameters and programming of the existing pressure drop solution process. Problems such as heavy workload can facilitate the design and use of on-site personnel.
(2) The model test was carried out according to the parameters of the coalbed methane production well in the Qinshui Basin. The analysis results showed that the maximum absolute error of the velocity string pressure drop calculation using the BP neural network was 0.02MPa, the minimum absolute error was 2.2×10 -5 MPa, and the average relative error is 2.48%, and the prediction effect is good.