Introduction to Fluid Dynamics

What is a fluid? Viscosity, the continuum hypothesis, and compressibility

What Is a Fluid?

A fluid is any substance that deforms continuously under an applied shear stress — liquids and gases alike. Unlike solids, fluids have no preferred shape and will flow to fill their container. Fluid dynamics studies how these substances move, and it all begins with three foundational ideas: the continuum hypothesis, viscosity, and compressibility.

The demos below let you explore each concept interactively. Every visualization runs in real time on a 2D canvas, so feel free to adjust the controls and build intuition before diving into the equations.

The Continuum Hypothesis

At the molecular level, a fluid is a chaotic swarm of individual molecules bouncing around. But if we zoom out far enough, the random molecular motion averages into smooth, deterministic fields — velocity, pressure, density — that vary continuously in space and time. This is the continuum hypothesis, and it is the foundation on which the Navier-Stokes equations are built.

Use the slider below to transition between the molecular view (individual particles with Brownian motion) and the continuum view (a smooth velocity field). Notice how the random jitter of individual molecules vanishes into coherent flow arrows.

MolecularContinuum

At the molecular scale, each dot is a “molecule” with random (Brownian) motion superimposed on the flow. Zoom out to the continuum scale to see the same motion described as a smooth velocity field — the foundation of fluid dynamics.

Viscosity — A Fluid's Resistance to Shear

Viscosity measures how strongly a fluid resists being deformed. Water has low viscosity — layers of fluid slide past each other easily. Honey has high viscosity — internal friction couples adjacent layers tightly together. The simplest setup to see this difference is Couette flow: fluid between two parallel plates, one moving and one stationary.

In a low-viscosity fluid, the velocity is nearly uniform across the gap except in thin boundary layers near the walls. In a high-viscosity fluid, the velocity varies linearly from zero at the stationary wall to the plate speed at the moving wall. Adjust the plate speed and boundary layer thickness to see how the velocity profile and particle motion change.

ThinThick
Particle color: slowfast  |  White curve = velocity profile u(y)

Compressibility — Can the Fluid Be Squeezed?

When you push a piston into a tube of gas, the molecules near the piston crowd together first, and this compression propagates outward as a pressure wave traveling at the speed of sound. This is compressible flow.

For liquids (and gases at low Mach numbers), density changes are negligible. In the incompressible idealization, pressure disturbances propagate instantaneously — every particle in the tube shifts at the same moment. Toggle between the two modes and push the piston to see the difference.

In compressible flow, a pressure disturbance travels at a finite wave speed (sound speed) — you can see the compression front move through the tube. In incompressible flow, pressure changes propagate instantaneously — all particles respond at once.

Key Concepts

  • Continuum hypothesis — We treat the fluid as a continuous medium rather than tracking individual molecules. This is valid when the mean free path is much smaller than the length scales of interest (Knudsen number Kn « 1).
  • Viscosity (μ) — The proportionality constant between shear stress and strain rate. High viscosity means strong internal friction; low viscosity means layers slide freely. The ratio ν = μ/ρ is the kinematic viscosity.
  • Compressibility — In compressible flow, density varies significantly and pressure disturbances travel at a finite wave speed. In incompressible flow (Mach number M « 1), density is approximately constant and the governing equations simplify considerably.
  • Couette flow — The canonical setup of flow between parallel plates. It is one of the few exact solutions to the Navier-Stokes equations and provides direct insight into how viscosity shapes the velocity profile.