
High-quality mesh generation is one of the most critical steps in any CFD simulation, directly influencing accuracy, stability, and computational efficiency. This course offers a practical, hands-on introduction to CFD meshing using fully open-source tools within the OpenFOAM ecosystem. Through carefully designed 2D examples, you will learn how to create, refine, and evaluate meshes using tools such as blockMesh, Classyblocks, snappyHexMesh, cfMesh, and Gmsh, with a strong focus on real-world workflows and best practices.
For a detailed breakdown of the course structure, covered topics, example cases, and learning outcomes, please refer to the attached PDF provided at the end of the course description.
In this lecture, we will learn how to assign various parameters in Gmsh for an existing geometry imported as an STEP file. We will also discuss how to define labels or physical groups, which are essential for the solver setup. Finally, we will cover the file format required by OpenFOAM for simulation.
In this lecture, we will generate a mesh from scratch by constructing a backward-facing step geometry. We will explore how the geometry created using the Gmsh GUI can be converted into a Gmsh script, which can then be edited to create reproducible geometries. We will also discuss how labelling is done in this example.
In this lecture, we will construct a simple geometry using Python scripting. We will discuss how to set up the Python environment, install Gmsh, and write a Python script to generate a simple geometry. Finally, we will learn how to save the result as an .msh file.
In this lecture, we are going to explore the classy_blocks Python library, a powerful tool for generating block meshes using a CAD-style workflow.
This lecture is part of the Turbulence Modelling using RANS series. Here, we introduce the blockMesh utility in detail. It serves as an essential foundation for understanding how computational grids are generated in OpenFOAM. Therefore, this lecture is designed to familiarize students with the blockMesh program, its structure, and its practical use in setting up CFD simulations.
The provided file gives a starting point to follow the tutorial along.
In this lecture, we dive into using SnappyHexMesh in OpenFOAM to generate a mesh around a simple 2D triangle geometry. We cover the essential steps of the meshing process, focusing on castellation (refinement and subdivision) and snapping (aligning mesh to the surface). Topics covered:
Setting up the geometry using Gmsh
Running blockMesh and surfaceFeatureExtract
Configuring SnappyHexMesh dictionaries
Understanding castellation: controlling refinement levels, cell counts, and features
Understanding snapping: how cells are moved/cut to fit the surface
Tips for controlling mesh quality and computational cost
In this tutorial, we continue our SnappyHexMesh series by exploring the addLayers option in OpenFOAM. After covering castellation and snapping in previous videos, this lecture focuses on creating boundary layer meshes to accurately capture near-wall flow gradients. You’ll learn:
✅ What layers are and why they are important in CFD
✅ Key parameters in the addLayers configuration
✅ How to fix common issues when layers fail to generate
✅ Tips for achieving smooth, high-quality boundary layer meshes
Boundary layer meshing is essential for resolving velocity and pressure gradients near walls in CFD simulations. By the end of this video, you will know how to configure and troubleshoot addLayers in SnappyHexMesh for better simulation accuracy.
In this tutorial, we continue exploring SnappyHexMesh for challenging geometries with high aspect ratios and skewness. Building on the previous lecture, where we added mesh layers around corners using internal faces, we now test how meshing strategies change when dealing with elongated and skewed triangular geometries. You’ll learn:
How to generate meshes for high aspect ratio geometries.
Techniques for adding layers around sharp corners and internal faces.
Why small or poorly defined surfaces can prevent layer creation.
How surface feature extraction angles influence mesh quality.
Step-by-step troubleshooting when layers fail to generate.
In this lecture, we continue exploring meshing in OpenFOAM using SnappyHexMesh. We first demonstrate how it works well with Cartesian-aligned geometries, but struggles when the geometry is rotated. We then compare the results with CFMesh, another open-source meshing tool, and show how feature extraction and local refinements can significantly improve mesh quality. Topics covered:
Creating a cube geometry using Gmsh.
Running blockMesh and SnappyHexMesh.
Issues with meshing rotated geometries.
Snapping and castellated mesh stages explained.
Introduction to CFMesh and its minimal setup.
Using feature extraction and local refinement in CFMesh.
In this lecture, we explore CFMesh, an open-source meshing utility for OpenFOAM that provides better mesh generation compared to snappyHexMesh, especially for geometries with sharp features. We walk through the installation, setup, and key features of CFMesh — including global and local refinement, boundary layer generation, anisotropic meshing, and debugging steps. Learn how to use CFMesh effectively for 3D Cartesian meshing, control mesh resolution, and refine specific regions or surfaces. This video also compares CFMesh’s workflow to snappyHexMesh and demonstrates how to debug and optimize mesh quality. ? Topics Covered:
CFMesh installation and user guide overview
Input geometry and STL file handling
Global and local refinement parameters
Object and surface refinement
Boundary layer setup (global and local)
Anisotropic meshing techniques
Workflow control and debugging stages
Mesh quality checks and optimization
? Ideal for CFD learners and engineers using OpenFOAM for internal/external flow simulations.
High-quality meshes are the foundation of accurate, stable, and efficient CFD simulations. This course provides a practical, hands-on introduction to CFD mesh generation using widely adopted open-source tools within the OpenFOAM ecosystem. Instead of focusing on theory alone, the course emphasizes real meshing workflows, common pitfalls, and best practices that directly impact solver performance and numerical stability.
You will learn how to generate both structured and unstructured meshes using tools such as blockMesh, Classyblocks, snappyHexMesh, cfMesh, and Gmsh. Through carefully designed 2D examples, the course demonstrates how different meshing strategies influence solution accuracy, convergence behavior, and computational cost. These simplified cases allow you to focus on meshing fundamentals while still reflecting real CFD challenges.
The course combines video lectures, additional reading material, and ready-to-run case files, enabling you to follow along and experiment independently. You will explore techniques for geometry preparation, surface refinement, boundary layer generation, and mesh quality assessment using standard CFD metrics. Each topic is reinforced with practical examples that highlight how poor meshing choices can lead to instability and how to fix them effectively.
By the end of the course, you will be able to confidently select and apply the right meshing tool and strategy for a given CFD problem, build reproducible preprocessing workflows, and generate meshes that lead to reliable and efficient OpenFOAM simulations. This course is ideal for students, researchers, and professionals who want to strengthen their meshing skills using fully open-source CFD tools.