PhD course in CFD with OpenSource software, 2007


The course gives an introduction to the use of OpenSource software for CFD applications. A major project work in OpenFOAM (see the short description below) forms a large part of the course. The project may be defined according to the student's special interests. The result of the project should be a detailed tutorial for a specific application of OpenFOAM. The tutorials will be peer-reviewed and graded by the students, and the tutorials thus form a part of the course. The tutorials will be made available as OpenSource, as a contribution to the OpenFOAM community. To pass the course the student must do the project and peer-review the tutorials from the other projects.

The course homepage is

OpenFOAM (Open Field Operation and Manipulation, is developed and distributed by OpenCFD ( OpenFOAM is an object oriented C++ toolbox for solving various systems of partial differential equations using the finite volume method on arbitrary control volume shapes and configurations. It includes preprocessing (grid generator, converters, manipulators, case setup), postprocessing (using OpenSource Paraview), and many specialized CFD solvers are implemented. The features in OpenFOAM are comparable to what is available in the major commercial CFD codes. Some of the more specialized features that are included in OpenFOAM are: sliding grid, moving meshes, two-phase flow (Langrange, VOF, Euler-Euler) and fluid-structure interaction. The strength of OpenFOAM is however the object-oriented approach to generating specialized solvers, utilities and libraries, using a flexible set of C++ modules. OpenFOAM runs in parallel using automatic/manual domain decomposition, and the parallelism is integrated at a low level so that solvers can generally be developed without the need for any parallel-specific coding. Due to the distribution as an OpenSource code it is possible to gain control over the exact implementations of different features, which is essential in research work. It also makes development and tailoring of the code for the specific application possible. In addition to the source code, OpenFOAM gives access to an international community of OpenFOAM researchers through the discussion board at the OpenFOAM home page.

First occasion

Lectures and hands-on workshop
October 18, 10-17, MT11
October 19, 9-17, MT11
Lunch 12-13 on your own expence
Home work: Practice using OpenFOAM yourself


UserGuide, Chapter 1-2 (and some more)
Download source and binary files from OpenCFD and run
Download source files from OpenCFD, patch, compile and run
UserGuide, chapter 3 (and some more)

Second occasion

Lectures and hands-on workshop
December 13, 10-15, MT11
December 13, 15-17, Gamma (Rasmus Hemph will show how to use Python, VTK and OpenFOAM together)
December 14, 9-17, MT11
Lunch 12-13 on your own expence
Home work: Develop a new tutorial, which should be presented at the third occasion.


Syllabus (The same as at the first occasion)
Additions to the first occasion
Implement application
Implement turbulence model
Implement boundary condition
Basics of C++

Invited speaker

Files from Rasmus Hemph: Slides,
Recommended Python book: "Python Scripting for Computational Science" by Hans Petter Langtangen.

Third occasion

March 27, 10-17, MT11
March 28, 9-17, MT11
Lunch 12-13 on your own expence
Student presentations and hands-on workshop
Invited OpenFOAMers presentations and hands-on workshop
Home work: Peer-review all developed tutorials, and improve your own tutorial according to the peer-reviews you get

Invited speakers

Final, peer-reviewed, student-contributed tutorials

These files should at least work for OF-1.4.1 or OF-1.4.1-dev at the student computers in the Mechanical Engineering building at Chalmers, at the time of the third occasion of this course.

Project suggestions

(Most of these topics have been discussed a lot in the forum, so it should be possible to find all the answers there)

Highlights from the Wiki

Rhie and Chow in OpenFOAM, by Fabian Peng Kärrholm
A conjugate heat transfer tutorial

Other notes

See my notes on how to use OpenFOAM at Ada.


The OpenFOAM homepage.
The OpenFOAM Wiki homepage.
The OpenFOAM-extend project homepage.
A C++ introduction,and Example files.
Introduction to object-oriented programming using C++