## 3 3D SPH Surface-to-Surface Contact Algorithm Using Surface Reconstruction
### Enforcement of Contact Conditions  
Contact conditions for slave particle-master segment contact pairs are enforced by a penalty method. The penalty method applies normal penalty forces to prevent the penetration between the contact pairs. It applies tangential friction forces to deal with the friction effect between them. For a slave particle-master segment contact pair, the normal penalty force is derived by assuming that it removes the penetration between the contact pair in a time step. It is calculated as  
\[F_{\text{n}}^{\alpha}=\frac{k_{\text{p}}\big{(}\delta_{\text{p}}-\Delta\delta_ {\text{p}}\big{)}}{(\frac{1}{m_{s}}+\frac{\delta_{1}^{2}}{m_{1}}+\frac{\delta _{2}^{2}}{m_{2}}+\frac{\delta_{3}^{2}}{m_{3}})(\Delta t)^{2}}n^{\alpha}, \tag{18}\]  
where \(k_{\text{p}}\) is a constant, which is about 0.5, \(m_{s}\) is the mass of the slave particle, \(m_{1}\), \(m_{2}\) and \(m_{3}\) are the masses of the three master particles on the master segment, \(\xi_{1}\), \(\xi_{2}\) and \(\xi_{3}\) are the fractions of the normal penalty force transmitted to the three master particles, and \(\Delta\delta_{\text{p}}\) is a correction to the penetration distance \(\delta_{\text{p}}\). The fractions \(\xi_{1}\), \(\xi_{2}\) and \(\xi_{3}\) are the area coordinates of the projection point of the slave particle in the master segment. \(\Delta\delta_{\text{p}}\) is introduced to compensate the computational error of \(\delta_{\text{p}}\), since \(\delta_{\text{p}}\) is calculated from Equation (13) with the coordinates of particles at the beginning of a time step, while the coordinates of particles will change at the end of the time step due to the motion of particles within it. \(\Delta\delta_{\text{p}}\) is calculated as  
\[\Delta\delta_{\text{p}}=(\widetilde{v}_{s}^{\alpha}-\widetilde{v}_{p}^{\alpha })n^{\alpha}\Delta t, \tag{19}\]  
where \(\widetilde{v}_{s}\) and \(\widetilde{v}_{p}\) are the predicted velocities of the slave particle and the projection point of the slave particle on the master segment, respectively, and their expressions are  
\[\widetilde{v}_{s}^{\alpha}=v_{s}^{\alpha}+\frac{\text{d}\widetilde{v}_{s}^{ \alpha}}{\text{d}t}\ \text{and}\ \ \widetilde{v}_{p}^{\alpha}=v_{p}^{\alpha}+\frac{\text{d}\widetilde{v}_{p}^{ \alpha}}{\text{d}t}\Delta t, \tag{20}\]  
Figure 3: Schematic diagram of crossover test. respectively, where  
\[v_{p}^{\alpha}=\xi_{1}v_{1}^{\alpha}+\xi_{2}v_{2}^{\alpha}+\xi_{3}v_{3}^{\alpha}, \ \frac{\mathrm{d}\widetilde{v}_{p}^{\alpha}}{\mathrm{d}t}=\xi_{1}\frac{\mathrm{d} \widetilde{v}_{1}^{\alpha}}{\mathrm{d}t}+\xi_{2}\frac{\mathrm{d}\widetilde{v}_ {2}^{\alpha}}{\mathrm{d}t}+\xi_{3}\frac{\mathrm{d}\widetilde{v}_{3}^{\alpha}}{ \mathrm{d}t}. \tag{21}\]  
Note that the accelerations \(\mathrm{d}\widetilde{v}_{s}^{\alpha}/\mathrm{d}t\), \(\mathrm{d}\widetilde{v}_{1}^{\alpha}/\mathrm{d}t\), \(\mathrm{d}\widetilde{v}_{2}^{\alpha}/\mathrm{d}t\) and \(\mathrm{d}\widetilde{v}_{3}^{\alpha}/\mathrm{d}t\) are those computed from Equation (2) in addition to the contributions of contact forces of other related contact pairs processed before the present contact pair. The tangential friction force for a slave particle-master segment contact pair is determined based on the Coulomb's Law of Friction. It is calculated as  
\[F_{\mathrm{t}}^{\alpha}=\left\{ \begin{array}{ll}\mu\|\mathbf{F}_{\mathrm{n}} \|\frac{\widetilde{F}_{\mathrm{t}}^{\alpha}}{\|\widetilde{\mathbf{F}}_{ \mathrm{t}}\|},&\left\|\widetilde{\mathbf{F}}_{\mathrm{t}}\right\|>\mu\| \mathbf{F}_{\mathrm{n}}\|\\ \widetilde{F}_{\mathrm{t}}^{\alpha},&\left\|\widetilde{\mathbf{F}}_{\mathrm{t }}\right\|\leq\mu\|\mathbf{F}_{\mathrm{n}}\|\end{array} \right., \tag{22}\]  
where \(\mu\) is the friction coefficient, \(\|\mathbf{F}_{\mathrm{n}}\|=\sqrt{F_{\mathrm{n}}^{\mathrm{n}}F_{\mathrm{n}}^{ \mathrm{n}}}\) is the magnitude of the normal penalty force, and \(\left\|\widetilde{\mathbf{F}}_{\mathrm{t}}\right\|=\sqrt{\widetilde{F}_{ \mathrm{t}}^{\alpha}\widetilde{F}_{\mathrm{t}}^{\alpha}}\) is the magnitude of the predicted tangential friction force.