User Guide Chapter 2 Tutorials

From OpenFOAMWiki

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 they have installed OpenFOAM correctly.

The tutorial cases describe the use of the blockMesh pre-processing tool, case setup and running OpenFOAM solvers and post-processing using paraFoam. Those users with access to third-party post-processing tools supported in OpenFOAM have an option: either they can follow the tutorials using paraFoam; 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 subdirectories by solver, e.g. all the icoFoam cases are stored within a subdirectory icoFoam. It is strongly recommended that the user copy the tutorials directory into their local run directory. If not, they can be easily copied by typing:

     mkdir -p $FOAM RUN
     cp -r $FOAM TUTORIALS $FOAM RUN



2.1 Lid-driven cavity flow


This tutorial will describe how to pre-process, run and post-process a case involving isothermal, incompressible flow in a two-dimensional square domain. The geometry is shown in Figure 2.1 in which all the boundaries of the square are walls. The top wall moves in the x-direction at a speed of 1 m/s while the other 3 are stationary. Initially, the flow will be assumed laminar and will be solved on a uniform mesh using the icoFoam solver for laminar, isothermal, incompressible flow. During the course of the tutorial, the effect of increased mesh resolution and mesh grading towards the walls will be investigated. Finally, the flow Reynolds number will be increased and the turbFoam solver will be used for turbulent, isothermal, incompressible flow. </p>


2.1.1 Pre-processing