[version 12][version 11][version 10][version 9][version 8][version 7][version 6]
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
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 .
2.1.1 Pre-processing
2.1.2 Viewing the mesh
2.1.3 Running an application
2.1.4 Post-processing
2.1.5 Increasing the mesh resolution
2.1.6 Introducing mesh grading
2.1.7 Increasing the Reynolds number
2.1.8 High Reynolds number flow
2.1.9 Changing the case geometry
2.1.10 Post-processing the modified geometry
2.2 Stress analysis of a plate with a hole
2.2.1 Mesh generation
2.2.2 Running the code
2.2.3 Post-processing
2.2.4 Exercises
2.3 Breaking of a dam
2.3.1 Mesh generation
2.3.2 Boundary conditions
2.3.3 Setting initial field
2.3.4 Fluid properties
2.3.5 Turbulence modelling
2.3.6 Time step control
2.3.7 Discretisation schemes
2.3.8 Linear-solver control
2.3.9 Running the code
2.3.10 Post-processing
2.3.11 Running in parallel
2.3.12 Post-processing a case run in parallel