1. Introduction
The stability of the wellbore is a worldwide challenge in drilling engineering and is a central concern for safe and efficient operations. With the development of technologies such as deep shale and horizontal drilling, various drilling safety issues have become increasingly prominent. Among these, wellbore instability is particularly significant due to its substantial negative impact on both operational safety and cost. During drilling deep formations, the wellbore experiences stress concentration due to anisotropic in situ stress. It is difficult to entirely prevent wellbore collapse, often resulting from insufficient drilling fluid pressure to support the borehole. Notably, the orientation of collapse typically aligns with the direction of the minimum horizontal in situ stress. After a wellbore is drilled, the pressure exerted by the drilling fluid column replaces the mechanical support provided by the removed rock, disrupting the formation’s initial stress equilibrium and leading to stress redistribution in the surrounding rock [
1]. If this redistributed stress exceeds the rock’s load-bearing capacity, whether in tension or compression, wellbore instability will occur [
2,
3].
The carbonate rocks of the Dengying Formation are rich in oil and gas resources and represent a key target for current development. However, wellbore collapse occurs frequently during drilling in deep carbonate formations. For instance, during deep oil and gas exploration in the No. 5 fault zone of the Shunbei field, wellbore collapse in fractured carbonate intervals extended the drilling cycle of five wells by 913 days and increased costs by approximately 130 million RMB. Similarly, in several wells in western Sichuan, drilling through the carbonate strata of the Maantang–Leikoupo Formation led to varying degrees of borehole collapse and block detachment, severely impacting drilling progress and downhole safety [
4,
5]. Another example is Well ZJ2 in the TH area of the Sichuan Basin, where a downhole collapse occurred in the fractured carbonate section of the Dengying Formation’s Second Member, resulting in 11.88 days of non-productive time [
6,
7]. Incomplete statistics from the PT well area further indicate frequent occurrences of formation collapse, block fall, and wellbore instability in deep carbonate reservoirs, with an average borehole enlargement rate of 21% and localized enlargement reaching 119%. These incidents highlight the seriousness of wellbore instability and its adverse effect on drilling efficiency [
8,
9,
10]. In general, directional wells tend to exhibit poorer wellbore stability than vertical wells due to their inclination. The trajectory of a directional well directly influences stability because it alters the distribution of in situ stress around the borehole. Therefore, accurate prediction of collapse pressure under different wellbore trajectories is of great significance for achieving safe and efficient drilling in the Dengying Formation [
11,
12,
13,
14].
Based on linear poroelasticity theory, a mechanical model for wellbore stability in directional wells is established, and the collapse pressure is calculated. Based on a comparison of collapse pressures under different wellbore trajectories, the optimal wellbore trajectory is determined in target formations. Furthermore, a novel intelligent method for predicting collapse pressure is proposed to address the limitations of computationally complex and less accurate traditional approaches.
2. Mathematical Model
Wellbore stability is achieved by preventing collapse, fractures, or contraction during drilling through the coordinated use of drilling fluid density, fluid chemistry, and drilling practices. The accurate prediction of formation pressure is a critical prerequisite for drilling safety. Deep strata are usually subjected to two horizontal principal stresses, one vertical principal stress, and pore pressure. The creation of a wellbore disrupts the original in situ stress equilibrium, leading to stress redistribution in the surrounding rock. If the formation behaves as a linear elastic material, stress concentration will occur around the wellbore. When passing through low-strength formations, this concentrated stress may exceed the rock’s strength, resulting in mechanical instability of the wellbore. In contrast, wellbore instability is generally less likely in formations with high rock strength and favorable in situ stress conditions. Because drilling fluid replaces the original rock in supporting the borehole wall, insufficient drilling fluid pressure can lead to borehole collapse or contraction. In contrast, excessively high formation pressure may cause kicks or blowouts. Therefore, to investigate the instability mechanisms in the deep carbonate formations of the Dengying Formation, it is essential to establish an appropriate mechanical model for wellbore stability analysis [
15,
16,
17].
In wellbore stability analysis, pore pressure is a crucial parameter. Currently, the primary methods for calculating formation pressure include the Equivalent Depth Method, Eaton’s Method, and the Effective Stress Method. The Equivalent Depth Method and Eaton’s Method, while accurate for sand-shale sequences, face limitations in carbonate formations due to the scarcity of mudstone. The lack of mudstone makes it difficult to establish a standard compaction trend equation, thereby reducing the accuracy of pore pressure predictions in carbonates when using these methods. Therefore, as illustrated in
Figure 1, a formation pressure prediction model based on the compressional-to-shear wave velocity ratio is developed by fitting the relationship between P-wave and S-wave travel-time differences [
18,
19,
20,
21,
22,
23]:
where
σe is effective stress, MPa;
Vp is the P-wave velocities, m/s; and
Vs is S-wave velocities, m/s.
Owing to the scarcity of shear-wave logging data in most wells within the study area, the absence of shear-wave travel time difference—an essential parameter—renders the subsequent wellbore stability mechanical model inoperative. Therefore, using limited acoustic logging data that includes shear-wave travel time differences, such as from Well DY1 and its vicinity, and incorporating relevant empirical formulas, a relationship between compressional- and shear-wave travel time differences was established by fitting. This approach not only resolves the issue of missing key parameters in the formation pressure prediction model based on P-wave velocity ratio, but also provides fundamental data for calculating subsequent rock mechanical strength and elastic parameters. The relationships among relevant rock mechanics parameters are illustrated in
Figure 2.
The fitting relationship of P-wave and S-wave time difference is shown as follows:
where
DTS is S-wave travel time, us/ft;
AC is P-wave travel time, us/ft.
To establish the stress distribution model around the wellbore, the carbonate rock is treated as a poroelastic medium. Subsequently, stress distribution models are developed for highly deviated and horizontal wells [
24].
The stress distribution model induced by in situ stress and drilling fluid column is [
25]
When the borehole radius
rw is equal to the polar coordinate radius
r, it can be simplified as follows:
where
σr,
σθ, and
σz are radial stress, circumferential stress and axial stress components, respectively;
τθz,
τrθ, and
τrz are three shear stress components;
θ is circumferential angle of wellbore;
rw is wellbore radius;
r is the radius from the wellbore axis at any position around the well;
μ is Poisson ratio;
σxx,
σyy,
σzz,
σxy,
σyz, and
σxz are the in situ stress component in the borehole rectangular coordinate system;
σH,
σh, and
σv are maximum and minimum horizontal ground stress and vertical ground stress, respectively;
αb is wellbore deviation angle;
βb is the wellbore azimuth angle;
Ω is the azimuth angle of the maximum horizontal in situ stress; and
pm is the drilling fluid column pressure.
From Equation (6), the stress tensor
σij of the borehole can be written as
Then, by solving the eigenvalue of the stress tensor of the wellbore, the three-way principal stress at the wellbore of the inclined shaft is obtained:
Usually, the radial stress of the wellbore is in the direction of the minimum principal stress. After considering the effective stress, the three principal stresses (
σ1 >
σ2 >
σ3) can be expressed as
where
α is the Biot coefficient;
pp is pore pressure, MPa; and
σ2 is the intermediate principal stress.
In drilling engineering, creating a wellbore replaces rock support with drilling fluid support, redistributing the stress field around the wellbore. Insufficient drilling fluid support can cause stress concentration along the direction of the minimum horizontal principal stress, which may induce shear failure of the surrounding rock, thereby posing a risk of wellbore collapse and instability [
26,
27].
Based on previous studies of rock composition, the carbonate rocks of the Dengying Formation are characterized as hard and brittle. For shear failure to occur along a potential plane, the shear stress must exceed the rock’s inherent shear strength (cohesion) plus the frictional resistance on that plane. Using the Mohr–Coulomb failure criterion, the collapse pressure can be expressed as follows [
28,
29]:
where
σ1,
σ2, and
σ3 are three principal stresses, MPa;
C is Cohesion, MPa; and
ϕ is internal friction angle, (°).
To prevent wellbore collapse, control higher formation pressure, and avoid kicks and blowouts, a higher drilling fluid density may be employed. However, the resulting elevated fluid-column pressure can induce significant stress concentration in the direction of the maximum horizontal principal stress. In severe cases, this may lead to tensile failure of the wellbore, posing a risk of wellbore fracture and instability [
30,
31,
32].
Since the aforementioned directional wellbore stability model determines only whether collapse occurs and does not yield a closed-form analytical solution, an iterative numerical solver was implemented in MATLAB R2022b to obtain the solution. The detailed workflow for directional wellbore stability calculation is illustrated in
Figure 3, as well as defined below:
- (1)
We input relevant logging parameters, including natural gamma value, acoustic travel time, and rock skeleton density.
- (2)
Using the fitted empirical regression formula and the established P-wave to S-wave velocity ratio model, key parameters, including rock mechanical properties, in situ stress, and formation pore pressure, are calculated. Based on these results, the wellbore trajectory—defined by its deviation and azimuth angles—is subsequently determined [
33,
34].
- (3)
The range of wellbore angle θ and the range of wellbore liquid column pressure pm are set, and the principal stresses σ1, σ2, and σ3 around the wellbore under different drilling fluid column pressures pm are calculated iteratively. The drilling fluid column pressure satisfying the Mohr–Coulomb (M-C) criterion is determined, and the critical liquid column pressure pmi under each well angle is recorded and stored.
- (4)
Comparing the critical liquid column pressure pmi, the maximum liquid column pressure pmmax is found, which is the collapse pressure pb at the current well depth.
- (5)
Draw the collapse pressure profile of the Dengying formation, we compare the equivalent density of collapse pressure with the actual equivalent density of the drilling fluid, and analyze and evaluate the risk of wellbore instability in directional wells.
The specific calculation process of wellbore stability of a directional well is shown as follows:
The traditional directional wellbore stability calculation program needs to first set the liquid column pressure, pm = 0. By solving the stress distribution formula for the θ wellbore at different well circumference angles, the θmax corresponding to the maximum principal stress σ1max around the wellbore is found. Then, a new solution domain for liquid column pressure pm, is established, and the collapse pressure value satisfying the strength criterion is determined by cyclic iteration.
The directional wellbore stability calculation program developed in this study streamlines the computational procedure. It implements a dual-loop iterative scheme over the circumferential angle (θ) and the drilling fluid column pressure (pm), where the solution accuracy can be directly controlled by adjusting the step size within each loop. This structure renders the algorithm both efficient and conceptually transparent.
3. Intelligent Prediction Model
Despite the mechanical analytical model’s high accuracy, its computational process remains complex, involving iterative solutions that result in slow processing speeds. This limitation hinders its application in real-time simulation and rapid decision-making during actual drilling operations. The adoption of machine learning methods can effectively alleviate this issue, enabling high-efficiency and high-precision engineering applications.
Currently, research on wellbore collapse and instability primarily focuses on deriving complex computational formulas based on various rock-strength criteria and elastic-mechanics theories. Traditional methods for predicting collapse pressure often involve cumbersome calculation procedures and suffer from low predictive accuracy, which ultimately reduces the efficiency of drilling design [
35,
36]. To effectively predict collapse pressure and thereby determine key drilling engineering parameters, such as optimal drilling fluid density, well trajectory, and well structure design, a more efficient and accurate approach is required.
Therefore, provided that the early-stage collapse pressure calculations are accurate, the collapse pressure equivalent density can be predicted by integrating logging data, wellbore trajectory, and historical collapse pressure data using the XGBoost algorithm. Consequently, an intelligent method for predicting wellbore collapse pressure based on the XGBoost algorithm is established [
37].
XGBoost is an enhanced gradient boosting decision tree (GBDT) framework that incorporates several improvements over the original GBDT algorithm to enhance computational efficiency and scalability. This machine learning method is commonly employed for both classification and regression tasks. XGBoost constructs an ensemble of classification or regression trees, where each tree contributes a prediction score from its leaf nodes, and the final output is obtained by summing the scores across all trees:
where
xi is the input data of the model,
ypi is the prediction result of the model, and
fk is the leaf score of the
k-th tree.
The specific process of the intelligent evaluation method for the wellbore collapse risk is shown in
Figure 4.
First, well logging data, borehole trajectory parameters, and collapse pressure equivalent density are integrated to form a dataset. Feature correlation analysis is then performed using the Spearman correlation coefficient method, which is calculated as follows:
where
di is the rank difference of each pair of observations in two variables;
n is the number of samples.
The evaluation metrics for the collapse pressure prediction model are the goodness-of-fit (R
2) and mean squared error (MSE). The calculation methods are as follows:
where
yi is the true value of the
i th sample,
is the predicted value of the
i th sample, and
is the average value of the m samples.
4. Case Study
4.1. Mechanical Analysis of Wellbore Collapse
The drilling fluid density from stable wellbore sections with no instability is employed as a proxy for the actual collapse pressure. Although this approach is practical and commonly used in the industry, it should be noted that it is an approximation, as the true collapse pressure may be slightly lower than the mud weight actually used. Treating drilling fluid density as a direct equivalent to formation collapse pressure introduces a significant systematic positive bias, primarily stemming from an oversimplification of the wellbore stability mechanisms and a neglect of multiphysics coupling effects. Regarding the nature of the error, operational prudence dictates that the drilling fluid density employed in the field invariably incorporates a substantial safety margin above the theoretical minimum required for stability; consequently, utilizing this operational density as the labeled collapse pressure in historical datasets induces a significant right-skewness in training labels, leading to unduly conservative predictions in data-driven models. The root cause of this discrepancy lies in the inherent limitations of conventional analytical frameworks, which typically presuppose the formation to be a homogeneous continuous medium while failing to account for structural anisotropies—such as bedding plane weaknesses—and the transient pore pressure transmission induced by fluid infiltration, thereby compelling engineers to offset these unquantified risks by artificially elevating the drilling fluid density. Finally, the true collapse pressure is frequently lower than the operational density because high-density drilling fluid provides more than mere hydrostatic support; it confers an additional chemomechanical stabilization via the rapid formation of an impermeable mud cake, effectively masking the rock’s intrinsic steady-state creep response under lower stress regimes. Therefore, equating drilling fluid density with formation collapse pressure conflates the actual geomechanical threshold with the cumulative engineering overhead required to mitigate complex, time-dependent failure mechanisms.
Based on the collapse pressure calculation formula, wellbore stability analysis was performed on the Dengying Formation sections of three wells with complete logging data, and the resulting collapse pressure profiles were plotted. The distribution of the collapse pressure equivalent density is shown in
Figure 5.
In the DY1, DY101, and DY103 wells, the formation collapse pressure of the Dengying Formation exceeds the formation pore pressure and gradually increases with depth. The equivalent collapse pressure density ranges from 1.25 to 1.35 g/cm3, whereas the actual drilling fluid density used in these wells is between 1.20 and 1.25 g/cm3. In the lower section of the Dengying Formation, the actual drilling fluid density falls below the equivalent collapse pressure density. This insufficient drilling fluid density fails to provide adequate wellbore support, potentially leading to wellbore instability such as collapse and borehole enlargement.
The rate of hole enlargement in the lower section of the Dengying Formation is significantly higher than in the upper section, exceeding 15% in many intervals and averaging over 10%. In Well DY1, a drilling fluid density of 1.30 g/cm3 was used in the interval 5650–5675 m, which is higher than the predicted collapse pressure of 1.21 g/cm3, resulting in a hole enlargement rate of only 3.53%. In contrast, a density of 1.20 g/cm3 was used in the interval 6275–6300 m, which is below the predicted collapse pressure of 1.35 g/cm3, leading to a hole enlargement rate of 80.62%. Statistics from Wells DY101 and DY103 also follow this trend. These results indicate that the wellbore instability mechanism in the Dengying Formation of the Penglai gas area aligns with the model predictions.
Given the impracticality of directly measuring collapse pressure at the production site, the actual drilling fluid density used in stable sections of the upper Dengying Formation—where no wellbore instability (such as enlargement, blockage, or block dropping) occurred—is taken as a proxy for the actual collapse pressure. This approach was used to validate the accuracy of the prediction. For example, in Well DY1 (interval 5650–5675 m), the actual/proxy collapse pressure is 1.30 g/cm3, the predicted value is 1.21 g/cm3, yielding an accuracy of 93%. Similarly, in Well DY101 (5610–5635 m), the actual value is 1.25 g/cm3 against a prediction of 1.22 g/cm3 (97.6% accuracy), and in Well DY103 (5710–5715 m), the actual value is 1.25 g/cm3 versus a prediction of 1.20 g/cm3 (96% accuracy). Overall, the collapse pressure prediction accuracy for the Dengying Formation in the Penglai gas area exceeds 93%, which meets the requirements for drilling engineering design.
Based on logging data and inclination records, the collapse pressure equivalent density was predicted for the directional section of the Well PL001-H1. As this section had not yet been logged during drilling, the data from the adjacent Well DY103 were used for the prediction. The wellbore stability of the directional section was thus assessed before drilling. As shown in
Figure 6, the predicted collapse pressure equivalent density in the Dengying Formation directional interval ranges from 1.20 to 1.27 g/cm
3. With the actual drilling fluid density maintained between 1.25 and 1.30 g/cm
3 during operations, no blockages or falling blocks were observed. The actual collapse pressure for this interval is inferred to be 1.25 g/cm
3, resulting in a maximum error of less than 4% and a prediction accuracy of 96%.
4.2. Wellbore Trajectory Optimization Design
The DY103 well with the most serious hole enlargement was selected for analysis, and the corresponding collapse equivalent density cloud map (
r is the deviation angle,
θ is the azimuth angle, and the color depth reflects the equivalent density of the drilling fluid) was established, as shown in
Figure 7. The relevant basic parameters include
TVD = 6080 m,
σH = 168.63 MPa,
σh = 146.66 MPa,
σV = 155.23 MPa,
pp = 64.87 MPa,
μ = 0.22,
C = 22 MPa, and
ϕ = 45°.
Under strike-slip fault stress conditions, the collapse pressure is highest when drilling a vertical well, while lower collapse pressures are observed in horizontal or directional wells. The lowest collapse pressure density occurs at a deviation angle (αb) of 90° with deviation azimuths (βb) of 71°, 179°, 251°, and 359°. Therefore, under strike-slip fault conditions, the optimal wellbore drilling direction is approximately 36° from the direction of the maximum horizontal stress.
To analyze the influence of varying wellbore trajectories on wellbore stability, the equivalent densities of collapse pressure were extracted for different inclination and azimuth angles, and the corresponding curves were plotted, as shown in
Figure 8. The results are summarized as follows:
Under strike-slip fault stress conditions, with a constant wellbore azimuth, the equivalent density of collapse pressure decreases with increasing well inclination. This decrease is more pronounced at an azimuth of 30°. For inclinations of 30° and 60°, the equivalent density initially rises and then stabilizes as the azimuth increases. At an inclination of 0°, the equivalent density remains largely constant regardless of azimuth variation. In contrast, at an inclination of 90°, the equivalent density first decreases and then increases with increasing azimuth.
In summary, as the well deviation angle increases, the difference between the maximum and minimum principal stresses (σ1–σ3) on the wellbore wall decreases. According to the Mohr–Coulomb criterion, this reduces the probability of shear failure at the wellbore. In contrast, as the well azimuth increases, the trend is generally the opposite; however, its exact influence must be evaluated in conjunction with the magnitude of the deviation angle.
4.3. Intelligent Prediction of Wellbore Collapse
It is worth noting that the primary innovation of this study lies in the establishment of a high-fidelity intelligent proxy for the poroelastic wellbore stability model, rather than the development of a new machine learning algorithm. While various algorithms exist, the XGBoost framework was selected for its proven robustness in handling heterogeneous geological data and its computational efficiency. The achieved R2 of 0.98 and the reduction in inference time to the second-level sufficiently validate that the chosen model meets the rigorous demands of real-time drilling risk assessment in the target formation.
The specific application procedure for the intelligent prediction method of wellbore collapse pressure comprises the following steps: First, data from drilled wells, including logging, wellbore trajectory, and collapse pressure data, were collected and processed. The logging data consist of true vertical depth (TVD), compressional wave slowness (AC), caliper (CAL), compensated neutron log (CNL), gamma ray (GR), flushed zone resistivity (RT), and formation resistivity (RXO). The wellbore trajectory data include deviation angle (DEV) and azimuth angle (DAZ). The data used for the intelligent prediction is shown in
Table 1.
Then, Spearman correlation coefficients were calculated between the logging data, wellbore trajectory parameters, and the equivalent density of collapse pressure to perform feature correlation analysis for screening and selecting effective features. The results are presented in
Figure 9.
When the correlation coefficient between features exceeds 0.8, the information they convey is highly redundant, increasing model training costs. Accordingly, the feature parameters AC, CNL, and RXO were removed. TVD, DEN, GR, RT, DEV, DAZ, CAL, etc., were used as input parameters of the model.
The selected features were used as input parameters, with the equivalent density of collapse pressure as the output. The dataset was split in a 3:1 ratio, with 75% allocated to the training set. A grid search was employed to identify the optimal hyperparameter combination for the model. The optimal combination of hyperparameters is shown in
Table 2. The prediction model of collapse pressure equivalent density was trained on this set, while the remaining 25% served as the test set for performance evaluation. Comparison of calculated and predicted values is shown in
Figure 10. The two results are highly consistent. The training results indicate high predictive accuracy on the test set, with an R
2 of 0.997 and an MSE of only 6.28 × 10
−5.
The collapse pressure equivalent density prediction model developed through the above method was validated using data from Well DY103, as shown in
Figure 11. The predicted values based on the XGBoost algorithm closely match the calculated values derived from logging data, with an R
2 of 0.98 (approaching 1) and an MSE as low as 0.0086. The results demonstrate the model’s high predictive accuracy and reliability.
The traditional method for predicting collapse pressure not only requires extensive logging data but also relies on regression fitting of characteristic parameters derived from laboratory experiments. This process is computationally cumbersome and yields low prediction accuracy, thereby reducing the efficiency of drilling design. In contrast, the intelligent prediction method for collapse pressure based on the XGBoost algorithm requires only logging data and wellbore trajectory parameters, bypassing the intermediate calculations required for complex rock mechanics and in situ stress parameters. This method reduces the calculation time from hours to seconds, while maintaining an accuracy rate of more than 98%. The model’s generalizability may be limited when applied to other blocks, as its performance depends on the specific geological characteristics of the training data.