[Table of Contents][Index][Version 4 | Version 3]

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>/run where <USER> is the account login name. 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 blockMesh pre-processing tool, case setup and running OpenFOAM solvers and post-processing using ParaView. Those users with access to third-party post-processing tools supported in OpenFOAM have an option: either they can follow the tutorials using ParaView; or refer to the description of the use of the third-party product in chapter 6 when post-processing is required.

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 icoFoam cases are stored within a subdirectory incompressible/icoFoam, 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 . 

© 2011-2016 OpenFOAM Foundation
CC-NC-ND 3.0