A method for predicting gas-liquid two-phase nozzle flow in gas wells based on cascaded feedforward neural network

Through a method based on cascade forward neural network, combined with random forest algorithm and L2 regularization term, the error and overfitting problems of gas-liquid two-phase nozzle flow prediction in shale gas wells are solved, achieving higher prediction accuracy and generalization ability.

CN118313234BActive Publication Date: 2024-11-19SOUTHWEST PETROLEUM UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410124502.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-29
Publication Date
2024-11-19
Estimated Expiration
2044-01-29

AI Technical Summary

Technical Problem

The prior art has problems of large errors and overfitting in the prediction of gas-liquid two-phase nozzle flow in shale gas wells, making it difficult to accurately predict oil nozzle flow, and the description and promotion capabilities of complex oil and gas wells are limited.

Method used

Using the gas-well gas-liquid two-phase nozzle flow prediction method based on cascade forward neural network, the gas-liquid two-phase nozzle flow dynamic data is obtained and preprocessed, the data set is constructed, the target model characteristics are determined, and the cascade forward neural network model is constructed. , and trained through the training set and test set for gas yield prediction, the parameter importance is evaluated using a random forest algorithm, and combined with L2 regularization and Adam optimizer to improve the generalization capability of the model.

Benefits of technology

The accuracy of gas-liquid two-phase nozzle flow prediction is improved, the Gaussian process regression overfitting problem is solved, the generalization ability and prediction accuracy of the model are enhanced, and the error of the traditional model is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118313234B_ABST
    Figure CN118313234B_ABST
Patent Text Reader

Abstract

The present invention relates to a gas well gas-liquid two-phase nozzle flow prediction method based on a cascade forward neural network, including obtaining gas-liquid two-phase nozzle flow dynamic data of a gas well from fracturing backflow to normal production; preprocessing the gas-liquid two-phase nozzle flow dynamic data; constructing a gas-liquid two-phase nozzle flow dynamic data set containing different gas wells; determining target model characteristics; constructing a cascade forward neural network model; deleting redundant data in the gas-liquid two-phase nozzle flow dynamic data set based on the target model characteristics, and dividing it into a training set and a test set; presetting a loss function and a preset optimizer, and training the cascade forward neural network model through the training set and the test set; and predicting gas production for new gas wells based on the trained cascade forward neural network model. The present invention solves the limitation that the traditional model error is unacceptable, makes up for the deficiency of overfitting of Gaussian process regression, improves the comprehensive performance and generalization ability of the model, and has high prediction accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a gas well gas-liquid two-phase nozzle flow prediction method based on a cascade forward neural network, and belongs to the technical field of computer system engineering. Background Art

[0002] With the continuous increase in my country's energy demand, shale gas has attracted much attention as an effective supplement to unconventional oil and gas resources, and has also become a key factor in ensuring my country's energy supply. In the shale gas production system, by reasonably adjusting the size of the wellhead nozzle of the shale gas well and limiting the gas flow through it, the wellhead nozzle plays an important role in avoiding excessive production of gas wells, preventing gas and water cone entry, controlling sand production, and reducing potential damage to pipelines. Therefore, accurate prediction of nozzle gas flow can effectively ensure the safety of gas well production and improve production efficiency. And to achieve the efficient application of oil and gas well big data to promote the effective use of oil and gas resource big data, the key lies in giving full play to the joint application of oil and gas well data and effectively mining gas-liquid two-phase nozzle flow information.

[0003] During the production process of shale gas wells, there is usually a gas-liquid two-phase flow in the wellhead nozzle. Under the conditions of gas-liquid two-phase flow, the performance characteristics of the nozzle are relatively complex, and it is difficult to accurately predict the nozzle flow rate and select a reasonable wellhead nozzle size. At present, the main methods for predicting gas-liquid two-phase nozzle flow are: (1) theoretical methods based on mass, momentum and energy balance equations; (2) Gilbert-type correlation (GC); (3) support vector machine (SVM); (4) gaussian process regression (GPR).

