OpenFOAM – Install OpenFOAM

Written by cfd.ninja

March 19, 2020

Bookstore

Source: CFD Direct

OpenFOAM for Windows 10

The packaged distributions of OpenFOAM for Ubuntu can now be installed directly on Microsoft Windows 10 using Windows Subsystem for Linux (WSL).  WSL provides a full compatibility layer for running Linux applications on Windows by performing real-time translation of Linux system calls into Windows OS system calls.  The system can support graphical Linux applications, such as the version of ParaView that includes the OpenFOAM reader module, with additional X server software (see below).  Running OpenFOAM applications in parallel using WSL is reported to work effectively.

Activate Windows Subsystem for Linux

Installing OpenFOAM

The packaged distributions of OpenFOAM on Ubuntu Linux can now be installed from within the Bash environment.  We recommend users install the Ubuntu pack of OpenFOAM v7 or the current development version (or both).

  • Installing OpenFOAM 7
    sudo sh -c "wget -O - http://dl.openfoam.org/gpg.key | apt-key add -"
    sudo add-apt-repository http://dl.openfoam.org/ubuntu
    sudo apt-get update
    sudo apt-get install openfoam7
  • Installing OpenFOAM-dev
    sudo sh -c "wget -O - http://dl.openfoam.org/gpg.key | apt-key add -"
    sudo add-apt-repository "http://dl.openfoam.org/ubuntu dev"
    sudo apt-get update
    sudo apt-get install openfoam-dev

Compilation Tools

In order to compile applications and libraries in OpenFOAM, the user should install additional compilation tools by the following command:

sudo apt-get install build-essential

User Configuration

In order to use the installed OpenFOAM package, the user needs to set their environment for OpenFOAM as follows.

  1. One Time Only: At the bottom of the user’s .bashrc file, source the bashrc file in the OpenFOAM installation which contains the environment settings.  For openfoam7, the following command avoids the need to open an editor (for OpenFOAM-dev, replace openfoam7 with openfoam-dev):
    echo ". /opt/openfoam7/etc/bashrc" >> $HOME/.bashrc
  2. One Time Only: register the change to the .bashrc file by typing at the terminal prompt (note the dots):
    . $HOME/.bashrc
  3. Test that the simpleFoam application, from the OpenFOAM package, is working by typing
    simpleFoam -help
    
  4. A “Usage” message should appear. Your installation and user configuration is complete.

If more than one OpenFOAM package is installed, e.g. both openfoam7 and openfoam-dev, the user’s .bashrc file should contain only the source... command for the version they currently wish to use.

In this tutorial, you will learn how to install OpenFOAM on Windows 10. We recommend you see our tutorial about the history of openfoam before installing it. OPENFOAM HISTORY

CFD DIRECT: https://openfoam.org/

ESI GROUP: https://www.openfoam.com/

OpenFOAM vs ANSYS CFX

OpenFOAM vs ANSYS CFX

OpenFOAM is the free, open source CFD software developed primarily by OpenCFD Ltd since 2004. It has a large user base across most areas of engineering and science, from both commercial and academic organisations.

OpenFOAM – Units

OpenFOAM – Units

In continuum mechanics, properties are represented in some chosen units, e.g. mass in kilograms (kg \relax \special {t4ht=), volume in cubic metres ( 3 m \relax \special {t4ht=), pressure in Pascals ( −1 −2 kgm s \relax \special {t4ht=).

Tutorial:

OpenFOAM on Windows 10

Related Articles

OpenFOAM – Units

OpenFOAM – Units

In continuum mechanics, properties are represented in some chosen units, e.g. mass in kilograms (kg \relax \special {t4ht=), volume in cubic metres ( 3 m \relax \special {t4ht=), pressure in Pascals ( −1 −2 kgm s \relax \special {t4ht=).

OpenFOAM – pitzDaily Tutorial

OpenFOAM – pitzDaily Tutorial

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

OpenFOAM – OpenFOAM on Windows

OpenFOAM – OpenFOAM on Windows

The packaged distributions of OpenFOAM for Ubuntu can now be installed directly on Microsoft Windows 10 using Windows Subsystem for Linux (WSL).

Stay Up to Date With The Latest News & Updates

Help us keep growing

CFD.NINJA is financed with its own resources, if you want to support us we will be grateful.

Join Our Newsletter

Subscribe to receive emails with detailed information related to the CFD.

Follow Us

Subscribe to our social networks to receive notifications about our new tutorials

Pin It on Pinterest

Shares

Share This

Share this post with your friends!