
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
- Follow the Guide to Install the Windows Subsystem for Linux and install the Ubuntu Linux Distribution.
- Launch the Ubuntu distribution through WSL.
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.
- One Time Only: At the bottom of the user’s
.bashrc
file, source thebashrc
file in the OpenFOAM installation which contains the environment settings. Foropenfoam7
, the following command avoids the need to open an editor (for OpenFOAM-dev, replaceopenfoam7
withopenfoam-dev
):echo ". /opt/openfoam7/etc/bashrc" >> $HOME/.bashrc
- One Time Only: register the change to the
.bashrc
file by typing at the terminal prompt (note the dots):. $HOME/.bashrc
- Test that the
simpleFoam
application, from the OpenFOAM package, is working by typingsimpleFoam -help
- 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 hoe to install OpenFOAM on Windows 10.

OpenFOAM Tutorial | Multiphase Simulation
In this tutorial you will learn how to simulate a multiphase simulation through lockExchange tutorial that comes by default with OpenFOAM.

OpenFOAM Tutorial | motorBike (simpleFoam)
In this video you will learn how to simulate motorBike tutorial using OpenFOAM with simpleFoam solver.
Related Articles
OpenFOAM Tutorial | motorBike (simpleFoam)
In this video you will learn how to simulate motorBike tutorial using OpenFOAM with simpleFoam solver.
OpenFOAM Tutorial | How to create an Animation
In this tutorial you will learn how to create an animation using OpenFOAM through Paraview (paraFoam Command).
OpenFOAM Tutorial | pitzDaily | LES Turbulence Model
In this tutorial you will learn how to simulate the LES turbulence model using pitzDaily tutorial on OpenFOAM.
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