[0004] The prediction error of the theoretical model is large, and the description and promotion ability of complex oil and gas wells is limited. When using the traditional GC method to study the dynamic analysis of the gas-liquid two-phase nozzle flow at the wellhead of the production oil well, unacceptable errors will be generated due to uncertain factors. In this regard, previous researchers have proposed methods with higher prediction accuracy such as SVM and GPR, but Gaussian process regression often easily causes overfitting. At present, scholars are still continuing to explore new methods with better prediction effects. Summary of the invention

[0005] In order to overcome the defects existing in the prior art, the present invention aims to provide a gas-liquid two-phase nozzle flow prediction method for a gas well based on a cascade forward neural network. The present invention performs sample training based on the cascade forward neural network, and then predicts the gas production of new oil and gas wells based on the optimized cascade forward neural network model.

[0006] The technical solution provided by the present invention to solve the above technical problems is: a gas well gas-liquid two-phase nozzle flow prediction method based on a cascaded forward neural network, comprising:

[0007] Obtain gas-liquid two-phase nozzle flow dynamic data from fracturing flowback to normal production of gas wells;

[0008] Preprocessing the dynamic data of gas-liquid two-phase nozzle flow;

[0009] Based on the preprocessed gas-liquid two-phase nozzle flow dynamic data, a gas-liquid two-phase nozzle flow dynamic data set containing different gas wells is constructed;

[0010] Determine the target model characteristics based on the gas-liquid two-phase nozzle flow dynamic data set;

[0011] Based on the target model characteristics, a cascade forward neural network model is constructed;

[0012] Based on the target model characteristics, redundant data in the gas-liquid two-phase nozzle flow dynamic data set is deleted and divided into a training set and a test set;

[0013] Preset loss function and preset optimizer, and train the cascade forward neural network model through training set and test set;

[0014] Gas production prediction for new gas wells is carried out based on the trained cascade feedforward neural network model.

[0015] A further technical solution is that the gas-liquid two-phase nozzle flow dynamic data includes on-site wellhead nozzle parameters and wellhead flow rate.

[0016] A further technical solution is that the on-site wellhead nozzle parameters include time, wellhead oil pressure, casing pressure, liquid-gas ratio, temperature, flow meter pressure difference, flow meter upstream pressure, net discharge, accumulated net discharge, nozzle size, orifice size, flame height, residual liquid, and chloride ions.

[0017] A further technical solution is that the preprocessing of the gas-liquid two-phase nozzle flow dynamic data includes: filling or deleting missing values ​​in the gas-liquid two-phase nozzle flow dynamic data, then deleting abnormal values, and finally performing normalization processing.

[0018] A further technical solution is that the target model characteristics are determined based on the gas-liquid two-phase nozzle flow dynamic data set, including:

[0019] The gas-liquid two-phase nozzle flow dynamic data set is input into the preset random forest algorithm model to evaluate the feature importance and obtain the importance score of each field wellhead nozzle parameter to the wellhead flow rate:

[0020] The on-site wellhead nozzle parameters are ranked according to their importance scores:

[0021] Through differential analysis of feature importance sequence, the largest position is selected as the segmentation point;

[0022] According to the split point, the field wellhead nozzle parameters with high importance scores are selected from the sorting results as the target model features.

[0023] A further technical solution is that the cascade forward neural network model includes multiple hidden layers, and the neurons in each hidden layer are not only connected to the neurons in the previous layer, but also connected to the neurons in the input layer, which can increase the nonlinearity and learning ability of the network.

[0024] A further technical solution is that the preset loss function and the preset optimizer train the cascade forward neural network model through a training set and a test set, including: using the mean square error (MSE) as the basic loss function, and adjusting the weight of the model by adding an L2 regularization term to the loss function; at the same time, the preset optimizer uses the Adam optimizer to update the weights on the training set; completing the training and tuning of the cascade forward neural network model, and then using the test set for test evaluation to obtain the trained cascade forward neural network model.

