
The most comprehensive PINN series in the collection. Starting from 1D scalar transport and building all the way to coupled Navier-Stokes with the energy equation, this series gives you everything you need to apply PINNs to real fluid mechanics problems, with rigorous quantitative validation at every stage.
Working entirely in PyTorch, you will implement pressure-velocity coupling, enforce incompressibility, solve the full nonlinear Navier-Stokes equations, and simulate buoyancy-driven natural convection. Every worksheet builds directly on the previous one, and the NS worksheets are validated against published benchmark data from the CFD literature.
10 notebooks, one new idea each:
WS1 | 1D Steady Convection-Diffusion: Introduces the convection term alongside diffusion for the first time. Covers the Péclet number, its physical significance, and how it controls the solution character from smooth diffusion-dominated profiles to sharp advection-dominated boundary layers. Validated against the analytical exponential solution.
WS2 | 1D Transient Convection-Diffusion: Adds time dependence to the convection-diffusion equation. The network predicts a scalar field φ(x,t) as it is advected and diffused simultaneously. Introduces the three-part loss (IC + BC + physics) and space-time collocation sampling. The advecting front is visualised as both time-slice profiles and a full space-time heatmap.
WS3 | 2D Steady Convection-Diffusion: Extends to a 2D square domain with a prescribed diagonal velocity field. Introduces vector velocity fields, 2D interior collocation, and mixed boundary conditions. Builds the 2D autograd skills — four derivative calls per training step — needed for the NS worksheets ahead.
WS4 | 2D Steady Stokes Flow (Lid-Driven Cavity): The most important conceptual step in the series. Introduces pressure-velocity coupling, the incompressibility constraint, and a three-output network predicting (u, v, p) simultaneously from spatial coordinates. Solves the classic lid-driven cavity in the Stokes regime. Includes streamline and pressure field visualisation.
WS5 | 2D Steady Navier-Stokes at Re=100: Adds the nonlinear convection term to the Stokes residuals — the only change from WS4, but physically everything changes. Solves the lid-driven cavity at Re=100 where inertia shifts the primary vortex and creates secondary corner structures. Validated quantitatively against the Ghia et al. (1982) benchmark, the canonical reference dataset for this problem.
WS6 | Kovasznay Flow: Rigorous Benchmark Validation: Uses the Kovasznay (1948) exact analytical solution to the 2D Navier-Stokes equations for full quantitative validation of all three fields (u, v, p) simultaneously. Computes L2 and Linf errors and compares directly against Raissi et al. (2019) — the original PINN paper — and Mao et al. (2020). The definitive test of whether your NS PINN implementation is correct.
WS7 | Navier-Stokes with Energy Equation (Natural Convection): The series finale. Couples the NS equations to the energy equation via the Boussinesq approximation, enabling simulation of buoyancy-driven natural convection in a differentially heated cavity. The network predicts four fields simultaneously: (u, v, p, T). The hot and cold walls drive a recirculating flow entirely through thermal forcing with no imposed velocity anywhere.
3 animation tutorials:
AWS1 | 1D Convection-Diffusion Animation: Watch the PINN prediction converge toward the analytical exponential solution, with the characteristic Pe=20 boundary layer sharpening visibly over training.
AWS2 | Navier-Stokes Animation: Full 2x2 dashboard showing the velocity magnitude field and pressure field evolving during training, alongside the u-centreline converging toward the Ghia et al. benchmark data points in real time.
AWS3 | Kovasznay Validation Animation: Watch the L2 relative errors for all three fields (u, v, p) drop simultaneously toward the Raissi et al. (2019) benchmark level of approximately 1e-3. The most satisfying convergence plot in the series.
Every worksheet includes:
Full governing equation derivation and residual formulation before any code. Pre-written PyTorch code with clearly signposted fill-in-the-blank sections. Conceptual and analysis questions. Quantitative validation against analytical solutions or published benchmark data. Optional extension challenges. A complete answer key.
What is included: Ten Jupyter notebooks, each in fill-in-the-blank worksheet and complete answers versions. A technical handbook PDF. A Google Colab quick-start guide. Everything runs in Google Colab — no installation required.
Who this is for: Engineering students, researchers, and CFD practitioners who want to understand how PINNs apply to fluid mechanics, from scalar transport through to coupled multiphysics. Solid undergraduate CFD knowledge assumed (Reynolds number, Navier-Stokes, boundary conditions).
Prerequisite: The Mastering Heat Transfer PINNs series, or equivalent PINN experience.