A method for evaluating the displacement efficiency of cementing based on machine learning
Through a machine learning-based method, a full wellbore physics model was established and the regression prediction model was optimized using a random forest algorithm, which solved the problem of complex calculation and low accuracy of cement injection efficiency in deep oil and gas wells, and achieved higher calculation accuracy and parameter importance analysis.
Patent Information
- Application Number
- CN202311757223.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-20
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2043-12-20
AI Technical Summary
It is difficult to effectively calculate and improve the cement injection replacement efficiency of cementing wells, especially in deep and ultra-deep oil and gas wells. Due to the complex geological conditions and strict underground conditions, the existing methods are complex in calculations and have low accuracy.
Using a machine learning-based method, the regression prediction model is optimized by establishing a full wellbore physics model and a random forest algorithm, and the importance of each parameter to substitution efficiency is analyzed, and the simulation process is closer to the field conditions to improve the accuracy of the simulation results.
The problems of complex numerical simulation modeling, difficult calculation and difficult operation were overcome, the calculation accuracy of substitution efficiency was improved, and the importance of each parameter to substitution efficiency was effectively analyzed.
Smart Images

Figure CN117744486B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of oilfield development, and particularly to a method for evaluating the displacement efficiency of cementing based on machine learning. Background Technique
[0002] With the continuous exploration and discovery of deep, ultra-deep and extra-deep oil and gas resources, how to improve the cementing quality of oil and gas wells in complex formations to extend the full life cycle of the wellbore is a technical problem to be solved urgently. Deep and ultra-deep formations are the main areas for national energy replacement. During the cementing process in such reservoirs, due to complex geological conditions and harsh downhole conditions, etc., the cementing operation faces great challenges. And improving the displacement efficiency of cementing is an important indicator of cementing quality. Therefore, it is of great significance to predict the displacement efficiency of cementing well.
[0003] Scholars at home and abroad have carried out a large number of experimental and numerical simulation studies on the displacement efficiency of cement injection. In terms of laboratory experiments, Ytrhus et al. conducted experiments through an annular fluid displacement device and obtained that rotating the casing will apply shear force to the fluid in the narrow gap part, thereby improving the fluidity of the narrow gap fluid and greatly improving the displacement efficiency. In terms of numerical simulation, Luo Hengrong et al. believe that the shape of the displacement interface is mainly affected by the eccentricity effect, buoyancy effect and mass diffusion effect. Wei Kai et al. considered the surface tension between the phase interfaces and carried out numerical simulation analysis on the process of cement injection in an eccentric annulus. The analysis results show that when the eccentricity, the properties of the cement slurry, the preflush fluid or the drilling fluid are certain, using a low displacement rate for displacement helps to reduce the influence of the eccentricity effect on the displacement efficiency.
[0004] Yuhuan Bu et al. obtained the conclusion that when the casing eccentricity is less than 0.2, with the increase of the casing eccentricity, the displacement efficiency increases slightly, while when the casing eccentricity is greater than 0.2, the displacement efficiency decreases significantly. For irregular wellbores, Song Lin et al. believe that the rheological parameters of the cement slurry have a certain influence on the displacement efficiency of the irregular well section. Reducing the consistency coefficient, flow behavior index and displacement rate of the cement slurry helps to improve the displacement efficiency of the irregular well section. Aiming at the short length of existing numerical simulations, Tao Qian et al. carried out numerical simulations based on the Tianhe-1 large-scale cluster computing platform. The experiments show that under the condition of high casing centrality, improving the fluidity of the cement slurry by reducing the n value is beneficial to improving the displacement efficiency of the cement slurry.
[0005] Currently, the calculation methods for displacement efficiency include the indoor experiment calculation method and the numerical simulation method. Among them, the experimental calculation method can only calculate the displacement efficiency of the indoor experiment model, and cannot calculate the on-site displacement efficiency. Moreover, the accuracy of experimental calculation is low. Although the numerical simulation method using Fluent software to calculate displacement efficiency has high accuracy, it requires processes such as establishing a physical model, mesh generation, pre-processing using the case module in Fluent, and data analysis and processing after simulation. These complex processes make it difficult to implement the numerical simulation calculation of displacement efficiency, and the operator needs to be trained and have a certain degree of proficiency. In addition, when analyzing the sensitivity factors of each parameter to displacement efficiency, it is impossible to effectively analyze the importance of the influence of each parameter on displacement efficiency. Summary of the Invention
[0006] In view of this, the present invention proposes a method for evaluating the displacement efficiency of cementing based on machine learning, establishes a full-wellbore physical model, analyzes its displacement efficiency, and at the same time, the simulation process is closer to the on-site conditions, improving the accuracy of the simulation results.
[0007] The technical solution adopted by the present invention to solve the above problems is a method for evaluating the displacement efficiency of cementing based on machine learning, including the following steps:
[0008] Step S1: Based on the on-site well completion wellbore structure data, use modeling software to establish a full-wellbore physical model;
[0009] Step S2: Import the physical model into the mesh module of Fluent software for mesh generation;
[0010] Step S3: Import the generated mesh file into the case module of Fluent software. Based on the relevant parameters of the on-site fluid, randomly generate multiple groups of cementing simulation schemes within a reasonable range of fluid parameters, and numerically simulate to obtain multiple groups of displacement simulation results in combination with the imported mesh file;
[0011] Step S4: Normalize the displacement simulation results;
[0012] Step S5: Use the random forest algorithm to optimize the parameters of the optimal regression prediction model, and obtain the importance of each parameter relative to the displacement efficiency based on the simulation schemes in the original dataset;
[0013] Step S6: Randomly select at least 5 groups of data from the original dataset and substitute them into the random forest regression prediction model to predict the displacement efficiency.
[0014] The specific effects of the present invention are:
[0015] 1. The present invention overcomes the disadvantages of complex numerical simulation modeling, high computational difficulty, long time consumption, and high operation difficulty. Through the feature importance analysis in the random forest algorithm, the importance of each parameter to the displacement efficiency can be effectively analyzed.
[0016] 2. A full wellbore physical model is established through software, considering the factors of slurry mixing and channeling in the pipe. The simulation process is close to the field conditions, making the simulation results more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the embodiments will be briefly introduced below.
[0018] Figure 1 It is the technical flow chart of the present invention;
[0019] Figure 2 It is the full wellbore physical model diagram of the present invention;
[0020] Figure 3 It is the overall and partial grid division diagram of the present invention;
[0021] Figure 4 It is the comparison diagram of the predicted value and the actual value of the displacement efficiency of the regression prediction model of the present invention;
[0022] Figure 5 It is the difference diagram of the predicted value and the actual value of the displacement efficiency of the regression prediction model of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0023] In order to facilitate better understanding of the present invention by those skilled in the art, the present invention will be further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.
[0024] Embodiment:
[0025] For a certain example well, this method is used for evaluation. The specific steps are as follows. Among them, the example well has a three-opening wellbore structure, with a total drilling depth of 2538 m, a 177.8 mm casing for the third opening, a well diameter of 226 mm, a casing eccentricity of 0.2 in the vertical section, a casing eccentricity of 0.42 in the build section, a liner cementing method, and a 177 mm casing is used. The liner is lowered to the bottom of the well using a 157 mm drill pipe. Before cementing, the density of the drilling fluid in the wellbore is 1.36 g / cm 3 , during the cement injection process, low-density drilling fluid, spacer fluid, wash fluid, retarder slurry, quick-drying slurry, and displacement slurry are injected into the wellbore. The fluid densities and dosages are as follows: 1.33 g / cm 3 (20 m 3 ), 1.5 g / cm 3 (15 m 3 ), 1.02 g / cm 3(4m 3 )、1.9 g / cm 3 (11m 3 )、1.9 g / cm 3 (13m 3 )、1.94 g / cm 3 (16.7m 3 )。
[0026] Step S1: Based on the on-site completion wellbore structure data, use modeling software to establish a full wellbore physical model. In some embodiments, conventional modeling software such as SpaceClaim, Soildworks, Creo, etc. can be used for the modeling software. In this embodiment, SpaceClaim is used to establish the wellbore physical model. According to the wellbore structure data of the above example well, including the inner diameter of the pipe, annulus size, pocket cross-section size, wellbore trajectory line, etc., use the sketch module in SpaceClaim to construct the cross-sections of the inside of the pipe (diameter 157 mm), annulus (a circular ring with an eccentricity of 0.2, an inner diameter of 177 mm, and an outer diameter of 226 mm in the vertical section, and a circular ring with an eccentricity of 0.42, an inner diameter of 177 mm, and an outer diameter of 226 mm in the deviated section), pocket (diameter 226 mm), and the wellbore trajectory line. Use the pulling function to pull the cross-section along the trajectory line to obtain the full wellbore physical model as shown in Figure 2 the figure.
[0027] Step S2: Import the physical model into the mesh module of Fluent software for mesh generation. Specifically, it is necessary to set the mesh size range, domain, and wall surface to control the calculation time and determine the flow space of the fluid in the model. Among them, to ensure the accuracy of the model, the mesh size range for mesh generation is 1 mm - 100 mm. In this embodiment, the mesh size range is 4.7 mm - 100 mm. Set the inlet position (the top inside the pipe) and the outlet position (the top of the annulus), define the entire model as the domain, add boundary conditions, and after setting, generate the mesh as shown in Figure 3 the figure, generating 373,196 nodes and 114,855 meshes.
[0028] Step S3: Import the divided grid file into the case module of Fluent software. Based on the relevant parameters of the on-site fluid, randomly generate multiple groups of cementing simulation schemes within a reasonable range of fluid parameters. Combine with the grid file imported into the case module and numerically simulate to obtain multiple groups of displacement simulation results. The specific process is as follows: After importing the grid file into the case module, refer to the types of fluids injected during the cementing process, including 7 types of fluids: drilling fluid, low-density drilling fluid, spacer fluid, flushing fluid, retarded slurry, quick-setting slurry, and displacement slurry. Therefore, set the number of fluid phases to 7 in the Multiphase module, set the flow regime to laminar flow in the Viscous module, import the relevant parameters of each phase of fluid in the Materials module, and use the Separate module function to partition the model. The specific quantity can be arbitrarily specified according to actual needs. In this embodiment, it is selected to be divided into 10 regions with relatively uniform lengths. At the same time, based on the fluid injection speed in actual construction, set the injection speeds of low-density drilling fluid, spacer fluid, flushing fluid, retarded slurry, quick-setting slurry, and displacement slurry in the Boundary Conditions module to 1.292 m / s, 1.292 m / s, 0.775 m / s, 0.861 m / s, 0.947 m / s, and 0.861 m / s respectively, and use the monitor module to detect the fluid volume fraction of the 10 regions, initialize, and set the iteration step size and number of iteration steps of low-density drilling fluid, spacer fluid, flushing fluid, retarded slurry, quick-setting slurry, and displacement slurry. Taking the convergence of simulation iteration as the principle, the iteration step size can usually be set according to actual needs, and the number of iteration steps is calculated by dividing the grouting time required by the amount and displacement of each liquid. Using the grouting time divided by the iteration step size can be calculated. Therefore, the number of iteration steps in this embodiment is 1066, 800, 355, 880, 945, and 1336 respectively, and the iteration step size is 0.005 s. Then, according to the reasonable parameter range that each phase of fluid can reach in on-site construction, generate through random number code, produce simulation schemes within these reasonable parameter ranges, and repeat generating simulation schemes according to the iteration conditions. The original data set is composed of multiple groups of obtained simulation schemes.
[0029] Among them, the fluid-related parameters imported in the Materials module include dosage, displacement, density, consistency coefficient, flow behavior index, and shear stress, as shown in Table 1 specifically:
[0030] Table 1 On-site fluid-related parameters during cementing
[0031]
[0032] In this embodiment, the reasonable parameter ranges of each phase of fluid for random number code generation are shown in Table 2 specifically:
[0033] Table 2 Reasonable parameter ranges of each phase of fluid in on-site construction
[0034]
[0035] In this embodiment, part of the original data set generated is shown in Table 3, and the parameters in the entire original data set correspond to the parameters in Table 2:
[0036] Table 3 Original data set composed of multiple groups of simulation schemes
[0037]
[0038]
[0039] Step S4: Normalize the displacement simulation results, and its normalization equation is shown in Equation (1):
[0040]
[0041] In Equation (1): X is the processed data; X i is any data; X max is the maximum data; X min is the minimum data
[0042] Use Equation (1) to normalize each item in the original data set except the displacement efficiency, and the results are shown in Table 4:
[0043] Table 4 Original data set after normalization processing
[0044]
[0045]
[0046]
[0047] Step S5: Use the random forest algorithm to optimize the parameters of the optimal regression prediction model, and based on the simulation schemes in the original data set, obtain the importance of each parameter relative to the displacement efficiency. By changing parameters such as the maximum depth of the tree, the number of decision trees, and the maximum number of leaf nodes of the random forest algorithm, optimize the parameters of the optimal regression prediction model, and obtain the importance degree of the characteristics affecting the displacement efficiency. The principle of the random forest algorithm is as follows:
[0048] Step 1) Randomly extract m sample points from the data set S to obtain a new sub-data set S1…S n sub-data sets;
[0049] Step 2) Use the sub-dataset to train a CART regression tree. The final prediction result of each CART regression tree is the mean of the leaf nodes reached by the sample point. In the principle of random forest algorithm, the core process is to train the CART regression tree. The CART regression tree algorithm process is as follows:
[0050] Step 3) From the dataset (e.g., step 2), n In any data set), the optimal segmentation feature j and segmentation point s are selected to minimize the sum of the mean variances of the two regions after division, as shown in formula (2):
[0051]
[0052] In formula (2), c1 is the mean value of the R1 region; c2 is the mean value of the R2 region; x i is the characteristic value of the region; y i is the output value of the region.
[0053] Step 4) After selecting the optimal segmentation feature j and segmentation point s, the selected segmentation feature j and segmentation point s are used to divide the data set into data sets R1 and R2 and determine the corresponding output values, as shown in formulas (3)-(5):
[0054] R1(j,s)={x|x (j) ≤s} (3)
[0055] R2(j,s)={x|x (j) >s} (4)
[0056]
[0057] Where: c m For R m The mean of the sample output, Nm is the number of leaf nodes.
[0058] Step 5) Continue to call the calculation method in step 2) and step 3) for the two data sets R1 and R2 until the stopping condition is met (reaching the maximum depth of the tree, reaching the number of decision trees, and reaching the maximum number of leaf nodes, etc.). In this embodiment, the node classification evaluation criterion of the random forest algorithm is the mean square error, and the algorithm parameters are selected according to the number of sets to ensure the operation efficiency of the algorithm, where the maximum depth of the tree is 10, the number of decision trees is 100, the minimum number of samples for internal node splitting is 2, and the maximum number of leaf nodes is 50.
[0059] Step 6) Divide the input data set into M data sets, R1, R2, ... R M , generate a regression tree and find the predicted value, as shown in formula (6):
[0060]
[0061] In formula (6), f(x) is the predicted value, and the indicator function I(x∈R m ) is the divided region.
[0062] When making predictions for the generated CART regression tree, the mean value of the leaf nodes is used as the output result of the prediction.
[0063] Step 7) Repeat the above steps 1)-6) to generate multiple CART regression tree models.
[0064] Step 8) The final prediction result of the random forest is the mean value of the prediction results of all CART regression trees.
[0065] The result of the random forest regression algorithm is the mean value of the prediction results of all CART regression trees as shown in formula (7):
[0066]
[0067] In formula (7), F(x) is the prediction result of the random forest regression algorithm; N is the number of CART regression trees.
[0068] The principle of feature importance analysis is as follows:
[0069] Feature X j The importance at node m, that is, the change in MSE (mean squared error) before and after branching at node m, is specifically shown in formula (8):
[0070] VIM jm (Mse) = MS m - MS l - MS r (8)
[0071] In formula (8): MS m is the mean squared error of node m; MS l and MS r respectively represent the mean squared errors of the two new nodes split from node m.
[0072] Feature X j appears M times in the i-th tree, then the importance of variable X j in the i-th tree is, specifically shown in formula (9):
[0073]
[0074] Among them, VIM is the value of the importance of the feature.
[0075] The importance of feature X j in the random forest regression algorithm is specifically shown in formula (10):
[0076]
[0077] In formula (10): n is the number of regression trees in the random forest.
[0078] According to the principle of the feature importance algorithm in step 9), the dataset is processed to obtain the feature importance affecting the displacement efficiency. The specific results are shown in Table 5 as follows:
[0079] Table 5 Feature Importance Table
[0080]
[0081]
[0082] Step S6: Randomly select at least 5 groups of data from the original dataset and substitute them into the random forest regression prediction model to predict the displacement efficiency.
[0083] Verify the accuracy of the model. Take five groups of data from the original data and substitute them into the random forest regression prediction model to output the predicted values of the wide-edge displacement efficiency and the narrow-edge displacement efficiency. The results are shown in Tables 6 and 7. Compare the predicted values with the actual values and analyze the accuracy of the prediction model. As Figure 4 、 5 shown, it can be seen that the errors of the prediction results are all within 4%, and the prediction accuracy is accurate. Therefore, the random forest prediction model in the present invention meets the requirements for predicting the cementing displacement efficiency and has good guidance for on-site construction.
[0084] Table 6 Comparison of Predicted Results of Wide-Edge Displacement Efficiency
[0085] Number of groups Wide-edge replacement efficiency / % Predicted value of wide-edge replacement efficiency / % Difference / % 1 90.37 89.791 0.5798 2 88.213 86.86 1.353 3 87.46 86.41 1.0537 4 90.93 89.26 1.669 5 87.41 85.41 1.999
[0086] Table 7 Comparison of Predicted Results of Narrow-Edge Displacement Efficiency
[0087] Number of groups Narrow-edge replacement efficiency / % Predicted value of narrow-edge replacement efficiency / % Difference / % 1 86.568 82.67 3.89 2 79.5497 81.14 1.59 3 82.63 80.93 1.6999 4 86.38 83.33 3.047 5 80.398 82.04 1.642
[0088] The above is only the preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed in the embodiments of the present invention should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. A method for evaluating the displacement efficiency of cementing slurry based on machine learning, characterized in that, It includes the following steps: Step S1: Based on the on-site well completion wellbore structure data, establish a full wellbore physical model using modeling software; Step S2: Import the physical model into the mesh module of Fluent software for mesh generation; Step S3: Import the generated mesh file into the case module of Fluent software. Based on the relevant parameters of the on-site fluid, randomly generate multiple groups of cementing simulation schemes within a reasonable range of fluid parameters. Combine with the mesh file imported into the case module, and numerically simulate to obtain the original data set of multiple groups of displacement simulation results; Step S4: Normalize the displacement simulation results; Step S5: Use the random forest algorithm to optimize the optimal regression prediction model parameters, and obtain the importance of each parameter relative to the displacement efficiency based on the simulation schemes in the original data set; Step S6: Randomly select at least 5 groups of data from the original data set and substitute them into the random forest regression prediction model to predict the displacement efficiency.
2. The evaluation method for the displacement efficiency of cementing slurry based on machine learning according to claim 1, wherein: The modeling software in Step S1 is one of SpaceClaim, Soildworks, and Creo.
3. The evaluation method for the displacement efficiency of cementing slurry based on machine learning according to claim 1, characterized in that: The wellbore structure data in Step S1 includes inner pipe diameter, annulus size, pocket cross-sectional size, and wellbore trajectory line.
4. A method for evaluating the displacement efficiency of cementing slurry based on machine learning according to claim 1, characterized in that: The mesh size range for mesh generation in Step S2 is 1mm - 100mm.
5. The evaluation method for the displacement efficiency of cementing slurry based on machine learning according to claim 1, characterized in that: The on-site fluids in Step S3 include drilling fluid, low-density drilling fluid, spacer fluid, wash fluid, retarded slurry, quick-setting slurry, and displacement fluid.
6. The evaluation method for the displacement efficiency of cementing slurry based on machine learning according to claim 5, characterized in that: The relevant parameters of the on-site fluids in Step S3 include dosage, displacement, density, consistency coefficient, flow behavior index, and shear stress.
7. A method for evaluating the displacement efficiency of cementing slurry based on machine learning according to claim 1, characterized in that: The node typing evaluation criterion of the random forest algorithm in Step S5 is the mean square error. Among them, the maximum depth of the tree is 10, the number of decision trees is 100, the minimum number of samples for internal node splitting is 2, and the maximum number of leaf nodes is 50.
Citation Information
Patent Citations
MMP prediction method and device based on random forest algorithm
CN114399121A
Oil reservoir exploitation method for ultrahigh-water-content oil field
CN114862609A