Simulation Method of Borehole Trajectory Based on Vector Similarity

For the well planning stage, the application of the designed borehole trajectory (DBT) predicts that the torque and drag is low, and it is impossible to accurately analyze the diﬃculty and risk of drilling construction. This paper proposes a method for comparing and selecting borehole trajectory control parameters based on the vector cosine similarity. The database for borehole trajectories has been established, and two vectors were designed to represent the control state of the actual borehole trajectory (ABT) and the simulation position of the simulated borehole trajectory (SBT), respectively, and the similarities of them were used as the reference standard for simulating the behavior of engineers to determine the control parameters. Random selection of control parameters was set to further simulate the behavior of the engineer. The feasibility of the method was evaluated by using the control deviation and torque and prediction deviation. The case well experiment results show that the control deviations of the SBT and the ABT relative to the DBT are close, and the ﬂuctuation law is similar. In rotary drilling conditions, the torque calculated using SBT is slightly higher than the actual drilling torque, and the maximum deviation is less than 10%. In tripping out condition, the hook loads are slightly higher, and the maximum deviation is less than 9%. In additional operating conditions, the hook loads calculated by the SBTare the same as the actual hook loads, and the maximum deviation is less than 4%. This work provides a feasible method to simulate ABT in the well planning stage and enhances the reliability of the predicted torque and drag results.


Introduction
Torque and drag prediction is one of the important contents of well planning for deep wells, highly deviated wells, and extended reach wells. It is also the basis for drilling construction difficulty assessment, well plan optimization, drilling tools, and main power equipment selection. However, the curve shape of the designed borehole trajectory (DBT) was significantly different from the actual borehole trajectory (ABT), resulted in a higher probability of a large deviation of the torque and drag prediction value. e borehole trajectory is a curve used to describe the borehole axis, and it is the basis for analyzing the stress state of the drill string in the borehole. As shown in Figure 1, DBT generally consists of straight lines and arcs, the straight line corresponds to the vertical section, the angle holding section, or the horizontal section, and the arc corresponds to the angle building section or the angle descending section, the number of lines it contains is very small, and generally a curve or straight line represents a complete well section. And ABT is connected by lots of arcs fitted by points measured by the inclinometer according to the depth sequence [1]. e length of these arcs is usually short and closely related to the spacing of the measuring points, and the radius of adjacent arcs may vary greatly [2]. When using the borehole described by DBT for torque and drag prediction, the difference in radius of adjacent arcs in the borehole described by ABT cannot be considered, and the uneven radius of the arc causes the drill string to be forced to bend, which will increase the lateral force of the drill string to the borehole [3,4]. erefore, torque and drag predicted by DBT is often low, which cannot reasonably reflect the difficulty of drilling construction. Choosing these data as a reference for drilling design optimization, drilling tools, and main power equipment selection will lead to high safety risks. e borehole trajectory control is influenced by many factors, such as structure of bottom hole assembly (BHA), directional drilling tool performance, drilling parameters, formation dip and direction, rock mechanical properties, in situ stress distribution, and experience and responsibility of directional drilling engineers [5][6][7]. During directional drilling in the deviated section, directional drilling engineers first obtain the spatial position deviation between the current measuring point of the ABT and the corresponding point of the DBT. en they will set the expected borehole trajectory control parameters depending on the acquired information such as the characteristics of the formation, the performance of the BHA and the directional drilling tool, and the adjustable range of the drilling parameters. Finally, through intermittent adjustment of the bit weight, tool face angle, and other parameters, the borehole trajectory can extend forward and downward along DBT within the allowable deviation range. e effects of this process are also affected by subjective factors such as the technical capabilities and experience and responsibility of the directional drilling engineers, resulting in a certain randomness of the borehole trajectory control parameters set in the drilling process and obtained by the actual drilling [8,9]. Consequently, based on the DBT, it is sometimes difficult to obtain a SBT, which is similar to ABT.
To improve the reliability of the prediction result of the torque and drag before drilling, a borehole trajectory simulation method based on the random number was established [10]. is method uses the set maximum fluctuation and the randomly generated fluctuation coefficient to determine the control deviation of the inclination and the azimuth and considers the relationship between the azimuth fluctuation and the inclination, which conforms to the borehole trajectory control law, that is, the larger the inclination, the smaller the azimuth fluctuation. However, this method uses the random number as the driving force for the borehole trajectory control deviation, and the resulting deviation is completely unplanned, which is significantly different from the directional well engineer's control of the borehole trajectory. A borehole trajectory simulation model based on fuzzy control theory was established [11], which takes the maximum deviation of the closure distance, the inclination change rate, and the azimuth change rate as the control criterion and establishes a set of fuzzy control rules. Because only limited influence factors are taken into consideration, the fuzzy control rules are not rich, which leads to the idealized borehole trajectory simulated by this method. At present, there is not any literature report on its application in engineering.
In summary, the borehole trajectory simulation method continues to have problems. e engineer applies the DBT to predict the torque and drag as usual and attaches a large safety factor to increase the reliability of the result. However, this safety factor is depended on the experience of the engineer and the reliability of the prediction results cannot be guaranteed. To solve this problem, this paper  proposes a borehole trajectory simulation method for simulating the behavior of directional engineers and elaborates on the steps of the borehole trajectory simulation. e case well application shows that the borehole trajectories simulated by the method have similar control characteristics to the ABT, and the predicted torque and drag is close to the actual drilling load, which will help improve the reliability of the torque and drag prediction result in the well planning stage. Deviations are the differences of the parameters between the borehole trajectory (the ABT or the SBT) and its DBT, including the deviation of the parameters such as the inclination, the azimuth, the closure azimuth, the closure distance, the inclination change rate, and the azimuth change rate. e formula for calculating the deviation is given by the following equation:fd1

