From Documentation
Revision as of 22:27, 10 August 2014 by Isaac (Talk | contribs)

Jump to: navigation, search
Description: open source CFD software package
SHARCNET Package information: see OPENFOAM software page in web portal
Full list of SHARCNET supported software


OpenFOAM is a free, open source CFD software package produced by a commercial company, OpenCFD Ltd ( It has a large user base across most areas of engineering and science, from both commercial and academic organisations.


Due to a variety of versions with third party installation for each group/user, SHARCNET does not provide the module for this software and instead we support the users to install his or her own version in the user's working directory. If you need a support for installation, please see below for instance or open a ticket for the help.

Version Selection

As of July 2014, version 2.3.0 is the latest version.


Here is a short instruction about how to install the package. Here the package is installed in /work/$USER.

0. Make directory

[isaac@orc-login2:/work/isaac] mkdir OpenFOAM

1. Download the package (source + third party) and unzip the package

[isaac@orc-login2:/work/isaac] cd OpenFOAM
[isaac@orc-login2:/work/isaac/OpenFOAM] wget
[isaac@orc-login2:/work/isaac/OpenFOAM] wget
[isaac@orc-login2:/work/isaac/OpenFOAM] tar zxvf OpenFOAM-2.3.0.tgz
[isaac@orc-login2:/work/isaac/OpenFOAM] tar zxvf ThirdParty-2.3.0.tgz

2. Check the module environment and change into

[isaac@orc-login2:/work/isaac/OpenFOAM] cd OpenFOAM-2.3.0
[isaac@orc-login2:/work/isaac/OpenFOAM/OpenFOAM-2.3.0] module list
Currently Loaded Modulefiles:
 1) torque/2.5.13            3) intel/12.1.3             5) mkl/10.3.9               7) ldwrapper/1.1
 2) moab/7.1.1               4) openmpi/intel/1.6.2      6) sq-tm/2.5                8) user-environment/2.0.1
[isaac@orc-login2:/work/isaac/OpenFOAM/OpenFOAM-2.3.0] module switch intel/12.1.3 gcc/4.8.2
[isaac@orc-login2:/work/isaac/OpenFOAM/OpenFOAM-2.3.0] module switch openmpi/intel/1.6.2 openmpi/gcc/1.8.1
[isaac@orc-login2:/work/isaac/OpenFOAM/OpenFOAM-2.3.0] module list
Currently Loaded Modulefiles:
 1) torque/2.5.13            3) gcc/4.8.2                5) mkl/10.3.9               7) ldwrapper/1.1
 2) moab/7.1.1               4) openmpi/gcc/1.8.1        6) sq-tm/2.5                8) user-environment/2.0.1

3. Change basic environment script for OpenFOAM

[isaac@orc-login2:/work/isaac/OpenFOAM/OpenFOAM-2.3.0] vi etc/bashrc
45 #foamInstall=$HOME/$WM_PROJECT
46 foamInstall=/work/$USER/$WM_PROJECT
[isaac@orc-login2:/work/isaac/OpenFOAM/OpenFOAM-2.3.0] source etc/bashrc

4. Submitting a job to compile

[isaac@orc-login2:/work/isaac/OpenFOAM/OpenFOAM-2.3.0] sqsub -r 1d -o log -e err --mpp=4G /work/isaac/OpenFOAM/OpenFOAM-2.3.0/Allwmake

Submitting Parallel Jobs

Before submitting a job, you should load the appropriate working environment by

[isaac@orc-login1:~] source /work/isaac/OpenFOAM/OpenFOAM-2.3.0/etc/bashrc

You may setup an alias to load the working environment by inserting the following into '~/.bashrc'

[isaac@orc-login1:~] vi .bashrc

alias of23='source /work/isaac/OpenFOAM/OpenFOAM-2.3.0/etc/bashrc'

To submit a job,

sqsub -q mpi -n {No of Subdomains} -r {Run Time Required} -o {Log File} -e {error reporting file} --mpp {mem required per processor} 
{OpenFOAM Solver} -parallel

Pre/Post Processing

Since all SHARCNET machines are targeted to run the CPU-intensive jobs, all Pre- and Post-processing has to be done via our Visualization machines.

Isaacs-MacBook-iPro:~ isaac$ ssh -Y

Instead of paraFoam, there is the 'Paraview' installed in our visualization machines. To run it, simply type

[isaac@localhost:/work/isaac/OpenFOAM/isaac-2.3.0/run/tutorials/incompressible/icoFoam/cavity] paraview

Note that the grid generation 'blockMesh' must be done in the main cluster and paraview is only used to check the grid and results.


o OpenFOAM Homepage