OpenFOAM

From ACENET
Jump to: navigation, search
Achtung.png Legacy documentation

This page describes a service provided by a retired ACENET system. Most ACENET services are currently provided by national systems, for which please visit https://docs.computecanada.ca.


Description
The OpenFOAM (Open Field Operation and Manipulation) CFD Toolbox is a free, open source CFD software package. OpenFOAM has an extensive range of features to solve anything from complex fluid flows involving chemical reactions, turbulence and heat transfer, to solid dynamics and electromagnetics.
Modulefile
openfoam
Documentation
OpenFOAM homepage and Tutorials.
Notes
OpenFOAM 2.2.1 includes ParaView 3 and the PV3Readers module. It also contains Swak4foam OF 2.2.
OpenFOAM 2.3.x includes ParaView 4 and the PV4Readers module.
Usage
OpenFOAM requires substantial preparation of your environment. In order to run OpenFOAM commands (such as paraFoam, blockMesh, etc), you must load a modulefile followed by sourcing a configuration script.
Here is an example of a serial submission script for OpenFOAM 2.3.0:
#$ -cwd
#$ -l h_rt=01:00:00

module purge
module load gcc/4.6.4 openmpi/gcc openfoam/2.3.0
source $OPENFOAM/etc/bashrc

blockMesh
icoFoam
Here is an example of a parallel submission script for OpenFOAM 2.3.0:
#$ -cwd
#$ -l h_rt=01:00:00
#$ -pe ompi* 4

module purge
module load gcc/4.6.4 openmpi/gcc openfoam/2.3.0
source $OPENFOAM/etc/bashrc

blockMesh
mpirun icoFoam -parallel
Mesh preparation (blockMesh) may be fast enough to be done at the command line (see Head Node Policies). The solver (icoFoam and others) is usually the most expensive step and should always be submitted as a Grid Engine job except in very small test cases or tutorials.
Performance
OpenFOAM can emit a lot of debugging information in very frequent small writes (e.g. hundreds per second). This may lead to poor performance on our network file systems. If you are in stable production and don't need the debug output, you can reduce or disable it with:
$ mkdir -p $HOME/.OpenFOAM/$WM_PROJECT_VERSION
$ cp $WM_PROJECT_DIR/etc/controlDict $HOME/.OpenFOAM/$WM_PROJECT_VERSION/
followed by editing the debugSwitches dictionary in $HOME/.OpenFOAM/$WM_PROJECT_VERSION/controlDict, changing flags from values >0 to 0. (Contribution from C. Lane)