## 2 SPH Numerical Simulation Method for Rocks with Random Pores
### Random Pore Generation Algorithm  
There are a large number of pores inside the rock, and the reasons for their formation are as follows: (1) physical weathering, such as temperature changes causing differences in expansion and contraction between the surface and the interior of the rock to form fissures and then pores, and the freeze-thaw action expanding the rock pores when water freezes to form holes; (2) chemical weathering, such as the dissolution of rocks such as limestone leaving holes due to the dissolution effect, and the oxidation effect changing the mineral structure of the rock to produce holes; (3) biological action: the mechanical pressure of plant root growth enlarges the rock fissures to form holes, and the excavation of animals and the decomposition of rocks by substances secreted by microorganisms also cause holes. Pores have a significant impact on the mechanical properties of rocks. They will reduce the strength of the rock. The existence of pores weakens the internal connection of the rock, making it more likely to be damaged under external forces. They also reduce the elastic modulus of the rock, change the deformation characteristics of the rock, and make it more likely to produce large deformations when subjected to force. At the same time, they increase the permeability of the rock. The interconnected pores form channels, making it easier for fluids to flow in the rock. Therefore, it is necessary to consider concrete pores in numerical simulation.  
Assume that the shape of the pores in the rock mass is circular, and define the center coordinates of the pore as (_xpori_, _ypori_) and the radius of the circular pore as _rpori_. To characterize the randomness of the pores, random numbers \(R1\), \(R2\), and \(R3\) with values between (0-1) are introduced. For a two-dimensional rock mass model with a length of \(l\) and a width of \(m\), the \(x\) and \(y\) coordinates of the center of the circular pore can be expressed as  
\[xpor_{i}=l\cdot R1 \tag{7}\]  
\[ypor_{i}=m\cdot R2 \tag{8}\]  
After obtaining the center coordinates of the circular pore, it is necessary to determine the radius of the circular pore. In this section, the particle size range of the generated center pore is defined as (\(d_{\text{min}}\), \(d_{\text{max}}\)). Therefore, to characterize the randomness of the pore size, the radius of the circular pore can be determined by the following formula:  
\[r_{i}=\ (d_{\text{min}}+(d_{\text{max}}-d_{\text{min}})\cdot R3)/2 \tag{9}\]  
When generating random aggregates inside the rock mass, it should be noted that the \(i\)+1 th pore and the \(i\)th pore cannot overlap. The determination method is that the distance between the centers of the \(i\)+1 th circular pore and the \(i\)th circular pore needs to be greater than the sum of the radii of the \(i\)+1 th circular pore and the \(i\)th circular pore, that is,  
\[\sqrt{\left(xpor_{i+1}-xpor_{i}\right)^{2}+\left(ypor_{i+1}-ypor_{i}\right)^{2 }}\geq r_{i}+r_{i+1} \tag{10}\]  
When the area percentage of the pores in the rock mass model reaches the predetermined pore percentage \(P_{\text{por}}\), the generation of pores stops, and the circular pore data are imported into the SPH program. No SPH particles are generated inside the circular pores.  
Therefore, according to the above steps, the generation process of random pores inside the rock mass within the SPH framework can be obtained, as shown in Figure 1. It mainly includes generating initial parameters, generating pore parameters, checking for overlap between pores, and judging whether the target pore percentage has been reached.  
Figure 1: Flow chart of generating random pores inside the rock mass within the SPH framework.