From Documentation
Jump to: navigation, search
 
(43 intermediate revisions by 6 users not shown)
Line 1: Line 1:
==What is OpenFoam?==
+
{{Template:CCDelete}}
OpenFOAM is a free, open source CFD software package produced by a commercial company, OpenCFD Ltd (http://www.openfoam.com/).  It has a large user base across most areas of engineering and science, from both commercial and academic organisations.
+
{{Template:GrahamUpdate}}
 +
{{Software
 +
|package_name=OPENFOAM
 +
|package_description=open source CFD software package
 +
|package_idnumber=117
 +
}}
  
==OpenFoam v2.0.x Installation==
+
==Introduction==
  
It appears that the 2.0.1 official version has a bug preventing it from compiling on our systems, but the most up-to date, git version (2.0.x) does compile. The instructions below are for our newer systems (orca, saw, hound, kraken). If compiled on one of them, it should also work on the rest without any changes.
+
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.  
  
===Preliminary steps===
+
===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.
  
Assuming we want to compile OpenFOAM on global work, the following steps should be done.
+
==Version Selection==
 +
As of Feb 2017, version 4.1 is the latest version.
  
First, we create the environment, by executing these commands (you only have to do it once, for the compilation; for using OpenFOAM, these commands will be added in the OpenFOAM bashrc file, as described below):
+
==Installation==
 +
Here is a short instruction about how to install the package. Here the package is installed in /work/$USER.
  
module unload compile
+
0. Make directory
module unload intel
+
module unload openmpi/intel
+
module load gcc/4.3.4
+
module load openmpi/gcc/1.4.2
+
  
Next, we create the root OpenFOAM directory, and go there:
+
[isaac@orc-login2] cd /work/$USER
 +
[isaac@orc-login2] mkdir OpenFOAM
  
mkdir /work/$USER/OpenFOAM
+
1. Download the package (source + third party) and unzip the package
cd /work/$USER/OpenFOAM
+
  
Then we download, unpack, compile and install the package "flex", which is needed for OpenFOAM compilation:
+
[isaac@orc-login2] cd OpenFOAM
 +
[isaac@orc-login2] wget http://dl.openfoam.org/source/5-0
 +
[isaac@orc-login2] tar zxvf 5-0
 +
[isaac@orc-login2] mv OpenFOAM-5.x-version-5.0 OpenFOAM-5.0
 +
[isaac@orc-login2] wget http://dl.openfoam.org/third-party/5-0
 +
[isaac@orc-login2] tar zxvf 5-0.1
 +
[isaac@orc-login2] mv ThirdParty-5.x-version-5.0 ThirdParty-5.0
  
wget http://prdownloads.sourceforge.net/flex/flex-2.5.35.tar.gz
+
2. Download 'boost' and 'CGAL'
tar xvzf flex-2.5.35.tar.gz
+
cd flex-2.5.35
+
./configure --prefix=/work/$USER/OpenFOAM/flex
+
make
+
make install
+
  
===Getting and preparing the OpenFOAM packages===
+
[isaac@orc-login2] wget https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.10.1/CGAL-4.10.1.tar.xz
 +
[isaac@orc-login2] wget https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz
 +
[isaac@orc-login2] cd ThirdParty-5.0
 +
[isaac@orc-login2] tar zxvf ../boost_1_65_1.tar.gz
 +
[isaac@orc-login2] tar xf ../CGAL-4.10.1.tar.xz
  
Getting the third party packages (currently for the 2.0.1 version):
+
3. Setting up the compilation configuration
  
  cd /work/$USER/OpenFOAM
+
  [isaac@orc-login2] cd /work/$USER/OpenFOAM/OpenFOAM-5.0/etc
wget http://downloads.sourceforge.net/foam/ThirdParty-2.0.1.gtgz
+
  [isaac@orc-login2] vi bashrc
  tar xvzf ThirdParty-2.0.1.gtgz
+
mv ThirdParty-2.0.1 ThirdParty-2.0.x
+
  
Getting the up-to-date OpenFOAM package from the git repository:
+
This file is the core file to setup all relevant working/compilation variables in OpenFOAM. It has been known that OpenFOAM is working well with Gcc compiler + OpenMPI. Here is an example to change modules and change 'HOME' directory to install by setting the new location as 'NEWHOME'. Don't forget to change all 'HOME' variable in the file have to be changed into 'NEWHOME' in the following setup.
  
git clone git://github.com/OpenFOAM/OpenFOAM-2.0.x.git
 
cd OpenFOAM-2.0.x
 
git pull
 
 
Now we should edit the etc/bashrc file (inside the OpenFOAM-2.0.x subdirectory), by adding these lines to the very top of the file:
 
 
module unload compile
 
 
  module unload intel
 
  module unload intel
  module unload openmpi/intel
+
  module unload openmpi
  module load gcc/4.3.4
+
module unload python
  module load openmpi/gcc/1.4.2
+
  export FOAM_VERBOSE=1
+
  module load gcc/6.3.0
 +
  module load openmpi/gcc630-std/2.1.1
 +
  export NEWHOME=/work/$USER
  
Further in the same file, change the value assigned to the foamInstall variable:
 
  
foamInstall=/work/$USER/$WM_PROJECT
+
Furthermore, you also need to comment out the following two lines
  
Comment - if you plan to share OpenFOAM between a few group members, in the above line you have to substitute "$USER" with the actual login name of the user where OpenFOAM is being installed.
+
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
 +
#
 +
# FOAM_INST_DIR is the location of the OpenFOAM installation which defaults to
 +
# the directory containing this file if sourced by a bash shell.
 +
#
 +
# Please set to the appropriate path if the default is not correct.
 +
#
 +
'''#[ $BASH_SOURCE ] && \'''
 +
'''#export FOAM_INST_DIR=$(cd ${BASH_SOURCE%/*/*/*} && pwd -P) || \'''
 +
export FOAM_INST_DIR=$NEWHOME/$WM_PROJECT
  
Finally, find the line in etc/bashrc which starts with "export WM_MPLIB=", and change it to
+
Since we use different version of CGAL and boost from what is installed in system. '''Two''' files need to be modified as followed.
  
  export WM_MPLIB=SYSTEMOPENMPI
+
  [isaac@orc-login2] cd ThirdParty-5.0
 +
[isaac@orc-login2] sed -i -e 's=boost-system=boost-1_65_1=' makeCGAL
 +
[isaac@orc-login2] sed -i -e 's=cgal-system=CGAL-4.10.1=' makeCGAL
 +
[isaac@orc-login2] cd ../OpenFOAM-5.0/etc/config.sh
 +
[isaac@orc-login2] sed -i -e 's=boost-system=boost-1_65_1=' CGAL
 +
[isaac@orc-login2] sed -i -e 's=cgal-system=CGAL-4.10.1=' CGAL
  
Next, we add these lines to the bottom (but before the comment "# cleanup environment:") of the file etc/config/settings.sh :
+
Finally, we need to '''source''' the bashrc file
  
  FLEX=${WM_PROJECT_INST_DIR}/flex
+
  [isaac@orc-login2] source /work/$USER/OpenFOAM/OpenFOAM-5.0/etc/bashrc
_foamAddPath ${FLEX}/bin
+
_foamAddLib ${FLEX}/lib
+
  
===Compilation===
+
We can make sure the setup by checking environment variables as shown
  
Go to the OpenFOAM root directory:
+
[isaac@orc-login2] env |grep WM
 +
WM_LINK_LANGUAGE=c++
 +
WM_ARCH=linux64
 +
WM_COMPILER_TYPE=system
 +
WM_OSTYPE=POSIX
 +
WM_THIRD_PARTY_DIR=/work/isaac/OpenFOAM/ThirdParty-5.0
 +
WM_CXXFLAGS=-m64 -fPIC -std=c++0x
 +
WM_CFLAGS=-m64 -fPIC
 +
WM_PROJECT_VERSION=5.0
 +
WM_COMPILER_LIB_ARCH=64
 +
WM_PROJECT_INST_DIR=/work/isaac/OpenFOAM
 +
WM_CXX=g++
 +
WM_PROJECT_DIR=/work/isaac/OpenFOAM/OpenFOAM-5.0
 +
WM_LABEL_OPTION=Int32
 +
WM_PROJECT=OpenFOAM
 +
WM_LDFLAGS=-m64
 +
WM_COMPILER=Gcc
 +
WM_MPLIB=SYSTEMOPENMPI
 +
WM_CC=gcc
 +
WM_COMPILE_OPTION=Opt
 +
WM_DIR=/work/isaac/OpenFOAM/OpenFOAM-5.0/wmake
 +
WM_LABEL_SIZE=32
 +
WM_PROJECT_USER_DIR=/work/isaac/OpenFOAM/isaac-5.0
 +
WM_OPTIONS=linux64GccDPInt32Opt
 +
WM_PRECISION_OPTION=DP
 +
WM_ARCH_OPTION=64
  
cd /work/$USER/OpenFOAM/OpenFOAM-2.0.x
+
4. Build boost
  
and execute there
+
[isaac@orc-login2] cd /work/isaac/OpenFOAM/ThirdParty-5.0/boost_1_65_1
 +
[isaac@orc-login2] ./bootstrap.sh
 +
[isaac@orc-login2] ./b2
  
source etc/bashrc
+
4. Submitting a job to compile
  ./Allwmake
+
  [isaac@orc-login2] sqsub -r 1d -o log -e err --mpp=4G /work/isaac/OpenFOAM/OpenFOAM-5.0/Allwmake
  
Attention: there is a small problem with the OpenFOAM not being able to find the flex header file, FlexLexer.h . The workaround is to let "Allwmake" run for a while (it should finish compiling in the ThirdParty-2.0.x subdirectory, and start compiling in the OpenFOAM-2.0.x subdirectory), then kill it by pressing Ctrl-C one ore more times, and execute the following command:
+
==Submitting Parallel Jobs==
  
ln -s /work/$USER/OpenFOAM/flex/include/FlexLexer.h /work/$USER/OpenFOAM/OpenFOAM-2.0.x/src/OpenFOAM/lnInclude/FlexLexer.h
+
Before submitting a job, you should load the appropriate working environment by
  
and then run Allwmake for the second time:
+
[isaac@orc-login2] source /work/isaac/OpenFOAM/OpenFOAM-4.1/etc/bashrc
  
./Allwmake
+
You may setup an alias to load the working environment by inserting the following into '~/.bashrc'
  
This time it should run without generating many error messages for a long time (many hours), until OpenFOAM is completely built.
+
[isaac@orc-login2] vi .bashrc
 +
 +
alias of41='source /work/isaac/OpenFOAM/OpenFOAM-4.1/etc/bashrc'
  
===Using the compiled OpenFOAM===
+
To submit a job,
  
Every time you or your group member wants to use the compiled OpenFOAM, s/he has to first execute
+
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
  
source /work/$USER/OpenFOAM/OpenFOAM-2.0.x/etc/bashrc
+
==Pre/Post Processing==
  
where "$USER" has to correspond to the user who installed the package.
+
===BlockMesh===
  
 +
To generate the grid, you may want to run the 'blockMesh'. Here is the example for cavity case in incompressible solver,
  
==OpenFoam v1.7 Installation==
+
<pre>
 +
[isaac@orc-login2:/work/isaac/OpenFOAM/isaac-2.3.0/run/tutorials/incompressible/icoFoam/cavity] blockMesh
 +
/*---------------------------------------------------------------------------*\
 +
| =========                |                                                |
 +
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
 +
|  \\    /  O peration    | Version:  2.3.0                                |
 +
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
 +
|    \\/    M anipulation  |                                                |
 +
\*---------------------------------------------------------------------------*/
 +
Build  : 2.3.0-6b88e07ba67e
 +
Exec  : blockMesh
 +
Date  : Aug 12 2014
 +
Time  : 00:47:49
 +
Host  : "orc-login2"
 +
PID    : 23077
 +
Case  : /gwork/isaac/OpenFOAM/isaac-2.3.0/run/tutorials/incompressible/icoFoam/cavity
 +
nProcs : 1
 +
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
 +
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
 +
allowSystemOperations : Disallowing user-supplied system call operations
  
===Module loading===
+
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 +
Create time
  
In this installation, Gcc compiler is used in conjunction with Openmpi. So, you should load appropriate modules like
+
Creating block mesh from
 +
    "/gwork/isaac/OpenFOAM/isaac-2.3.0/run/tutorials/incompressible/icoFoam/cavity/constant/polyMesh/blockMeshDict"
 +
Creating curved edges
 +
Creating topology blocks
 +
Creating topology patches
  
module load gcc/4.3.4
+
Creating block mesh topology
module load openmpi/gcc/1.4.2
+
  
Please note that you may have to 'unload' the default settings like
+
Check topology
  
module unload intel/11.0.083
+
Basic statistics
module unload openmpi/intel/1.4.2
+
Number of internal faces : 0
 +
Number of boundary faces : 6
 +
Number of defined boundary faces : 6
 +
Number of undefined boundary faces : 0
 +
Checking patch -> block consistency
  
===Unpacking the source files===
+
Creating block offsets
The package requires two parts; one is a main solver part and the other is a third-party. Two gtgz files can be downloaded from the website above.
+
Creating merge list .
  
[isaac@hnd50:/work/isaac/hound/builds/OpenFOAM] ls -lrt
+
Creating polyMesh from blockMesh
total 92196
+
Creating patches
-rwxr-xr-x  1 isaac isaac 38998257 Nov  3 01:27 OpenFOAM-1.7.0.gtgz
+
Creating cells
-rwxr-xr-x  1 isaac isaac 55390881 Nov  3 01:27 ThirdParty-1.7.0.gtgz
+
Creating points with scale 0.1
 +
    Block 0 cell size :
 +
        i : 0.005 .. 0.005
 +
        j : 0.005 .. 0.005
 +
        k : 0.01 .. 0.01
  
As shown, the mother directory is made in '/work/isaac/hound/builds/OpenFOAM' and unpacked all files there like;
 
  
[isaac@hnd50:/work/isaac/hound/builds/OpenFOAM] ls -lrt
+
Writing polyMesh
drwxrwxr-x 10 isaac isaac    4096 Nov  3 02:19 ThirdParty-1.7.0
+
----------------
drwxrwxr-x 10 isaac isaac    4096 Nov  9 11:46 OpenFOAM-1.7.0
+
Mesh Information
 +
----------------
 +
  boundingBox: (0 0 0) (0.1 0.1 0.01)
 +
  nPoints: 882
 +
  nCells: 400
 +
  nFaces: 1640
 +
  nInternalFaces: 760
 +
----------------
 +
Patches
 +
----------------
 +
  patch 0 (start: 760 size: 20) name: movingWall
 +
  patch 1 (start: 780 size: 60) name: fixedWalls
 +
  patch 2 (start: 840 size: 800) name: frontAndBack
  
===Setting Environment Variables===
+
End
 +
</pre>
  
The environment variable settings are contained in files in an OpenFOAM-1.7.0/etc directory in the OpenFOAM release. Basically two environment files ('bashrc' and 'settings.sh') must be adjusted to the system.  
+
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.  
  
In 'bashrc', there are some changes;
+
Isaacs-MacBook-iPro:~ isaac$ ssh -Y isaac@viz9-uwo.sharcnet.ca
  
# Installation location
+
Instead of paraFoam, there is the '[[PARAVIEW]]' installed in our visualization machines. To run it, simply type
NEWHOME=/work/isaac/hound/OpenFOAM
+
..
+
foamInstall=$NEWHOME/$WM_PROJECT
+
..
+
export WM_PROJECT_USER_DIR=$NEWHOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION
+
  
  ...
+
  [isaac@localhost:/work/isaac/OpenFOAM/isaac-2.3.0/run/tutorials/incompressible/icoFoam/cavity] paraview
# Compiler: set to Gcc, Gcc43, Gcc44, or Icc (for Intel's icc)
+
: ${WM_COMPILER:=Gcc43}; export WM_COMPILER
+
 
+
# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA | MPI | QSMPI
+
: ${WM_MPLIB:=OPENMPI}; export WM_MPLIB
+
+
# Detect system type and set environment variables appropriately
+
# 11:05, 14 February 2011 (EST)11:05, 14 February 2011 (EST)11:05, 14 February 2011 (EST)11:05, 14 February 2011 (EST)11:05, 14 February 2011 (EST)11:05, 14 February 2011 (EST)11:05, 14 February 2011 (EST)11:05, 14 February 2011 (EST)11:05, 14 February 2011 (EST)11:05, 14 February 2011 (EST)11:05, 14 February 2011 (EST)11:05, 14 February 2011 (EST)~~
+
export WM_ARCH=`uname -s`
+
 
+
case $WM_ARCH in
+
Linux)
+
    WM_ARCH=linux
