# Boundary Conditions

## General Remarks on Boundary Conditions in Lattice Boltzmann Method

One of the most important pieces of creating the correct flow with the Lattice Boltzmann method is to accurately impose the desired boundary conditions. Although specifying boundary conditions on the Navier-Stokes equation is straightforward, imposing boundary conditions within a Lattice Boltzmann simulation can be quite challenging, especially on the GPU. In this section, we will discuss the different boundary conditions implemented in our Lattice Boltzmann code. Specifically we will cover the implementation of the following boundary conditions:

- Bounce Back: No-Slip Boundary Conditions
- Boundary Conditions with Known Velocity
- Periodic Boundary Conditions
- Imposed Pressure Difference Boundary Conditions

It is difficult to apply boundary conditions in the Lattice Boltzmann technique because macroscopic boundary conditions from the Navier Stokes equation must be translated to boundary conditions on *f* and *feq*. We must consequently determine appropriate equations for calculating the *f* and *feq* along boundaries given a macroscopic boundary condition.

## Implementation of Boundary Conditions

In this section we will describe how we implemented a variety of boundary conditions. Future work will develop our boundary condition code further.

### Bounce Back Boundary Condition

In order to obtain a no-slip boundary condition for a specified boundary, we use the "Bounce Back Method." This method has been discussed extensively in the literature and a few versions have been developed. The most simple scheme is to place a wall halfway between a wall grid point and a fluid grid point and then "bounce-back" particles that stream into the wall. For instance, *f _{4}, f_{7}*, and

*f*stream into the wall, and are bounced back by setting

_{8}*f*, and

_{5}=f_{7}, f_{2}=f_{4}*f*.

_{6}=f_{8}*Figure 1: Scheme describing the Bounce Back Method (Mohamad, 2011).*

### Boundary Conditions with Known Velocity

Imposing a constant velocity at an inlet and outlet is commonly used in simulations. Let us focus on the west inlet in the picture below. Particles *f _{6}, f_{3}, f_{7}, f_{2}*, and

*f*will stream onto a point on the wall; we must now solve for

_{4}*f*and

_{5}, f_{1},*f*based on the constant velocity assumption. In general, one should apply bounceback to the nonequilibrium part of

_{8}*f*on the boundaries, i.e.

*f*

_{5 }- f_{5,eq}= f_{7 }- f_{7,eq}_{ }(as discussed in

_{ }Zou, Q., & He, X. (1997). On pressure and velocity boundary conditions for the lattice Boltzmann BGK model).

*feq*depends on the hydrodynamic variables, so the constant-velocity boundary condition will enter through

*feq*. In general this is a painful but necessary procedure.

*Figure 2: Schematic showing the known and unknown distribution*

* functions at respective boundaries of the domain (Mohamad, 2011).*

### Periodic Boundary Conditions

The periodic boundary conditions is the simplest boundary condition because one can directly relate the knowns of one boundary to the unknowns of the other boundary. Namely, along boundary (a) of Fig. 3 the unknowns are, after streaming, *f _{6}, f_{2}, *and

*f*. However, along boundary (b) these three distributions are known! We thus solve all of the unknowns by relating

_{5}*f*, and likewise for the other boundaries and for the unknowns of (b) relating them to the knowns of (a).

_{6,a}=f_{6,b }, f_{2,a}=f_{2,b}, and f_{5,a}=f_{5,b}*Figure 3: Schematic illustrating the periodic boundary conditions*

* and how they relate to each other and the flow (Mohamad, 2011).*

### Imposed Pressure Difference Boundary Condition

The pressure boundary condition is particularly confusing as pressure enters Lattice Boltzmann simulations in a subtle way. In our Lattice Boltzmann simulation, pressure is related to density by *ΔP ∝ Δρc _{s}^{2}*; the constant in front of

*Δρ*relates to how we scaled our simulation. To set

*f*at each boundary, we follow a procedure similar to the "Boundary Conditions with Known Velocity" above but now set

*ρ*to a constant. Note that Lattice Boltzmann simulations become unstable when

*Δρ*is large, so in practice we had to adjust the resolution of our simulation until

*Δρ~0.01.*For this method it is also important to make sure that the initial velocity and density matches that of the imposed flow; if you do not do this, confusing shocks will propagate through the domain.

## References

- Mohamad, Abdulmajeed A.
*Lattice Boltzmann method: fundamentals and engineering applications with computer codes*. Springer Science & Business Media, 2011.- Zou, Qisu, and Xiaoyi He. "
*On pressure and velocity boundary conditions for the lattice Boltzmann BGK model.*" Physics of Fluids (1994-present) 9.6 (1997): 1591-1598.

- Zou, Qisu, and Xiaoyi He. "
- Succi, Sauro.
*The lattice Boltzmann equation: for fluid dynamics and beyond.*Oxford university press, 2001.