Methodology
where α i , ϕ i , ϕ si , S i , Build i , and Turn i are the inclination, azimuth, closure azimuth, closure distance, the inclination change rate, and the azimuth change rate of measurement point i, respectively. α pi, ϕ pi, ϕ psi, S pi, Build pi , and Turn pi are the designed values of inclination, azimuth, closure azimuth, closure distance, the inclination change rate, and the azimuth change rate of measurement point i, respectively. Δα ci , Δϕ ci , Δϕ si , ΔS ci , ΔBuild ci , and ΔTurn ci are the deviation of the inclination, azimuth, closure azimuth, closure distance, the inclination change rate, and the azimuth change rate of measurement point i, respectively.

Establishing the Borehole Trajectory Database for Drilled Wells.
e borehole trajectory database is used to store the parameters of the DBT, ABT, and the calculated control deviation. Because of the differences in the borehole trajectory control characteristics of different borehole sections, the borehole section features of the DBT are divided into three types of data, which are the vertical section, the angle holding section, and the angle changing section. e three types of data are stored separately.

Simulating Borehole Trajectories.
Design two vectors b j and a i with the same data structure. b j is used to characterize the control characteristics of the ABT, it contains the DBT feature information and the actual control deviation at measurement point j, and its data are from the established database. a i is used to characterize the simulated position of the SBT, it contains the DBTfeature information and the simulated control deviation at simulation point i of the DBT, and the deviations are calculated from the simulation results of point i − 1.
Assuming that the borehole simulation at the point i of the design well had been completed, when the point i + 1 is continued to be simulated, the vector cosine similarity algorithm [12,13] given by equation (2) is first applied to calculate the similarity between a i and b j , and the similarity calculation results are sorted in ascending order. en, select a set of vectors whose similarity values are greater than a certain empirical value M, which are used as reference vectors for determining the control parameters of the SBT. And then, vector b k is randomly selected from these reference vectors, and the length, the inclination change rate, and the azimuth change rate between this point corresponding to b k and its next point in the same well are found in the database. Finally, simulated inclination and azimuth of point i + 1 point can be obtained by applying equations (3) and (4), respectively: where θ is the angle between b j and a i .
where Build m+1 , Turn m+1 , and ΔL m+1 are the inclination change rate, the azimuth change rate, and the length between point m and point m + 1, respectively, where point m is the point corresponding to b k in the well to which it belongs. Applying this method to calculate point by point in topdown order, the predrilling simulation of the borehole trajectory can be realized. Since the information of different well sections is stored separately, the borehole trajectory simulation should be carried out in sections, and the last simulation point for each section is used as the starting point for the next section.
It should be noted that the simulation method of the borehole trajectory described in this paper is driven by the borehole trajectory control deviation, since there is no deviation of the wellhead as the starting point, a measuring point with measured depth less than 50 m is randomly selected from the vertical well section of the database, and the inclination angle and azimuth angle of this point are used as the control deviation of the first point below the wellhead.
In this method, two random selection data links are set up in the process of borehole trajectory simulation, when the number of samples of drilled borehole trajectory data in the database is large, the method is used to simulate borehole trajectory many times, and many different borehole trajectories can be obtained in the stage of well planning.

