Child pages
  • OpenFoam on Odyssey and Linux Desktop
Skip to end of metadata
Go to start of metadata


This page has information on running OpenFoam interactively as well as in batch mode on the FASRC Cluster (currently Odyssey). To learn basics of modeling with OpenFoam, please visit:

OpenFOAM - Modeling Basics

Openfoam via singularity container

We have built a singularity container with freecad, gmsh, openfoam and paraview. The container can be used on odyssey (in both the interactive and batch modes) or on a local linux machine with singularity installed.

On Odyssey

Running interactively

Connect to odyssey via OnDemand ( Open a terminal and create a directory for OpenFoam:

mkdir openfoam-test
cd openfoam-test

Run the openFoam container with shell option to obtain a command shell.

singularity shell /n/seas_computing/scientific_software/freecad-OpenFoam.simg

Once inside shell, you should be able to run a simple test job as follows:

source /opt/openfoam6/etc/bashrc

cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .
cd pitzDaily

Running in batch

To run openfoam in batch, you can create a bash script with openfoam setup, meshing and run commands in a script (say scr_pitzDaily) and invoke the script via singularity in a slurm submit script (say The script "scr_pitzDaily" might look like:

#!/usr/bin/env bash
source /opt/openfoam6/etc/bashrc
rm -rf pitzDaily 
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily/ .
cd pitzDaily 
#Create mesh
#Run openfoam via the solver simpleFoam

The submit script "" might look like:

#SBATCH -n 1  #Number of cores 
#SBATCH -N 1  #Number of nodes 
#SBATCH -t 60  #Runtime in minutes 
#SBATCH -p general  #Partition to submit to 
#SBATCH --mem-per-cpu=500 #Memory per cpu in MB (see also --mem) 

module load intel/17.0.4-fasrc01 impi/2017.2.174-fasrc01

singularity exec /n/seas_computing/scientific_software/freecad-OpenFoam.simg ./scr_pitzDaily    

# Report some useful info




Modeling on your own desktop/laptop

The singularity image on Odyssey (freecad-OpenFoam.simg) can be downloaded to your desktop/laptop and run in a flavor of Linux (eg: ubuntu) with singularity installed. For this you need:

  • Either a linux desktop/laptop or linux installed in a virtualized environment (such as virtualbox). For help with this, just use a modern search engine (google, bing, etc.) and look for "ubuntu installation in virtualbox" etc. There is plenty of documentation available on this.
  • Install singularity. Visit the following and look under documentation for users:
  • Once you have singularity installed, the commands are identical to those under "OpenFoam via singularity – running interactively"  described above.
  • No labels