Large-fluctuation oil-gas mixed transportation pipeline liquid holdup prediction method based on SSA-BP neural network

By introducing the SSA algorithm into the BP neural network to optimize parameters, the SSA-BP neural network is formed, which solves the problems of slow learning speed and over-fitting in the prediction of liquid holdup in large fluctuation oil and gas mixed pipelines, and improves the accuracy and stability of prediction. .

CN118569067APending Publication Date: 2024-08-30SOUTH CHINA UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410626009.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-20
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

The existing technology has the problems of slow learning speed, easy falling into optimality and over-fitting when predicting liquid holdup in large fluctuation oil and gas mixed transportation pipelines, resulting in inaccurate prediction results.

Method used

The SSA algorithm is used to optimize the BP neural network, and the parameter weights and thresholds of the BP neural network are assigned by outputting the optimal position and the best fitness value to form an SSA-BP neural network model, which is used for liquid retention of oil and gas mixed transportation pipelines with large fluctuations. rate prediction.

Benefits of technology

It improves the learning speed and global search ability of BP neural network, overcomes the shortcomings of traditional BP neural network, and achieves more efficient and accurate liquid retention rate prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118569067A
    Figure CN118569067A
Patent Text Reader

Abstract

The invention relates to an SSA-BP neural network-based liquid holdup prediction method for a large-fluctuation oil-gas mixed transportation pipeline, and the method comprises the following steps: calculating flow data of the large-fluctuation oil-gas mixed transportation pipeline under different actual working conditions through an OLGA, collecting and analyzing the data, screening out liquid holdup influence factors, and determining BP neural network input parameters; constructing a BP neural network optimized by an SSA algorithm, wherein the BP neural network comprises the following steps: determining an initial structure of the BP neural network; initializing population parameters; calculating individual fitness and obtaining a current optimal solution; updating the positions of the discoverer, the subscriber and the reconnaissitor; iterating until an end condition is met, outputting an optimal weight and a threshold value, and endowing the optimal weight and the threshold value to the BP neural network; a BP neural network is trained, and the liquid holdup is predicted; and calculating an evaluation index and evaluating a prediction effect. The BP neural network is optimized through the SSA algorithm, the convergence speed is increased, the accuracy is improved, and the result shows that the method is high in prediction precision and suitable for predicting the liquid holdup of the large-fluctuation oil-gas mixed transportation pipeline.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of gas-liquid two-phase flow prediction of mixed pipelines, and in particular to a method for predicting liquid holdup of a large fluctuation oil and gas mixed pipeline based on an SSA-BP neural network. Background Art

[0002] The growing demand for energy in today's world is driving the development of oil and gas fields. In the process of oil and gas field development, a large amount of crude oil and natural gas are often produced, which need to be transported from the mining site to the processing plant, storage facilities or consumption site through pipelines. The mixed oil and gas transportation method can transport oil and gas in the same pipeline at the same time, effectively improving the transportation efficiency and reducing the waste of energy resources, which is of great significance to the development of the energy industry and resource utilization. However, the development of oil and gas fields in my country mostly involves mountainous and hilly areas. For large-undulating oil and gas mixed pipelines, due to the large terrain fluctuations, liquids are easily accumulated in low-lying areas, which affects the transportation efficiency and may also cause pipeline corrosion and other problems, which is not conducive to the safe and efficient operation of mixed pipelines. Compared with single-phase flow pipelines, the process calculations considering gas-liquid two-phase in mixed pipelines are more complicated. The study of the liquid accumulation law in mixed pipelines is mainly reflected through calculations of flow type discrimination, pipeline liquid holdup, pressure drop prediction, etc. Among them, the calculation of liquid holdup can indirectly reflect the amount of liquid accumulation in the pipeline, which is very important for studying the liquid accumulation law in large-fluctuation oil and gas mixed pipelines. Therefore, accurate liquid holdup prediction technology is needed.

