Boundary Handling#
SweepGen can generate two kinds of boundary handling sweeps for LBM simulations in waLBerla: sparse and grid-aligned boundary handlers. Sparse boundary sweeps prescribe boundary conditions on arbitrary geometries by collecting all lattice links crossing the boundary in an index list, and then iterating that list in parallel. Grid-aligned boundary sweeps are more efficient, as they are implemented as a dense parallel iteration over a cell interval, but can only handle grid-aligned boundary geometries with a fixed wall normal. Their primary use case is boundary conditions at domain borders; for most other cases, sparse boundaries should be used.
Sparse Boundary Handlers#
- class sweepgen.boundaries.sparse.SparseBoundary(bc, lb_method, pdf_field)#
Generate a sparse boundary handling sweep from a given boundary definition.
Generate a sparse boundary handling sweep that applies a given boundary condition on cells or lattice links listed on a given index vector. This generator supports boundary conditions provided by
lbmpy.boundariesas well as SweepGen-specific sparse boundaries deriving fromSparseBoundaryDefinition.Sparse boundary sweeps rely on an index list to iterate boundary links efficiently. This index list is created by a factory class. The factory comprises two parts: A CRTP base class located in a header file of the SweepGen runtime library, which implements the actual index list construction logic and incorporates implementation details via templates; and a minimal, boundary-specific subclass that is generated alongside the boundary sweep.
Example Apps
- Parameters:
bc (LbBoundary | SparseBoundaryDefinition)
lb_method (AbstractLbMethod)
pdf_field (Field)
Grid-Aligned Boundary Handlers#
- class sweepgen.boundaries.grid_aligned.GridAlignedNoSlip(name, lb_method, pdf_field, wall_orientation)#
Zero-velocity half-way bounce back boundary condition at a grid-aligned wall.
Generate a sweep that applies the zero-velocity half-way bounce back (NoSlip) boundary condition to fluid cells touching a wall oriented to the given normal direction. The generated sweep must be invoked on the layer of fluid cells touching the wall.
- class sweepgen.boundaries.grid_aligned.GridAlignedFreeSlip(name, lb_method, pdf_field, wall_orientation)#
Specular-reflection half-way bounce back boundary condition at a grid-aligned wall.
Generate a sweep that applies a specular-reflection boundary condition to fluid cells touching a wall oriented to the given normal direction. It can be used to mode both free slip and symmetry boundaries. The generated sweep must be invoked on the layer of fluid cells touching the wall.