+
   
+
    # compiler specifics
+
    case `uname -m` in
+
      ...
+
+
        64)
+
            WM_ARCH=linux64
+
            export WM_COMPILER_LIB_ARCH=64
+
            export WM_CC='/opt/sharcnet/gcc/4.3.4/bin/gcc'
+
            export WM_CXX='/opt/sharcnet/gcc/4.3.4/bin/g++'
+
            ...
+
 
+
In 'settings.sh',
+
 
+
# Select compiler installation
+
# 11:05, 14 February 2011 (EST)11:05, 14 February 2011 (EST)11:05, 14 February 2011 (EST)11:05, 14 February 2011 (EST)11:05, 14 February 2011 (EST)[[User:Isaac|Isaac]]
+
# compilerInstall = OpenFOAM | system
+
 
+
    if [ -n "$gcc_version" ]
+
    then
+
        gccDir=/opt/sharcnet/gcc/4.3.4
+
 
+
# Communications library
+
# 11:05, 14 February 2011 (EST)11:05, 14 February 2011 (EST)11:05, 14 February 2011 (EST)11:05, 14 February 2011 (EST)~~
+
       
+
unset MPI_ARCH_PATH MPI_HOME
+
           
+
case "$WM_MPLIB" in
+
OPENMPI)   
+
    mpi_version=openmpi-1.4.2