[0003] At present, most liquid holdup calculation models are based on empirical or semi-empirical correlations. These methods are relatively complex and the calculation results have large errors. With the development of big data science and artificial intelligence, the emergence of neural networks has brought new ideas and methods to the study of liquid holdup prediction. In recent years, some scholars at home and abroad have carried out research on the prediction of liquid holdup in mixed pipelines based on various neural network algorithms. Shao Mengliang et al. (Shao Mengliang, Yu Yingmin. Optimization of BP neural network gas-liquid two-phase flow liquid holdup prediction model based on genetic algorithm [J]. Journal of Xi'an Shiyou University (Natural Science Edition), 2019, 34(06): 44-49.) Combined genetic algorithm and BP neural network, optimized weights and thresholds, and constructed an inclined pipeline liquid holdup prediction model; Zheng Lin et al. (Zheng Lin, Liu Yun. Liquid holdup prediction model based on big data method [J]. Natural Gas and Petroleum, 2021, 39(04): 20-25.) Constructed a liquid holdup prediction model GA-GRE-BP based on genetic algorithm and grey correlation entropy weighting; Xiao Rongge et al. (Xiao Rongge, Jin Shuaishuai, Zhuang Qi, et al. Research on liquid holdup prediction model based on WOA-BP algorithm [J]. Chemical Engineering, 2022, 50(01): 67-73.) Combined WOA algorithm and BP neural network, a horizontal pipe liquid holdup prediction model was constructed.

[0004] The problem of predicting the liquid holdup in a large undulating oil and gas mixed pipeline involves the comprehensive influence of complex nonlinear multiple factors, mainly including pipe diameter, pressure, temperature, inclination, gas phase conversion velocity, liquid phase conversion velocity, liquid phase viscosity, etc. The BP neural network algorithm can well solve the prediction problem of the nonlinear influence of multiple independent variables on a single dependent variable. However, the change of the number of hidden nodes in the traditional BP neural network algorithm during the training process is also accompanied by the change of initial weights and thresholds, which is prone to slow learning speed, easy to fall into optimality and overfitting, thereby affecting the accuracy of the prediction results. To solve the above problems, the researchers proposed a SSA algorithm to optimize the BP neural network model to predict the liquid holdup of large undulating oil and gas mixed pipelines. Summary of the invention

[0005] In view of the above problems, the present invention proposes a liquid holdup prediction method for a large fluctuation oil and gas mixed pipeline based on SSA-BP neural network to improve the accuracy and stability of liquid holdup prediction.

[0006] The present invention is achieved by at least one of the following technical solutions.

[0007] The method for predicting the liquid holdup of a large-fluctuation oil and gas mixed pipeline based on SSA-BP neural network includes the following steps:

[0008] S1. Establish an actual large-volume oil and gas mixed transportation pipeline model, conduct oil and gas mixed transportation simulation, and obtain pipeline flow data;

[0009] S2, perform data preprocessing, divide the training set and the test set, build a BP neural network, and initialize the model parameters of the BP neural network;

[0010] S3, substitute the training set data into the BP neural network for training;

[0011] S4, output the optimal position and the best fitness value through the SSA algorithm, assign them to the BP neural network as parameter weights and thresholds respectively, and obtain the optimal SSA-BP neural network model;

[0012] S5. Use the optimal SSA-BP neural network model to predict the liquid holdup, denormalize the output prediction data, and obtain the liquid holdup prediction result of the large fluctuation oil and gas mixed pipeline based on actual operating conditions.

[0013] Furthermore, the error analysis between the final liquid holdup prediction results and the actual operating condition simulation values ​​was performed to evaluate the prediction performance of the optimal SSA-BP neural network model.

[0014] Furthermore, the prediction performance of the optimal SSA-BP neural network model was evaluated by calculating the mean absolute error, root mean square error and goodness of fit.

[0015] Furthermore, the specific method of obtaining pipeline flow data in step S1 is: using OLGA software to establish an actual large-fluctuation oil and gas mixed pipeline model, importing fluid component information, elevation mileage information, pipeline wall thickness material information, and insulation layer information into the actual large-fluctuation oil and gas mixed pipeline model, and setting model boundary conditions according to the actual pipeline operating pressure, temperature, and flow rate;

[0016] OLGA software is used to calculate pipeline flow data, including pressure, temperature, pipeline inclination, gas conversion velocity, liquid conversion velocity, liquid phase viscosity, and liquid holdup.

[0017] Furthermore, data preprocessing includes normalizing the pipeline flow data, as shown in the following formula:

[0018]

[0019] Where X is the normalized data, x is the input feature value in the pipeline flow data, and xmax and xmin are the maximum and minimum values ​​of the input feature in the pipeline flow data, respectively.

[0020] Furthermore, the pipeline flow data is divided into a training set and a test set in proportion.

[0021] Furthermore, the BP neural network includes an input layer, a hidden layer, and an output layer.

[0022] Furthermore, the normalized training set data is substituted into the BP neural network, and the BP neural network is trained using the SSA algorithm to form a prediction model based on the SSA-BP neural network.

[0023] Further, the optimal position and the optimal fitness value are outputted by the SSA algorithm, including the following steps:

[0024] S4.1. Initialize the parameters of the SSA sparrow population, including the initial sparrow population size, the maximum number of iterations, the flock warning value, the proportion of discoverers, and the proportion of scouts;

[0025] S4.2, based on the SSA parameters initialized in step S4.1, iterate, calculate the individual fitness and obtain the current optimal solution, and update the positions of the discoverer, joiner, and scout, iterate until the end condition is met, and output the optimal position and the best fitness value;

[0026] S4.3, assign the optimal position and the best fitness value outputted in step S4.2 to the BP neural network as parameter weight and threshold, respectively, so as to obtain the optimal SSA-BP neural network model.

[0027] Furthermore, the output prediction data is denormalized, and the formula is as follows:

[0028] Y=y(x max -x min )+x min (2)

[0029] Where Y is the normalized output prediction value; y is the denormalized actual prediction value, and xmax and xmin are the maximum and minimum values ​​of the input features in the pipeline flow data, respectively.

[0030] The method for predicting the liquid holdup of a large-fluctuation oil-gas mixed pipeline based on the SSA-BP neural network proposed in the present invention has the following beneficial effects compared with the existing technology:

[0031] The SSA-BP neural network-based model proposed in the present invention predicts the liquid holdup of a large undulating oil and gas mixed pipeline, and calculates the optimal weights and thresholds through the SSA algorithm, thereby overcoming the problems of slow learning speed, easy to fall into the optimal and overfitting of the traditional BP neural network algorithm, improving the global optimization ability of the BP neural network algorithm, achieving better stability, global search ability and convergence speed, and providing an accurate and efficient liquid holdup prediction method. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 This is a flow chart of a method for predicting liquid holdup of a large-volume oil and gas mixed pipeline based on an SSA-BP neural network model;

[0033] Figure 2 It is a schematic diagram of the geometric model of the large-volume oil and gas mixed transmission pipeline of the embodiment;

[0034] Figure 3 It is a comparison chart of the predicted value and the true value based on the SSA-BP neural network model of the embodiment;

[0035] Figure 4 This is a comparison chart of mean absolute errors of the four prediction models in the embodiment;

[0036] Figure 5 Root mean square error comparison diagram of the four prediction models in Example 1;

[0037] Figure 6 It is a comparison diagram of the goodness of fit of the four prediction models in Example 1. DETAILED DESCRIPTION

[0038] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention, but the implementation of the present invention is not limited thereto. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0039] like Figure 1 As shown, this embodiment provides a method for predicting the liquid holdup of a large-fluctuation oil and gas mixed pipeline based on an SSA-BP neural network, comprising the following steps:

