FOAMY Lectures

CFD Lectures with OpenFOAM

by Dr. Cuneyt Sert

Lecture 1. Introduction

1.1 What is OpenFOAM?

OpenFOAM is a software framework (or toolbox) that you can use to develop Finite Volume Method based solvers for general continuum mechanics problems, mostly for fluid flow and heat transfer. It is a huge library of about 1.5 million lines of C++ code located in hundreds of files. You can use this toolbox to develop Computational Fluid Dynamics (CFD) solvers. You can use it to develop incompressible and compressible flow solvers for steady and unsteady problems. You can write solvers for single phase or multiphase flows, isothermal flows or flows with heat transfer, solvers with fixed or moving boundaries, maybe with fluid-structure interaction, maybe using rotating reference frames. You can develop solvers to simulate combustion, elasticity or electromagnetics. Once the toolbox with the necessary ingredients is there, the choices are endless, and you can do whatever you want with it. The following image taken from Chris Greenshield's OpenFOAM Open Dev 2018 talk shows the general structure of OpenFOAM.

alt text

"FOAM" stands for Field Operation And Manipulation. Thermofluidic transport problems involving fluid mechanics and heat transfer are called “field” problems because we are interested in calculating the velocity, pressure, density, temperature, concentration, etc. fields. The history of OpenFOAM goes back to late 1980s, to the research work of several graduate students in Prof. David Gosman's team at Imperial College, London, where it was being called just FOAM. Interestingly, today, Prof. Gosman has no relation with OpenFOAM, because he'd decided to walk on a different track, a commercial one, and founded CD-Adapco, the company that developed the popular CFD software STAR-CD and Star-CCM+, which are currently being developed and sold by Siemens.

The "Open" part of the name is due to the fact that, today OpenFOAM is a free and open source software (FOSS). It was released as such and started to be called OpenFOAM after 2004. It is free in two different senses, which are the main principles of GNU General Public License (GPLv3), the license used by OpenFOAM.

People use OpenFOAM in mainly two different ways

1.2 The OpenFOAM Ecosystem

When you buy a commercial CFD software, it probably comes with an initial training, together with version update rights and technical support for a certain period. You usually get access to a customer portal where you can find extra learning resources, and user forums for discussion and help. Being an open source software, OpenFOAM's ecosystem is somewhat different. It involves Developers and Distributors:
As of today, OpenFOAM is being developed and released by the following three different groups.
The historical perspective of the current situation is a bit complicated. If you are interested in it, you can have a look at this or this.

alt text The company OpenCFD, which is today a part of the ESI Group, develops and distributes OpenFOAM since 2005. They currently hold the OpenFOAM trademark. They release two versions each year, first in June and then in December. Their latest release as of this writing is 25.06, released on the 6th month of year 2025. Their version numbering is based on the release date. Their next release will be 25.12, expected to come out on December of 2025. They started to use this versioning scheme after year 2016, and before that the releases were like 1.0, 2.0, etc. In 2016, their version number suddenly jumped from 3.0 to 16.06, possibly to differentiate themselves from the other distributors, that we will talk about below. If you find an old OpenFOAM tutorial on the net, which says that it is based on a release 2.0, they are talking about an old OpenCFD release.

OpenCFD releases OpenFOAM under the GPLv3 license. Their source codes are kept here, where it is called OpenFOAM-plus. Plus? Yes. Up to year 2016 they were calling it OpenFOAM+, but then they decided to drop the "plus". Like any other GPL licensed open source software, you can download these source files, compile them, report bugs if you notice any, modify the codes if you want, share your modifications with the developers to be included in the next release, or re-distribute them on your own, even maybe under a different name such as NextFOAM. Yes you can do that if you want. The license allows that.

OpenCFD's OpenFOAM development efforts are governed by a steering committee and several technical committees. There, you can find people from automobile companies such as Volkswagen or General Motors and people from academia. OpenCFD offers paid engineering consulting, training services.

alt text The OpenFOAM Foundation and the company behind it, CFD Direct, also develop and distribute OpenFOAM through their site openfoam.org since 2014. The main figure behind this development is Dr. Henry Weller, who is considered by many as the creator of FOAM. He is still actively developing code for OpenFOAM. He was one of the founders of the OpenCFD company in 2004, but then left it to found CFD Direct in 2014.