Similarity Comparison Vector Design.
e similarity comparison vectors b j and a i contain two parts of information. One is the characteristic information of the DBT, and the other is actual or simulated control deviation Mathematical Problems in Engineering 3 information.
e characteristic information of the DBT includes three parameters: inclination, the inclination change rate, and azimuth change rate. e control deviation information includes the deviation of the inclination, azimuth, closure azimuth, closure distance, the inclination change rate, and azimuth change rate. Because the designed inclination, the inclination change rate, and the azimuth change rate of the vertical section are all 0, the vector of the vertical section does not contain these three parameters, at the same time, due to the small inclination of the vertical section, the azimuth is randomly distributed in the range of 0-360°, and the deviation of the closure azimuth and the azimuth change rate are also not contained. Also, the designed inclination change rate and change in azimuth of the angle holding section are 0. ese two parameters are not contained. e data structure of the similarity comparison vector of each borehole section is shown in Table 1.

Borehole Trajectory Design and Survey Calculation
Method.
e radius-of-curvature calculation method [14] is used to design borehole trajectory, and the calculation tool used is COMPASS module in the HALLIBURTON-LANDMARK drilling and completion software.
e minimum curvature method [15] is used to calculate the survey. e formulas are as follows: where ΔL i , ΔH i , ΔN i , ΔE i , ΔS i , Δα, and Δφ are the increments of the section length, vertical depth, northing, easting, closure distance, inclination, and azimuth between point i − 1 and point i, respectively. When Δα � 0 and Δφ � 0, ΔH i , ΔS i , ΔN i , and ΔE i are given by equations (6)-(9), respectively:

Application Results and Discussion
In the case of a well that has been completed, this method is implemented to simulate the borehole trajectory based on its DBT and the borehole trajectory database of the same development block. By comparing the distribution of control deviation between SBT and its ABT, we can analyze and judge whether there is a similar control law between them. Further, we apply the SBT to calculate the torque and drag and compare it with the actual drilling load to analyze whether this method can enhance the reliability of the prediction results. Our results show that the control deviation values between them are close and have similar fluctuation laws, and the torque and drag predicted by SBTs is slightly higher than the actual drilling load, and the maximum deviation is less than 10%.

Design Information of Case
Well. NP12-X16L is a case well for the application of this method. Its designed borehole trajectory is "J" type and parameters are shown in Table 2

Analysis of the Borehole Controls Deviation.
ree SBTs were obtained by the method, and the traveling cylinder scanning method [16] was used to calculate the normal distance between the SBT and the DBT, and the distance was used as the comprehensive parameter to evaluate the control deviation. e principle of the traveling cylinder scanning method and the results are shown in Figures 2 and 3, respectively. As shown in Figure 3(a), in the vertical section, the control deviation of the SBT and ABT increases with the increase of well depth, although the deviation of SBT C decreases slightly near the kick-off point, it does not affect the overall trend. e control deviation of the ABT increases slowly and increases rapidly when approaching the kick-off point, while the increase of the control deviation of SBTs is more average, and deviations near the kick-off point are the largest. Average control deviations of SBTs are slightly higher than those of ABT, and the maximum control deviation is within ±2m. As shown in Figure 3(b), in the angle building section, the deviation conforms to the actual control laws of the borehole trajectories, or remains relatively stable in a small range, such as SBT A, B, and C, or increases first and then decreases, such as SBT A and B, or decreases first and then increases, such as SBT C. e average deviations of SBT C and the ABT are similar, and the maximum deviation of SBT C is slightly higher than that of the ABT. As shown in Figure 3(c), in the angle holding section, the deviations of three SBTs also conform to the  Mathematical Problems in Engineering control law of increasing first and then decreasing, or decreasing first and then increasing and having the control characteristics of the ABT. Average deviations of SBTs are higher than those of the ABT; however, the maximum deviation is only about 35 m. According to the above analysis, the borehole trajectory control law of SBTs and the ABT is similar, and the mean value of the control deviation of SBTs is slightly higher.

