Describe how to run OpenFOAM using a singularity container on a slurm cluster. The procedure below was tested on Ubuntu.
First we need to create a singularity definition file to build a container with OpenFOAM installation.
For example, we can create the openfoam.def
file.
The singularity build
command will build the singularity container image (openfoam.sif
)
singularity build -f openfoam.sif openfoam.def
Now we can run the OpenFOAM motorBike example using the following job scripts:
OpenFOAM uses MPI for parallelism. So, the environment must have some MPI implementation installed. The above scripts have been tested with OpenMPI.
When the calculation is done, the results can be viewed in paraview, using the following command inside the motorBike folder:
singularity run ../openfoam.sif paraFoam