What It Is
A fluid simulator as the name suggests, simulates fluids. What exactly is a fluid? It is any liquid or gas. My simulator specifically targets smoke.How It Works
I use the Navier-Strokes equations to simulate fluids.
In my program, the Navier-Strokes equations boil down to two things. What is the density of the fluid at a each point and what is the velocity of the fluid at a each point? And these are two equations.
The first equation shown above is for density and it can be broken down to 3 parts. The first part is that the density follows the velocity field. The second part is that density will diffuse at a certain rate. The last is that the density will increase due to more fluid entering the system.
The second equation shown above is for velocity and it also can be broken down to 3 parts. The first part is that the velocity changes due to self advection. You can think of this as the velocity field moves along itself. The second part is that velocity will change due to viscous diffusion. Finally the velocity will increase due to added forces.
Controls
The controls are made up of keyboard shortcuts. They include:
- D = Switch to Density mode (add density with a mouse click)
- V = Switch to Velocity mode (add density with a mouse click and movement)
- C = Clear velocities and densities
- P = Increase viscosity
- ; = Decrease viscosity
- O = Increase diffusion
- L = Decrease diffusion
- G = Turn gravity on/off
- B = Turn buoyancy on/off
- I = Turn ink effect on/off
- Q = Quit
References
- Real-Time Fluid Dynamics for Games by Jos Stam
- Dr. Zoe" Wood and her amazing computer animation class!