News Blog Tools About Me
Clemente Gotelli
The Flood painting illustrating water dynamics

14 weeks to a Shallow Water solver

Hydraulics CFD

This is a personal 14-week project where I document, step by step, how to build a simple 2D shallow water solver from scratch. The idea is to grow it into a basic CFD course for hydraulic engineers: each week adds one concept—numerics, stability, boundary conditions, friction, visualization—until we have a working, readable solver.

My motivation is simple: if we want to truly understand the software we use for flood simulations and related problems, we should be able to write a minimal solver ourselves. Even if you never use this code in production, the mental model it builds is valuable for any hydraulic engineer.

A living project

This page will evolve as I move forward: I will publish each week only after I have written and tested the corresponding code. The outline below is a roadmap, not a finished syllabus.

The code for this project lives openly on GitHub at the project repo. You can follow along, fork it, or use it as a starting point for your own experiments.

I am taking inspiration from the famous CFD Python: 12 Steps to Navier–Stokes course by Lorena Barba, adapting that spirit of hands-on numerical learning to the shallow water equations and hydraulics applications.

Weekly roadmap

Weeks will be added, refined, or reshuffled as the project progresses. Expect rough edges at the beginning and more polished material later on.

Header image: Noah’s Ark series for Prince-Archbishop Wolf Dietrich von Raitenau: The Flood, Kaspar Memberger the Elder, 1588, oil on canvas. © Residenzgalerie Salzburg, Illustration Fotostudio Ulrich Ghezzi, Oberalm.