Researches on the Fast Determination of Cell Type of Cartesian Grid

The relationship between the spatial cell and the object is unknown for the Cartesian grid using the immersed boundary method. For the researches about complex geometry or multi-body relative motion, grid generation is a very time-consuming work, and the consumption is mainly concentrated in the position determination of the Cartesian cells, which we called the cell type determination. In this study, based on the axis-aligned bounding box method and the ray casting method, we employed the dot product method and the painting algorithm to investigate the acceleration method for Cartesian grid generation. The octree structure is used to store the Cartesian cells, and the k-dimensional tree is used to store the object surface. These data management strategy can minimize the CPU’s resource while have a small memory usage. The grid generation results show that the strategy we proposed has a high eﬃciency and well robustness, and the time consume can reduce more than 50% compare with the original method. When dealing with a enough complex problem, the time consume can even reaches several orders of magnitude diﬀerence compared with the original method.


3
The traditional body-fit structured/unstructured meshes have great advantages in 4 solving problems using complex geometries. However, the mesh generation for those 5 meshes may cost a lot of manual time to get a enough good quality to ensure the 6 stabilization of simulation [1,2]. In particular for the relative motion simulations 7 using multi-geometrics, the meshes have to be deformed or regenerated at each time 8 step [3][4][5]. 9 Cartesian grid can neglect those problems due to the non-body-fitted character- 10 istic. The hexahedral cells in domain intersect with solid walls, change the problem 11 of generating a body-fitted mesh to a more general problem of computing and char- 12 acterizing intersections between hexahedral cells and the geometry [6][7][8][9]. Thus, all 13 difficulties associated with the flow field solving using Cartesian grid are restricted 14 to the problem of flux reconstruction near solid walls. The immersed boundary tech- 15 nique [10,11] is one of the most common approaches for this problem. To apply the 16 immersed boundary technique, the position relationship between Cartesian cells 17 and the objects should be determined into 4 types: non-intersecting outside cell, 18 intersecting outside cell, non-intersecting inside cell, and intersecting inside cell. 19 The conventional cell type determination is based on the ray casting method 20 [12,13]. The intersection relationship can be determined by the relative position between the eight vertices of cell and the objects. The inside/outside relationship 22 can be determined by the relative position between the cell center and the objects. 23 However, due to the special cases that the ray might tangent to the object surface 24 [14], multiple rays or other auxiliary methods [15] should be used to improve the 25 robustness. As the result, this method will usually facing the problem of a huge 26 computational consumption [16]. Axis-aligned bounding box (AABB) method [17] 27 is a robust and efficient method for intersection determinations between cells and 28 objects, but it cannot be used to determine whether the cell is inside or outside the 29 object. 30 On the basis of the two methods above, the focus of this paper is to find a more 31 efficient and robust cell type determination method for Cartesian grid generation.

32
By using the dot product method, the intersecting object surface obtained by AABB 33 method is used for a quick inside/outside determination for intersecting cells. At 34 the same time, the painting algorithm is adopted to mark the non-intersecting cells.

35
The k-dimensional tree (KDT) is used to store the object surface for higher query 36 efficiency.

37
This paper is organized as follows. The data structure for Cartesian grid has two typical types: unstructured [18,19] 51 and octree [20][21][22]. The octree structure has minimum memory requirement as well 52 as a straightforward grid hierarchy [23]. In this paper, the octree data structure is 53 used for the Cartesian grid storage. The general strategy of the process of Cartesian 54 grid generation with octree is given as follow.          The basic principle of the ray casting method is shown in Fig. 3

118
To saving the consumption of computational resources, we make the improvement 119 in two aspects: reduce the times of determinations, and reduce the time complexity 120 of the algorithm. We divide the inside/outside determination process into two parts 121 to avoid the use of ray casting method: the determination for the intersecting cells 122 by a simply dot product, and a quick painting process for the non-intersecting cells.

123
Also a efficient data structure is used to order the elements of object surface. The outer normal of the intersecting triangle is given by: Here V 1, V 2, V 3 are three vertices of the triangle. And the vector from triangle to the cell center can be defined as: Here O is any point both inside the cell and the triangle.

143
Finally, the dot product result can get as follow: According to the definition of dot product (a · b = |a||b|cosθ), we know that if

152
The principle of painting algorithm is shown as Fig. 7. The initial background grid is 153 divided into two categories after the intersecting determination: non-interesting cells 154 (white and green cells in Fig. 7) and interesting cells (golden cells in Fig. 7). Firstly, 155 the painting algorithm needs to find a non-intersecting outside cell as the painting source. Here the ray casting method is used for querying the non-intersecting cells. can be stabilized at the optimal solution [29]. In this paper, a quick KDT building 176 method [30,31] is used to divide the triangle elements of the object according to the 177 median point in each dimension (Fig. 8(b)). Finally, a balanced binary-tree with 178 the depth of log 2 N tri + 1 is obtained for the object with N tri triangle elements 179 (Fig. 8(c)).
In the intersecting determination process, the AABB method do determinations 181 for each KDT node. Once intersected, the intersecting process terminates. If does 182 not intersected, only one branch of the KDT will entered according to the division 183 position of this KDT node. By applying the KDT structure, even in the worst 184 situation, only log 2 N tri +1 times of AABB determinations are needed to find out the

222
In order to examine the robustness and the stability of the grid generation method 223 developed in this paper, different geometrics including a simple sphere, a medium-224 complex bogie, and a complex pantographs are used for the test, as shown in Fig. 11.

225
The bogie and the pantograph are constructed by many slits and component with   In the present paper, the dot product method, the painting algorithm, and the 244 k-dimensional tree is employed to accelerate the process of Cartesian grid gen-