ODU Research Computing Forum

Running OpenFOAM on the cluster

I want to use the OpenFOAM fluid dynamics simulation software on HPC. Is this software available on Wahab cluster? How to use or run it on our HPC?

The OpenFOAM software is available on ODU HPC clusters using the openfoam module.

To get started with OpenFOAM, follow these steps:

  1. If you need to use paraFoam, connect to the cluster via remote desktop connection:

This step is optional but required if you want to use paraFoam. Otherwise, you can use SSH.

  1. Allocate a compute node:

salloc -c 16

  1. Load the OpenFOAM module:

module load openfoam.com/2112

  1. Prepend “crun” to your OpenFOAM commands, like this:

crun paraFoam

If you want to run OpenFOAM with MPI, use the following job script:

#!/bin/bash

#SBATCH -n 20

module load openfoam.com/2112

srun crun foamXXXX

Replace foamXXXX with the command you need to run. Save the script in the same directory as your input file, for example “job_script.sh”.

To submit the script, use “sbatch job_script.sh”. If you’re new to Slurm, here are some common commands and a resource link to get you started:

• Submit a job:

sbatch job_script.sh (this will give you a job ID, and your output will be in slurm-jobid.out)

• Check job status:

squeue -u $USER

• Delete a job:

scancel job_id