Page tree
Skip to end of metadata
Go to start of metadata

OpenFOAM is a free, open source FVM software that features extensive range of solvers ranging from complex fluid flows involving chemical reactions, turbulence and heat transfer, to acoustics, solid mechanics and electromagnetics. See details here.

Usage

A typical use of OpenFOAM would require setting up both your case file, e.g. explicitly defining the domain decomposition of mesh and field, and your job submission script. The method of parallel computing used by OpenFOAM is known as domain decomposition, in which the geometry and associated fields are broken into pieces and allocated to separate processors for solution. It normally requires explicitly definition of, e.g. numberOfSubdomains and method


Make sure explicit definition of the domain decomposition is made in the case file before the job submission and the definition is consistent with the number of CPUs requested in the job submission script.


You will need to load the OpenFOAM module in your shell environment in the following way:

module load OpenFOAM

to get the default version. To load the specific version of 4.1 do

module load OpenFOAM/4.1

See our modules help doco for more details.

An example job submission script (openFoam_job.sh) is provided below. It requests 32 processors, 64GB of memory, 400GB of local disk space, and 10 hours of walltime for the job. This script should be saved in the working directory from which the analysis will be done. Note that the submission script uses the PBS software resource flag -l software=OpenFOAM. To change the number of processors, memory, or jobfs required, simply modify the appropriate PBS resource requests at the top of this file.

#!/bin/bash
#PBS -l ncpus=32
#PBS -l mem=64GB
#PBS -l jobfs=400GB
#PBS -l walltime=10:00:00
#PBS -l software=openFOAM
#PBS -l wd

# Unload modules. 
module rm openmpi intel-cc intel-fc

# Load modules.
module load OpenFOAM/4.1
mpirun <foamExec> <otherArgs> -parallel > $PBS_JOBID.log

Replace the <foamExec> with the executable, such as icoFoam, and <otherArgs> with the actually arguments passing to the executable that you are using.

To run the job you would use the command

qsub openFoam_job.sh


We suggest that you carefully go through the OpenFOAM's user guide before any job submissions to Raijin. The user guide pdf files are available on Raijin under the corresponding installation directories.