OpenFOAM is a free open-source text based CFD – Computational Fluid Dynamics software. OpenFOAM stands for Open Field Operation and Manipulation. Nowadays, it is widely used around the world as an alternative to commercial packages on universities and established companies.
1. Is OpenFOAM free?
The simple answer to that question is: Yes.
OpenFOAM is available for free without any restrictions. This question is probably most frequently asked by people who just came across OpenFOAM: “Is an OpenFOAM really a free CFD software?”, often followed by “Could it be any good since it’s free.” This question is not that surprising given the fact that the commercial solutions are unbelievably expensive, reaching in some cases tens of thousands of dollars. To answer the latter question, we need to dive a little bit into the subject, but let’s start with the history first on how it all came to be.
2. OpenFOAM origins
OpenFOAM was originated at Imperial College London in the late ‘80s, early ‘90s under the project named FOAM (Field Operation and Manipulation). Among many other contributors over the years it is worth to mention Henry Weller the main Architect and Principal Developer from the beginnings to the present day.
On December 10, 2004 commercial code formerly known as FOAM changed its name to OpenFOAM, this way marking it’s new identity – open source. This day it has been released under GNU General Public License.
3. OpenFOAM applications
OpenFOAM code is a collection of libraries and applications written in C++ programming language. The applications can be divided into three groups: preprocessing, solvers and postprocessing.
Preprocessing
Set of tools allowing for importing the mesh, generating the mesh using different kind of meshers:
- BlockMesh
- SnappyHexMesh
- FoamyHexMesh
OpenFOAM meshers listed above are performing operations like converting tetrahedral cells to polyhedral, creating cell zones (sub region of mesh) using specified geometry as a selection tool, checking mesh quality, and others.
Solvers
Solver in OpenFOAM is an console application that loads the data and configuration stored inside case directory and using specified numerical method solves given physical problem. Each solver application is designed for solving specific physical problem, like:
- incompressible steady state single phase flow,
- two phase flow
- supersonic flow
- adjoint optimization, and many others
Therefore when you think of OpenFOAM as CFD tool you should consider it as a collection of different applications suitable for specific task.
Postprocessing
Postprocessing tools are also a collection of small console application that are designed to compute specific data basing on current solution stored in case directory. The subset tools allows user for example to:
- extract results on some section plane
- generate streamlines
- compute y+ at walls
- compute heat transfer coefficient at given wall
- calculate flow rate at specified boundary and many others
The result might be presented just as text output in the console or written as discrete numerical data inside the case director for loading in third-party tools (e. g. ParaView)
4. OpenFOAM libraries
OpenFOAM is also a collection of libraries. While applications are usually suitable for end user engineer the OF libraries are very useful for developers. OpenFOAM libraries makes a very good framework for developing a new solver by utilizing the same data structures, tools for reading and writing data, running code in parallel etc.
Also OF as a whole is written in a way that lets you easily extend some functionality within the framework. For instance you project might require custom boundary condition. To do this you just copy and modify existing boundary condition code and register it in the list of available boundary conditions. From now on you will be able to use your custom boundary condition under existing solvers. The same approach applies to many other parts of the framework, like custom sources (heat/momentum), mesh motion function, turbulence models and so on.
5. OpenFOAM advantages
The most obvious advantage of using OpenFOAM is definitely the lack of licensing costs, which can make a huge difference to your budget. Among the others there is also a wide range of applications.
OpenFOAM advatages:
- no license costs
- wide range of CFD applications and models ready to use
- open code
- Friendly syntax for partial differential equations
- Fully documented source code
- Unstructured polyhedral grid capabilities
- Automatic parallelization of applications written using OpenFOAM high-level syntax
6. OpenFOAM disadvatages
Probably the biggest disadvantage (challenge) of OpenFOAM is the lack of an integrated GUI (Graphical User Interface), combined with fragmented and poor documentation it is making OpenFOAM very difficult to start with especially for the beginners.
OpenFOAM disadvantages:
- lack of the integrated OpenFOAM GUI
- poor and fragmented documentation
- steep learning curve