Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Advanced CFD Coding Techniques using C++ (Object Oriented)
Rating: 3.5 out of 5(21 ratings)
75 students

Advanced CFD Coding Techniques using C++ (Object Oriented)

C++ OOP coding techniques for CFD
Created byMohamed Sereez
Last updated 3/2020
English
English [Auto],

What you'll learn

  • C++ object oriented style programming techniques that are currently used in modern CFD softwares such as OpenFOAM
  • Gradients, Laplacian and Gradients of vector and scalar Fields
  • Finite Difference Methods which is transferable to Finite Volume Methods
  • Constructor overloading, polymorphism, STL Library
  • File writing, I/O stream, Inheitance, Friend classes, etc..

Course content

2 sections • 9 lectures • 2h 57m total length
  • Introduction to the course12:36

    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

  • Vectors, classes and objects22:41

    Introduction to vectors, classes, objected and template classes.

Requirements

  • Some level of understanding of basic C++ and fluid dynamics

Description

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.

Who this course is for:

  • Intermediate programming students in CFD, anyone interested in coding fluid dynamics