ICHEC Software
Information about software packages installed on the ICHEC systems.
OpenFOAM
Versions Installed
Stokes: 1.6-ext / 1.7.1 / 2.0.1 / 2.1.0 / 2.1.1
Stoney: 2.0.1 / 2.1.1
Description
OpenFOAM is an open source package for finite-volume based solution of problems in continuum mechanics, primarily Computational Fluid Dynamics (CFD). OpenFOAM is supplied with several standard solvers for different classes of flow problems, including multiphase flow and combustion. The object-oriented C++ implementation of OpenFOAM facilitates the development of custom flow solvers.
License
OpenFOAM is available under the terms of the GNU General Public License.
Benchmarks
N/A.
Job Submission Example
Like other jobs on ICHEC systems, OpenFOAM jobs must be submitted using a PBS script. The following is an example PBS script for running the motorBike tutorial in parallel over 12 cores (1 node) on Stokes for a maximum walltime of 2 hours. Note that OpenFOAM employs domain decomposition for parallel runs which is defined geometrically by decomposeParDict in the system directory. Each processor must be assigned a portion of the mesh on which to operate. For the case below, the corresponding decomposeParDict, the default shipped with the source, defines 6 regions. The solvers can therefore only be run over 6 cores. To vary this, the decomposeParDict must be edited accordingly.
More detailed information on running OpenFOAM in parallel can be found here.
If you wish to run this job on the Stoney system, the following script should be modified to use 8 cores on 1 node, i.e. nodes=1:ppn=8 and mpiexec -np 6 accordingly.
#PBS -l nodes=1:ppn=12
#
#PBS -l walltime=02:00:00
#PBS -N myJobName
#PBS -A MyProjectName
#PBS -o outputFileName
#PBS -e errorFileName
module purge
module load openfoam/X.Y.Z
source /ichec/packages/OpenFOAM/OpenFOAM-X.Y.Z/etc/bashrc
cd $PBS_O_WORKDIR
echo "Starting at "
date
cp -r 0.org/ 0
# copy motorbike surface from resources folder
cp $FOAM_TUTORIALS/resources/geometry/motorBike.obj.gz constant/triSurface/
blockMesh >> blockMesh.log
decomposePar >> decomposePar.log
mpiexec -np 6 snappyHexMesh -overwrite >> snappyHexMesh.log
mpiexec -np 6 potentialFoam -parallel -noFunctionObjects -writep >> potentialFoam.log
mpiexec -np 6 simpleFoam -parallel >> simpleFoam.log
reconstructParMesh -mergeTol 1.0e-6 -constand >> reconstructParMesh.log
reconstructPar >> reconstructPar.log
echo "Run completed at "
date
This job can be submitted using the command
where scriptname.pbs is the filename of the sample PBS script
Setting Environment Variables
Frequent OpenFOAM users will know that the custom linux environment is set by sourcing the bashrc contained within the source code. However, to ensure full capability of OpenFOAM the user will need to set the $WORK path before sourcing the bashrc. This is done with a command similar to
Post-Processing
OpenFOAM comes with its own build of Paraview which it imports case data to using the paraFoam module. Paraview is built, as part of the OpenFOAM/2.1.1 module, on the login nodes of Stokes but we advise users to simply create the reader module using
then transfer their case data to their local machine using a utility such as scp or sshfs. Not only will this prevent the shared login nodes from becoming clogged, but also allow for faster rendering as there will not be any live data transfer.
Additional Notes
Further information can be obtained from the OpenFOAM Foundation Website www.openfoam.org.
