## 1 Introduction  
Wellbore instability, which is the key to impeding quality and efficient drilling, is the focus of attention in the petroleum engineering field [1; 2; 3; 4; 5; 6]. In particular, carbonate rocks are tricky for oil and gas drilling because they are full of unpredictable cracks and solution cavities [7; 8; 9; 10]. These features can disrupt the pressure distribution and weaken the rock, leading to instability issues of the wellbore in the drilling process [11; 12]. The instability of the wellbore in carbonate formation has perplexed engineers and researchers, even though this problem has been on the research radar for a while now [13; 14; 15], especially since there is still a lot we do not know about how these cracks and solution cavities affect the wellbore stability. It is a common understanding that cracks and solution cavities play a key role in affecting the wellbore stability in carbonate formation. Undoubtedly, the cracks can affect the rock's mechanical properties and fluid flow in the formation, resulting in instability of the wellbore. [PERSON] et al. [16], [PERSON] et al. [17], [PERSON] et al. [18], and [PERSON] et al. [19] pointed out that the crack's properties, such as strength and friction, are crucial for the wellbore stability. [PERSON] et al. [20] discovered that the weak plane effect is significant, and the borehole wall is prone to collapse along the crack. [PERSON] et al. [21] believe that the higher risk of wellbore instability may correspond to the formation with relatively high permeability, porosity, and gas saturation. [PERSON] et al. [22] found that cracks would promote rock hydration and then weaken the stability of the wellbore. On the other hand, the size and distribution of formation pores have a significant impact on wellbore stability. The size and distribution of pores can greatly affect the effectiveness of mud in supporting the wellbore [23]. Pore throats can affect the flow of drilling fluid in the formation and change the wellbore stability condition [24; 25]. Moreover, pores can also impact the pore pressure distribution and ultimately result in a different wellbore collapse condition [26]. Researchers have tried various ways to evaluate the stability of wellbores in the formation of cracks and solution cavities. For example, [PERSON] et al. [27] utilized lithological descriptions to predict rock strength parameters and subsequently introduced a wellbore stability evaluation method based on finite element theory. Based on a Monte Carlo probability analysis and the Mogi-Coulomb failure criterion, [PERSON] et al. [28; 29] proposed a method for evaluating the wellbore collapse pressure of a carbonate reservoir. [PERSON] et al. [19] and [PERSON] and [PERSON] [30] established a discrete element numerical model to study the wellbore stability of fractured shale formation. [PERSON] et al. [31] proposed a generalized H-B criterion model based on acoustic data for evaluating the wellbore stability of multi-set fractured limestone formation. [PERSON] et al. [32] employed the fractal method to fit the functional relationship between the cohesion, internal friction angle, and fractal dimension of micro-fractured rocks and then developed a wellbore stability evaluation method for fractured carbonate formation. Based on the thermo-poroelastic medium theory, [PERSON] et al. [33] proposed a wellbore stability evaluation method for porous formation. These studies attempted to obtain a method to evaluate the wellbore stability of carbonate formation, considering the effect of cracks and solution cavities. Still, many of these studies did not fully address how unevenly distributed these cracks and solution cavities can be.