Visions Of Chaos HPP Lattice Gas Automata Tutorial|
Lattice Gas Automata (LGA) are a simplified model of gas and/or fluid flow. The HPP LGA model comes from Hardy, Pomeau and de Pazzis back in 1973.
HPP LGA Model|
HPP LGA is based on a grid of particles that can move horizontally and vertically.
The grid of locations is updated simultaneoulsy in discrete time steps. Each time step the following takes place
1. When two of the particles collide head on (particle moving down hits a particle moving up, or particle moving left hits a particle moving right) then they bounce off each other at right angles. So if a particle moving left hits a particle moving right they will collide and then be moving up and down.
2. Particles that do not collide continue to move in the direction they are going.
3. Particles that collide with a wall rebound 180 degrees. So a particle moving left will rebound off a wall and then be moving right.
HPP LGA Simulation Styles|
Visions Of Chaos includes a few preset grid setups to demonstrate how the HPP LGA model works.
Random with circle - Starts with a more dense circle of particles in the middle of the grid that expands out in a shockwave.
Leak through wall - starts with the left side of the grid filled with particles and the right side empty. There is a small gap in the wall that the particles can flow through. Over time, both sides will reach the same density of particles.
Leak through 2 walls - starts with the left third of the grid filled with particles and the right side empty. There is a small gap in two walls that the particles can flow through. The following image shows how the initial high density gas in the left hand chamber is dispersing through the other two areas.
Other HPP LGA Settings|
Particle density - determines how dense the initial particles are within the grid.
Oversample - each pixel of the image is made up of multiple particles. For example if oversample is set to 2 then each screen pixel actually has 4 simulation grid points. Oversampling can help smooth out the rough edges of the simplistic LGA approach.
Create AVI frames - saves the steps of the simulation so that an AVI movie can be created. Here is a quick sample movie. The compression really ruins the details, but you can see how the density of particles moves from the left chamber, to the middle chamber and then finally to the right chamber until all three areas have roughly the same density of particles within them.
Save every n frames - Specifies how frequent the steps should be saved to create the AVI movie. For oversampled simulations they tend to evolve slower, so increasing this value will make the resulting AVI movie faster.