Navier-Stokes Flow Visualization Back
Fluid Mechanics / CFD

Navier-Stokes Flow Visualization

Real-time 2D incompressible CFD in your browser. Adjust Reynolds number and flow type to visualize velocity fields, vorticity, and streamlines instantly.

Presets
Parameters
Statistics
Max velocity
0.00
U_lid
Max vorticity
0.0
Steps
0
Re (actual)
100
Incompressible N-S
$\frac{\partial \mathbf{u}}{\partial t}+ (\mathbf{u}\cdot\nabla)\mathbf{u}= -\nabla p + \frac{1}{Re}\nabla^2\mathbf{u}$
$\nabla \cdot \mathbf{u} = 0$
Vorticity: $\omega = \partial v/\partial x - \partial u/\partial y$
LowMidHigh
Initializing...

What is Navier-Stokes Flow?

🧑‍🎓
What exactly is the Reynolds number? I see it's the main slider in the simulator.
🎓
Basically, it's a single number that tells you if a flow is smooth and orderly (low Re) or chaotic and turbulent (high Re). It's the ratio of inertial forces to viscous forces. In practice, if you slide it to a low value like 10 here, the fluid is very "sticky" and smooth. Slide it to 1000, and you'll see much more complex, swirly patterns.
🧑‍🎓
Wait, really? So the "vorticity" and "streamlines" views are showing me different things about the same flow?
🎓
Exactly! Streamlines show you the paths a tiny particle would follow—they never cross. Vorticity, on the other hand, is a measure of local rotation. Try switching the visualization type while the simulation runs. You'll see the smooth lines of flow in one view, and in the vorticity view, bright spots show you where the fluid is spinning, like little whirlpools.
🧑‍🎓
This simulator shows a box with a moving lid. Is that a common case, or just a simple example?
🎓
It's a classic benchmark in CFD called the "lid-driven cavity." It seems simple, but it contains all the complex physics of the Navier-Stokes equations! For instance, change the Reynolds number and watch the primary vortex in the center. At low Re, it's centered. As you increase Re, smaller vortices appear in the bottom corners. This simple box is used to test and validate supercomputers for fluid simulation.

Physical Model & Key Equations

The core model is the incompressible Navier-Stokes equations. The first equation (momentum conservation) says that changes in fluid velocity are due to pressure gradients, viscous diffusion, and the fluid's own inertia. The second (continuity) enforces that the fluid is incompressible—its density doesn't change, so the flow has no sources or sinks.

$$ \frac{\partial \mathbf{u}}{\partial t}+ (\mathbf{u}\cdot\nabla)\mathbf{u}= -\nabla p + \frac{1}{Re}\nabla^2\mathbf{u}, \quad \nabla \cdot \mathbf{u}= 0 $$

Here, $\mathbf{u}$ is the velocity vector, $p$ is pressure, $t$ is time, and $Re$ is the Reynolds number. The term $(\mathbf{u}\cdot\nabla)\mathbf{u}$ is the tricky non-linear part that causes turbulence.

Vorticity is a derived quantity that is incredibly useful for visualizing rotation. It's mathematically defined as the curl of the velocity field. In 2D, it simplifies to this scalar equation, telling us how much a tiny fluid element is spinning around an axis pointing out of the screen.

$$ \omega = \frac{\partial v}{\partial x}- \frac{\partial u}{\partial y} $$

$\omega$ is the vorticity. $u$ and $v$ are the x and y components of velocity. Positive vorticity (red/yellow in the sim) means counter-clockwise rotation; negative (blue) means clockwise.

Real-World Applications

Aerodynamic Design: Every car, airplane, and wind turbine blade is designed using CFD solvers based on these equations. Engineers run thousands of simulations, varying shapes and flow conditions (like the Reynolds number slider) to minimize drag and maximize lift or efficiency before building a single physical prototype.

Weather & Climate Forecasting: Global climate models and your local weather forecast solve a form of the Navier-Stokes equations on a planetary scale. They simulate the flow of the atmosphere and oceans, where phenomena like hurricanes are massive, complex vortex structures similar to what you see forming in the cavity at high Re.

Biomedical Engineering: Modeling blood flow in arteries, airflow in lungs, or the movement of medical devices through the body relies on these equations. For instance, simulating flow in an aneurysm at different Reynolds numbers helps doctors assess rupture risk.

