The formalism allows us to realise at least four grid variants: no-grid, regular, adaptive and reluctant adaptive grids. These grid variants form four types of mor- phologies that exhibit different properties for different particle setup scenarios. A deteriorated space grid (Figure 6.8) is the mono-cell grid which constitutes of a sin- gle cell of eight vertices in three dimensional space. All the remaining grids form hierarchies.
Regular grid. The regular grid version recursively refines all spacetree nodes until all children cell lengths are just larger than the smallest particle diameter
CHAPTER 6. GRID META DATA STRUCTURE
1
0
2
Figure 6.7: A single particle is dropped from a coarse cell into a fine cell. All fine cell are uniformly refined along the fine levels. The grid refined up until the particle is hosted at a cell no smaller than its diameter.
(Figure 6.7). This grid strategy yields a multiscale regular grid as every refinement is applied uniformly on all grid cells at each level. Each particle is assigned to the correct grid level as we drop and reassign them downwards the hierarchy levels until they fit into the correct cell length (Figure 6.8).
A regular grid is a naive approach to grid refinement as we allow the creation of large numbers of uniformly sized cells where no particles reside. The regular grid is a multiscale grid that refines every cell. The configuration of a regular grid is advantageous when the engineering scenario that defines a composition of particles that are equally distributed and sized.
The large number of cells become problematic when some particles are very small relative to the biggest one. If the simulation scenario exhibits clusters of particles of varying sizes then the regular grid by design realises redundant particle-to-particle comparisons. This is because the regular grid discretises space uniformly and it disregards particle scale and movement during runtime. When particles are not uniformly sized and distributed in clusters then an adaptive grid scheme is desirable. Another major disadvantage is the high number of particle comparisons (× triangle counts) required when particles cluster (Figure 6.10) into one region of the domain. Adaptive grid. The dynamically adaptive grid variant is characterised by two elements, the mesh refinement control and inter-grid particle treatment as shown in Figure 6.9. The algorithm successively drops particles down the spacetree hierarchies
CHAPTER 6. GRID META DATA STRUCTURE
Figure 6.8: Left: A single cell hosting particles that are positioned on top of a hopper structure. All particles are associated to a cell vertex (blue line) at the root level. Middle: A regular grid that is refined uniformly across the finest level. Right: An adaptive grid adopts the grid around particles but does not refine cells that hold no particles. Both regular and adaptive grid types hold the hopper structure at a coarser level.
Figure 6.9: Two particles approach each other. As they are of different size they might be held at different spacetree resolution levels.
CHAPTER 6. GRID META DATA STRUCTURE
and it simultaneously refines coarse cells to match particles (Figure 6.8). The drop is performed during the first vertex visit on touchVertexFirstTime (Algorithm 9). The algorithm determines the smallest diameter of all the particles held by the vertex host. If the particle diameter is smaller than 1/3 of the mesh edge at the level of the vertex then the region around the vertex is refined. At each gird vertex, we check whether there are spatially coinciding vertices on a coarser level. If such vertices do exist, the particles that they hold are moved one level down as long as their diameter permits. The opposite hierarchical movement occurs when a cell is coarsened, this happens when particles move towards a neighbouring cell that is coarse, it is ”lifted” and dropped to its level again.
In adaptive grids, we vary the morphology according to the dynamics of the particles under a set of conditions and rules. If we delete a vertex a that holds particles, its particles are moved to the next coarser level and reassigned. Each vertex holds a Boolean marker that is set ⊥ before the vertex is read for the first time. If a vertex holds a particle, all the markers of the vertices where they are descendants of are set to ⊤. If a vertex whose adjacent cells are all refined holds ⊥ at the end of the multi-scale traversal, we coarsen these refined adjacent cells. We rely on a top-down tree traversal. The refinement/coarsening procedure is evaluated on-the-fly and it is analogous to an analysed tree grammar [47].
A cascade of uniformly refined cells create a regularly refined grid. When we make changes to the refinement criteria then we can vary the refinement strategy from cell to cell. The selection of criteria per cell triggers refinement and coarsening events that form dynamically varying adaptive grids. The combined behaviour of criteria based on moving particles and grid rules can create a very dynamic grid morphology. To avoid undefined behaviour, it is important that particle-to-vertex associations are consistent with the grid behaviour at all times. From here on we do not discuss the mono-cell and we treat it as a no-grid variant that only holds the root cell.
The dynamic adaptive grid is a great improvement over the regular grid, as the number of particle-to-particle comparisons is reduced (Figure 6.10) and thus com- putation during contact detection is minimised. Particle sizes per level dynamically influence the space discretisation at this stage. The inheritance of particles from coarse to fine vertices becomes the key concept that enable such grid. We can construct and adopt the adaptive grid on the fly at every time step. However the adaptive grid only pays off when particle dynamics surpass grid administration over- head at every time step. The adaptive grid is great for reducing the total number of comparisons but it is also significantly more complex to implement and debug when
CHAPTER 6. GRID META DATA STRUCTURE 0 500 1000 1500 2000 2500 3000 TIME STEP 103 104 105 106 # PARTICLE COMPARISONS regular adaptive
Figure 6.10: Particle comparisons of the hopper (1k particles) flow simulation using regular and adaptive grids. The regular grid make use of more cells/vertices than the adaptive variant and it refined uniformly on the whole domain. The adaptive grid refines only on the areas of particles thus the number of grid vertices is reduced significantly (and grid overhead), this also reduces the number of comparisons re- quired as there are fewer vertices to compare at collisions areas. During the peak of hopper flow particle clustering phase (step 1200), the regular grid performs 850,000 comparisons while the adaptive grid only 25,000, this translates to 34 million versus 1 million triangle comparisons for granulates of 20 triangles for around 2000 actual collision points.
CHAPTER 6. GRID META DATA STRUCTURE
Figure 6.11: Two particles collide into each other. The adaptive grid refining around each particle while its diameter constrains the mesh size (left column - top and bottom left figure). The reluctant adaptive grid works with a coarser resolution as long as particles are far away from each other (right column - top and bottom right figure). Just before they collide, the grid is refined and particles are dropped down the resolution levels.
compared to the regular grid.
A reluctant adaptive grid. The dynamic adaptive grid refines aggressively, when a particle is smaller than the length of the cell that they are associated with we refine the grid and the particles are dropped to the finest refinement level. Adaptive grid regions follow particles (Figure 6.11) and the empty cells are coarsened. The downside of aggressive refinement is that it can create a larger number of fine cells than the minimum number of cell required for contact detection, this translates to grid administration overhead. Thus employing a relaxed-reluctant grid refinement strategy gives us the twin benefit of a minimal grid refinement administration and the minimal particle comparisons required from an adaptive grid.
The spacetree hierarchy allow us to realise four types of grids: no-grid, regular grid, adaptive grid and reluctant adaptive grid. These grids are subject to flag rules over time to maintain consistent multiscale morphological changes between levels.
CHAPTER 6. GRID META DATA STRUCTURE
through two modifications of the refinement criterion. If only one particle is held by a vertex then no refinement is triggered as long as its particular diameter length is smaller than the cell size. Moreover, the refinement is triggered only if the vertex visited holds at least two particles that approach each other. Two particles A and B at dt step are approaching each other when the relative velocity difference
vBA= (vA· dBA)− (vB· dBA).
along a particle distance line dBA is less than zero. The distance line is defined as
dBA = cB − cA where cA and cB are the centres of the two particles. A relative
velocity difference vBA that is greater than zero indicates particle separation. When
particles move away from each other no refinement is required.
The reluctant adaptive variant ensures that the adaptivity is not as aggressive and the morphology behaves reluctantly with respect to the particle movement. The reluctant adaptive grid refines only when two particles are in close enough proximity (they exist in neighbouring cells) and the particles are approaching towards each other. An important property of reluctant adaptivity is that small particles are allowed to reside in coarse cells when they are lifted. Fine particles that are lifted and reside on coarse cells are not allowed to be dropped to finer cells unless the refinement criterion around their associated vertex is fulfilled (i.e. there are potential collision candidates at adjacent locations).
We present a novel use of the spacetree with the implementation of an adaptive and reluctant adaptive scheme. The adaptive grid premise is the reduction of the number of particle comparisons. Grid adaptivity pays off (Figures 6.11, 6.10) when particles of different size exist and when particles are irregularly distributed over the domain space. We employ a reluctant adaptive grid that aims at reducing the overhead associated with aggressive refinement and we show that the association of particles to coarser levels reduces grid adminis- tration overhead.