2D Fluids Simulation

This is a 2D fluids simulation written in JavaScript, based on the paper "Stable Fluids" by Jos Stam. The algorithm splits the 2D surface into an n by m grid, and tracks the velocity and density at each cell. The density is then moved between cells at the rate specified by the velocity.

Your browser does not support the canvas element.


Left Mouse Action:           Add Density:      Add Velocity:

Show Grid:      Show Velocities:      Show Stats:

Viscosity:      Diffusion:      Time Step:

Grid Cols (X):      Grid Rows (Y):      Num Solver Iterations:

Left-click and drag your mouse across the screen to add density. Right-click and drag to add velocity.

Source code for this project is available on GitHub!

Back to Top