OpenFOAM 5.0 on Stampede2
Last update: January 5, 2018

The OpenFOAM (Open Field Operation and Manipulation) Toolbox is a free, open source Computational Fluid Dynamics (CFD) software package providing an extensive range of features, from solving complex fluid flows involving chemical reactions, turbulence and heat transfer, to solid dynamics and electromagnetics.

Running OpenFOAM on Stampede2

TACC staff has built and installed OpenFOAM 5.0 using Intel compiler 18.0.0 and Intel MPI on Stampede2. Please follow the steps below to set up the environment and run a OpenFOAM tutorial example.

Set Up the Computing Environment

Set up the proper computing environment by loading the appropriate Intel compiler and loading the OpenFoam module.

  • Assuming you have the default compiler loaded, issue the following commands:

      login1$ module swap intel intel/18.0.0
      login1$ module load openfoam/5.0
  • OpenFOAM places its cases in the directory defined by the FOAM_RUN environment variable. TACC staff suggests using your $WORK file space to run OpenFOAM cases. The following commands set this environment variable and create the FOAM_RUN directory under the user's $WORK directory.

      login1$ export FOAM_RUN=$WORK/My_OpenFOAM/5.0/run
      login1$ mkdir -p $FOAM_RUN

Run Tutorials

The following demonstrates running the OpenFOAM's Lid-driven Cavity Flow test case involving isothermal, incompressible flow in a two-dimensional square domain.

  • Copy OpenFOAM's tutorials into the OpenFOAM work directory created above, then change to the cavity case directory:

      login1$ cp -r $FOAM_TUTORIALS $FOAM_RUN 
      login1$ cd $FOAM_RUN/tutorials/incompressible/icoFoam/cavity
  • Use the pre-processing tool, blockMesh, to generate the mesh. Then run the icoFoam solver.

    Do NOT run these commands on the login nodes. You may either submit a batch job, or start an interactive session using TACC's idev utility.

      login1$ idev
      c557-804$ blockMesh
      c557-804$ icoFoam
      c557-804$ exit