4. Boundary Conditions
In LBM simulations, boundary conditions must be defined within the boundary_conditions operator block. This block allows the specification of different types of boundary conditions applied to the simulation domain. It is possible to include multiple boundary conditions within the same boundary_conditions block. Each condition will be processed accordingly, ensuring accurate enforcement of flow properties at the domain boundaries.
4.1. Neumann conditions
The Neumann boundary conditions below are applied through a single operator, neumann, which can be applied on one or several boundary planes at once via the regions parameter. The same prescribed velocity U is enforced on every region listed. Allowed values for regions:
plan_xy_0/plan_xy_l: Z = 0 / Z = lz planesplan_yz_0/plan_yz_l: X = 0 / X = lx planesplan_xz_0/plan_xz_l: Y = 0 / Y = ly planes
YAML example:
boundary_conditions:
- neumann:
U: [0.0,0,0]
regions: [plan_xy_0, plan_xy_l]
4.1.1. Neumann Z 0
Operator Name:
neumannwithregions: [plan_xy_0]Description: This operator enforces a Neumann boundary condition at z = 0 in an LBM simulation. The Neumann boundary condition ensures that the gradient of the distribution function follows a prescribed value (
U{ux,uy,uz}).Formula:
Parameters:
U: Prescribed velocity at the boundary (z = 0), enforcing the Neumann condition.
YAML example:
boundary_conditions:
- neumann:
U: [0.001,0,0]
regions: [plan_xy_0]
4.1.2. Neumann Z l
Operator Name:
neumannwithregions: [plan_xy_l]Description: This operator enforces a Neumann boundary condition at z = lz in an LBM simulation. The Neumann boundary condition ensures that the gradient of the distribution function follows a prescribed value (
U{ux,uy,uz}).Formula:
Parameters:
U: Prescribed velocity at the boundary (z = lz), enforcing the Neumann condition.
YAML example:
boundary_conditions:
- neumann:
U: [0.001,0,0]
regions: [plan_xy_l]
4.1.3. Neumann X 0
Operator Name:
neumannwithregions: [plan_yz_0]Description: This operator enforces a Neumann (Zou-He) boundary condition at x = 0. The prescribed velocity
U{ux,uy,uz}is imposed via the equilibrium reconstruction method.
YAML example:
boundary_conditions:
- neumann:
U: [0.001,0,0]
regions: [plan_yz_0]
4.1.4. Neumann X l
Operator Name:
neumannwithregions: [plan_yz_l]Description: This operator enforces a Neumann (Zou-He) boundary condition at x = lx.
YAML example:
boundary_conditions:
- neumann:
U: [0.001,0,0]
regions: [plan_yz_l]
4.1.5. Neumann Y 0
Operator Name:
neumannwithregions: [plan_xz_0]Description: This operator enforces a Neumann (Zou-He) boundary condition at y = 0.
YAML example:
boundary_conditions:
- neumann:
U: [0,0.001,0]
regions: [plan_xz_0]
4.1.6. Neumann Y l
Operator Name:
neumannwithregions: [plan_xz_l]Description: This operator enforces a Neumann (Zou-He) boundary condition at y = ly.
YAML example:
boundary_conditions:
- neumann:
U: [0,0.001,0]
regions: [plan_xz_l]
4.2. Bounce Back
4.2.1. Domain Boundaries (Pre/Post-Collision)
pre_bounce_back and post_bounce_back enforce the no-slip (bounce-back) condition on the outer, non-periodic boundaries of the domain. They must be used as a pair: pre_bounce_back is called in pre_stream_bcs (before the collision/streaming step, to save the incoming distribution functions at the boundary), and post_bounce_back is called in post_stream_bcs (after streaming, to bounce them back). Any other boundary condition that needs to overwrite the outgoing distribution functions at the boundary (cavity_z_0/cavity_z_l, lid_driven_cavity) must be placed in post_stream_bcs after post_bounce_back.
Operator Name:
pre_bounce_backDescription: This operator applies the pre-collision bounce-back boundary condition to the distribution functions at the boundary points of the grid.
Parameters: No parameters.
YAML example:
pre_stream_bcs:
- pre_bounce_back
Operator Name:
post_bounce_backDescription: This operator applies the post-collision bounce-back boundary condition to the distribution functions at the boundary points of the grid.
Parameters: No parameters.
YAML example:
post_stream_bcs:
- post_bounce_back
4.2.2. Wall / Surface conditions
The standard bounce-back boundary condition is used to enforce the no-slip condition at solid walls in Lattice Boltzmann Methods (LBM). It is implemented by reflecting the distribution functions at wall nodes back in the opposite direction.
Let:
\(\mathbf{x}\) be the position of a lattice node,
\(\mathbf{c}_i = (e_{x,i}, e_{y,i}, e_{z,i})\) be the discrete velocity in direction \(i\),
\(\bar{i}\) be the index of the opposite direction of \(i\),
\(f_i(\mathbf{x}, t)\) be the distribution function in direction \(i\) at node \(\mathbf{x}\) and time \(t\).
Then, for a node \(\mathbf{x}\) marked as a wall, and for each direction \(i = 1, \dots, Q - 1\), the bounce-back condition is applied as:
Operator Name:
wall_bounce_backDescription: The WallBounceBack class is described as part of the Lattice Boltzmann Method (LBM) implementation, specifically the wall bounce back steps.
YAML example:
pre_stream_bcs:
- wall_bounce_back
4.3. Cavity
This boundary condition models a moving wall, such as the lid in a lid-driven cavity flow. It is implemented through momentum injection at fluid nodes adjacent to the boundary.
FORMULA: TODO
Operator Name:
cavity_z_0orcavity_z_lDescription: This operator enforces a Cavity boundary condition at z = lz in an LBM simulation. The Cavity boundary condition ensures that the gradient of the distribution function follows a prescribed value.
- Parameters:
U: Prescribed velocity at the boundary (z = lz or z = 0), enforcing the Cavity condition.
YAML example:
pre_stream_bcs:
- cavity_z_l:
U: [0.0, 0.1, 0]
4.4. Lid-Driven Cavity
This boundary condition generalizes the Cavity condition above: instead of being restricted to the bottom or top Z plane, it can be applied on any of the six domain boundary planes through the regions parameter. At each fluid node adjacent to the selected plane(s), it enforces a moving wall (lid) by reinitializing the distribution functions to their equilibrium value at the prescribed velocity U.
Formula:
Operator Name:
lid_driven_cavityDescription: This operator enforces a moving-wall (lid) boundary condition by reinitializing the distribution functions to their equilibrium value at the prescribed velocity
U, on one or several boundary planes given byregions. It must be called after the bounce-back step, typically as part ofpost_stream_bcs.- Parameters:
U: Prescribed velocity (real units) at the moving wall.regions: List of boundary planes on which the condition is applied. Allowed values:plan_xy_0,plan_xy_l,plan_xz_0,plan_xz_l,plan_yz_0,plan_yz_l.
YAML example:
post_stream_bcs:
- post_bounce_back
- lid_driven_cavity: ## needs to be called after bounce back
U: [0.1, 0.0, 0]
regions: [plan_xy_l]
Note
Obstacle operators (register_solid_wall, register_solid_ball, register_quadrics) are documented in the Obstacles page.