How to compile, write and use CFD libraries in C++

Part 1: Understanding static, dynamic, and header-only C++ libraries

Libraries/dependencies are a powerful tool in C++. Written by C++ experts, we get functionality and speed for free. Learn how to leverage them for your code. Read More

Part 2: How to write a CFD library: Discretising the model equation

Learn how to discretise the heat diffusion equation with the finite volume method and how to discretise it using explicit and implicit time integrations. Read More

Part 3: How to write a CFD library: Basic library structure

Don't know how to structure a library and how to test it? Learn how to do just that along with scripts to compile your library on Windows, Linux, and macOS. Read More

Part 4: How to write a CFD library: The Conjugate Gradient class

Learn how to implement the conjugate gradient algorithm to solve the linear system of equations (Ax=b) for Computational Fluid Dynamics applications. Read More

Part 5: How to write a CFD library: The vector class

The vector class is a fundamental building block in our linear system of equations solver library and we'll explore in this article how to implement it. Read More

Part 6: How to write a CFD library: The sparse matrix class

Learn the compressed sparse row (CSR) matrix storage format in this article and how to code it in C++ for Computational Fluid Dynamics applications. Read More

Part 7: How to write a CFD library: Compiling and testing

Learn how to compile library code into static and dynamic libraries on UNIX and Windows, as well as how to turn libraries into header-only libraries. Read More

Part 8: How to integrate external CFD libraries in your code

Learn how to use Make, Ninja, CMake, Meson, Autotools and MSBuild to compile your own and third-party CFD libraries from source for cross-platform development. Read More

Part 9: How to handle C++ libraries with a package manager

Learn how to compile and manage CFD libraries automatically using the Conan C++ package manager, and why you should stay away from Microsoft's vcpkg tool. Read More