OPEN SOURCE CFD SOLVER OPENFOAM 3.0 IN HPC CLUSTERS
About OpenFOAM
OpenFOAM is a multiphysics CFD open source code that is under active development. It is derived from an early code created at Imperial College London called FOAM, and it has evolved a lot since those days. Since this is an open source code, anyone can start a new project from it, and that is why the world around OpenFOAM is becoming very chaotic. Because it is free to use, OpenFOAM has become more and more popular over the past years in both academic research community and industrial domain.
OpenFOAM in HPC Cluster
The first version of OpenFOAM which was installed in the HPC cluster many years ago was version 1.6 , followed by versions 2.1 and 2.3. The previous stable version 2.4 and the current stable version 3.0.1 are both available in the cluster. Both version 2.4 and version 3.0.1 operates in its specific system environment. So you need to run the following command to initialize the environment for the specific version.
For version 2.4:
# source openfoam 2.4
For version 3.0.1:
# source openfoam 3.0.1
After running the above command, you can launch and run OpenFOAM solvers and modules directly. For example:
# icoFoam –help
If you have a large model to compute and this may run for hours or days, you can submit the simulation for execution in batch queue. For example, to run “simpleFoam” of version 3.0.1 in parallel computing with 12 cores, you can prepare a script file “script_simplefoam.txt” with the following content:
#!/bin/bash #BSUB -q parallel #BSUB -n 12 #BSUB -o stdout_ofjob_%J.o #BSUB -R "span[ptile=12]" ## Init OpenFOAM env. source openfoam 3.0.1 ## Exec OF Solver mpirun -np ${LSB_DJOB_NUMPROC} -f ${LSB_DJOB_HOSTFILE} simpleFoam –parallel
You may then submit the job from the OpenFOAM case directory as:
# bsub < script_simplefoam.txt
OpenFOAM version v1606+ was released in June 2016. We are assessing it and will install this latest version if necessary.
Installation of OpenFOAM in Linux Computer
The source code of OpenFOAM can be downloaded and installed on most Linux computers, including RedHat Linux (RHEL or CentOS), SuSe Linux and Ubuntu Linux. Although RedHat Linux is widely adopted by many high-performance computing clusters worldwide, it is unfortunate that the installation of OpenFOAM in RedHat Linux platform is a bit complicated due to many dependencies of the system compilers, libraries and toolkits. This is a typical consequence of open source packages which are usually chaotic in proper management of versions and dependencies.
It is fortunate that some enthusiasts provide detailed instructions and steps on installation of OpenFOAM in a RedHat Linux computer. The details can be found from this OpenFOAM wiki page. You can follow the installation steps to compile and build your own flavor of OpenFOAM.
If you wish to compile and build an individual OpenFOAM flavor for your own in your HPC /home directory on the HPC cluster, please take note of the following:
• The overall storage space required for the installation is about 5GB.
• The “Development Tools” are installed in the HPC cluster; you can ignore steps 1-3.
• Steps 14-15 are for the third part tool ParaView and you can skip them. The ParaView is installed as a common tool and can be launched via “paraview” command.
• It takes times to download, compile and build/install the whole OpenFOAM package. A rough estimation is about a few days if everything goes smoothly.
• You need to feel comfortable using Linux operating system, which includes working with the Shell and familiar with the shell/terminal environments and related operation.
Summary
OpenFOAM versions 2.4 and 3.0.1 are available in the HPC cluster. To access the specific version, please run the specific initialization command first. It takes a lot of effort and time to compile and build a customized OpenFOAM from scratch. It demands a certain amount of comfort level using Linux.