Fluid Dynamics Simulator

Click and drag to inject dye and force into a real-time Navier-Stokes fluid simulation. 100% client-side — no data leaves your browser.

0 FPS

What Are the Navier-Stokes Equations?

The Navier-Stokes equations are a set of partial differential equations that describe the motion of viscous fluid substances. First developed by Claude-Louis Navier and George Gabriel Stokes in the 19th century, these equations form the foundation of computational fluid dynamics (CFD) — one of the most important fields in modern engineering and physics. They remain one of the seven Millennium Prize Problems in mathematics.

How This Simulator Works

This tool implements Jos Stam's "Stable Fluids" algorithm (1999), widely used in VFX and game dev. Each frame performs four operations:

  1. Add Forces — Your mouse input is added to the velocity field
  2. Diffuse — Viscosity equalizes neighboring velocities
  3. Advect — The velocity field moves itself and dye through back-tracing
  4. Project — Pressure solve ensures divergence-free (mass-conserving) flow

The simulation runs on a 128×128 grid with Gauss-Seidel relaxation. RGB dye channels are tracked independently, allowing natural color mixing. Runs at 60+ FPS entirely client-side.

Real-World Applications

Frequently Asked Questions

Is this a real physics simulation?

Yes — it solves the Navier-Stokes equations for incompressible flow each frame. While simplified to 2D, the underlying mathematics are identical to professional CFD software.

Is my data sent anywhere?

No. Everything runs 100% in your browser. Screenshots are generated locally via the Canvas API.

Can I use screenshots commercially?

Yes. Any images you export are yours to use however you wish.