
Introduction video lesson. Please download all source codes, code lite zip folder. Also read the blog :
https://aeroflightcfd.blogspot.com/2020/03/quite-often-users-of-openfoam-su2-and.html
Introduction to vectors, classes, objected and template classes.
Some includes and macros we will be using.
Mesh class and preview of the mesh vectors
Creating the U,V,P fields class with subclasses scalar fields, vector fields
The finite Matrix class which is used to bring all the finite difference operations together.
The finite difference operations such as gradients, laplacian, time derivatives, etc..
Correction of boundaries for pressure and velocity.
In this course, you will learn how to apply modern object-oriented C++ programming techniques—leveraging custom classes, dynamic memory management, and std::vector containers—to build a complete computational fluid dynamics (CFD) solver from scratch. Using these tools, you will discretise and solve the governing equations for the classic lid-driven cavity flow benchmark problem. Once the numerical simulation converges, you will export your computed flow data for detailed visual analysis in industry-standard post-processing software such as ParaView or Tecplot.
Core Learning Outcomes
Field Operations: Implement discrete mathematical differential operators—including spatial gradients, Laplacians, and explicit or implicit time derivatives—to solve the incompressible Navier-Stokes equations numerically across a computational grid.
Object-Oriented Design: Architect clean, modular, and maintainable solver code by creating and manipulating dedicated classes for core simulation components such as meshes, scalar fields, vector fields, and boundary conditions.
Function Overloading: Write flexible and reusable scientific code by overloading C++ member functions and class constructors to handle varying data types, grid dimensions, and boundary setups cleanly.
Operator Overloading & Friend Functions: Overload standard arithmetic operators (+, -, *) alongside friend functions so that complex operations on custom field objects can be written using intuitive, mathematical equation-like syntax.
Data Export & Visualisation: Format and write raw numerical simulation outputs into structured, readable file formats (such as .vtk or .dat) for rendering velocity vectors, streamlines, vortex structures, and pressure contours.