Interactive LBM Simulation - 1D
July 2024This is a little interactive simulation of the Boltzmann equation in 1d. It uses the theory detailed in the last post - 1D Lattice Boltzmann Theory. It is written in Rust and compiled to Wasm with a JavaScript wrapper to handle the interactivity & plotting.
Click below …
Clicking on the canvas creates a momentary localized density excess, which then spreads in both directions. Changing the slider updates the value of $\tau$, and thus the viscosity. For higher values, the density pulse will diffuse and slow down faster. The simulation has periodic boundary-conditions.
Although the density & velocity changes are plotted on the $y$-axis, keep in mind this is a 1D simulation. As such, the pressure waves created are longitudinal waves . The tracer particles illustrate this by showing the path followed by massless particles, which get advected with the fluid. In reality the velocities, and thus the net motions, due to the density pulse are very small. For the purposes of illustration I have exageratted the displacements from equilibrium by x30 here.
The topology of 1D space means there is no “room” for interesting flow phenomena beyond density waves. For more interesting fluid dynamics simulations, with macroscopic relative motion, we need to advance to 2- and 3-dimensions!