Industrial Process Design: From mixing chemicals in a tank to designing the ventilation for a clean room, understanding how fluids move is critical. The lid-driven cavity flow itself is a simplified model for studying mixing in stirred tanks, where the "lid" is like a rotating impeller.

Common Misunderstandings and Points to Note

When you start using this simulator, there are a few points you should be careful about. First, don't misunderstand that "the colormap values directly represent physical pressure." What's displayed here is "vorticity," representing the "strength of rotation" in the fluid. Pressure is a different quantity and is not visualized in this tool. For example, areas where blue and red are adjacent behind an obstacle indicate opposing vortices competing with each other.

Next, avoid changing parameters too extremely. Especially if you suddenly set the Reynolds number (Re) to a very large value like 10,000, the calculation can become unstable, leading to grid-like noise (numerical oscillations) or divergence. In practical CFD as well, you don't start by calculating the final condition immediately; you gradually increase from a low Re, checking for solution convergence. For instance, if you want to observe behavior at Re=10,000 for a lid-driven cavity, try increasing it step by step: 1000 → 3000 → 5000….

Finally, don't think that "2D results directly represent 3D phenomena." This tool is for educational purposes, to help you understand the essence of phenomena. Real flows are three-dimensional. For example, even in a lid-driven cavity flow, complex vortex structures (like Taylor-Görtler vortices) form on the side walls in 3D where there is depth. While 2D simulation is low-cost and useful for understanding phenomena, keep in mind that 3D analysis is essential for actual design.

Related Engineering Fields

The fundamental flow equations solved by this tool are actually used at the core of a wide variety of engineering fields. The first to mention is "Thermal Fluid Engineering". By adding the energy conservation equation (temperature transport equation) to the Navier-Stokes equations, you get the foundation for simulating coolant flow in engines or heat dissipation in electronic components. For example, if you heat a wall inside the cavity, natural convection occurs due to buoyancy from the temperature difference.

Another is "Chemical Process Engineering". To improve the mixing efficiency of chemicals inside a reaction vessel, you need to understand flow patterns and substance diffusion. The vortices and circulation you see here become key factors promoting mixing. Also, "Biomechanics" is an important application area. Studies of separation and vortices around obstacles like these serve as a first step in analyzing blood flow dynamics in blood vessels (blood is a non-Newtonian fluid, but the fundamentals are the same) or flow around heart valves.

It might be slightly surprising, but large-scale numerical simulations in "Meteorology and Oceanography" are also fundamentally based on the same equations. When calculating large-scale circulation of the atmosphere or ocean currents, terms like the Coriolis force due to Earth's rotation are added, but the concept of the Reynolds number, representing the balance between inertia and viscosity, is extremely important. Changing the Re in the tool and observing the flow become more complex is a gateway to understanding the onset of turbulence at small scales.

For Further Learning

Once you're comfortable with this simulator and think, "I want to know more about how it works," it's time to take the next step. I recommend first learning about "discretization" and "algorithms". Computers cannot solve continuous differential equations directly, so the domain is divided into a mesh (grid), and derivatives are approximated by differences. For example, the velocity gradient $\frac{\partial u}{\partial x}$ is calculated using the difference between values at adjacent grid points $(u_{i+1}-u_{i-1})/(2\Delta x)$ (central difference). This tool performs such calculations in the background as well.

Next, look into the crucial "pressure-velocity coupling solution methods" in this field. For incompressible flow, pressure plays the role of adjusting the velocity field to satisfy the continuity equation $\nabla \cdot \mathbf{u}=0$. How to solve this efficiently is one of the core aspects of CFD, with famous algorithms like the "SIMPLE method" and the "projection method". Learning about these methods will give you a tangible sense of why CFD calculations take time.

Regarding the mathematical background, a basic knowledge of "vector calculus" and "partial differential equations" will allow for a deeper understanding of the equations' meanings. In particular, understanding what the $\nabla$ (nabla) operator does (gradient, divergence, curl) will help you intuitively grasp that each term in the Navier-Stokes equations represents "acceleration," "force due to pressure gradient," and "diffusion due to viscosity." A great first step is to start by playing with this tool and practicing how to verbally describe the changes in the flow field when you modify parameters.