Skip to content

NimaSam/OpenFOAM_tutorials

Repository files navigation

OpenFOAM Tutorials

This repository contains the tutorial cases used with the book OpenFOAM Training Through Problem Solving. The examples cover incompressible flow, two-phase flow, heat transfer, conjugate heat transfer, rotating machinery, OpenFOAM programming, free-surface hydraulics, combustion, urban wind flow, and particle flow.

Current Structure

Folder Role Status
OpenFOAM-9/ Main tutorial set aligned with the current book text Canonical
OpenFOAM-10/ Partial migration of selected chapters In progress
OpenFOAM-3.0.1/, OpenFOAM-4/, OpenFOAM-5/, OpenFOAM-7/, OpenFOAM-8/ Older case snapshots Historical
Extra_tutorials/ Additional examples outside the main chapter sequence Supplementary
Movies/ Output videos and animations Reference media
swak4Foam/ Supporting swak4Foam material Optional dependency

OpenFOAM-9/ should be treated as the first place to update when the book content changes. Older release folders should be changed only when intentionally maintaining compatibility.

Chapter Index

Chapter Case Main solver or topic Canonical path
1 cavityInPipe icoFoam OpenFOAM-9/chapter1/cavityInPipe
2 ellipsoidal interFoam OpenFOAM-9/chapter2/ellipsoidal
3 elbow buoyantSimpleFoam OpenFOAM-9/chapter3/elbow
4 multiRegionHeater chtMultiRegionFoam OpenFOAM-9/chapter4/multiRegionHeater
4 multiRegionHeaterFine chtMultiRegionFoam OpenFOAM-9/chapter4/multiRegionHeaterFine
5 propeller simpleFoam with MRF OpenFOAM-9/chapter5/propeller
6 heatedCavity Heat-transfer case setup OpenFOAM-9/chapter6/heatedCavity
6 icoHeatFoam Custom solver programming OpenFOAM-9/chapter6/icoHeatFoam
7 spillWay interFoam OpenFOAM-9/chapter7/spillWay
8 coFlowFlame2D reactingFoam OpenFOAM-9/chapter8/coFlowFlame2D
9 pitzDaily3D XiFoam OpenFOAM-9/chapter9/pitzDaily3D
10 coarse, fine Urban wind flow with simpleFoam OpenFOAM-9/chapter10
11 denseParticleFoam Particle flow in cyclone OpenFOAM-9/chapter11/denseParticleFoam

The machine-readable version of this index is kept in tutorials.yml.

Requirements

The recommended learning environment is Ubuntu LTS with OpenFOAM installed from the official distribution packages. For the canonical cases, install OpenFOAM 9:

sudo apt-get install git

Then follow the OpenFOAM 9 installation instructions:

https://openfoam.org/download/9-ubuntu/

Some cases use swak4Foam features. Install it only for chapters or variants that require it:

https://openfoamwiki.net/index.php/Installation/swak4Foam/Downloading#swak4Foam_development_version

Running a Case

From inside a case folder:

./Allclean
./Allrun

Most case folders follow the standard OpenFOAM layout:

0/
constant/
system/
Allrun
Allclean

Some chapters contain parent-level scripts that run more than one subcase. For example, chapter 10 has coarse and fine case folders plus a parent Allrun.

Maintenance Workflow

  1. Update the canonical OpenFOAM-9/ case first.

  2. Record the change in tutorials.yml when the case structure, solver, or dependency changes.

  3. Run the structure checker:

    tools/check_tutorials.sh
  4. Migrate the change to OpenFOAM-10/ only after the canonical case is clear.

  5. Treat older OpenFOAM release folders as archived compatibility references.

Citation

Please cite and refer to the guidebook whenever you use this material:

http://dx.doi.org/10.13140/RG.2.2.25519.61601

About

Learn OpenFOAM by doing tutorials

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages