Foundations to Frontier
Tests
A. Mathematical Foundations › A3 Calculus and Analysis › Vector calculus

Applications: Fluid Flow and Physics-Informed Models

Vector calculus at work. Conservation of mass, momentum and energy become PDEs (continuity, Euler/Navier–Stokes, heat) through the divergence theorem. Ideal flow around a cylinder explains lift and the Magnus effect. Physics-informed models (PINNs, physics-informed least squares, neural operators) put the PDE itself into the loss, solving forward problems and identifying unknown physical constants from sparse data.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Water, air and the rules they obey

Squeeze a garden hose and the water shoots out faster. The same amount of water has to get through a smaller opening each second, so it speeds up. That’s conservation of mass. Faster-moving fluid also has lower pressure, which is Bernoulli’s principle. Together they explain why a curveball curves, how a plane’s wing lifts, and how a pipe’s flow meter works.

The equations of fluids are written with divergence (does fluid pile up?), curl (does it spin?) and the Laplacian (does it diffuse?). Modern AI can even be trained by giving it these equations as rules to obey. Those are physics-informed models.

Flow past a spinning cylinder: where does lift come from?
flow →
θ: 0° (front) → 90° (top) → 180° → 270° (bottom) → 360°Cp = 1 − (q/U)², up = high pressure
drag D′ = 0.0000 (d'Alembert's paradox)
lift L′ = 4.8000 · ρUΓ = 4.8000 (Kutta–Joukowski, ρ = 1.2)
Stagnation points: on the surface at θ = -19° and 199°.
Spin speeds the flow over the top and slows it underneath. By Bernoulli, faster flow means lower pressure, so the cylinder is pushed up: the Magnus effect, and the same circulation idea that explains airfoil lift. Real flows have drag, from viscosity and the separating wake that ideal flow ignores.
Why engineers care

Spacecraft design runs on fluid equations: rocket nozzles, re-entry heating, Mars helicopter blades in thin air, cooling loops on the space station. Physics-informed ML is a fast-growing tool for these problems when full simulations are too slow or the data is too sparse.

📝 Quick check (Level 0)
0/3 answered
  1. 1. A pipe narrows. The water…
  2. 2. Faster-moving air has ___ pressure (Bernoulli).
  3. 3. A spinning ball curves because of…

Level 1: Beginner

★★☆☆☆ Basic⏱ 15 minSecondary-school mathematics: arithmetic and elementary algebra.

The basic equations

Law Equation Meaning
mass (continuity) ρt+∇⋅(ρu)=0\rho_t + \nabla\cdot(\rho\mathbf u) = 0 mass doesn’t appear or vanish
incompressible ∇⋅u=0\nabla\cdot\mathbf u = 0 volume in = volume out
pipe continuity A1v1=A2v2A_1v_1 = A_2v_2 the hose rule
Bernoulli (steady, ideal) p+12ρv2+ρgz=constp + \tfrac12\rho v^2 + \rho gz = \text{const} along a streamline energy budget
heat / diffusion Tt=α∇2TT_t = \alpha\nabla^2T spreads toward the local average

Example (the hose). Area 0.50.5 to 0.250.25 at v1=2v_1 = 2 gives v2=4v_2 = 4. With ρ=1000\rho = 1000, the pressure drops by 12ρ(v22−v12)=6000\tfrac12\rho(v_2^2 - v_1^2) = 6000 Pa. A Venturi meter reverses this, inferring the flow from the measured pressure drop (Practice Code 2).

Pressure coefficient: Cp=p−p∞12ρU2=1−(q/U)2C_p = \frac{p - p_\infty}{\frac12\rho U^2} = 1 - (q/U)^2 in ideal flow. It’s 1 at a stagnation point (q=0q = 0) and negative where the flow speeds up.

📝 Quick check (Level 1)
0/3 answered
  1. 1. A₁ = 0.5, v₁ = 2, A₂ = 0.25: v₂ = ?
  2. 2. Is (2x, −2y) incompressible?
  3. 3. Cp at a stagnation point?

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.

From conservation to PDEs

Mass. For any fixed control volume VV, ddt∭Vρ=−∯∂Vρu⋅n\frac{d}{dt}\iiint_V\rho = -\oiint_{\partial V}\rho\mathbf u\cdot\mathbf n. The divergence theorem turns the right side into −∭∇⋅(ρu)-\iiint\nabla\cdot(\rho\mathbf u). Since VV is arbitrary, the integrands match, giving the continuity equation.

Momentum. In the same way, with pressure and viscous stresses as surface forces, you get the Navier–Stokes equations for incompressible flow:

ut+(u⋅∇)u=−1ρ∇p+ν∇2u,∇⋅u=0\mathbf u_t + (\mathbf u\cdot\nabla)\mathbf u = -\frac{1}{\rho}\nabla p + \nu\nabla^2\mathbf u, \qquad \nabla\cdot\mathbf u = 0

