
Do you want to write your own CFD solver, but you don’t know how to get started? Have you tried writing your own solver before and felt lost in the process?
This is exactly how I felt when I started writing my first CFD solver, and I remember the struggle. There were no good resources available, and CFD textbooks rarely make an effort to talk about the computational side of Computational Fluid Dynamics
I want to spare you the frustration, and so I have written down all you need to know in one place, from theory to final working code. It is all here in this tightly packed 90-page eBook.
If you give me a weekend of your time, I can teach you what took me years to master. If that sounds like a fair deal, leave your email address below and I’ll send it straight into your inbox!
What others have said about the book
Mihir Graduate Aerospace Student/CFD Analyst “I truly enjoyed a complete and thorough explanation from theory all the way down to the code. It was very easy to follow, and given my limited C++ knowledge, I had no issue understanding the code structure. I definitely recommend this book and the amazing work done by the author to anyone who wants to get their hands dirty and understand how a CFD code comes together. “
Sam Video Game Programmer “So I had already written a MUSCL solver with the HLLC Riemann approximation prior to reading your ebook, but it was a grind to figure out how to do all that stuff, and it took me forever. Your ebook laid out the important concepts in a very accessible and learner-friendly format, and I wish I had seen it when I first started working on my project. I think it would be a great help to anyone starting out in this field to read your book first, both to get a sense of the road ahead of them and also to create a tangible solver they can experiment with, and then they’ll be able to focus their future learning much more productively.“
Francesco PhD student “It is really helpful to put theoretical knowledge about CFD into a working and efficient code. The bridge between theory and real code application is the most important thing during the learning process. “
Chris Propulsion Engineer “Tom’s passion for this type of work shows. He’s crafting a wonderful resource that I will refer to for each project I do.“
Santiago Consultant Engineer “I am more than satisfied with the ebook and all the content of the webpage. Looking forward to continuing learning and following the material on the website.“
Sai Post-graduate Mechanical Engineering Student “One word: just amazing and easy to understand!”
Get your copy now
Signup for the newsletter
What’s inside the book?
This book includes the following:
- 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 further improve 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 in the form above.