Rules for a Cellular-Space World Predicted by the Navier-Stokes Equations
Abstract This project is a study of lattice gas techniques for the graphical display of 2-D simulations of fluid dynamics. My motivation behind this project stems from my experience as an architect involved in evaluating building designs represented as digital models brought into software simulation environments to qualitatively understand how daylight or wind theoretically behaves in a building's design. Setting up a simulation environment is typically time intensive and costly, and utmost a luxury as an additional service charged to the client if the design firm carries such resources. By undertaking the study of simulating fluid phenomena, it is my goal to evaluate, understand, and test the advantages and limitations of lattice gas techniques as a math modeling approach for incompressible fluids - ultimately, to help shape an accessible simulation environment for designers with the support of information from an architect's perspective.
Keeping the ingredients in mind, the following state table shows some of the scattering rules for fluid simulation. To guide my process,
I began by implementing two-particle, three-particle, and four-particle rules described in "Discrete Fluids," a paper written by
theoretical physicist Brosl Hasslacher in 1987.
The simulation uses bits 0 to 5 to correspond with the six direction paths of a moving particle. In addition, bit 6 represents a rest particle, and bit 7 as a barrier. Each vector (given as ux and uy) is further assigned a coordinate point on the unit circle for travel direction. The following table shows how a vector is mapped to its corresponding direction and binary value.
As mentioned, all moving particles contain the same speed and mass (particle number). Using bitwise OR operators create the collision rules that demonstrate a state changes. For example, if we have one particle moving North-West, another South-West, and the other particle East-bound; the particles state transforms to North-East,South-East, and West respectively. This is shown as rule[NW|SW|E] = NE|W|SE, where NW|SW|E is stored in an array. If a particle runs into a barrier, then the particle reflects off in the opposite direction. This is done by first shifting the NE, NW, W particles (since they have higher value bits) to the right by 3 bits, and then moving SW, SE, WE particles by 3 bits to the left. Once particles move on the lattice, its values are stored in an array called updatedLattice. As particles move again according to the collision rules, its values are then stored to the oldLattice array. Since we've setup a triangular lattice, this means that the sites contain even and odd rows. Moving particles require looping and updating the even and odd rows as separate entities. The basic algorithm to simulate fluid flow using a lattice model:
Using the collision rules and algorithm mentioned, I've setup a lattice site with dimension of 700x400, with 0.2 particle density and speed. The particles are seen moving forward first to their nearest neighbor and then change states according to the collision rule table, the arrows indicate the direction of the particles upon each update step on the lattice. Below are the invented rules describing collision states that break the initial simulation: ...and the accompanying output: With the new rules, the qualitative behavior of the navier-stokes equations do not appear to uphold. Particles appear to collectively flow in one main direction. In the previous simulation, we saw that the particles first flow in the direction of their nearest neighbor and scattered according to their respective collision rule.
Data-Parallelism and GPUs for Lattice Gas Fluid Simulations The Lattice Gas Model and Lattice Boltzmann Model On Hexagonal Grids Lattice BGK Models for Navier-Stokes Equation Recovery of the Navier-Stokes equations using a lattice-gas Boltzmann method The Classical Lattice-Gas Method Real-Time Fluid Dynamics for Games Lattice Gas Automata for the Navier-Stokes Equation Fluid Flow for the Rest of Us: Tutorial of the Marker and Cell Method in Computer Graphics |