Close

1st December 2018

Download OpenFOAM-dev | Linux

Linux Distributions

The openfoam-dev pack provides an installation  of the current development line of OpenFOAM, packaged for Ubuntu 14.04, 16.04 and 16.10.  Known as OpenFOAM-dev, that contains the source code for the next major release of OpenFOAM. The pack is updated weekly to bring cutting-edge developments to users without them needing to compile source code.  Updates can conveniently run OpenFOAM-dev on 64 bit distributions of Linux using Docker to provide a self-contained environment that includes code, runtime, system tools and libraries, independent of the underlying operating system.  The following distributions have been tested, with instructions given below for installing Docker, but other Linux distributions should also work.

Note: simply install the native packaged version for Ubuntu 14.04LTS, 16.04LTS and 16.10.

Step 1: Before Installing Docker

  1. Ensure that your version of Linux operating system is sufficiently new.  A good test is to check the version of Linux kernel is 3.10 or higher by typing:
    uname -r
  2. The user requires superuser password authentication to execute the following commands with sudo. If in doubt, talk to your system administrator.
  3. Ensure you have a network connection to download packages via http(s).

Step 2: Installing Docker

Copy and paste the following commands in a terminal for the respective Linux distribution:

RHEL, CentOS and Fedora

On RHEL and CentOS only:

sudo yum -y update

On Fedora only:

sudo dnf -y update

Then on all distributions (RHEL, CentOS and Fedora):

curl -fsSL https://get.docker.com/ | sh
sudo systemctl enable docker.service
sudo systemctl start docker

SLES and openSuSE

On SLES only:

sudo SUSEConnect -p sle-module-containers/12/x86_64 -r ''

The on all distributions (SLES and openSuSE):

sudo zypper -n in docker
sudo systemctl start docker
sudo systemctl enable docker

Debian

sudo apt-get -y update
curl -fsSL https://get.docker.com/ | sh

Step 3: Docker Configuration

Docker runs as the root user by default.  To enable a (non-root) user to run Docker requires the user to be added to the docker group.  Log in to the account of the user to be added to the docker group and enter

sudo usermod -aG docker $(whoami)

(Alternatively the command above can be run from another user account, e.g. the system administrator, substituting $(whoami) with the name of the user to be added).

The user must log out and log in of their account for the change to take effect.

Step 4: Installing openfoam-dev-linux

OpenFOAM-dev is launched from a script named openfoam-dev-linux.  The script is available from the OpenFOAM Download Site and needs to be located somewhere on the user’s PATH for convenient execution.  We can download the file conveniently using wget, which can be installed if necessary by:

  • RHEL, CentOS: sudo yum -y install wget
  • Fedora: sudo dnf -y install wget
  • SLES and openSuSE: sudo zypper -n in wget

The following commands will then install in the system-wide /usr/bin directory and make the script executable:

sudo sh -c "wget http://dl.openfoam.org/docker/openfoam-dev-linux -O /usr/bin/openfoam-dev-linux"
sudo chmod 755 /usr/bin/openfoam-dev-linux

Step 5: Launching openfoam-dev-linux

The Docker container mounts the user’s file system so that case files are stored permanently. The container mounts the directory from where openfoam-dev-linux is launched by default, but the user can also specify the directory using the “-d” option.  Mounting the user’s $HOME directory is disallowed.  The mounted directory is represented in the container environment by the WM_PROJECT_USER_DIR environment variable, which is set to $HOME/OpenFOAM/${USER}-dev by default.  We therefore recommend creating that directory on the host machine and launching openfoam-dev-linux there by:

mkdir -p $HOME/OpenFOAM/${USER}-dev
cd $HOME/OpenFOAM/${USER}-dev
openfoam-dev-linux

The first time the container is launched, there is a short wait while the image downloads and unpacks.

Step 6: Testing openfoam-dev-linux

Follow the standard process to test the installation, first creating the run directory:

mkdir -p $FOAM_RUN

Copy across the backward facing step example, generate the mesh with blockMesh and run the steady flow, incompressible solver simpleFoam

cd $FOAM_RUN
cp -r $FOAM_TUTORIALS/incompressibleFluid/pitzDailySteady . 
cd pitzDailySteady
blockMesh
simpleFoam
paraFoam

Refer to the OpenFOAM User Guide to get started.

Step 7: Exiting Docker

When finished using OpenFOAM in Docker exit the environment by typing:

exit

Upgrading openfoam-dev

To upgrade the Docker image to the latest version of openfoam-dev, simply run the script with the “-u” option, i.e.

openfoam-dev-linux -u

Reporting Issues

If you encounter an issue with this installation, please report it to the OpenFOAM Issue Tracking system.