╔═══════════════════════════════════════════════════════════════╗
║ OpenFOAM Tutorials & Learning Hub ║
║ From Zero to CFD — A Hands-On Journey ║
╚═══════════════════════════════════════════════════════════════╝
OpenFOAM Tutorials & Learning Hub
A complete, self-study curriculum for learning Computational Fluid Dynamics (CFD) with OpenFOAM — from first principles to production-grade simulations.
Whether you're a student encountering CFD for the first time, an engineer switching from commercial solvers, or a researcher looking for a structured OpenFOAM reference — this repository has you covered. It combines 12 in-depth theory notes with 13 progressively challenging simulation projects so you can learn by reading and doing.
Version and Example Scope
The project launchers source OpenFOAM Foundation 6 (/opt/openfoam6/etc/bashrc).
The notes explain that classic solver/dictionary interface; later Foundation
releases and OpenCFD releases can use different solver names, model dictionaries,
and boundary-condition syntax. A larger version number is not a guarantee that
a case runs unchanged. Use the project launcher’s matching environment or port
and verify the case explicitly.
The notes preserve illustrative k-epsilon and snappyHexMesh alternatives. The
current NACA project uses Spalart–Allmaras with Gmsh, as documented in the
checked reference-case table.
Each guide has a section index and previous/next links. Numerical examples are
teaching estimates; use the project files and validation scope when running them.
Table of Contents
Why This Repository?
Most OpenFOAM resources fall into one of two traps: they're either too theoretical (pages of equations with no hands-on work) or too cookbook-style (copy-paste commands with no understanding). This repository bridges that gap:
| What You Get |
Why It Matters |
| 📚 12 Theory Notes |
Understand the why behind every setting and parameter |
| 🔬 13 Simulation Projects |
Build real muscle memory by running actual CFD cases |
| 📈 Progressive Difficulty |
Start with laminar cavity flow, finish with multiphase & rotating machinery |
| 🧩 Cross-Referenced |
Notes link to projects; projects reference the theory they rely on |
| 🐳 Docker-Ready |
Get running in minutes without dependency headaches |
Repository Structure
OpenFoam-Tutorials/
│
├── notes/ ← 📚 Theory & Reference (12 comprehensive guides)
│ ├── 01_short_intro_to_cfd.md CFD fundamentals & governing equations
│ ├── 02_openfoam_cases.md Case structure & setup workflow
│ ├── 03_openfoam_dictionaries.md Dictionary format & key dictionaries
│ ├── 04_meshing.md blockMesh, snappyHexMesh, mesh quality
│ ├── 05_boundary_conditions.md BC types, initial conditions & physical meaning
│ ├── 06_turbulence_models.md RANS, LES, DNS & model selection
│ ├── 07_parallelization.md Domain decomposition, MPI & scaling
│ ├── 08_cfl_number.md CFL concept, stability & time stepping
│ ├── 09_linear_solvers.md Solvers, preconditioners & convergence
│ ├── 10_icofoam_solver_analysis.md PISO algorithm & source code walkthrough
│ ├── 11_viscosity_models.md Newtonian & non-Newtonian viscosity models
│ └── 12_multiphase_flows.md VOF method, interFoam & multiphase setup
│
├── projects/ ← 🔬 Hands-On Simulations (13 projects)
│ ├── 01_lid_driven_cavity/ Classic benchmark — icoFoam, blockMesh
│ ├── 02_elbow/ Curved pipe flow — Fluent mesh import
│ ├── 03_flow_around_cylinder/ External flow — Gmsh mesh, pimpleFoam
│ ├── 04_naca_airfoil_analysis/ Airfoil aerodynamics — Spalart-Allmaras, Gmsh mesh
│ ├── 05_heated_pipe_flow/ Heated turbulent pipe flow — buoyantSimpleFoam
│ ├── 06_ahmed_body_aerodynamics/ Automotive aero — k-omega SST
│ ├── 07_backward_facing_step/ Vortex shedding behind a step — 2D LES, pimpleFoam
│ ├── 08_dam_break/ Multiphase VOF — interFoam
│ ├── 09_wind_turbine_blade/ Rotating machinery — 3-blade VAWT, sliding AMI mesh
│ ├── 10_mixing_t_junction/ Thermal mixing — buoyantSimpleFoam
│ ├── 11_boat_hull_fixed/ Fixed hull in water — interFoam + snappyHexMesh
│ ├── 12_boat_hull_floating/ Floating body dynamics — interFoam + 6-DoF
│ └── 13_window_ventilation/ Open versus tilted window — buoyancy + air replacement
│
├── tools/
│ └── make_reel.py ← 🎬 Vertical reels/shorts from any finished case
│
├── document.pdf ← 📄 Supplementary reference document
├── LICENSE ← ⚖️ MIT License
└── README.md ← 📖 You are here
Learning Path
Follow this roadmap from left to right. Each stage builds on the previous one.
🟢 BEGINNER 🟡 INTERMEDIATE 🔴 ADVANCED
┌──────────────────────┐ ┌──────────────────────┐ ┌──────────────────────┐
│ │ │ │ │ │
│ 📚 Notes 01–03 │ │ 📚 Notes 04–07, │ │ 📚 Notes 08–10 │
│ ───────────────── │ │ 11–12 │ │ ───────────────── │
│ • CFD Fundamentals │ │ ───────────────── │ │ • CFL & Stability │
│ • Case Structure │────────▶│ • Meshing │───────▶│ • Linear Solvers │
│ • Dictionaries │ │ • Boundary Conds. │ │ • icoFoam Deep Dive │
│ │ │ • Turbulence Models │ │ │
│ │ │ • Parallelization │ │ │
│ │ │ • Viscosity Models │ │ │
│ │ │ • Multiphase Flows │ │ │
├──────────────────────┤ ├──────────────────────┤ ├──────────────────────┤
│ │ │ │ │ │
│ 🔬 Projects │ │ 🔬 Projects │ │ 🔬 Projects │
│ ───────────────── │ │ ───────────────── │ │ ───────────────── │
│ 01 Lid-Driven │ │ 03 Cylinder Flow │ │ 06 Ahmed Body │
│ Cavity │ │ 04 NACA Airfoil │ │ 07 Backward Step │
│ 02 Elbow Flow │ │ 05 Heated Pipe │ │ 08 Dam Break (VOF) │
│ │ │ │ │ 09 Wind Turbine │
│ │ │ │ │ 10 T-Junction Mix │
│ │ │ │ │ 11 Boat Hull Fixed │
│ │ │ │ │ 12 Boat Hull Float │
│ │ │ │ │ │
└──────────────────────┘ └──────────────────────┘ └──────────────────────┘
Est. 1–2 weeks Est. 2–3 weeks Est. 3–4 weeks
💡 Tip: Don't skip the theory notes! Understanding why a setting exists is the difference between debugging a simulation in 10 minutes vs. 10 hours.
📚 Notes Overview
Twelve self-contained guides covering every major concept you'll need. Read them in order for the best experience, or jump to a specific topic as a reference.
| # |
Note |
Key Topics |
Level |
| 01 |
A Short Introduction to CFD |
Navier-Stokes equations, CFD vs other approaches, CFD tools, finite volume method, discretization |
🟢 Beginner |
| 02 |
OpenFOAM Cases |
Case directory structure (0/, constant/, system/), setup workflow, running a case |
🟢 Beginner |
| 03 |
OpenFOAM Dictionaries |
Dictionary syntax, controlDict, fvSchemes, fvSolution, transportProperties |
🟢 Beginner |
| 04 |
Meshing |
blockMesh fundamentals, snappyHexMesh workflow, mesh quality metrics, refinement strategies |
🟡 Intermediate |
| 05 |
Boundary & Initial Conditions |
Initial conditions, Dirichlet/Neumann types, fixedValue, zeroGradient, inlet/outlet, wall functions |
🟡 Intermediate |
| 06 |
Turbulence Models |
RANS vs LES vs DNS, k-epsilon, k-omega SST, model selection guidelines, y+ requirements |
🟡 Intermediate |
| 07 |
Parallelization |
Domain decomposition methods, decomposePar, MPI execution, scaling, reconstructPar |
🟡 Intermediate |
| 08 |
CFL Number |
Courant-Friedrichs-Lewy condition, stability criteria, adaptive time stepping, maxCo |
🔴 Advanced |
| 09 |
Linear Solvers |
PCG, PBiCGStab, GAMG, preconditioners, tolerance settings, convergence troubleshooting |
🔴 Advanced |
| 10 |
icoFoam Solver Analysis |
PISO algorithm step-by-step, C++ source code walkthrough, pressure-velocity coupling |
🔴 Advanced |
| 11 |
Viscosity Models |
Newtonian & non-Newtonian fluids, power-law, Bird-Carreau, Herschel-Bulkley, transportProperties |
🟡 Intermediate |
| 12 |
Multiphase Flows |
Volume of Fluid (VOF), interFoam, surface tension, alpha field, setFields, multiphase setup |
🟡 Intermediate |
🔬 Projects Overview
Thirteen simulation projects arranged by increasing complexity. Each project directory contains the complete OpenFOAM case structure ready to run.
| # |
Project |
Description |
Solver |
Mesh |
Turbulence |
Level |
| 01 |
Lid-Driven Cavity |
The "Hello World" of CFD — a square cavity with a moving top wall. Validates against Ghia et al. benchmark data. |
icoFoam |
blockMesh |
Laminar |
🟢 Beginner |
| 02 |
Elbow |
Flow through a curved pipe elbow. Demonstrates importing a Fluent mesh into OpenFOAM and post-processing in ParaView. |
icoFoam |
Fluent import |
Laminar |
🟢 Beginner |
| 03 |
Flow Around a Cylinder |
External flow past a circular cylinder at Re = 200. Introduces importing an externally generated Gmsh mesh (gmshToFoam), vortex shedding and drag/lift/Strouhal evaluation. |
pimpleFoam |
Gmsh import |
Laminar |
🟡 Intermediate |