When the viscosity ν→0\nu \to 0, these become the Euler equations. The ratio of the inertia term to the viscous term is the Reynolds number Re=UL/νRe = UL/\nu.

Ideal (potential) flow

If the flow is also irrotational, then u=∇ϕ\mathbf u = \nabla\phi and incompressibility gives Laplace’s equation ∇2ϕ=0\nabla^2\phi = 0. In 2-D you can also use a stream function ψ\psi, with u=ψyu = \psi_y and v=−ψxv = -\psi_x. That makes the flow divergence-free automatically, and streamlines are its level curves. Because Laplace’s equation is linear, solutions add:

  • uniform stream + doublet = flow past a cylinder;
  • add a vortex of circulation Γ\Gamma = a spinning cylinder.

The surface speed is q(θ)=∣2Usin⁡θ+Γ/(2πa)∣q(\theta) = |2U\sin\theta + \Gamma/(2\pi a)|. Integrating Bernoulli’s pressure around the surface gives

  • drag = 0 (d’Alembert’s paradox, 1752: real drag needs viscosity and the wake);
  • lift = ρUΓ\rho U\Gamma per unit span (the Kutta–Joukowski theorem).
🐍 Exercise 1: potential flow, d'Alembert's paradox and the Kutta–Joukowski theorem
Build the cylinder flow from a uniform stream, a doublet and a vortex. Verify it's divergence-free, curl-free and tangent to the wall, compute Cp from Bernoulli, and integrate the pressure to get zero drag and lift ρUΓ.
📝 Quick check (Level 2)
0/3 answered
  1. 1. Irrotational + incompressible ⇒ the potential satisfies…
  2. 2. Ideal flow past a cylinder has drag…
  3. 3. Lift per span of a spinning cylinder in ideal flow:

Level 3: Advanced

★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.

Vorticity

The curl of velocity, ω=∇×u\boldsymbol\omega = \nabla\times\mathbf u, is the vorticity, twice the local rotation rate. For solid-body rotation at rate Ω\Omega, ω=2Ω\omega = 2\Omega. Taking the curl of the Euler equations eliminates pressure. In 2-D the result is ωt+u⋅∇ω=ν∇2ω\omega_t + \mathbf u\cdot\nabla\omega = \nu\nabla^2\omega: vorticity is carried by the flow and diffuses through viscosity. Kelvin’s circulation theorem says that in ideal flow the circulation around a curve moving with the fluid is constant. That’s why an airfoil starting from rest sheds a starting vortex: the bound circulation Γ\Gamma that produces lift must be balanced by an equal and opposite one left behind (Anderson, 2017).

Why boundary conditions decide everything

Laplace and heat equations need boundary data. Dirichlet conditions fix the value (temperature at a wall). Neumann conditions fix the normal derivative (insulated: ∂T/∂n=0\partial T/\partial n = 0; no-penetration: ∂ϕ/∂n=0\partial\phi/\partial n = 0). By the maximum principle (A3.4-1), the solution of Laplace’s equation with given Dirichlet data is unique: the difference of two solutions is harmonic with zero boundary values, so it’s identically 0. For the heat equation, each Fourier mode sin⁡(kπx)\sin(k\pi x) decays like e−k2π2αte^{-k^2\pi^2\alpha t}. Sharp features (large kk) vanish fastest (Practice Code 4).

Stability is a vector-calculus question too

Explicit schemes need αΔt/h2≤12\alpha\Delta t/h^2 \le \tfrac12 in 1-D (14\tfrac14 in 2-D) for diffusion, and the CFL condition ∣u∣Δt/h≤1|u|\Delta t/h \le 1 for advection (Courant, Friedrichs and Lewy, 1928). Physically, information must not travel more than one cell per step.

Exercise 3.1: Show that a stream function always gives a divergence-free velocity

∇⋅(ψy,−ψx)=ψyx−ψxy=0\nabla\cdot(\psi_y, -\psi_x) = \psi_{yx} - \psi_{xy} = 0 by the symmetry of mixed partials. It’s the 2-D version of “the divergence of a curl is zero”.

📝 Quick check (Level 3)
0/3 answered
  1. 1. The vorticity of solid-body rotation at rate Ω:
  2. 2. Kelvin's theorem: in ideal flow, circulation around a material loop is…
  3. 3. Laplace's equation with fixed boundary values has…

Level 4: Expert

★★★★★ Expert⏱ 50 minResearchers: original papers and open problems.

Physics-informed models

A physics-informed neural network (PINN; Raissi, Perdikaris and Karniadakis, 2019) represents the solution uθ(x,t)u_\theta(\mathbf x,t) by a network. It trains on

