Research Article

Numerical Simulation Study on Flow and Fracture of Granular Materials

Algorithm 2

First-order contact detection algorithm.
(1)Transfer the basic information of all tetrahedrons obtained from mesh generation algorithm of granular system.
(2)Construct boundary box for each tetrahedron.
(3)Project the boundary box onto three coordinate axes of granular system.
(4)Generate three catalogues and store the sequence of starting points and ending points of boundary box projecting on three coordinate axes in the catalogue.
(5)Cycle all tetrahedrons (for (i = 0; i < num; i++) (num is the number of tetrahedrons)).
  (a) Find the starting point and ending point of the projection of the boundary box of the tetrahedron i on the three coordinate axes from the storage catalogue.
  (b) Cycle all remaining tetrahedrons after removing the tetrahedron i (for (j = 0; j < num-1; i++)).
   ① Generate a directory.
   ② Judge whether the projection on three coordinate axes of the boundary box of tetrahedron j and tetrahedron i are overlapping; if overlap, then the tetrahedron j is considered as the neighbor unit of the tetrahedron i, and the unit is stored in the catalogue.
  (c) End the cycle.
(6)End the cycle.
(7)Get the directory of all tetrahedron neighborhood units.