OpenFOAM¶
From the OpenFOAM website http://www.openfoam.org
OpenFOAM(Field Operation And Manipulation) is free, open source software for CFD from the OpenFOAM Foundation.
Running OpenFOAM on CSD3¶
OpenFOAM contains a number of applications and utilities. Version 2312 is currently installed with Intel MPI and the GNU compilers.
Running OpenFOAM will require a simple script:
#!/bin/bash
#SBATCH -A MYACCOUNT
#SBATCH -p cclake
#SBATCH -N 1
#SBATCH -n 5 # Matching requirements from example below. Tune according to your own needs.
#SBATCH -t 02:00:00
#SBATCH -o openfoam.out
#SBATCH -e openfoam.err
module purge
module load rhel8/cclake/base # Use on either cclake, icelake or sapphire, as it is designed to work for all RHEL8 CPU partitions.
module load openfoam/2312/gcc/intel-oneapi-mpi/2ioxyvgw
# This is required to setup the proper variables and library paths
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Using a parallel example from the tutorials. Replace the following by your own project
# This example uses up to 5 parallel streams, hence -n 5 in the SBATCH header.
cp -R $WM_PROJECT_DIR/tutorials/mesh/parallel/cavity .
cd cavity
./Allclean
./Allrun
which can be submitted to the queue with sbatch
from the same directory as the case directory. This will run on one node in pure MPI mode up to a limit of 2 hours. To run on more nodes the -N
and -n
options should be adjusted and the timelimit can be changed with -t
.