26th July 2017

Download v5.0 | Source Pack

The source code of OpenFOAM v5.0 and related third-party software can be downloaded as tar.gz compressed archive files:

The archive files download with inconvenient file names, so we recommend following the instructions below where they are unpacked immediately into the source directories, which avoids storing the files themselves.

Tested Platforms

OpenFOAM is developed and tested on Linux, and should work with any recent distribution of GNU/Linux. OpenFOAM-5.0 and ThirdParty-5.0 have been tested on the following Linux distributions:

  • Ubuntu 14.04 (trusty), 16.04 (xenial), 17.04 (zesty)
  • OpenSuSE Tumbleweed (July 2017)

Unpacking the Sources


After the installation directory is chosen (and, if necessary, created), open a terminal window, change into the installation directory and download an unpack the source and third-party archives by copying and pasting the following:

wget -O - | tar xvz
wget -O - | tar xvz

The files unpack to produce directories OpenFOAM-5.x-version-5.0 and ThirdParty-5.x-version-5.0, which need to be renamed as follows:

mv OpenFOAM-5.x-version-5.0 OpenFOAM-5.0
mv ThirdParty-5.x-version-5.0 ThirdParty-5.0

Software for Compilation

Follow the instructions for installing Software for Compilation of OpenFOAM for your platform.

Setting Environment Variables

The environment variable settings are contained in files in an OpenFOAM-5.0/etc directory in the OpenFOAM release. e.g. $HOME/OpenFOAM/OpenFOAM-5.0/etc for the case where the installation is in $HOME/OpenFOAM:

The user should configure their system with permanent settings to source the environment. If OpenFOAM is installed in the $HOME/OpenFOAM directory, the user should:



source $HOME/OpenFOAM/OpenFOAM-5.0/etc/bashrc



if running tcsh (avoid csh, which can have compatibility issues) source the etc/cshrc file by adding the following line to the end of your $HOME/.cshrc file:

source $HOME/OpenFOAM/OpenFOAM-5.0/etc/cshrc

then type “source $HOME/.cshrc” in the current terminal window.

When OpenFOAM is installed in an alternative directory, e.g. /opt, the user should substitute $HOME/OpenFOAM with the relevant installation location in the lines above.

Installing Third-Party Software

Follow the instructions for installing Third Party Software on your platform.

Compiling OpenFOAM

With the Third Party software installed and environment updated, compile OpenFOAM by going into the OpenFOAM-5.0 directory and executing the Allwmake script.  Type Allwmake -help for options, but the 2 main choices are to compile in serial with


or compile in parallel with all available cores/hyperthreads with:

./Allwmake -j

Serial compilation takes several hours, whereas compilation on 8 cores/threads should take approximately one hour, possibly less, depending on the processor.

Getting Started

Create a project directory within the $HOME/OpenFOAM directory named <USER>-5.0 (e.g. chris-5.0 for user chris and OpenFOAM version 5.0) and create a directory named run within it, e.g. by typing:

mkdir -p $FOAM_RUN


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

Refer to the OpenFOAM User Guide to get started.

Reporting Bugs in OpenFOAM
