๐ซ Lattice Boltzmann
Simulation
Section titled โSimulationโ๐ง Inspired by the famous Fluid Dynamics simulation by Daniel V. Schroeder (Weber State University)
๐ Check out the accompanying Lattice-Boltzmann Fluid Dynamics PDF!
From Boltzmann Statistics to Fluid Dynamics
Section titled โFrom Boltzmann Statistics to Fluid Dynamicsโ๐จ This section is a reproduction of From Boltzmann Statistics to Fluid Dynamics
For simplicity, this simulation works in two dimensions, and discretizes space into a square grid or lattice. Each lattice site is big enough to hold a large number of gas molecules, which will be moving in various directions due to their thermal motion plus any large-scale fluid flow.
We approximate this rich complexity by allowing only nine different velocity vectors only, corresponding to nine elementary displacements during a unit of time: up, down, right, left, along any 45ยฐ diagonal,or zero (staying in place). The nine elementary displacements are illustrated and listed below, using a unit system in which the lattice spacing is one unit.
To keep track of how many gas molecules at a site are moving in each of these nine directions, weโll need nine variables. Iโll call these variables , for , and define them as the respective densities of molecules with the corresponding velocities. Then the total density of all molecules at any given site is their sum:
We can also calculate the macroscopic fluid flow velocity, by taking a weighted average of the nine elementary velocities. Iโll call the flow velocity , and use the symbol for the natural unit of velocity, one grid site per unit time. Then the flow velocity at any given site is
which we can write more explicitly as
taking the and directions to point rightward and upward, respectively.
Thermal Velocities
Section titled โThermal VelocitiesโThe thermal velocities of ideal gas molecules are described by the Boltzmann distribution, which in two dimensions is
This is the function that, when integrated over any range of and values, gives the probability of a moleculeโs velocity being in that range, where is the moleculeโs mass, is Boltzmannโs constant, and is the temperature. The exponent in the last equation is the moleculeโs kinetic energy, and the prefactor ensures that the integral of over all velocity vectors equals (which you can easily check).