[0025] The present invention has the following beneficial effects: the present invention targets the complex dynamic laws of gas-liquid two-phase nozzle flow in oil and gas wells, utilizes a random forest algorithm model, determines the importance of each of the on-site wellhead nozzle parameters to the wellhead gas flow rate, and makes the target model characteristics more in line with actual working conditions; compared with the models of the prior art, the present invention has higher prediction accuracy and solves the problem of Gaussian process regression overfitting; at the same time, it integrates artificial intelligence neural network technology and big data technology into the prediction of gas-liquid two-phase nozzle flow in oil and gas production engineering, improves the accuracy of wellhead gas flow prediction, and enhances the generalization ability of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is a structural diagram of the random forest algorithm in the present invention;

[0027] Figure 2 It is a structural diagram of the cascaded forward neural network in the present invention;

[0028] Figure 3 It is a visualization diagram of the main control parameters of the cascade forward neural network model in the present invention;

[0029] Figure 4 This is a schematic diagram of the relationship between the predicted wellhead gas flow and the actual gas flow in Example 1 of the present invention. DETAILED DESCRIPTION

[0030] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0031] The gas-liquid two-phase nozzle flow prediction method of a gas well based on a cascaded feedforward neural network of the present invention comprises the following steps:

[0032] Step 1: Obtain the gas-liquid two-phase nozzle flow dynamic data from fracturing backflow to normal production of the gas well; the gas-liquid two-phase nozzle flow dynamic data includes the on-site wellhead oil nozzle parameters (time, wellhead oil pressure (MPa), casing pressure (MPa), liquid-gas ratio, temperature (℃), flow meter pressure difference (KPa), flow meter upstream pressure (MPa), net discharge (m 3 )、Cumulative net discharge(m 3 )、Nozzle size (mm), Orifice size (mm), Flame height (m), Residual liquid (m 3 ), chloride (mg / L)) and wellhead flow rate, which can be measured by the basic data of the wellhead nozzle on site;

[0033] Step 2, preprocessing the gas-liquid two-phase nozzle flow dynamic data;

[0034] The preprocessing includes missing value processing, outlier processing and normalization processing;

[0035] Specifically, for missing values, when processing the missing values ​​in some measurement data in the early stage of some flowback, since the interpolation method used for this part of data will affect the actual data, the direct deletion method is adopted to delete the record;

[0036] For outliers, a box plot can be used to detect outliers. Since outliers are obviously inconsistent with other data and exceed a reasonable range, filling them with other values ​​will cause deviations in the results. Therefore, this application chooses the deletion method to delete outliers to ensure the quality and credibility of the measurement data.

[0037] Normalization processing: Considering that the selected gas-liquid two-phase nozzle flow data usually contains multiple parameters of different units and magnitudes, this application uses the Z-SOCRE method to normalize the gas-liquid two-phase nozzle flow data so that different features have the same scale, which is convenient for comparative analysis of the data.

[0038] Step 3: constructing a gas-liquid two-phase nozzle flow dynamic data set containing different gas wells based on the preprocessed gas-liquid two-phase nozzle flow dynamic data;

[0039] Specifically, the on-site wellhead nozzle data and the corresponding on-site wellhead nozzle parameter category labels of the gas-liquid two-phase nozzle flow are sorted into a data set including the on-site wellhead nozzle parameters and the wellhead flow rate;

[0040] Step 4: Determine the target model characteristics based on the gas-liquid two-phase nozzle flow dynamic data set;

[0041] This application is based on the Out-of-Bag Decrease in Mean Squared Error. For each tree's out-of-bag sample, the reduction in mean squared error between the model's prediction using the original data and the prediction using the out-of-bag sample can be calculated. Assuming MSE original represents the mean square error using the original data, while MSE out-of-bag represents the mean square error of out-of-bag samples, then the out-of-bag error reduction is:

[0042] MSE Decrease=MSE original -MSE out-of-bag

[0043] This reduction represents the contribution of each tree to the overall performance of the model. The average or weighted average of the out-of-bag error reduction of all books is used to obtain the importance score of each feature. In this application, the variable importance score can be represented by VIM. For each feature X j , the out-of-bag error reduction of the feature in all trees can be accumulated or averaged to obtain the feature importance score VIM j :

[0044]

[0045] Where: C is the number of decision trees, MSE Decrease ij Represents the feature X in the i-th tree j The out-of-bag error reduction.

