TACC staff has built and installed OpenFOAM 2.3.0 using Intel compiler 14.0.1.106 and mvapich2 2.0b on Stampede. Please follow the steps below to set up the environment and run a OpenFOAM tutorial example.

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.

The need for compiling an executable arises from most OpenFOAM users defining their own OpenFOAM cases. Cases are placed in a specific directory inside the OpenFOAM build tree by default, meaning users must have the entire writeable tree within their own directories.

Please follow these instructions precisely. These instructions may be used to build different versions of OpenFOAM, however there may be variations in the build process. Please submit a TACC support ticket upon encountering difficulties.

TACC staff recommends using the Intel 14 compiler along with mvapich2 2.0b. The Intel 14 compiler helps to avoid C++ compiler errors, and the only available MPI with Intel 14 is mvapich2 2.0b. Furthermore, using mvapich2 2.0b helps avoid ptmalloc errors when making use of python wrappers.

Move the "include "mpi.h"" line outside the extern C scope to remedy this error.

Should you wish to add or remove features to the custom OpenFOAM installation or switch to different compilers/mpi, you must clean up the build tree manually as there is no "make clean" equivalent for OpenFOAM.

Delete the platforms/linux64* directories in both OpenFOAM and ThirdParty build trees

To reset everything

login1$ cdw; cd OpenFOAM
login1$ find ./* -iname "*.o" |xargs rm -fr

OpenFOAM requires a long list of environment variables to control the build and execution process. The commands…

login1$ printenv | grep -i wm
login1$ printenv | grep -i foam

…will show you these variables.

It is generally possible to reset these variables by sourcing "/etc/bashrc" a second time. You can, of course, exit the shell to start over. Alternatively, you can reset or unset variables manually.

OpenFOAM's visualization tool, ParaFOAM, does NOT work on Stampede. Instead, users may use the post-processing ParaView tool to visualize OpenFOAM data. ParaView is an open-source, multi-platform data analysis and visualization application.