[0040] S1. Establish an actual large-volume oil and gas mixed transportation pipeline model, conduct oil and gas mixed transportation simulation, and obtain pipeline flow data;

[0041] The specific method of obtaining pipeline flow data is: using OLGA software to establish an actual pipeline model, wherein the geometric model is as follows: Figure 2 As shown, the model imports fluid component information, elevation mileage information, pipeline wall thickness material information, and insulation layer information, and sets the model boundary conditions according to the actual pipeline operating pressure, temperature, and flow rate;

[0042] As an embodiment, OLGA software is used to calculate pipeline flow data, including pressure, temperature, pipeline inclination, gas conversion velocity, liquid conversion velocity, liquid phase viscosity, and liquid holdup, as shown in Table 1.

[0043] Table 1 Simulated flow data of a large-volume oil and gas mixed pipeline in an oil and gas field

[0044] data Value range unit Pipe inner diameter 0.0080~0.0200 m Gas phase conversion rate 0.0050~16.1262 m / s Liquid phase conversion speed 0.0614~3.0005 m / s Pipeline inclination -13.1284~13.6117 ° pressure 0.1012~4.8686 MPa temperature 15.0027~29.9923 ℃ Liquid viscosity 4.7123~25.0362 MPa·s

[0045] S2, perform data preprocessing, divide the training set and the test set, build the BP neural network optimized by the SSA algorithm, and initialize the model parameters of the BP neural network model;

