Research Article

Numerical Simulation Study on Flow and Fracture of Granular Materials

Algorithm 3

Second-order contact detection algorithm.
(1)Transfer geometric information of two tetrahedron neighbor units A and B that need to determine whether there is contact between them.
(2)Define a set of vecN of three-dimensional vectors to store the unit normal vector of the common surface in each iteration step.
(3)Connect the centroid of A and B and make the vertical bisector of the connecting line. With the vertical bisector as the common surface, the nearest vertices and . of A and B are obtained.
(4)Calculate the direction vectors of the connecting line of and ; the direction vector is stored in vecN as the unit normal vector of the common surface.
(5)The faces sharing vertices and are regarded as potential common surfaces and their unit normal vectors are stored in vecN, respectively.
(6)Make vector products for the direction vectors of the edges sharing vertex and vertex, respectively, unitized the vector product, and it is also stored in vecN as a normal vector of potential common surface.
(7)Take an edge that contains vertex , calculate its direction vector, and then calculate the direction vector of the line between and ; calculate their vector product, then take it to vector product with the direction vector of the edge passing through vertex, and store the vector product in vecN as the normal vector of the potential common surface. Repeat the above operations for all edges passing through vertex , and then repeat the above operations for all edges passing through vertex .
(8)For the normal vectors of each potential common surface in the set vecN, calculate the minimum distance between the two tetrahedrons, marking the nearest vertex as and ; if and , then the normal vector of the common surface is the final normal vector of the common surface and terminates the calculation; otherwise, return to 4 and continue the calculation.