[version 12][version 11][version 10][version 9][version 8][version 7][version 6]
Chapter 2 Tutorials
This chapter we describes 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 test cases are taken from the tutorials directory which contains numerous example cases in OpenFOAM. The directory location is represented by the $FOAM_TUTORIALS variable in the OpenFOAM “environment”.
The directory contains numerous cases that demonstrate the use of all the solver modules, other solvers and many utilities supplied with OpenFOAM. Most examples are stored in sub-directories corresponding to each of the modular solvers. For example, the cases that use the incompressibleFluid module are stored in $FOAM_TUTORIALS/incompressibleFluid. The user can explore these example cases, starting by listing the top-level of the $FOAM_TUTORIALS directory, by typing in a terminal
ls $FOAM_TUTORIALS
The OpenFOAM environment includes a $FOAM_RUN variable which represents a directory in the user’s file system at $HOME/OpenFOAM/<USER>-12/run where <USER> is the account login name and “12” is the OpenFOAM version number. The directory provides a recommended location to store and run simulation cases. The examples presented in this chapter will be copied into the run directory. The user should check whether the directory exists by typing
ls $FOAM_RUN
mkdir -p $FOAM_RUN
Any example case from $FOAM_TUTORIALS can then be copied into the run directory. For example to try the motorBike example for the incompressibleFluid solver module, the user can copy it to the run directory by typing:
cd $FOAM_RUN
cp -r $FOAM_TUTORIALS/incompressibleFluid/motorBike .
2.1.1 Pre-processing
2.1.2 Mesh generation
2.1.3 Viewing the mesh
2.1.4 Boundary and initial conditions
2.1.5 Physical properties
2.1.6 Momentum transport
2.1.7 Control
2.1.8 Discretisation and linear-solver settings
2.1.9 Running an application
2.1.10 Time selection in ParaView
2.1.11 Colouring surfaces
2.1.12 Cutting plane (slice)
2.1.13 Vector plots
2.1.14 Popular filters in ParaView
2.1.15 Contours
2.1.16 Streamline plots
2.1.17 Inlet boundary condition
2.1.18 Turbulence model
2.2 Breaking of a dam
2.2.1 Mesh generation
2.2.2 Boundary conditions
2.2.3 Phases
2.2.4 Setting initial fields
2.2.5 Fluid properties
2.2.6 Gravity
2.2.7 Turbulence modelling
2.2.8 Time step control
2.2.9 Discretisation schemes
2.2.10 Linear-solver control
2.2.11 Running the code
2.2.12 Post-processing
2.2.13 Running in parallel
2.2.14 Post-processing a case run in parallel
2.3 Stress analysis of a plate with a hole
2.3.1 Mesh generation
2.3.2 Boundary and initial conditions
2.3.3 Physical properties
2.3.4 Control
2.3.5 Discretisation schemes and linear-solver control
2.3.6 Running the code
2.3.7 Post-processing