[0046] The data preprocessing is specifically performed by normalizing the pipeline flow data, as shown in the following formula:

[0047]

[0048] Where X i is the normalized value, x i is the input feature value in the data set, x max 、x min are the maximum and minimum values ​​of the input features in the dataset, respectively.

[0049] As an embodiment, the division of the training set and the test set is specifically carried out by dividing the data set into the training set and the test set in a ratio of 7:3.

[0050] The BP neural network includes an input layer, a hidden layer, and an output layer. The model parameters of the BP neural network model are initialized by: determining the number of hidden layers, the number of neurons in the input layer, the number of neurons in the hidden layer, and the number of neurons in the output layer.

[0051] Among them, the input layer includes 7 factors, including pressure, temperature, pipeline inclination, gas conversion speed, liquid conversion speed, and liquid viscosity, so the number of neurons in the input layer is 7;

[0052] The output layer outputs the predicted value of liquid holding rate, so the number of neurons in the output layer is 1;

[0053] The number of neurons in the hidden layer is determined by the following empirical formula:

[0054]

[0055] Where: N h N is the number of neurons in the hidden layer; in is the number of neurons in the input layer; N out is the number of neurons in the output layer; a is a constant ranging from 1 to 10.

[0056] As an example, the number of training times is 1000 and the target error is 1X10 -6 , the learning rate is 1X10 -3 .

[0057] S3. Substitute the normalized training set data into the BP neural network, use the SSA algorithm to train the BP neural network, and form a prediction model based on the SSA-BP neural network.

[0058] S4, outputting the optimal position and the optimal fitness value through the SSA algorithm, and assigning them to the BP neural network as parameter weights and thresholds respectively, including the following steps:

[0059] S4.1. Initialize the parameters of the SSA sparrow population, including the initial sparrow population size, the maximum number of iterations, the bird flock warning value, the proportion of discoverers, and the proportion of scouts. Among them, the initial sparrow population size is 30, the maximum number of iterations is 50, the bird flock warning value is 0.8, the proportion of discoverers is 0.2, and the proportion of scouts is 0.3;

[0060] S4.2. Based on the SSA parameters initialized in step S4.1, iterate, calculate the individual fitness and obtain the current optimal solution, and update the positions of the discoverer, joiner, and scout. Iterate until the end condition is met and output the optimal position and the best fitness value.

[0061] The calculation formula of fitness is:

[0062]

