Your ABC in fluid dynamics

Course offering, 21-22 November 2019

Registration deadline: 20 October 2019

OpenSource CFD for industry

– high-level development:

Implementations with the OpenFOAM(R) technology and C++

The use of OpenSource CFD in industry and academia has been growing rapidly the last decade. Many industries use it as a complement to the proprietary CFD tools, in order to reduce license costs and facilitate the usage of large computational resources. Some industries, and academia, use it because it facilitates the development of new functionalities throughout the entire code, without the limitation of specific modifications through user-defined functions. However, OpenSource CFD tools generally require more knowledge by the user than the proprietary alternatives. This is not necessarily a drawback, since although the proprietary alternatives are easier to use, the user should still have the same knowledge of the underlying methods in order to set up the simulations correctly and to assess the quality of the results.

Preliminary syllabus:


The present course is the second of two courses (2+2 days), teaching high-level development using the OpenFOAM technology and C++. It covers the directory and code organization, and how to implement new applications and libraries such as solvers, turbulence models and boundary conditions. A crash-course in C++ gives a basic understanding of the code syntax and object orientation. The course is given as a hands-on workshop. The basic procedures are shown using a projector, and time is left for the participants to follow on their own laptop (brought by the participant – installation instructions will be provided before the start of the course). The course language is English.


After the course, the participant should be able to:

  • Understand the OpenFOAM source code directory structure
  • Understand C++ syntax and object orientation
  • Read OpenFOAM code and figure out its functionality
  • Find OpenFOAM implementation examples in the source code
  • Implement and compile new solvers and utilities, based on the OpenFOAM technology
  • Implement and compile new libraries, based on the OpenFOAM technology
  • Use a debugger while implementing new code
  • Continue learning using the installed code


The course is useful for engineers and researchers who are interested in Computational Fluid Dynamics with OpenSource software. It focuses on how to do high-level implementations in OpenFOAM, and it is assumed that the participant already has a basic knowledge of the underlying theories of CFD. It is assumed that the participant has a very limited knowledge in C++ and object orientation. A significant part of the course is to learn how to continue learning, i.e. how to learn from the installed code also after course.

If you are interested in taking the course you should send an e-mail to, and you will be put in a list that will be used for further information and for future announcements. You may at any time ask to be removed from that list.


Registration and fee

Register by sending a mail to The registration fee is SEK10200(+VAT, if applicable), which includes course material as well as lunches and coffee. Supply full invoice details with the registration (name, title, company, address, country, phone, e-mail, VAT number for EU/EFTA, organisationsnummer for swedish participants). Deadline for registration is one month before the start of each course (see top of page). Cancellation can not be made after the deadline for registration, but the registration can be transferred to someone else.

There is a minimum (6) and maximum (16) number of participants. The course will be cancelled if the minimum number of participants is not reached at the registration deadline. A confirmation that the course will take place (or not) will be communicated four weeks before the start of the course, so do not make any reservations that can’t be cancelled before that confirmation. You will be notified immediately if the course is full.

If you gather a group of at least 6 participants the course may possibly be given at other times. Then it will be given as last time it was “officially” given, using the same material and software versions as at that time. We could as well discuss trainings on-site. Send an e-mail to if you are interested.


Prerequisites and preparations

  • Fluid Dynamics and CFD: You ideally have some knowledge in Fluid Dynamics and CFD.
  • Linux, OpenFOAM and Paraview: You have skills and knowledge similar to those gained in the course OpenSource CFD for industry – basic usage. You are proficient in command-line Linux usage. You know how to run the basic OpenFOAM tutorials, how the cases are organized, how to pre and post-process using OpenFOAM utilities, and how to make graphical representations of the results with Paraview/paraFoam.
  • Programming: You have a basic knowledge in programming, but not necessarily in C++ and object orientation.
  • Software: You should have Linux and OpenFOAM (with its third-party packages, such as Paraview) installed on your own laptop before the course, and bring the laptop for the course. There are no computers supplied. I will provide installation instructions as we get closer to the start of the course. The installation can be done under e.g. VirtualBox, so that you don’t have to change your current operating system. Since you work on your own laptop you will be able to work directly in your own environment, and to continue learning after the end of the course.


Schedule and Contents

  • Day, 09:15-17:00:


  • Syllabus and introduction
  • OpenFOAM source code directory structure
  • High-level programming and compilation of applications (solvers and utilities):

Implement three solvers: Electromagnetic field around a conductor, Add a scalar transport equation to icoFoam, Add solid particles to interFoam.

  • A crash-course in C++, from an OpenFOAM perspective

10:30-10:45: Coffee

12:00-13:00: Lunch

14:30-14:45: Coffee

  • Day 2, 08:00-15:00:


  • Continuation of the crash-course in C++
  • A detailed look inside the icoFoam solver
  • High-level programming and compilation of libraries:

Implementation of a new turbulence model, based on an existing one

Implementation of a new boundary condition, based on an existing one

  • Debugging OpenFOAM implementations

10:00-10:15: Coffee

11:30-12:30: Lunch

14:00-14:15: Coffee


Preliminary contents slide (click to see it enlarged):








The course is given by Prof. Håkan Nilsson. Read about me under About.



Accommodation is not included.

For those of you travelling to the course, here are some suggested hotels:

1.Normal standard:

City Hotel

Hotel Royal

Hotel Vasa AB

Hotel Flora AB

2. High standard:

Quality Hotel Panorama

Hotel Opalen

Hotell Liseberg Heden

Hotel Novotel

Grand Hotel Opera AB

Hotel Riverton AB

3. Very high standard:

Hotel Avalon

Elite Plaza Hotel

4. Cheap alternatives:

Youth Hostel Stigbergsliden

Hotel Nice B&B

5. Other:

Info from go:teborg&company

More hotels



OPENFOAM® is a registered trade mark of OpenCFD Limited, the producer of the OpenFOAM software. This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM® and OpenCFD® trade marks




September 23, 2017

A first version of the homepage is being set up.

© Copyright. All Rights Reserved.