[0046] This application uses the random forest algorithm for regression modeling. On the trained random forest model, by retrieving the importance score of each feature, the contribution of each feature to the model output is reflected. Field wellhead nozzle parameters with higher importance mean greater contribution in predicting the liquid production and gas production of oil and gas wells. That is: the sorted data set is input into the random forest algorithm model for feature importance evaluation to obtain the importance score of each field wellhead nozzle parameter for the prediction of the liquid production and gas production of oil and gas wells, and then the scores of all parameters are sorted. Finally, through the differential analysis of the feature importance sequence, the largest position is selected as the split point, that is, the factor before the threshold split point is a significant influencing factor; then, according to the split point, the field wellhead nozzle parameters with high importance scores are selected from the sorting results as the target model features.

[0047] Step 5: Based on the target model features, a cascaded feedforward neural network model (CFNN) is constructed;

[0048] CFNN adopts a cascade structure, which consists of multiple cascaded sub-networks, each of which is responsible for processing part of the problem. This structure can make the network better adapt to complex tasks because each sub-network can focus on solving a specific sub-problem. This helps to better understand the spatial structure in the measured data, and CFNN helps to capture the complex relationship of the gas-liquid two-phase nozzle flow dynamics in oil and gas wells.

[0049] Specifically, it includes multiple hidden layers. The cascade structure means that the neurons in each hidden layer are not only connected to the neurons in the previous layer, but also to the neurons in the input layer, which can increase the nonlinearity and learning ability of the network.

[0050] Step 6: based on the target model characteristics, redundant data in the gas-liquid two-phase nozzle flow dynamic data set is deleted and divided into a training set and a test set;

[0051] The stratified random sampling method can be used to divide the model into training set and test set. Through the training set, the model can adjust its parameters to minimize the loss function so that it performs as well as possible on the training data. Through the test set, the performance of the model on new data can be measured to detect its generalization ability.

[0052] Step 7: Preset the loss function and the optimizer, and train the cascade forward neural network model through the training set and the test set;

[0053] The mean square error (MSE) is used as the basic loss function, and the L2 regularization term is added to the loss function to adjust the model weight. At the same time, the preset optimizer uses the Adam optimizer to update the weights on the training set to complete the training and tuning of the cascade forward neural network model, and then the test set is used for test evaluation to obtain the trained cascade forward neural network model (CFNN);

[0054] It uses the mean square error (MSE) as the basic loss function and adds the L2 regularization term. The total error (loss function) can be written as follows:

[0055]

[0056] Among them, L MSE is the mean square error, λ is the regularization strength, and w i Represents weight.

[0057] L2 regularization improves the generalization ability of the model and prevents overfitting in deep learning. By adding the L2 regularization term to the loss function, L2 regularization constrains the weights of the model to prevent them from growing excessively, thereby reducing the risk of overfitting the training data. This helps make the model more general, performs better on unseen data, and improves the robustness and reliability of the model. L2 regularization also helps prevent large differences between weights, making the model smoother and less sensitive to abnormal data;

[0058] It uses the Adam optimizer, which can automatically adjust the learning rate, consider the first-order and second-order moments of the gradient, introduce momentum terms to improve the convergence speed, and is relatively insensitive to the default parameter values. It provides an efficient and stable optimization solution for model training, has good robustness, and helps prevent model overfitting.

[0059] The forward backpropagation algorithm refers to calculating the output of the network forward, then calculating the error and gradient of the network backward, and then updating the weights and bias of the network according to the gradient descent method.

[0060] Step 8: Predict the gas production of new gas wells based on the trained cascade feedforward neural network model.

[0061] In this application, the field wellhead nozzle data is used to analyze the main control parameters of the gas-liquid two-phase nozzle flow dynamics of the oil and gas wells through the random forest algorithm, and the field wellhead nozzle parameters with high feature importance ranking are screened out as the main control parameters, i.e., the target model features. The screened out main control parameters are used as the input data of the cascade forward neural network (CFNN), and the prediction of the gas-liquid two-phase nozzle flow dynamics of the oil and gas wells has been realized. Compared with the traditional Gilbert-type correlation dynamic analysis model or Gaussian process regression, it solves the limitation of the unacceptable error of the traditional model, makes up for the deficiency of overfitting of the Gaussian process regression, and improves the comprehensive performance and generalization ability of the model.

