I seem to spend a lot of my spare time playing with cellular automata. Here's a simple model of gases:

image:

video:

Squares move around on a grid, bouncing off each other and the walls.

The amazing thing about this model is this: run it on a bigger grid and you get an accurate simulation of flow patterns. And that means turbulence and swirling eddies and wisps of smoke and things like that:

image:

video:

All we've done is run it on a larger grid (3000x1000) and to show the direction of the local flow with lines. We make the fluid flow from left to right by simply overwriting the left-hand column with particles moving to the right. An obstacle disrupts the flow, shedding eddies in its wake.

The question asks itself: Why does this work? Why does such a simple model of bouncing particles yield a good model of flow? The key is that the particles conserve momentum: they keep moving until they collide, and the particles after a collision have the same total momentum as the particles before the collision. And so over a larger area you get two things happening: a) the fluid will tend to move into areas of lower pressure (particles get bounced out of higher density areas), and b) if an area of fluid has an overall momentum it will get carried forward, pushing against whatever it encounters. It's a delightful system and makes pretty pictures.