+
    export MPI_ARCH_PATH=/opt/sharcnet/openmpi/current/gcc
+
       
+
    # Tell OpenMPI where to find its install directory
+
    export OPAL_PREFIX=$MPI_ARCH_PATH
+
       
+
    _foamAddPath    $MPI_ARCH_PATH/bin
+
    _foamAddLib    $MPI_ARCH_PATH/lib
+
    _foamAddMan    $MPI_ARCH_PATH/man
+
       
+
    export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version
+
    unset mpi_version
+
    ...
+
 
+
===User environment setup===
+
 
+
The environment variable FOAM_INST_DIR can be used to find and source the appropriate resource file. Here is a bash/ksh/sh example:
+
 
+
    * export FOAM_INST_DIR=/data/app/OpenFOAM
+
    * foamDotFile=$FOAM_INST_DIR/OpenFOAM-1.7.1/etc/bashrc
+
    * [ -f $foamDotFile ] && . $foamDotFile
+
+
and a csh/tcsh example:
+
+
    * setenv FOAM_INST_DIR /data/app/OpenFOAM
+
    * foamDotFile=$FOAM_INST_DIR/OpenFOAM-1.7.1/etc/cshrc
+
    * if ( -f $foamDotFile ) source $foamDotFile
+
  
The value set in $FOAM_INST_DIR will be used to locate the remaining parts of the OpenFOAM installation.
+
Note that the grid generation 'blockMesh' must be done in the main cluster and paraview is only used to check the grid and results. The details for paraview can be found in our wiki page[[https://www.sharcnet.ca/help/index.php/PARAVIEW]].
  
===Building the Sources===
+
==References==
  
Go to the top-level source directory $WM_PROJECT_DIR and execute the top-level build script
+
o OpenFOAM Homepage<br>
 +
http://www.openfoam.org/
  
[isaac@hnd50:/work/isaac/hound/builds/OpenFOAM/OpenFOAM-1.7.0]./Allwmake
+
<!--checked2016-->

Latest revision as of 10:34, 6 June 2019

This page is scheduled for deletion because it is either redundant with information available on the CC wiki, or the software is no longer supported.
Note: Some of the information on this page is for our legacy systems only. The page is scheduled for an update to make it applicable to Graham.


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 Feb 2017, version 4.1 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] cd /work/$USER 
[isaac@orc-login2] mkdir OpenFOAM

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

[isaac@orc-login2] cd OpenFOAM
[isaac@orc-login2] wget http://dl.openfoam.org/source/5-0
[isaac@orc-login2] tar zxvf 5-0
[isaac@orc-login2] mv OpenFOAM-5.x-version-5.0 OpenFOAM-5.0
[isaac@orc-login2] wget http://dl.openfoam.org/third-party/5-0
[isaac@orc-login2] tar zxvf 5-0.1
[isaac@orc-login2] mv ThirdParty-5.x-version-5.0 ThirdParty-5.0

2. Download 'boost' and 'CGAL'

[isaac@orc-login2] wget https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.10.1/CGAL-4.10.1.tar.xz
[isaac@orc-login2] wget https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz
[isaac@orc-login2] cd ThirdParty-5.0
[isaac@orc-login2] tar zxvf ../boost_1_65_1.tar.gz
[isaac@orc-login2] tar xf ../CGAL-4.10.1.tar.xz

3. Setting up the compilation configuration

[isaac@orc-login2] cd /work/$USER/OpenFOAM/OpenFOAM-5.0/etc
[isaac@orc-login2] vi bashrc

This file is the core file to setup all relevant working/compilation variables in OpenFOAM. It has been known that OpenFOAM is working well with Gcc compiler + OpenMPI. Here is an example to change modules and change 'HOME' directory to install by setting the new location as 'NEWHOME'. Don't forget to change all 'HOME' variable in the file have to be changed into 'NEWHOME' in the following setup.

module unload intel
module unload openmpi
module unload python

module load gcc/6.3.0
module load openmpi/gcc630-std/2.1.1
export NEWHOME=/work/$USER


Furthermore, you also need to comment out the following two lines

# USER EDITABLE PART: Changes made here may be lost with the next upgrade
#
# FOAM_INST_DIR is the location of the OpenFOAM installation which defaults to
# the directory containing this file if sourced by a bash shell.
#
# Please set to the appropriate path if the default is not correct.
#
#[ $BASH_SOURCE ] && \
#export FOAM_INST_DIR=$(cd ${BASH_SOURCE%/*/*/*} && pwd -P) || \
export FOAM_INST_DIR=$NEWHOME/$WM_PROJECT

Since we use different version of CGAL and boost from what is installed in system. Two files need to be modified as followed.

[isaac@orc-login2] cd ThirdParty-5.0 
[isaac@orc-login2] sed -i -e 's=boost-system=boost-1_65_1=' makeCGAL
[isaac@orc-login2] sed -i -e 's=cgal-system=CGAL-4.10.1=' makeCGAL
[isaac@orc-login2] cd ../OpenFOAM-5.0/etc/config.sh
[isaac@orc-login2] sed -i -e 's=boost-system=boost-1_65_1=' CGAL
[isaac@orc-login2] sed -i -e 's=cgal-system=CGAL-4.10.1=' CGAL

Finally, we need to source the bashrc file

[isaac@orc-login2] source /work/$USER/OpenFOAM/OpenFOAM-5.0/etc/bashrc

We can make sure the setup by checking environment variables as shown

[isaac@orc-login2] env |grep WM
WM_LINK_LANGUAGE=c++
WM_ARCH=linux64
WM_COMPILER_TYPE=system
WM_OSTYPE=POSIX
WM_THIRD_PARTY_DIR=/work/isaac/OpenFOAM/ThirdParty-5.0
WM_CXXFLAGS=-m64 -fPIC -std=c++0x
WM_CFLAGS=-m64 -fPIC
WM_PROJECT_VERSION=5.0
WM_COMPILER_LIB_ARCH=64
WM_PROJECT_INST_DIR=/work/isaac/OpenFOAM
WM_CXX=g++
WM_PROJECT_DIR=/work/isaac/OpenFOAM/OpenFOAM-5.0
WM_LABEL_OPTION=Int32
WM_PROJECT=OpenFOAM
WM_LDFLAGS=-m64
WM_COMPILER=Gcc
WM_MPLIB=SYSTEMOPENMPI
WM_CC=gcc
WM_COMPILE_OPTION=Opt
WM_DIR=/work/isaac/OpenFOAM/OpenFOAM-5.0/wmake
WM_LABEL_SIZE=32
WM_PROJECT_USER_DIR=/work/isaac/OpenFOAM/isaac-5.0
WM_OPTIONS=linux64GccDPInt32Opt
WM_PRECISION_OPTION=DP
WM_ARCH_OPTION=64

4. Build boost

[isaac@orc-login2] cd /work/isaac/OpenFOAM/ThirdParty-5.0/boost_1_65_1
[isaac@orc-login2] ./bootstrap.sh
[isaac@orc-login2] ./b2

4. Submitting a job to compile

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

Submitting Parallel Jobs

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

[isaac@orc-login2] source /work/isaac/OpenFOAM/OpenFOAM-4.1/etc/bashrc

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

[isaac@orc-login2] vi .bashrc

alias of41='source /work/isaac/OpenFOAM/OpenFOAM-4.1/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

BlockMesh

To generate the grid, you may want to run the 'blockMesh'. Here is the example for cavity case in incompressible solver,

[isaac@orc-login2:/work/isaac/OpenFOAM/isaac-2.3.0/run/tutorials/incompressible/icoFoam/cavity] blockMesh 
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 2.3.0-6b88e07ba67e
Exec   : blockMesh
Date   : Aug 12 2014
Time   : 00:47:49
Host   : "orc-login2"
PID    : 23077
Case   : /gwork/isaac/OpenFOAM/isaac-2.3.0/run/tutorials/incompressible/icoFoam/cavity
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Creating block mesh from
    "/gwork/isaac/OpenFOAM/isaac-2.3.0/run/tutorials/incompressible/icoFoam/cavity/constant/polyMesh/blockMeshDict"
Creating curved edges
Creating topology blocks
Creating topology patches

Creating block mesh topology

Check topology

	Basic statistics
		Number of internal faces : 0
		Number of boundary faces : 6
		Number of defined boundary faces : 6
		Number of undefined boundary faces : 0
	Checking patch -> block consistency

Creating block offsets
Creating merge list .

Creating polyMesh from blockMesh
Creating patches
Creating cells
Creating points with scale 0.1
    Block 0 cell size :
        i : 0.005 .. 0.005
        j : 0.005 .. 0.005
        k : 0.01 .. 0.01


Writing polyMesh
----------------
Mesh Information
----------------
  boundingBox: (0 0 0) (0.1 0.1 0.01)
  nPoints: 882
  nCells: 400
  nFaces: 1640
  nInternalFaces: 760
----------------
Patches
----------------
  patch 0 (start: 760 size: 20) name: movingWall
  patch 1 (start: 780 size: 60) name: fixedWalls
  patch 2 (start: 840 size: 800) name: frontAndBack

End

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 isaac@viz9-uwo.sharcnet.ca

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. The details for paraview can be found in our wiki page[[1]].

References

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