[0062] The following will introduce the above-mentioned gas-liquid two-phase nozzle flow dynamic prediction method of oil and gas wells based on cascade forward neural network with a complete example combined with a specific implementation method, as follows:

[0063] Step 1: Get data.

[0064] Specifically, the construction text file is first converted into a CSV file, wherein the first line is a header, recording the names of the parameters of the wellhead nozzles at each site.

[0065] And according to the on-site wellhead nozzle data contained in the construction report and the corresponding on-site wellhead nozzle parameter category labels of the gas-liquid two-phase nozzle flow, a data set is organized into a data set containing on-site wellhead nozzle parameters (which can be used as the characteristics of the model) and the actual gas flow rate (which can be used as the target variable of the model).

[0066] Step 2: Data preprocessing;

[0067] Preprocessing is performed according to the actual situation of the data, such as outlier processing, missing value processing, and normalization processing; finally, the row header corresponding to each sample is different field wellhead nozzle parameters, and each row is filled with a set of field wellhead nozzle parameter combinations. At the same time, the model target variable corresponding to each set of field wellhead nozzle parameter combinations, and the tables of all samples constitute a data set.

[0068] Step 3: Feature extraction;

[0069] The processed data set has 14 on-site wellhead nozzle parameters. However, in this application, time is not used as the importance evaluation, but it is regarded as a data index item. The remaining 13 on-site wellhead nozzle parameters are used for feature importance evaluation. Wellhead gas flow (10 4 m 3 / day) as the target output.