CFD Direct releases a new version each year. Their latest version, as of this writing, is 13, released in July 2025. Their source files are kept at GitHub and just like the case for OpenCFD, you can download these sources freely and do whatever you want with them as long as you do not violate the license.

To keep their development efforts sustainable, CFD Direct asks for the monetary support of their users through fund-raising activities under the OpenFOAM Foundation umbrella. Also they offer paid support, training and cloud computing services all over the world. Similar to OpenCFD's policy, the software is again free, but unfortunately training is not.

The above mentioned two groups seem to be the most active developers and distributors of OpenFOAM. But there is one more.

alt text Prof. Hrvoje Jasak of Zagreb University, who is one of the original developers of FOAM and the founder of Wikki Ltd., has been releasing OpenFOAM under the name foam-extend since it was first open sourced in 2004. Its lastest version, as of this writing, is 5.0 released in 2025. Here are their source files. You can also get paid OpenFOAM training from Prof. Jasak.


User Community:
Like in any open source software project, the user community of OpenFOAM is quite special. Freedoms brought them together and they try to overcome the difficulties together. They got a high quality product freely and they feel the responsibility of giving back to the community, in one way or another. Helping each other becomes especially important when the official documentation is somewhat incomplete. They do this in various ways, such as by preparing tutorials, forming local user groups, preparing and sharing online course materials, answering questions in forums, or setting up wiki pages. Users can also report bugs that they encounter, correct these bugs if they can, or develop new solvers and utilities and share them with the core developers to be included in their upcoming releases.

Third Party Companies:
As OpenFOAM increased its popularity over the years and gained the respect of users, companies other than the core developers listed above were established to make money out of it. Today there are several small companies offering training, engineering consulting and cloud computing services. Examples are alt text

1.3 Which OpenFOAM Should We Use?

It is hard to tell exactly what the differences in these different OpenFOAM releases developed by OpenCFD, CFD Direct and Wikki are. Their core part, coming from the "FOAM years", should be the same. Unfortunately they got separated and become more and more different with each version. Over the years, and especially after the separation of CFD Direct from OpenCFD in 2014, different code developers and communities added different features to their releases. Sometimes, these changes were major such as CFD Direct's introduction of the non-conformal coupling feature in their 10th release in year 2022 or the introduction of the concept of "modular solvers" in their 11th version in 2023.

It is possible to see the changes made in the latest versions of OpenCFD's, CFD Direct's and Wikki's releases,
here, here, and here. The details in these pages are not important for us at this point, but as you can see, different groups keep adding different features and capabilities to their codes. Looks like that some of the changes made in one branch can get the chance of being included in another in a future release. In Wikki's release 5.0 notes, there is a part titled as Main differentiators between foam-extend and OpenFOAM which says;

"A large number of features have been lost within the release of OpenFOAM since version 1.3, the code base has shrunk by more than 40%. While we understand the lack of technical ability of supporting advanced CFD features, we feel that existing features and specifically large-scale contributions should remain active and developed further. Below is a list of main features of foam-extend which are lacking, lost, deactivated or unusable in ESI releases: ..." (followed by a long list of such features)


Free and open source community is proud of their licenses, which allow and actually encourage the creation of branches and alternatives. If you are not happy with the code, just fork it, modify it and redistribute it. Alternatives are good, but it may lead to fragmentation, which by some, in different contexts, is considered to be a negativity.

So, which one should you choose today? The answer depends on what you want to do with OpenFOAM.

1.4 Advantages and Disadvantages of Using OpenFOAM

In my opinion, here are the main advantages and disadvantages of using OpenFOAM.

Advantages: Disadvantages: For many individuals or small companies with limited or no budget, cost may be the biggest concern in choosing a CFD software. For some others, like larger companies that just want a working tool for the task, cost may not be a concern at all. They may be after a proven technology with good, quick technical support when it is necessary. It is very difficult for such companies to switch from a popular commercial CFD software that they have been using for years to an open source one. This is stated by the following quite interesting phenomenon known as the 9x Effect

