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

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


Introduction

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

OpenFOAM in SHARCNET

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.

Installation

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 http://downloads.sourceforge.net/foam/OpenFOAM-2.3.0.tgz?use_mirror=mesh
[isaac@orc-login2:/work/isaac/OpenFOAM] wget http://downloads.sourceforge.net/foam/ThirdParty-2.3.0.tgz?use_mirror=mesh
[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
...
85 #export WM_MPLIB=OPENMPI
86 export WM_MPLIB=SYSTEMOPENMPI
...
106 #foamOldDirs="$FOAM_INST_DIR $WM_PROJECT_SITE $HOME/$WM_PROJECT/$USER"
107 foamOldDirs="$FOAM_INST_DIR $WM_PROJECT_SITE /work/$USER/$WM_PROJECT/$USER"
...
135 #export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION
136 export WM_PROJECT_USER_DIR=/work/$USER/$WM_PROJECT/$USER-$WM_PROJECT_VERSION
[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

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

References

o OpenFOAM Homepage
http://www.openfoam.org/