[0063] In the formula, f is the fitness value; n is the number of samples in the training set; y i is the measured value; is the predicted value;

[0064] Update the finder's position as follows:

[0065]

[0066] Where: t is the current iteration number; i = 1, 2, 3, ..., k, k is the total number of sparrows, i is the current sparrow number; j = 1, 2, 3, ..., N, N is the maximum number of iterations; is the position information of the i-th sparrow in the j-th dimension after the t-th iteration; a is a random number between [0,1]; Q is a random number that follows a normal distribution; L is a unit row vector; R2 is the warning value; S T is a safe value;

[0067] Update the position of the joiner according to the following formula:

[0068]

[0069] Where: is the current discoverer's location; is the global worst position; A + is a row vector containing only two random elements, 1 and -1;

[0070] Update the scout's position as follows:

[0071]

[0072] Where: is the current global optimal position; β is the step size parameter; K is a random number between [-1,1]; f i is the individual fitness; ε is a constant close to 0; f worst is the global worst fitness value; f best is the global optimal fitness value;

[0073] S4.3, assigning the optimal position and the best fitness value outputted in step S4.2 to the BP neural network as parameter weights and thresholds, respectively, thereby obtaining the optimal SSA-BP neural network model;

[0074] S5. Use the optimal prediction model to predict the liquid holdup, denormalize the output data, and obtain the liquid holdup prediction result of the large fluctuation oil and gas mixed pipeline based on actual working conditions.

[0075] The specific denormalization formula is as follows:

[0076] Y i =y i (x max -x min )+x min (7)

[0077] In the formula, y i is the normalized output prediction value; Y i is the denormalized actual predicted value.

[0078] S6. The predicted value of the final liquid holdup is compared with the actual operating condition simulation value through error analysis to evaluate the prediction performance of this model. The evaluation indicators include the calculated mean absolute error, root mean square error and goodness of fit.

[0079] The calculation formula of mean absolute error is as follows:

[0080]

[0081] The formula for calculating the root mean square error is as follows:

[0082]

[0083] The goodness of fit calculation formula is as follows:

[0084]

[0085] Where: m is the number of samples; y i is the true value of the liquid holdup rate of the i-th group of samples; is the predicted value of liquid holdup of the i-th group of samples; is the average value of the true value of the sample liquid holdup.

[0086] 2268 sets of liquid holdup prediction results for large fluctuation oil and gas mixed pipelines under different actual working conditions were obtained. The comparison between the predicted value and the actual value is shown in Figure 2. Figure 3 shown.

[0087] In order to verify the superiority of the SSA-BP neural network model in predicting the liquid holdup of mixed oil and gas pipelines with large fluctuations, the prediction results are compared with those of the traditional BP neural network model, the BP neural network model optimized by genetic algorithm, and the BP neural network model optimized by particle swarm algorithm. The performance is compared by calculating the evaluation index of each model. The results are as follows: Figures 4 to 6 As shown in the results, the average absolute error of the SSA-BP neural network model for predicting the liquid holdup of large-volume oil and gas mixed pipelines is 0.0329, the root mean square error is 0.0026, and the goodness of fit is 0.9802, showing good prediction accuracy.

[0088] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, etc. made without departing from the spirit and principle of the present invention shall be equivalent replacement modes and shall be included in the protection scope of the present invention.

Claims

1. A method for predicting liquid holdup of large fluctuation oil and gas mixed pipeline based on SSA-BP neural network, characterized in that: The following steps are involved: S1. Establish an actual large-volume oil and gas mixed transportation pipeline model, conduct oil and gas mixed transportation simulation, and obtain pipeline flow data; S2, perform data preprocessing, divide the training set and the test set, build a BP neural network, and initialize the model parameters of the BP neural network; S3, substitute the training set data into the BP neural network for training; S4, output the optimal position and the best fitness value through the SSA algorithm, assign them to the BP neural network as parameter weights and thresholds respectively, and obtain the optimal SSA-BP neural network model; S5. Use the optimal SSA-BP neural network model to predict the liquid holdup, denormalize the output prediction data, and obtain the liquid holdup prediction result of the large fluctuation oil and gas mixed pipeline based on actual operating conditions.

