key: cord-0851489-o73s6rvj authors: Di, QinFeng; Wu, ZhiHao; Chen, Tao; Chen, Feng; Wang, WenChang; Qin, GuangXu; Chen, Wei title: Artificial intelligence method for predicting the maximum stress of an off-center casing under non-uniform ground stress with support vector machine date: 2020-11-16 journal: Sci China Technol Sci DOI: 10.1007/s11431-019-1694-4 sha: 2212596bc0b72f0032c132b88317f95850b358c2 doc_id: 851489 cord_uid: o73s6rvj The situation of an off-center casing under non-uniform ground stress can occur in the process of drilling a salt-gypsum formation, and the related casing stress calculation has not yet been solved analytically. In addition, the experimental equipment in many cases cannot meet the actual conditions and the experimental cost is very high. These comprehensive factors cause the existing casing design to not meet the actual conditions and cause casing deformation, affecting the drilling operation in Tarim oil field. The finite element method is the only effective method to solve this problem at present, but the re-modelling process is time-consuming because of the changes in the parameters, such as the cement properties, casing centrality, and the casing size. In this article, an artificial intelligence method based on support vector machine (SVM) to predict the maximum stress of an off-center casing under non-uniform ground stress has been proposed. After a program based on a radial basis function (RBF)-support vector regression (SVR) (ε-SVR) model was established and validated, we constructed a data sample with a capacity of 120 by using the finite element method, which could meet the demand of the nine-factor ε-SVR model to predict the maximum stress of the casing. The results showed that the artificial intelligence prediction method proposed in this manuscript had satisfactory prediction accuracy and could be effectively used to predict the maximum stress of an off-center casing under complex downhole conditions. ELECTRONIC SUPPLEMENTARY MATERIAL: Supplementary material is available for this article at 10.1007/s11431-019-1694-4 and is accessible for authorized users. Casing plays an important role in ensuring normal drilling and oil and gas production, and correctly obtaining the stress on the casing is the foundation of casing strength design and check. For the centered casing as shown in Figure 1 (a) and (b), the stress can be easily obtained by using an analytical method. However, for the off-center casing under the action of non-uniform ground stress, as shown in Figure 1 (c), there is no analytical solution of the stress. At present, the finite element method is the only method used to solve the stress of the casing in such a complex situation, but it is very timeconsuming. In this study, we attempted to solve this problem by using artificial intelligence method. In the petroleum industry, an oil and gas well is a pressure vessel system under complex loads. Any damage to the casing may induce huge economic losses, and the issue of casing strength and seal ability has attracted considerable attention. Therefore, it is of great significance to accurately determine the maximum stress of casing. Because the experimental equipment in many cases cannot meet the actual downhole condition and the experimental cost is very high, many scholars have reported a series of studies on the casing stress calculation by using analytical and numerical methods. In the past, the casing stress calculation did not consider wear; i.e., the casing was considered to have a uniform wall thickness. In 1939, Clinedinst [1] obtained the collapse pressure formula of casings of different diameter-thickness ratios on the basis of the regression and fitting of the experimental data. On the basis of his work, the American Petroleum Institute (API) classified casings into four types according to the different diameter-thickness ratios and proposed an empirical formula for the collapse pressure [2] . Since then, many scholars have conducted research work to improve the API formula [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] . Han and Shi [3, 4] developed the casing collapse pressure formula under non-uniform horizontal stress on the basis of the elastic-plastic theory and the von Mises criterion. Yin and Li [5] derived the elastic solution of a casing-cement-formation system under non-uniform stress and proposed a collapse strength formula for the centering casing. Fang et al. [6] conducted some creative work that considered the effect of non-uniform stress on the collapse strength of a casing under directional well conditions. Chen et al. [7] derived the theoretical solution of the stress of the casing under non-uniform loads by using the stress function method, and provided a new idea for exploring the problem of casing collapse in the water-swelling stratum. Li et al. [8, 9] analyzed the effect of the cement sheath elastic modulus on the casing external collapse load under the conditions of uniform and non-uniform in-situ stress by using an elastic analytical method and an FEM analysis. Taheri et al. [10] and Wang et al. [11] studied the creep characteristics of the salt-gypsum formation and pointed out that the creep of formation has a considerable influence on the collapse strength of the casing. Zhu et al. [12, 13] established an FEM model of the casing-cement-rock and simulated the emergence and propagation of fractures along the wellbore axial and circumferential direction during hydraulic fracturing. Note that the above works were based on the centering casing; i.e., the casing axis is consistent with the borehole axis, or the cement ring has uniform wall thickness. Another important aspect of the casing strength study is about the eccentric worn casing. Song et al. [14] studied the internal pressure capacity of a "crescent-shaped" eccentric worn casing and proposed the internal pressure strength expression on the basis of the von Mises strength. Wang et al. [15] deduced the theoretical solution of the stress distribution of an eccentric worn casing under the combined action of internal and external pressure and proposed the predictive equation of the remaining strength after eccentric wear. Sun et al. [16] proposed the casing collapse strength formula considering the ellipticity, eccentricity, and residual stress but did not consider the comprehensive effect of the cement and the formation. Lin et al. [17] presented the collapse strength formula of the inner-wall elliptical casing or the eccentric cylindrical casing under uniform stress, which was a further extension of the formula of Tamano et al. [18] and Han and Shi [4] . Chen et al. [19, 20] proposed a burst pressure expression of an eccentric worn casing, including material ultimate strength, material strain hardening coefficient, and material yield ratio. The abovementioned works have made very important contributions to the casing strength calculation, but note that because of the complexity of the structure, FEM has been generally adopted to calculate the stress of an eccentric casing. Huang et al. [21] analyzed the collapsing strength of the eccentric worn casing by using the nonlinear FEM and compared it with the experimental data. Wang et al. [22] calculated the remaining collapsing strength, burst strength, and tensile strength of a worn casing by using the finite element theory and the arc length method. With the increase of the directional wells and horizontal wells, the centralization of the casing in the borehole has become increasingly prominent. At this time, the issue of the stress calculation of an off-center casing under non-uniform stress has been emphasized. However, because of the complexity of the problem, scholars have often used the FEM to solve the stress distribution in casing-cement-formation under non-uniform loads, such as Rodriguez et al. [23] , Mueller et al. [24] , Pattillo et al. [25] , Nabipour et al. [26] , and Chen et al. [27] . Dou [28] made a groundbreaking attempt from the perspective of theoretical analysis, but the boundary stress between formation and cement sheath and that between cement sheath and casing are not correspond to reality. So far, the stress distributions of an off-center casing under non- uniform ground stress have not been solved analytically. One might argue that non-uniform stresses do not act directly on the casing, so the problem does not exist, and it does not matter whether there is an analytical solution. This is not true. In most cases, the effect of non-uniform stress on the casing stress is limited, but in the case of drilling through a salt-gypsum formation or the high-flow hydraulic fracturing of shale gas, this effect can be significant and even cause casing deformation. This will be more noticeable when the casing is not centered. Because of the complexity of the problem in the theoretical analysis, the analytical solution of the off-center casing under non-uniform ground stress has not been obtained. Many scholars and engineers have investigated the problem by using the FEM. However, FEM has some inherent shortcomings. Any tiny change in the material and/or geometrical and ground stress parameters will lead to remodeling and recalculation, and this will waste a considerable amount of computing resources. Therefore, it is necessary to find a new method to calculate or predict the casing stress. The success of AlphaGo Zero has contributed to the current boom in artificial intelligence (AI) technology [29] . Recently, AI techniques have been successfully used in petroleum engineering to predict various reservoir properties such as porosity, permeability, water saturation, lithofacies, and wellbore stability. The AI prediction methods include gray system theory, artificial neural network (ANN), time series analysis, SVM, and a combination of various prediction methods [30] [31] [32] . Among them, SVM is based on the principle of minimizing structural risk and can effectively solve the problems with small samples, high dimensions, and nonlinearity, such as the works of Zhao et al. [33] and Anifowose et al. [34] . Zhao et al. [33] trained a ε-insensitive SVM to regress the water saturation from seismic data. Anifowose et al. [34] predicted the porosity and permeability of an oil and gas reservoir by using SVM. In this article, we adopted the SVM to predict the maximum stress of the offcenter casing under non-uniform ground stress. First, the key factors that affect the stress distributions of the casing are determined according to the actual situation. Then, a large number of finite element calculations are conducted to replace the experimental method to build data samples for SVM. On this basis, a nine-factor ε-SVR model is formed to predict the maximum stress on the casing. Finally, the predictive results are compared with the FEM result on the basis of the field data. SVM is a machine learning algorithm based on statistical theory. It minimizes the actual risk by seeking structural risk minimization and obtains optimal results under finite information [31] . Because of its potential application value, a variety of improved SVM algorithms have emerged [32, 35] . SVM shows many unique advantages in solving small sample, non-linear, and high-dimensional pattern recognition problems. Its principle is to use a non-linear transformation to transform the input space into a high-dimensional feature space and to find an optimal linear interface, which not only ensures the classification accuracy but also maximizes the classification interval. In the case of linear separability as shown in Figure 2 , to ensure the minimum empirical risk in the support vector classification model, an accurate classification and a maximum classification interval should be made when determining the optimal dividing line. In the case of linear inseparability, the main idea of SVM is to map the input vector X to a high-dimensional feature vector space and use the feature vector Φ(x) instead of the input vector to obtain the optimal classification function. The problem of SVR is to find an optimal hyperplane that minimizes the overall deviation of all the sample points from it. The regression prediction problem needs to introduce a suitable loss function such as ε. Considering a set of training sample vector and y R i is the target output, we can transform the SVR problem with the insensitive loss function ε into the dual quadratic problem [34] : where the constant C is the penalty factor; α i and i are Lagrange multipliers; n is the sample size; i and j represent the sample numbers; and K(x i ,x j ) stands for the kernel function. After solving eq. (1), we can express the approximate function as follows [36] : where b is the classification threshold and can be obtained by using the following eq. (3) [36] : To predict the casing stress with the SVM method, it is necessary to develop a computational program. Here, we adopted MATLAB for this goal, which has a function to solve dual quadratic problems. With the help of this function, the SVM algorithm could be well implemented. Here, we selected an RBF as the kernel function and used the MA-TLAB software to construct the coefficient matrix. The value of α i , i , and b could be calculated using the quadratic function, and the ε-SVR model could be obtained using the RBF. For this model, the regression result was affected by the parameter of the kernel function σ, the insensitivity coefficient ε, and the penalty factor C [37] . After comparing various methods of selecting parameters, we chose the network search method for parameter optimization [38] . The network search method needed to determine the value range and step length of each parameter in advance, and searched for the optimal parameters according to the optimization judgment criteria through a loop search. In this study, we chose the minimum mean square error (MSE) of the training sample as the judgment of parameter optimization, i.e., where y i is the original value and f(x i ) is the predicted value. The program operation process is shown in Figure 3 . To use the SVM method to predict the maximum stress of the off-center casing under non-uniform ground stress, the key influencing factors had to be identified first. Figure 4 shows a geometric model of casing-cement-formation, in which the casing was eccentrically fixed and cemented in the wellbore. Here, a 0 is the inner diameter of the casing, a 1 is the outer diameter of the casing, and a 2 is the outer diameter of the cement sheath. The maximum horizontal ground stress σ H is plotted along the x direction, and the minimum horizontal ground stress σ h is plotted along the y direction. The eccentric distance δ is the eccentricity from the casing axis to the borehole axis, and the eccentric angle φ is the counterclockwise angle relative to the maximum horizontal ground stress direction, i.e., the x direction. For a vertical well, the longitudinal deformation of a high-quality cemented casing is limited, so the stress solution on the casing can be reduced to a plane strain problem. For the convenience of calculation, the variation of the ground stress along the depth in a shorter hole section was not taken into consideration. As we know, there are many factors that affect the maximum stress of the casing. The external load is mainly composed of the ground stress and the liquid column pressure in the casing. The ground stress is the manifestation of the tectonic stress and can be determined according to the geological structural mechanics of the block. The liquid column pressure in the casing is proportional to the depth of the well and the density of the drilling fluid. The physical parameters of the "casing-cement-formation" system include the inner and outer diameter of the casing, the mechanical properties of casing, the geological features of the cement sheath, the mechanical properties of the cement sheath, and the stratum. In this study, the geological features of the cement sheath included two parameters, i.e., δ and φ. According to the importance of each factor, nine parameters constituted the key factors that affected the maximum stress of a given casing, including the maximum and minimum horizontal stress, drilling fluid density, elastic modulus and Poisson's ratio of cement sheath and formation, and the relative eccentricity angle and eccentricity distance of the casing. After the identification of the key factors, another important task was to determine a reasonable range of each parameter. This was a difficult task. Because of the influence of the diagenetic processes of the formation and geological movements, as well as the complexity of the formation type and structure, it was difficult to determine the range of the relevant factors through experimental methods. Here, we determined them through a literature review and an actual investigation. We found that the maximum horizontal ground stress range given in ref. [39] was from 85.0 to 130.0 MPa, so a range of 80.0-135.0 MPa was defined in this study. The minimum horizontal ground stress ranged from 35.0 to 78.0 MPa [39] , so it was set at 30.0 to 80.0 MPa in this study. According to the concrete strength grade [40] , the elastic modulus of the cement sheath ranged from 10.00 to 60.00 GPa and Poisson's ratio was from 0.15 to 0.35. Similarly, the range of the elastic modulus of formation was determined to be 1.40-30.00 GPa and Poisson's ratio was 0.10-0.30 [41] . The ranges of the other key factors are listed in Table 1 . This method could ensure that the parameters used in the application were within the scope of the model established in this study, and at the same time, it could reduce the amount of irrelevant computation. In view of the difficulty and high cost of the experiment, in this study, we adopted the method of numerical calculation to obtain the data samples. We took the casing-cement-forma-tion system shown in Figure 5 as an example, where the borehole diameter was 311.2 mm and the inner diameter and the outer diameter of the casing were 219.0 and 250.8 mm, respectively. Using ANSYS to analyze the stress characteristics of the casing-cement-formation system. We adopted PLANE183, a high-order two-dimensional eight-node element, for meshing. The grid contained 18953 nodes and 6215 elements. The corresponding parameters are listed in Table 2 . The results showed that the maximum stress was located in the inner wall of the casing. The vector diagram of the stress on the casing inner wall is shown in Figure 6 . We found that the distribution of the stress in the casing inner wall was obviously uneven and the maximum stress of the casing under the given working conditions was approximately 531.58 MPa. Different values of key factors led to different working conditions. For any of the conditions listed in Table 2 , the maximum von Mises stress of the casing could be calculated. We set several reasonable values for each key factor, which constituted thousands of working conditions. Then, 120 working conditions were selected randomly, and the maximum stress of the casing was calculated by using FEM. Finally, a database containing 120 samples was obtained, as shown in Supporting Information. Note that the above FEM models have been verified with the actual data of Tarim oil field [42] . The maximum stress prediction effect of the ε-SVR model mainly depended on the optimization of three core parameters, namely, σ, ε, and C. The initial ranges of the three parameters in this study were as follows: 0.10≤σ≤3.00 with a step of 0.01, 0.010≤ε≤3.060 with a step of 0.005, and 1.0≤C≤10.0 with a step of 0.1. The optimal parameters were determined according to the minimum MSE criterion. First, the last 20 samples were selected from Supporting Information as the test set and the other 100 samples as the training set. After parameter optimization, the optimal values of σ, ε, and C were 2.01, 0.010, and 3.0, respectively, and then, the prediction values for the test samples could be obtained. The prediction results corresponding to the last 20 samples are shown in Table 3 . At the same time, as the true value, the results calculated with ANSYS are also listed in the table. Table 3 shows that the SVM prediction results of the 20 test samples had high accuracy, with the relative error between 0.26% and 6.13%. These results can also be seen in Figure 7 . Note that this approach took considerably less time than FEM. The proposed method was successfully applied to the prediction of the maximum casing stress in the salt-gypsum formation in the Tarim oil field. The salt-gypsum formation was located at 4800.0 to 5000.0 m. The considered drilling fluid density was as high as 2.2 g/cm 3 in order to avoid the bore diameter reduction during drilling in the salt-gypsum formation. After drilling through the salt-gypsum formation, a P110 technical casing string with the diameter of 9-7/8′′ and the wall thickness of 15.9 mm was inserted the borehole and cemented to support the borehole wall. Then, a drilling fluid with a density of 1.25 g/cm 3 was used to drill the subsequent borehole. Unfortunately, a large casing deformation occurred, and the drill bit failed to pass through because of the improper drilling fluid density. In this area, the maximum and the minimum horizontal ground stress at the depth of the salt-gypsum formation was approximately 140.0 and 134.0 MPa, respectively. This problem was solved when the subsequent borehole was drilled with a drilling fluid density of 1.35 g/cm 3 , which was determined by FEM calculation after considering the eccentricity of the casing and the non-uniform ground stress. The calculation results are shown in Figure 8 . We found that the stress distribution of the eccentric casing was very uneven under the condition of non-uniform ground stress, and the maximum von Mises stresses corresponding to the drilling fluid densities of 1.25 and 1.35 g/cm 3 were 762.12 and 730.27 MPa, respectively. By using the ε-SVR model proposed in this study and selecting the model parameters given in Table 3 , we found that the maximum casing stresses corresponding to the drilling fluid densities of 1.25 and 1.35 g/cm 3 were 759.52 and 742.20 MPa, respectively, as shown in Table 4 . The relative errors between the predicted maximum stress and the numerical results were 0.33% and 0.98%, respectively. Thus, we found that the SVM prediction results had satisfactory accuracy. Note here that the yield strength of the P110 casing was approximately 758.00 MPa, which was lesser than the predicted maximum von Mises stress when the density of drilling fluid was 1.25 g/cm 3 and larger than the predicted maximum von Mises stress corresponding to the density of 1.35 g/cm 3 . This result was in good agreement with the actual situation of the Tarim oil field. In the subsequent wells drilled in this block, 1.35 g/cm 3 was designed to be the minimum density, and the problem that the bit could not pass through the casing did not occur again. Thus far, no analytical solution of the stress of an off-center casing under non-uniform ground stress has been proposed, and the numerical method has been mainly used to study it. This makes casing strength verification and design very time-consuming. In this study, the SVM method was established and used to predict the maximum casing stress. The required experimental data samples were replaced with a large number of numerical results, which could considerably reduce the cost of the experiment and overcome many difficulties faced in an experiment. The results showed that nine key factors had to be determined when the casing type was known and the samples could be constructed on the basis of the FEM according to the different combinations of these parameters. Through a self-learning and network optimization method, the kernel model parameters of the ε-SVR model for the given training samples could be determined. In order to avoid the influence of manual intervention on the selection of the training samples and the verification samples, the random sampling method had to be selected. Based on the above reasonable selection, the results obtained in this study exhibited good accuracy and were consistent with the actual data of the oil field. Note that the results reported in this article were based on a sample base with a capacity of 100. The prediction accuracy will be gradually improved with an increase in the sample size. The supporting information is available online at tech.scichina.com and link.springer.com. The supporting materials are published as submitted, without typesetting or editing. The responsibility for scientific accuracy and content remains entirely with the authors. A rational expression for the critical collapsing pressure of pipe under external pressure. In: Drilling and Production Practice Bulletin on formulas and calculations for casing, tubing, drill pipe and line pipe properties Equations calculate collapse pressures for casing strings Non uniform loading affects casing collapse resistance Computation of casing strength under non-uniform load On the collapse resistance of multilayer cemented casing in directional well under anisotropic formation Elasticity solution for the casing under linear crustal stress Effects of cement sheath elastic modulus on casing external collapse load Enzymatic activity characterization of SARS coronavirus 3C-like protease by fluorescence resonance energy transfer technique1 Investigation of rock salt layer creep and its effects on casing collapse Loads of casing and cement sheath in the compressive viscoelastic salt rock Cementing failure of the casingcement-rock interfaces during hydraulic fracturing Hydraulic fracture initiation and propagation of highly deviated well with oriented perforation completion technique The internal pressure capacity of crescent-shaped wear casing An analysis for the stress of eccentric worn casing with bipolar coordinates A new OCTG strength equation for collapse under external load only A new crescent-shaped wear equation for calculating collapse strength of worn casing under uniform loading A new empirical formula for collapse resistance of commercial casing Numerical and theoretical analysis of burst pressures for casings with eccentric wear Effect of the Y/T on the burst pressure for corroded pipelines with high strength Collapse strength analysis of casing design using finite element method Investigation of the ultimate residual strengthen of a worn casing by using the arc-length algorithm Simulation of collapse loads on cemented casing using finite element analysis Characterizing casing-cement-formation interactions under stress conditions: Impact on long-term zonal isolation Effect of nonuniform loading on conventional casing collapse resistance Finite element simulation of downhole stresses in deep gas wells cements Effects of eccentricity of casing on collapse resistance in non-uniform in-situ stresses Analysis of confining pressure of casing in different viscosity of casing and wellbore in viscoelastic surrounding rock Mastering the game of Go without human knowledge The Nature of Statistical Learning Theory Statistical Learning Theory Support-vector networks Water saturation estimation using support vector machine Prediction of oil and gas reservoir properties using support vector machines A training algorithm for optimal margin classifiers Experimental study and prediction model of casing wear in oil and gas wells A comparative study of ordinary kriging and support vector machine models for the spatial variability of rock depth in Bangalore Flowing bottomhole pressure prediction for gas wells based on support vector machine and random samples selection Analysis of distribution rule of geo stress in China Concrete Structure Design Principle (in Chinese). Beijing Groundwork and Foundation (in Chinese) The designing and checking method of casing string in salt-gypsum formation based on actual well path