Join CFD community

Do you want to write your own CFD solver? Do you struggle to discretise the Navier-Stokes equations and put them into code? Well, if you give me a weekend of your time, I show you how!

By signing up to my email list, you will receive my eBook Write your First CFD Solver – From Theory to Implemented CFD Solver in less than a weekend.

Write your First CFD Solver

From Theory to Implemented CFD Solver in less than a weekend

This tightly packed 90-page eBook covers all aspects of how to write a CFD solver from scratch. It covers:

  • A chapter on how to set up a suitable programming environment on either Windows, Linux, or macOS.
  • A review of the required theory to write a CFD solver (governing equations and numerical schemes, in particular, modern high-resolution schemes to capture shock waves with great accuracy).
  • A full implementation of the theory into code where each line is discussed in one chapter to explain precisely how the equations from the theory chapter are implemented into code.
  • A chapter on how to compile the code on different operating systems, how to run the code, as well as discussing the implemented schemes and how well they compare against the exact solution.
  • A chapter with ideas and instructions for implementing additional schemes and methods to improve further your understanding of how to write a CFD solver.

This eBook doesn’t assume any prior knowledge on your side. It is designed to be self-contained so you can follow along, regardless of your background. Anything that isn’t important right now is left out to keep the length to a minimum. This allows us to concentrate on the essentials and, indeed, write a solver over the span of a weekend.

We will first develop a framework that we can use to develop any kind of CFD solver. Every CFD solver under the sun follows this framework, and once you understand it, you know which steps to take to write a simple 1D solver to a complex 3D one.

The programming language chosen is C++ because that is the language of CFD solvers. You will find other example codes online showing how to write CFD solvers in Python, Matlab, and similar languages, but if you are serious about CFD, you need to know C++.

If you have never used C++ before, don’t worry; the first chapter of the ebook sets you up with everything you need to understand the basics of C++ and how to compile it on your machine, regardless of your operating system. The code does not use any fancy C++ techniques and is designed to be as simple as possible to read.

Why should I trust you?

Well, I have written quite a few solvers over the years! I have implemented solvers for incompressible and compressible flows, laminar and turbulent flows, structured and unstructured grids, explicit and implicit time discretisations, parallel computing (both CPU-based and GPU-based), classical Navier-Stokes and particle-based solvers (Lattice Boltzmann, Molecular Dynamics, Direct Simulation Monte Carlo), finite difference, finite volume, and finite element discretisation, and the list goes on.

I worked as a software engineer for the German Aerospace Center on their commercial CFD solver, and I now work as a senior lecturer in CFD at Cranfield University.

Why should I care?

I believe that if you can set up a CFD simulation and solve it, you can tackle the challenges of today we face in engineering and science. But if you can write your own solver, you can devise new algorithms and implement new models to tackle the unsolved challenges of tomorrow!

We need more capable CFD engineers and scientists, and I hope this ebook will get you started towards CFD mastery! Are you ready to be part of our CFD community? Then, leave your name and email address below.

Signup for the newsletter