2. The method for predicting liquid holdup of large fluctuation oil and gas mixed pipeline based on SSA-BP neural network according to claim 1 is characterized in that: The error analysis between the final liquid holdup prediction results and the actual operating condition simulation values ​​was performed to evaluate the prediction performance of the optimal SSA-BP neural network model.

3. The method for predicting liquid holdup of large fluctuation oil and gas mixed pipeline based on SSA-BP neural network according to claim 2 is characterized in that: The prediction performance of the optimal SSA-BP neural network model was evaluated by calculating the mean absolute error, root mean square error and goodness of fit.

4. The method for predicting liquid holdup of large fluctuation oil and gas mixed pipeline based on SSA-BP neural network according to claim 1 is characterized in that: The specific method of obtaining pipeline flow data in step S1 is: using OLGA software to establish an actual large-fluctuation oil and gas mixed pipeline model, importing fluid component information, elevation mileage information, pipeline wall thickness material information, and insulation layer information into the actual large-fluctuation oil and gas mixed pipeline model, and setting model boundary conditions according to the actual pipeline operating pressure, temperature, and flow rate; OLGA software is used to calculate pipeline flow data, including pressure, temperature, pipeline inclination, gas conversion velocity, liquid conversion velocity, liquid phase viscosity, and liquid holdup.

5. The method for predicting liquid holdup of large fluctuation oil and gas mixed pipeline based on SSA-BP neural network according to claim 1 is characterized in that: Data preprocessing includes normalizing the pipeline flow data, as shown in the following formula: Where X is the normalized data, x is the input feature value in the pipeline flow data, and xmax and xmin are the maximum and minimum values ​​of the input feature in the pipeline flow data, respectively.

6. The method for predicting liquid holdup of large fluctuation oil and gas mixed pipeline based on SSA-BP neural network according to claim 1 is characterized in that: The pipeline flow data is divided into training and test sets in proportion.

7. The method for predicting liquid holdup of large fluctuation oil and gas mixed pipeline based on SSA-BP neural network according to claim 1 is characterized in that: The BP neural network includes an input layer, a hidden layer and an output layer.

8. The method for predicting liquid holdup of large fluctuation oil and gas mixed pipeline based on SSA-BP neural network according to claim 1 is characterized in that: The normalized training set data is substituted into the BP neural network, and the BP neural network is trained using the SSA algorithm to form a prediction model based on the SSA-BP neural network.

9. The method for predicting liquid holdup of large fluctuation oil and gas mixed pipeline based on SSA-BP neural network according to claim 1 is characterized in that: The optimal position and the optimal fitness value are output through the SSA algorithm, including the following steps: S4.

1. Initialize the parameters of the SSA sparrow population, including the initial sparrow population size, the maximum number of iterations, the flock warning value, the proportion of discoverers, and the proportion of scouts; S4.2, based on the SSA parameters initialized in step S4.1, iterate, calculate the individual fitness and obtain the current optimal solution, and update the positions of the discoverer, joiner, and scout, iterate until the end condition is met, and output the optimal position and the best fitness value; S4.3, assign the optimal position and the best fitness value outputted in step S4.2 to the BP neural network as parameter weight and threshold, respectively, so as to obtain the optimal SSA-BP neural network model.

10. The method for predicting liquid holdup of large fluctuation oil and gas mixed pipeline based on SSA-BP neural network according to claim 1, characterized in that: The output prediction data is denormalized, the formula is as follows: Y=y(x max -x min )+x min (2) Where Y is the normalized output prediction value; y is the denormalized actual prediction value, and xmax and xmin are the maximum and minimum values ​​of the input features in the pipeline flow data, respectively.