Contributor

This chapter was written and developed by Federica Scolari Federica Scolari

OpenFOAM#

https://www.openfoam.com/themes/bs4esi/img/openfoam-logo.png (Open Field Operation and Manipulation) is a free, open source CFD software developed primarily by OpenCFD Ltd since 2004. OpenFOAM is a C++ toolbox that can be used to deploy Finite Volume Method (FVM)-based solvers for general continuum mechanics problems, mostly for fluid flow and heat transfer.

OpenFOAM has a wide range of functions, such as:

  • The ability to simulate anything related to CFD, such as turbulent flows in automotive aerodynamics, fires and fire suppression in buildings, combustion, chemical reactions, heat transfer, liquid sprinklers, or films.

  • It includes tools for dealing with complex geometries (e.g., a fish pass) and for data processing and visualization.

  • It performs parallel calculations allowing to take full advantage of modern multicore processors and multiprocessor computers through the Message Passing Interface (MPI) standard).

Requirements for this tutorial

To accomplish this tutorial, make sure that OpenFOAM is installed on you computer (see the OpenFOAM installation section). Technically, a basic understanding of the Navier-Stokes equations, specifically RANS and related turbulence closures, facilitates understanding the descriptions and assumptions made in this tutorial. And you are good to go.

Directories (OpenFOAM Folder Structure)#

Basic Directory#

The basic directory structure for an OpenFOAM case that contains the minimum set of files required to run an application is shown in Fig. 225:

case structure openfoam folder directories

Fig. 225 OpenFOAM case directory structure.#

Constant Directory#

The constant directory contains all values that remain constant during the calculation. These are files that specify the physical properties (e.g., transport properties and turbulence models). The subdirectory polyMesh contains all information concerning the mesh.

case structure openfoam files constant

Fig. 226 Example of the constant directory contents.#

System Directory#

In this directory, it is possible to modify the parameters associated with the solution procedure. It contains at least the following files:

  • controlDict including parameters like the start/end time, time step and data output are set;

  • fvSchemes where the discretization schemes can be selected;

  • fvSolution in which the parameters and solver choice are set for the run.

case structure openfoam files parameters

Fig. 227 Example of the system directory contents.#

Time Directories#

These directories contain the data files for every field of the simulation.

case structure openfoam files parameters time

Fig. 228 Example of the zero time step directory contents.#

Documentation & Further Reading#

The list below provides further sources where more information regarding OpenFOAM can be found, including tutorials and lecture notes.