March 19, 2020
Source: CFD Direct
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
- Follow the Guide to Install the Windows Subsystem for Linux and install the Ubuntu Linux Distribution.
- Launch the Ubuntu distribution through WSL.
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
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
In order to use the installed OpenFOAM package, the user needs to set their environment for OpenFOAM as follows.
- One Time Only: At the bottom of the user’s
.bashrcfile, source the
bashrcfile 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
echo ". /opt/openfoam7/etc/bashrc" >> $HOME/.bashrc
- One Time Only: register the change to the
.bashrcfile by typing at the terminal prompt (note the dots):
- Test that the
simpleFoamapplication, from the OpenFOAM package, is working by typing
- A “Usage” message should appear. Your installation and user configuration is complete.
If more than one OpenFOAM package is installed, e.g. both
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 hoe to install OpenFOAM on Windows 10.
In this tutorial you will learn how to create an animation using OpenFOAM through Paraview (paraFoam Command).
In this tutorial you will learn how to simulate the LES turbulence model using pitzDaily tutorial on OpenFOAM.
In this tutorial, you will learn how to simulate an Airfoil 2D using OpenFOAM. In this case, we will use the folder that comes by default.
In this tutorial you will learn to use Allclean and Allrun scripts on OpenFOAM. These scripts come by default in several OpenFOAM folders.
In the previous tutorial we installed OpenFOAM on Windows, in this video you will simulate the first tutorial called pitzDaily.
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.
Subscribe to our social networks to receive notifications about our new tutorials