CFD Python: 12 Steps to Navier-StokesNew

License: See LICENSE file · Updated 2026-10-24
My rating

Why start here

Before physics-ML, you need to feel how a CFD solver is built. "12 Steps to Navier-Stokes" (Barba & Forsyth, Computing in Science & Engineering 2018) walks from linear convection to the 2-D cavity flow in twelve incremental notebooks - each step adds exactly one numerical idea.

The twelve steps

  1. Linear convection (first-order upwind)
  2. Nonlinear convection
  3. Diffusion
  4. Burgers equation
  5. Linear second-order wave (leapfrog)
  6. Nonlinear 2-D convection
  7. 2-D diffusion
  8. Burgers 2-D
  9. Laplace equation (iterative relaxation)
  10. 2-D Poisson (pressure-Poisson preview)
  11. Cavity flow with explicit time stepping
  12. Channel flow with implicit treatment

How to use it

  • Run each notebook top to bottom; then delete outputs and retype the key lines
  • Experiment: change CFL, grid spacing, initial condition; watch stability break
  • Afterwards, discretization and stability feel concrete - which makes PINN residuals and differentiable solvers much easier to read

Pair with

  • The accompanying AeroPython / CFD Python lessons
  • A finite-volume text (e.g. LeVeque) for the conservative-form perspective
Tags: