flow

A fluid made of particles, flowing past a plate.
The simulation runs in this tab.
Signed ternary FHP lattice gas, vorticity averaged over time.

loading...

A lattice gas is a fluid made of particles that move along the six directions of a triangular grid, one step per tick, and collide at the nodes by a fixed rule. The idea comes from Frisch, Hasslacher and Pomeau in 1986. Nothing else is programmed: the flow around the plate and the vortex street behind it come from those collisions alone.

In this signed ternary version, each link holds only the difference from the local average: −1, 0 or +1. The gas carries less noise, so it reaches a higher Reynolds number on the same grid.

The picture shows how the fluid spins. Black and white are the two directions of rotation on a grey background, and the further from grey, the faster it spins.


Method: FHP lattice gas (Frisch, Hasslacher and Pomeau, 1986), flow past a plate after d'Humières and Lallemand (1987).
The signed ternary model is mine. Each link stores only a deviation of −1, 0 or +1 from a reference equilibrium set for each block of the grid, and everything is computed in integers, so mass and momentum are conserved exactly and the GPU and the CPU give the same result bit for bit. I found no earlier lattice gas built this way.
Source: jacobi2000, the same Rust code on the GPU and the CPU.
How it works: Cellular automata in science, the blog post.


← trucs.ai