Fluid Mechanics Course

Essential Foundation: Critical prerequisite for plasma physics (MHD), astrophysics, and engineering

Fluid Mechanics Programs

Interactive Python simulations and Fortran code for computational fluid dynamics

These Python programs run directly in your browser using Pyodide (WebAssembly Python). The first run downloads the Python environment (~15MB). Click "Run" to execute!

Pipe Flow (Hagen-Poiseuille)

Analytical solution for laminar flow in a circular pipe (Hagen-Poiseuille flow)

Click Run to execute the Python code

First run will download Python environment (~15MB)

Fundamental Equations of Fluid Mechanics

Navier-Stokes Equations

The fundamental equations governing viscous fluid motion:

Conservation of Mass (Continuity):

$$\frac{\partial \rho}{\partial t} + \nabla \cdot (\rho \mathbf{v}) = 0$$

For incompressible flow: $\nabla \cdot \mathbf{v} = 0$

Conservation of Momentum:

$$\rho\left(\frac{\partial \mathbf{v}}{\partial t} + (\mathbf{v} \cdot \nabla) \mathbf{v}\right) = -\nabla p + \mu \nabla^2 \mathbf{v} + \rho \mathbf{g}$$

Material derivative: $\frac{D\mathbf{v}}{Dt} = \frac{\partial \mathbf{v}}{\partial t} + (\mathbf{v} \cdot \nabla)\mathbf{v}$

In component form (Cartesian, incompressible):

$$\rho\left(\frac{\partial u}{\partial t} + u\frac{\partial u}{\partial x} + v\frac{\partial u}{\partial y} + w\frac{\partial u}{\partial z}\right) = -\frac{\partial p}{\partial x} + \mu\left(\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} + \frac{\partial^2 u}{\partial z^2}\right) + \rho g_x$$

Bernoulli Equation

For steady, inviscid, incompressible flow along a streamline:

$$p + \frac{1}{2}\rho v^2 + \rho g h = \text{constant}$$

$p$ = static pressure [Pa]

$\frac{1}{2}\rho v^2$ = dynamic pressure [Pa]

$\rho g h$ = hydrostatic pressure [Pa]

Total head form:

$$\frac{p}{\rho g} + \frac{v^2}{2g} + z = H$$

Continuity Equation

Mass conservation for steady flow:

$$\rho_1 A_1 v_1 = \rho_2 A_2 v_2 = \dot{m}$$

For incompressible flow:

$$A_1 v_1 = A_2 v_2 = Q$$

$Q$ = volumetric flow rate [m³/s]

$\dot{m}$ = mass flow rate [kg/s]

Hagen-Poiseuille Flow (Laminar Pipe Flow)

Velocity profile (parabolic):

$$u(r) = \frac{1}{4\mu}\left(-\frac{dp}{dx}\right)(R^2 - r^2)$$

Maximum velocity (at centerline):

$$u_{max} = \frac{R^2}{4\mu}\left(-\frac{dp}{dx}\right)$$

Average velocity:

$$\bar{u} = \frac{u_{max}}{2} = \frac{R^2}{8\mu}\left(-\frac{dp}{dx}\right)$$

Volumetric flow rate:

$$Q = \frac{\pi R^4}{8\mu}\left(-\frac{dp}{dx}\right) = \frac{\pi D^4 \Delta p}{128 \mu L}$$

Wall shear stress:

$$\tau_w = \mu\left.\frac{du}{dr}\right|_{r=R} = \frac{R}{2}\left(-\frac{dp}{dx}\right)$$

Darcy friction factor (laminar):

$$f = \frac{64}{Re_D}, \quad Re_D = \frac{\rho \bar{u} D}{\mu}$$

Stream Function $\psi$

For 2D incompressible flow, automatically satisfies continuity:

$$u = \frac{\partial \psi}{\partial y}, \quad v = -\frac{\partial \psi}{\partial x}$$

Properties:

  • $\bullet$ Lines of constant $\psi$ are streamlines
  • $\bullet$ $\psi_2 - \psi_1 = Q$ (volume flow between streamlines)
  • $\bullet$ $\nabla^2 \psi = -\omega$ (relates to vorticity)

Vorticity $\boldsymbol{\omega}$

Measure of local rotation in fluid:

$$\boldsymbol{\omega} = \nabla \times \mathbf{v}$$

In 2D:

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

Vorticity transport equation:

$$\frac{D\omega}{Dt} = \nu \nabla^2 \omega$$

Boundary Layer Theory

Blasius equation (flat plate):

$$f''' + \frac{1}{2}ff'' = 0$$

With similarity variable:

$$\eta = y\sqrt{\frac{U_\infty}{\nu x}}, \quad \frac{u}{U_\infty} = f'(\eta)$$

Boundary layer thickness (99%):

$$\delta = \frac{5.0x}{\sqrt{Re_x}}$$

Displacement thickness:

$$\delta^* = \int_0^\infty \left(1 - \frac{u}{U_\infty}\right)dy = \frac{1.72x}{\sqrt{Re_x}}$$

Momentum thickness:

$$\theta = \int_0^\infty \frac{u}{U_\infty}\left(1 - \frac{u}{U_\infty}\right)dy = \frac{0.664x}{\sqrt{Re_x}}$$

Skin friction coefficient:

$$C_f = \frac{\tau_w}{\frac{1}{2}\rho U_\infty^2} = \frac{0.664}{\sqrt{Re_x}}$$

Potential Flow Elements

Uniform Flow

$$\phi = U_\infty x, \quad \psi = U_\infty y$$

Source/Sink

$$\phi = \frac{m}{2\pi}\ln r, \quad \psi = \frac{m}{2\pi}\theta$$

Free Vortex

$$\phi = \frac{\Gamma}{2\pi}\theta, \quad \psi = -\frac{\Gamma}{2\pi}\ln r$$

Doublet

$$\phi = -\frac{\kappa \cos\theta}{r}, \quad \psi = -\frac{\kappa \sin\theta}{r}$$

Flow Around Cylinder

$$\psi = U_\infty r\sin\theta\left(1 - \frac{a^2}{r^2}\right)$$

Rankine Vortex

$$v_\theta = \begin{cases} \frac{\Gamma r}{2\pi r_c^2} & r < r_c \\ \frac{\Gamma}{2\pi r} & r \geq r_c \end{cases}$$

Important Dimensionless Numbers

Reynolds Number

$$Re = \frac{\rho V L}{\mu} = \frac{VL}{\nu}$$

Inertia / Viscous forces

Mach Number

$$Ma = \frac{V}{c} = \frac{V}{\sqrt{\gamma R T}}$$

Flow / Sound speed

Froude Number

$$Fr = \frac{V}{\sqrt{gL}}$$

Inertia / Gravity forces

Euler Number

$$Eu = \frac{\Delta p}{\rho V^2}$$

Pressure / Inertia forces

Weber Number

$$We = \frac{\rho V^2 L}{\sigma}$$

Inertia / Surface tension

Strouhal Number

$$St = \frac{fL}{V}$$

Oscillatory / Mean flow