Skip to main content

openfoam

Versions and Availability

h4

h5
Module Names for openfoam on qb3
Machine Version Module Name
qb3 1912 openfoam/1912/intel-19.0.5-impi-2019.5.281
qb3 1912 openfoam/1912/intel-19.0.5-mvapich-2.3.3

▶ Module FAQ?

▶ Did not find the version you want to use??

About the Software

OpenFOAM is a GPL-opensource C++ CFD-toolbox. This offering is supported by OpenCFD Ltd, producer and distributor of the OpenFOAM software via www.openfoam.com, and owner of the OPENFOAM trademark. OpenCFD Ltd has been developing and releasing OpenFOAM since its debut in 2004.

Usage

Running OpenFOAM through singularity container

Support of using OpenFOAM on LSU and LONI clusters will mainly use the singularity image in the future. OpenFOAM singularity images are currently built under the /home/admin/singularity directory. Example scripts showing how to run OpenFOAM through singularity with MPI support are posted on this GitHub link: https://github.com/lsuhpchelp/singularity/tree/main/recipes/openfoam/10/cavity.of10 (this link uses OpenFOAM10)

Set up your environment to run OpenFOAM

To load OpenFOAM to your environment on clusters using softenv, follow the two steps:

  1. Add the corresponding softenv key to your .soft file and resoft: you can use the "softenv -k OpenFOAM" command to find out what the keys are;
  2. The openfoam key makes some changes to the default path which will override the path set by the @default key, please make sure you put openfoam key before the @default key in your .soft file.

To load OpenFOAM to your environment on clusters using module, follow the two steps:

  1. Use the moduel load openfoam/2.3.0/INTEL-140-MVAPICH2-2.0 command to load OpenFOAM to your environment, you can also add this command to your ~/.modules file. You can use the "module av openfoam" command to find out what the module keys are. To query the openfoam module key, use moduel disp openfoam/2.3.0/INTEL-140-MVAPICH2-2.0.
  2. Source the openfoam bashrc file by using the source $FOAM_BASH command.

Sample script

#!/bin/bash
#PBS -A your_allocation
#PBS -q checkpt
#PBS -l nodes=1:ppn=16
#PBS -l walltime=12:00:00
#PBS -V
#PBS -j oe
#PBS -N openfoam_test

NPROCS=`wc -l < $PBS_NODEFILE`
cd /path/to/your/openfoam/case/dir
mpirun -np $NPROCS -machinefile $PBS_NODEFILE {openfoamSolverName} -parallel

The script is then submitted using qsub:

$ qsub job_script

where job_script is the name you gave the script file.

▶ QSub FAQ?

Resources

Last modified: November 30 2023 22:50:15.