[0070] Feature extraction methods based on random forest algorithms (such as Figure 2 As shown in the figure, the number of decision trees is set to 1000, and then the field wellhead nozzle parameters and the corresponding gas flow rate (10 4 m 3 / day) is input into the random forest algorithm model for training, and all on-site wellhead nozzle parameters are scored and ranked.

[0071] Among them, the difference between the 7th parameter and the 8th parameter is the largest, so the first 7 parameters are selected as the significant influencing factors on the gas-liquid two-phase nozzle flow of oil and gas wells as the target model features of the prediction model. A total of 7 on-site wellhead nozzle parameters are included, including: wellhead oil pressure (MPa), nozzle size (mm), orifice size (mm), temperature (℃), flowmeter pressure difference (KPa), flowmeter upstream pressure (MPa), and liquid-gas ratio.

[0072] Step 4: Construct a cascaded feedforward neural network model;

[0073] like Figure 3 As shown in Figure 1, the shape of the input data of the cascade forward back propagation neural network is (7, 1), where 7 represents the feature number (the 7 selected field wellhead nozzle parameters, these influencing factors will be used to predict the wellhead gas flow (10 4 m 3 / day)); The neural network in this example has 6 hidden layers and 6 normalized layers, and the number of neurons in the hidden layer is set to (64-64-32-32-16-16); the activation function f(·) = tanh.

[0074] Step 5: Model tuning and testing;

[0075] The data set is divided into a training set and a test set using a stratified random sampling method. The mean square error (MSE) is used as the basic loss function, and the weight of the model is adjusted by adding an L2 regularization term to the loss function. At the same time, the preset optimizer uses the Adam optimizer to update the weights on the training set to complete the training and tuning of the cascade forward neural network model; the test set is used to evaluate the trained prediction model, and in actual applications, the main control parameter data of the gas-liquid two-phase nozzle flow of the new well is preprocessed, and then it is input into the prediction model to complete the prediction of the wellhead gas flow of the well.

[0076] Figure 4 The figure is a schematic diagram of the relationship between the predicted wellhead gas flow and the actual gas flow in Example 1 of the present invention. The theoretical predicted gas flow of the present invention has a small error with the actual gas flow, which significantly demonstrates the predictive ability of the prediction model after parameter optimization of the present invention.

[0077] In addition, the gas flow analysis and prediction method of the present invention is compared with the prior art, and the results are shown in Table 1:

[0078] Table 1 Prediction errors of different methods

[0079]

[0080] From Table 1, it can be seen that the cascaded forward neural network model of the present invention has a smaller error than the currently commonly used model and has a higher accuracy.

[0081] The above description is not intended to limit the present invention in any form. Although the present invention has been disclosed through the above embodiments, it is not intended to limit the present invention. Any technician familiar with the profession can make some changes or modifications to equivalent embodiments of equivalent changes using the technical contents disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are within the scope of the technical solution of the present invention.

Claims

1. A gas-liquid two-phase nozzle flow prediction method for gas wells based on a cascaded feedforward neural network. It is characterized in that The following steps are involved: Obtain gas-liquid two-phase nozzle flow dynamic data from fracturing backflow to normal production of gas wells; Preprocessing the dynamic data of gas-liquid two-phase nozzle flow; Based on the preprocessed gas-liquid two-phase nozzle flow dynamic data, a gas-liquid two-phase nozzle flow dynamic data set containing different gas wells is constructed; Determine the target model characteristics based on the gas-liquid two-phase nozzle flow dynamic data set; Based on the target model characteristics, a cascade forward neural network model is constructed; Based on the target model characteristics, redundant data in the gas-liquid two-phase nozzle flow dynamic data set is deleted and divided into a training set and a test set; Preset loss function and preset optimizer, and train the cascade forward neural network model through training set and test set; The gas production of new gas wells is predicted based on the trained cascade feedforward neural network model; Determining the target model characteristics based on the gas-liquid two-phase nozzle flow dynamic data set includes: The gas-liquid two-phase nozzle flow dynamic data set is input into the preset random forest algorithm model to evaluate the feature importance, and the importance score of each field wellhead nozzle parameter to the wellhead flow is obtained: The on-site wellhead nozzle parameters are ranked according to their importance scores: Through differential analysis of feature importance sequence, the largest position is selected as the segmentation point; According to the split point, the field wellhead nozzle parameters with high importance scores are selected from the sorting results as the target model features.

2. The method for predicting gas-liquid two-phase nozzle flow in a gas well based on a cascaded feedforward neural network according to claim 1, It is characterized in that The gas-liquid two-phase nozzle flow dynamic data includes on-site wellhead nozzle parameters and wellhead flow rate.

3. The method for predicting gas-liquid two-phase nozzle flow in a gas well based on a cascaded feedforward neural network as claimed in claim 2, It is characterized in that The on-site wellhead nozzle parameters include time, wellhead oil pressure, casing pressure, liquid-to-gas ratio, temperature, flow meter pressure difference, flow meter upstream pressure, net discharge, cumulative net discharge, nozzle size, orifice size, flame height, residual liquid, and chloride ions.

4. The method for predicting gas-liquid two-phase nozzle flow in a gas well based on a cascaded feedforward neural network according to claim 1, It is characterized in that The preprocessing of the gas-liquid two-phase nozzle flow dynamic data includes: filling or deleting missing values ​​in the gas-liquid two-phase nozzle flow dynamic data, deleting abnormal values, and finally performing normalization processing.

5. The method for predicting gas-liquid two-phase nozzle flow in a gas well based on a cascaded feedforward neural network according to claim 1, It is characterized in that The cascade feedforward neural network model includes multiple hidden layers, and the neurons in each hidden layer are not only connected to the neurons in the previous layer, but also connected to the neurons in the input layer, which can increase the nonlinearity and learning ability of the network.

6. The method for predicting gas-liquid two-phase nozzle flow in a gas well based on a cascaded feedforward neural network according to claim 1, It is characterized in that The preset loss function and the preset optimizer train the cascade forward neural network model through the training set and the test set, including: using the mean square error as the basic loss function, and adjusting the weight of the model by adding the L2 regularization term to the loss function; at the same time, the preset optimizer uses the Adam optimizer to update the weights on the training set to complete the training and tuning of the cascade forward neural network model, and then uses the test set to perform test evaluation to obtain the trained cascade forward neural network model.