Analysis of Torque and Drag Prediction Results.
e torque and drag of the four working conditions in Φ215.9 mm open hole (4000∼5000 m), such as rotary drilling, slide drilling, tripping in, and tripping out, was predicted by using SBTs, the ABT, and the DBT, respectively, and they were evaluated by using the torque of the drill string at the wellhead location and the hook load as the evaluation parameters. e calculation tool used is WELLPLAN ™ module in the HALLIBURTON-LANDMARK drilling and completion software, and the selected drill string mechanical model is Bending Stress Magnification Factor [17], and the drilling structure is Φ215.9 mm bit × 0.34 m + Φ172 mm screw × 7.69 m + Φ165 check valve × 0.50 m + F206 × 1.53 m + Φ165 drill collar × 9.09 m + MWD × 2.17 m + Φ127 mm drill pipe × 1113.3 m + Φ127 mm heavyweight drill pipe × 85.15 m + Φ178 drilling jar × 3.57 m + Φ127 mm heavyweight drill pipe × 85.15 m + Φ139.7 mm drill pipe. Other parameters used are shown in Table 3. Figure 4 shows that in the rotary drilling condition, the torque predicted by using the DBT is the lowest, followed by using the ABT, and the highest by using SBTs. e difference between them grows with the increase of well depth. Figure 4 also demonstrates that the torque of the DBT is significantly less than that of the ABT and SBTs. Figure 5 shows that the torque of the ABT is greater than 10% higher than the DBT, up to 15%, while SBTs have higher torque, up to 25%. Figure 6 shows that SBTs have higher torque relative to the ABT. And the torque of SBT A and C is close to that of the ABT with deviations of less than 4%. e torque of SBT B is slightly higher, and the maximum deviation does not exceed 10%. e increase of the torque deviation of the three SBTs is almost negligible, and the increase is less than 2% in the range of 1000 m (4000-5000 m).
In the case of drilling difficulty evaluation of a well or selection of rotary power equipment (turntable or top drive system), the maximum predicted torque value of the well is usually added with a certain safety factor as a reference value for determining the continuous output torque of rotary power equipment. e purpose of this is to ensure that the rotary power equipment can provide enough power to complete the drilling task of the target well and deal with the sudden complex situation, and it is also beneficial to prolong the service life of the equipment. During drilling construction of a certain block, based on the actual measured torque value and known parameters, the circumferential friction factor can be reversed for torque prediction in other wells or deeper formations. In the calculation of the torque of this case well, the circumferential friction coefficient is obtained by inversion during the actual drilling process; therefore, the torque calculated using the ABT can represent the rotational drilling torque of the well. Figures 4 and 5 also show that the torque of the DBT is lower than the actual drilling load, and the deviation increases with the increase of the well depth; therefore, it is inappropriate to evaluate drilling difficulty by DBT, and it should not be used as a basis for selecting rotary power  equipment. At the same time, Figures 4 and 6 also show that torque calculated by using SBTs is slightly higher than the actual drilling load, which shows that in the well planning stage, the application of the SBT instead of the ABT in drilling difficulty assessment and rotary power equipment selection can obtain more reliable results. Figure 7(a) shows that, in the rotary drilling condition, the hook loads of SBTs are basically consistent with the ABT, and the maximum deviation is within ±1%. Figures 7(b) and 7(c) show that, in the slide drilling and the tripping in conditions, the average hook loads of SBTs are higher than the ABT; however, the maximum deviation is less than 4%. Figure 7(d) shows that, in the tripping out condition, the hook loads of SBT A and B are basically consistent with the ABT, the average deviations are less than 2%, the hook loads of SBT B are higher, and the maximum deviation is close to 9%.
In rotary drilling, sliding drilling, and tripping in conditions, the deviations of hook load between SBTs and ABT are less than 3% on average, and the maximum deviation is not more than 4%. Even if the deviation of tripping out is larger, it is not more than 9%. erefore, drag predicted by SBTs in the well planning stage can reflect the drag magnitude in the actual drilling process and can reliably guide the selection and strength design of drilling tools.

Conclusions
is paper presents a predrilling simulation method of borehole trajectory. By comparing the distance with ABT and the torque and drag calculated by ABT, it is proved that SBTs and ABT have similar fluctuation characteristics, and the calculation error of torque and drag is lower than 10%. e comparison results show that it is feasible to use the method proposed in this paper to simulate the borehole trajectory to evaluate the difficulty of drilling.
(1) Low torque and drags predicted by the DBTresult in an unreasonable evaluation of drilling construction difficulty, which cannot well guide the selection of main drilling equipment and optimization of well planning and will bring certain drilling construction risks. (2) e simulation method of borehole trajectory based on vector similarity is supported by a large number of borehole trajectory control data. e application of case well proves that the SBT can replace the ABT to predict torque and drag. e predicted results are slightly higher than the actual drilling loads, which significantly improves the reliability of the predicted results of torque and drag in the well planning stage. (3) In this method, the random selection of parameters is set in this method; therefore, when there are a large number of drilled well samples, multiple applications of this method can obtain multiple different SBTs; furthermore, multiple groups of torque and drag can be obtained, which is conducive to enhancing the reliability of prediction results. (4) Under the constraints of well quality control standards, wells with the same well type and close design parameters may have different control deviations in local sections but should have similar control characteristics as a whole. erefore, the method has wide applicability, even if the exploration and development block drilling have not been carried out, and taking the ABTs in other blocks as samples, the application of this method can also obtain the SBT that conforms to the characteristics of the ABT control.  Increment of inclination (m) Δφ: Increment of azimuth (m).

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.