"... whether or not a high-tech product succeeds can be explained by the “9x Effect”. In a very small nutshell, the 9x effect says that a potential user of a new product will underweight by a factor of three the benefits of a new product, and overweight by the same factor the costs of giving up their current solution. Human beings evaluate new things relative to the status quo, and we are risk averse (we exaggerate the cost of a loss in our minds). So if a new product is to succeed, it better be nine times better than the current solution."


Many companies and practicing engineers are not interested in code development/modification at all. They do not have the time or the resources for that. OpenFOAM being open source is of no value for them. The steep learning curve, the absence of a GUI and poor documentation are headaches for them.

For researchers who develop code and do hard core CFD, having access to the source code is a must, and they value OpenFOAM mostly for that. When making a choice, they question how well-documented the source code is and how open it is for future development. OpenFOAM's code is praised for having good extensibility qualities, but its programmer’s guide is considered to be weak. Experienced code developers may find the programming paradigms used in it such as object-oriented programming, operator overloading or template meta-programming beautiful, but for the newcomers, these may make understanding the codes and going deep into them difficult. Researchers do not care much about having no GUI because they may actually think that working inside a terminal window is more productive. Research involves experimenting with new ideas, and with an open source code with insufficient documentation, researchers will have to experiment a lot. They consider it to be a part of the research process.

For me as a FOSS enthusiast and an academician,

1.5 The Issue of Having No Graphical User Interface (GUI)

All commercial CFD software come with a GUI, like many other software we use, with windows, menus, buttons, check boxes, text entries, etc. In that GUI, they usually have built-in CAD capabilities for geometry creation or the software integrates seamlessly with full featured third party CAD software. The GUI is also used for mesh generation, setting up the problem parameters, boundary conditions and solver options, adjusting the material properties, monitoring the progress of the solution and post-processing the results. All of this sounds quite natural. But OpenFOAM is not your ordinary CFD software. With OpenFOAM we mostly work inside a terminal window (command line) editing text files, which can be a bit difficult and annoying at first.



The parts that require the most GUI support are drawing the problem geometry, generating the mesh and post-processing the results. Unless the problem geometry is too simple to be handled by the pre-processing utilities of OpenFOAM, you need to draw it using a third party CAD software. We have several alternatives here, some of them being free and open source ones (
SALOME or FreeCAD). OpenFOAM comes with mesh generation utilities, but they do not have a GUI. Instead they are used from the command line. It is also possible to generate the mesh using a third party software (again we have free and open source alternatives such as Gmsh or SALOME). OpenFOAM comes with necessary mesh conversion utilities. For setting problem parameters, material properties, boundary conditions, solver settings, etc., we need to use text files and it is actually not as difficult as it sounds. And we of course need a GUI for post-processing. Paraview is the standard tool for this, but there are again alternatives such as VisIt.

OpenFOAM’s lack of GUI is considered to be a show stopper by many people. Several CFD enthusiasts and companies tried to come up with a solution for this. The ones listed below are some of the free choices, but they are generally considered to be primitive and not used frequently There are also more mature, non-free alternatives such as the following ones. Some of these are web based services where the CFD is done inside a browser, either on your local computer or on the cloud.

1.6 And What About Using Linux?

Almost all of my undergraduate students use Windows operating system on their personal computers. Some use macOS, but almost none use Linux. Many students not even heard of the Linux operating system. But like almost all FOSS, developed by scientists or engineers to be used by the scientific and engineering communities, OpenFOAM is also being developed and mostly used under Linux. Linux is its home. But today, it is possible to create a Linux like environment inside Windows or macOS to use OpenFOAM. Therefore, those who do not want to switch their operating system to a new one just for OpenFOAM do not need to do that. But at the end, they should be learning how to do things up to a certain extent in a new environment. I believe that this enforcement is not a downside but instead an advantage of using OpenFOAM. It gives you a chance to taste Linux and the command line. We will talk about these details in the next lecture.

1.7 Are There Other Software Similar to OpenFOAM?

There are several free and open source CFD software. Most of these are developed in academia or in research institutions with specific research intentions, not as general purpose solvers. Don’t get this wrong, they do what they are intended to do nicely. They may solve certain types of problems faster and/or more accurate than OpenFOAM, or some of them may solve problems that OpenFOAM cannot. Some examples are alt text






< TOC    Next Lecture >