Skip to main content

Running OpenFOAM®

Official documentation

https://www.openfoam.com/

How to run OpenFOAM

OpenFoam is provided via the new software environment 

STEP 1: log into Axiom frontend

ssh <username>@axiom-front1.unil.ch

STEP 2: submit batch job

Go to your OpenFOAM project directory and submit the batch job with:

sbatch sbatch_openfoam_job.sh

where the script sbatch_openfoam_job.sh looks something like the example given below.

Here we use a problem that was decomposed in 4 sub-domains and explicitly spread over two nodes to illustrate the use of MPI for processing in "-parallel" mode.

#!/bin/bash -l

#SBATCH --account=<account_to_use>
#SBATCH --nodes 2
#SBATCH --ntasks 4
#SBATCH --partition=axiom
#SBATCH --constraint=AVX2
#SBATCH --mem-per-cpu=5G
#SBATCH --time=01:00:00

source /dcsrsoft/spack/bin/setup_dcsrsoft 

module load gcc mpich
module load openfoam


decomposePar

mpirun -np $SLURM_NTASKS interFoam -parallel