Chapter 2 Tutorials

In this chapter we shall describe in detail the process of setup, simulation and post-processing for some OpenFOAM test cases, with the principal aim of introducing a user to the basic procedures of running OpenFOAM. The $FOAM_TUTORIALS directory contains many more cases that demonstrate the use of all the solvers and many utilities supplied with OpenFOAM.

Before attempting to run the tutorials, the user must first make sure that OpenFOAM is installed correctly. Cases in the tutorials will be copied into the so-called run directory, an OpenFOAM project directory in the user’s file system at $HOME/OpenFOAM/<USER>-6/run where <USER> is the account login name and “6” is the OpenFOAM version number. The run directory is represented by the $FOAM_RUN environment variable enabling the user to check its existence conveniently by typing


    ls $FOAM_RUN
If a message is returned saying no such directory exists, the user should create the directory by typing


    mkdir -p $FOAM_RUN

The tutorial cases describe the use of the meshing and pre-processing utilities, case setup and running OpenFOAM solvers and post-processing using ParaView.

Copies of all tutorials are available from the tutorials directory of the OpenFOAM installation. The tutorials are organised into a set of directories according to the type of flow and then subdirectories according to solver. For example, all the simpleFoam cases are stored within a subdirectory incompressible/simpleFoam, where incompressible indicates the type of flow. The user can copy cases from the tutorials directory into their local run directory as needed. For example to run the pitzDaily tutorial case for the simpleFoam solver, the user can copy it to the run directory by typing:


    cd $FOAM_RUN
    cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .
OpenFOAM v8 User Guide - Chapter 2 Tutorials
CFD Direct