How to use OpenFOAM

Software
Version
Cluster
OpenFOAM
2106
Dardel

Running on the Batch system

sample job script

#!/bin/bash -l

#The name of the script is mytest
#SBATCH -J mytest

#SBATCH -A <allocation>

# 12 hour wall-clock time will be given to this job
#SBATCH -t 12:00:00

# Set the partition for your job. 
#SBATCH -p <partition>

# Number of nodes
#SBATCH --nodes=2

# Number of MPI processes per node (default 128)
#SBATCH --ntasks-per-node=128

# Load the openfoam module
module load PDC
module load openfoam/v2106

# Set the openfoam environment variables
. $FOAM_BASHRC

# Change OpenFoam user directory to the project directory
# Comment the three lines below if not running on the project directory

WM_PROJECT_DIRECTORY2=$(pwd)
export WM_PROJECT_USER_DIR=$WM_PROJECT_DIRECTORY2/$WM_PROJECT/$USER-$WM_PROJECT_VERSION
export FOAM_RUN=WM_PROJECT_USER_DIR/run

# Start the OpenFOAM job with 256 MPI-tasks on 2 nodes

srun -n 256 -N 2 <openfoam binary> -case <path to case directory> -parallel > my_output_file 2>&1

Disclaimer

PDC takes no responsibility for the correctness of results produced with the binaries. Always evaluate the binaries against known results for the systems and properties you are investigating before using the binaries for production jobs.