L(θ)=1N∑∣N[uθ](xi)∣2⏟PDE residual at collocation points+λb∑∣uθ−g∣∂Ω2⏟boundary/initial+λd∑∣uθ(xj)−uj∣2⏟sparse data\mathcal L(\theta) = \underbrace{\tfrac1N\sum\big|\mathcal N[u_\theta](\mathbf x_i)\big|^2}_{\text{PDE residual at collocation points}} + \lambda_b\underbrace{\sum|u_\theta - g|^2_{\partial\Omega}}_{\text{boundary/initial}} + \lambda_d\underbrace{\sum|u_\theta(\mathbf x_j) - u_j|^2}_{\text{sparse data}}

The derivatives inside N\mathcal N (gradients, Laplacians, divergences) come from automatic differentiation: nested JVPs/VJPs, or hyper-dual numbers (Practice Code 5). Unknown physical constants, such as a viscosity, a diffusivity or a drag coefficient, can be added as trainable parameters. That’s the inverse problem, and arguably PINNs’ strongest use case (Karniadakis et al., 2021).

When uu is linear in its parameters (fixed random features, as in “extreme learning machine” PINNs; Dong and Li, 2021), a linear PDE’s loss is a least-squares problem solved in one shot. That’s what Exercise 2 does.

🐍 Exercise 2 (research): physics-informed least squares, forward and inverse
Represent u with tanh random features. Solve k u″ = f, u(0) = u(1) = 0 using only the PDE residual and boundary conditions (no solution data), and watch the error fall as features are added. Then identify an unknown diffusivity k from 8 noisy measurements.

What works and what doesn’t (an honest map)

  • Strengths: inverse problems and data assimilation with sparse sensors; irregular geometry without meshing; fusing physics with measurements, for example flow fields reconstructed from flow-visualization videos (“hidden fluid mechanics”; Raissi et al., 2020).

  • Known failure modes:

    • stiff or multi-scale problems;
    • high-frequency solutions (spectral bias);
    • loss-term imbalance, which needs adaptive weights (Wang, Teng and Perdikaris, 2021);
    • convection-dominated flows (Krishnapriyan et al., 2021).

    For well-posed forward problems, classical solvers are usually faster and more accurate.

  • Neural operators learn the whole solution map, from parameters or forcing to solution, so a new instance costs one forward pass. Examples are DeepONet (Lu et al., 2021) and Fourier neural operators (Li et al., 2021). They’re used for fast weather forecasting surrogates and design loops.

  • Structure by construction. Output a stream function and take its curl, and the velocity is exactly divergence-free. Use finite-volume or flux-form layers and conservation is exact (A3.4-3). Hamiltonian or Lagrangian networks conserve energy. Building physics into the architecture often beats adding it to the loss.

  • Robotics and aerospace:

    • learned aerodynamic models for agile drone control (“Neural-Fly”; O’Connell et al., 2022);
    • physics-informed surrogates for thermal and structural analysis of spacecraft components;
    • differentiable fluid simulation for designing swimming and flying robots.

References

  1. M. Raissi, P. Perdikaris, G. E. Karniadakis (2019). “Physics-informed neural networks: a deep learning framework for solving forward and inverse problems involving nonlinear PDEs.” Journal of Computational Physics, 378.
  2. G. E. Karniadakis, I. Kevrekidis, L. Lu, P. Perdikaris, S. Wang, L. Yang (2021). “Physics-informed machine learning.” Nature Reviews Physics, 3.
  3. S. Dong, Z. Li (2021). “Local extreme learning machines and domain decomposition for solving linear and nonlinear PDEs.” Computer Methods in Applied Mechanics and Engineering, 387.
  4. M. Raissi, A. Yazdani, G. E. Karniadakis (2020). “Hidden fluid mechanics: learning velocity and pressure fields from flow visualizations.” Science, 367.
  5. S. Wang, Y. Teng, P. Perdikaris (2021). “Understanding and mitigating gradient flow pathologies in physics-informed neural networks.” SIAM Journal on Scientific Computing, 43(5).
  6. A. Krishnapriyan, A. Gholami, S. Zhe, R. Kirby, M. Mahoney (2021). “Characterizing possible failure modes in physics-informed neural networks.” NeurIPS.
  7. L. Lu, P. Jin, G. Pang, Z. Zhang, G. E. Karniadakis (2021). “Learning nonlinear operators via DeepONet.” Nature Machine Intelligence, 3.
  8. Z. Li et al. (2021). “Fourier neural operator for parametric partial differential equations.” ICLR.
  9. M. O’Connell et al. (2022). “Neural-Fly enables rapid learning for agile flight in strong winds.” Science Robotics, 7(66).
  10. J. D. Anderson (2017). Fundamentals of Aerodynamics, 6th ed. McGraw-Hill.
  11. R. Courant, K. Friedrichs, H. Lewy (1928). “Über die partiellen Differenzengleichungen der mathematischen Physik.” Mathematische Annalen, 100.
  12. G. K. Batchelor (1967). An Introduction to Fluid Dynamics. Cambridge.