## 5 Numerical Modeling of Wellbore Stability with WPM and HBm  
We carried out numerical simulations of wellbore stability with the code FLAC (Fast Lagrangian Analysis of Continua, ver 8.10, Itasca, Minneapolis, MN, USA). FLAC is a two-dimensional explicit finite difference program for engineering mechanic computations. The computational domain is a radial grid (Fish DONUT, implemented in FLAC) with 60 zones in the radial direction and 60 zones on the circumference. The wellbore diameter is 1 m and the diameter of the grid is 40 m (Figure 14). The state of stress within the model is initialized by imposing \(\sigma_{MAX}\) in the horizontal and \(\sigma_{min}\) in the vertical direction. The same horizontal and vertical stresses are applied at the external boundary of the grid. The grid is configured for fluid flow analysis. The undrained conditions used in the analytical solution (constant pore fluid pressure \(\Delta p_{f}=0\)) are obtained by (a) imposing and fixing the pore fluid pressure (\(p_{i}\)); (b) imposing the bulk modulus of the fluid equal to zero; (c) setting of the mechanical calculations and turning off the fluid flow calculations. Figure 14: (a) Grid used in the numerical simulations with FLAC. Notation: *10’1 = \(\times 10^{1}\) m (b) Directions of the far field stresses used in the simulations. A mechanical pressure, equal to the mud pressure calculated with the analytical solution, is applied at the internal boundary (wall of the borehole). A higher mechanical pressure avoids slip or failure in the rock matrix. A lower mechanical pressure results in an enlargement of the failed zone and possibly in borehole collapse. We carried out numerical simulations with the Ubiquitous Joint Model (UBI) and HB criterion for isotropic rock. Both constitutive laws are a continuum based model. UBI accounts for joint implicitly: the weakness planes are smeared across the rock mass (ubiquitous) with a given inclination (\(\delta\)). At first the code detects general failure with the M-C in the rock matrix and applies plastic corrections. The corrected stresses are then analyzed for failure on the weakness plane with the WPM, and updated accordingly. Figure 15 shows the results of the numerical simulations carried out with \(R=1.5\) with \(p_{f}=11\) MPa at \(\delta=0^{\circ}\)-\(30^{\circ}\)-\(45^{\circ}\)-\(90^{\circ}\) carried out with UBI. The pattern of failure location at \(\delta=0^{\circ}\), \(\delta=30^{\circ}\) and \(\delta=45^{\circ}\) shown in Figure 15a-c is in agreement with the peaks shown in Figure 9e. Figure 15d shows the results of the numerical simulations carried out at \(\delta^{*}=0^{\circ}\), with the new reference system (see Figure 5c). The figure clearly shows that there is the occurrence of plasticity in the rock matrix (at \(\theta=90^{\circ}\)) and, surprisingly, slip does not occur along the weakness planes, in agreement with the anomalous predictions shown in Figures 9e and 11d. The agreement between the results obtained with the WPM and UBI does not indicate that the prediction of the mud pressure at \(\delta^{*}=0^{\circ}\) is reliable. Instead, the results indicate that WPM under some field conditions cannot correctly predict mud pressures. Numerical simulations with HBm, by using the HB isotropic model implemented in FLAC, can be obtained by programming a routine or simply dividing the area around the well into slices with different \(\sigma_{c\beta w}\). The trend of \(\sigma_{c\beta w}\) with wellbore azimuth \(\theta\) are shown in Figure 8a. We identified the slices with constant averaged \(\sigma_{c\beta w}\) according to Figure 8a. Figure 16a,b show the variation of \(\sigma_{c\beta w}\) for the inclination \(\delta=45^{\circ}\), \(\delta=0^{\circ}\) and \(\delta^{*}=0^{\circ}\). The results of the numerical simulations with \(R=1.5\) with \(p_{f}=11\) MPa are shown in Figure 17. The numerical results shown in Figure 17a,b are in agreement with the analytical predictions.