Anda di halaman 1dari 11

OpenFOAM Windows Installation


November 2015

Email id:

Page 1

ESI Property

OpenFOAM Installation In Windows



The documents and related know-how herein provided by ESI Group subject to
contractual conditions are to remain confidential. The CLIENT shall not disclose the
documentation and/or related know-how in whole or in part to any third party
without the prior written permission of ESI Group.

2015 ESI Group. All rights reserved.

ESI Property

Page 2

OpenFOAM Installation in Windows

Table of Contents
1. Guidelines for Installation .....................................................................4
2. Change settings for Virtual Box .............................................................4
3. Trouble Shooting the Installation ...........................................................6
4. Working with OpenFOAM ......................................................................7
5. Miscellaneous Information ....................................................................8

ESI Property

OpenFOAM Installation in Windows

OpenFOAM Windows Installation Procedure


OpenFOAM for Windows from OpenCFD uses standard and unmodified

source code released by the OpenFOAM Foundation.

It works using a

containerised image of the standard installation using utilities which are

openly and freely available. This document describes the procedure for
downloading and installing all required software components.

Please note that Paraview, a third party post processing tool is used to
post process OpenFOAMs results. Paraview has not been bundled with
OpenFOAM windows version. Please download and install Paraview from
following page

Supported Platforms:

Windows 7

64 bit

Windows 8.1 64 bit

Earlier Windows versions with support for hardware virtualization.

Windows PowerShell (2 or above) must be installed in user Windows
Desktop. It comes by default from Windows7 onwards.
OpenFOAM is a registered trademark owned by OpenCFD Limited.

1. Hardware assisted virtualization should be enabled. If not already done,
please enabled it from the BIOS mode (see below), then reboot your system
twice before proceeding with this Installation.
In Windows7, check if hardware-assisted Virtualization is switched on by
running the Windows utility
In Windows8, it can be checked via the Task Manager.
environment for OpenFOAM is not guaranteed, but we aim future versions of
this installation to support Windows10.

ESI Property

Powershell version 2 and above should be installed. (It comes by default in

Windows7 and Windows8.) Please make sure that any image in VirtualBox is
in Powered off mode , if virtualBox in already installed.

OpenFOAM Installation in Windows

1. Guidelines for Installation

1. User need to click on the OpenFOAM-installer to install the OpenFOAM
environment for windows. Installation will install docker(docker, virtualBox, Git)
2. Once installation is done, User need to click on "OF_Create_Env" shortcut in
Desktop. A shell window will pop up and close which will create desired
environment for user. This has to be mandatory done first time.
3. Once the environment is set user can click "OpenFOAM_Start" shortcut in
Desktop to start OpenFOAM environment. (Press enter in terminal , if bash shell
takes long time to start)

2. Change Settings of Virtual Box

1. Virtual box requires to pre-specify maximum memory and number of processors
that it can use.
2. Click on Oracle Virtual Box short-cut and click on Setting->System as shown

Fig: 1- Virtual Box Setting : System memory

ESI Property

OpenFOAM Installation in Windows

3. Change base memory to at least the maximum values your OpenFOAM simulation
might require; it can be changed at any time provided boot2docker-vm is in
power off stage.
4. Click on processor tab and change the number of processors required to run

Fig: 2 - Virtual Box Setting Processor number

5. Setting->SharedFolder : This is the folder which both Windows and OpenFOAM

can see and will contain the OpenFOAM cases.

Fig: 3 - Virtual Box Setting Processor number

ESI Property

OpenFOAM Installation in Windows

3. Trouble Shooting the Installation

In case, user is unable to launch the OpenFOAM windows working environment, User
can follow following steps:
1. Check for created image and container:
It is suggested to check whether image has been loaded as desired. Click on the
boot2docker Start s short-cut from Desktop which will open terminal. Type
command as docker images which will show image which is loaded in the
environment. Typing command as docker ps a will show created container.
2. Installation of the OpenFOAM environment again. Before installing the fresh
one, User should uninstall the earlier installation of OpenFOAM windows version
by following the below steps

1. Go to Control-Panel-> Program(Uninstall the program )

and click on

OpenFOAM-installation to uninstall the OpenFOAM windows environment.

2. Click on VirtualBox and right click on boot2docker-vm and select close->
poweroff it.
2. User need to remove these file manually to complete the whole uninstallation
C:\Users\$UserName\VirtualBox VMs/boot2docker-vm


It is also suggested to uninstall the docker, Virtual Box and Git and reboot the
system before starting the fresh installation.
(If during uninstallation of Git, some files are not deleted (a popup message will
show few dll not being deleted as being used by some process), then delete them
manually after rebooting system. Please check even if no pop is showed while
uninstallation of Git that Git folder under C:\ Program Files(x86) \Git is empty.

ESI Property

OpenFOAM Installation in Windows


Working with OpenFOAM

Once installation is completed, user can run desired OpenFOAMs executable in

serial/parallel mode. User can launch OpenFOAM working environment by clicking
the shortcut OpenFOAM_Start in Desktop ofuser. (Press Enter tab to enter the
container environment as ofuser)
Go inside /home/ofuser/workingDir using command, if you are not directed to working
folder automatically
cd /home/ofuser/workingDir
(Please note that if user want to run foam tutorial provided with installation,
iser need to copy foam tutorial in workingDir folder. For more explanation on
workingDir , please see below)

Please note that workingDir is actually the shared folder between OpenFOAM
container and your computer. workingDir correspond to C:\Users\UserName
i.e C:\Users\adam if user is adam;.
Please note that if one is logged in as adam but do not have any folder with
name adam in C:\Users\ , then you need to create folder with name adam . Close
any working bash shell (container) for OpenFOAM by typing exit command. Then
click on OF_Env_Create shortcut from Desktop again to create new container
and then launch the OpenFOAM_Start shortcut to launch a shell with OpenFOAM
environment set

User can run any OpenFOAM executables in parallel and serial mode as desired
from bash shell (Please note that parallel run will be limited to number of
processors in machine. To run in distributed environment, please contact
OpenCFD support)

To run case in parallel mode, user need to go inside the working directory and
use mpirun command to launch the executables as
mpirun np 4 simpleFoam parallel

ESI Property

OpenFOAM Installation in Windows

To do the post processing, user need to install Paraview separately as

mentioned in starting of documents. Once user has completed the simulation, a
file with suffix (.foam) like casename.foam"

has to be created inside the case.

User can create file by using command

'touch a.foam' inside case folder.

User can launch Paraview and browse inside folder and open the file with suffix (
.foam i.e as a.foam ) to visualize case.

Please type exit command from terminal to close the terminal. It ensure smooth

5. Miscellaneous Information
1. To check whether everything is working in right way. Click on boot2dockerstart short-cut from Desktop. Type command docker images to see loaded
images and docker ps aq to see working containers.

Fig: 4 - container created in environment

In case, it does not show anything, please contact OpenCFD Support or again
follow the steps.

ESI Property

OpenFOAM Installation in Windows

2. In case, user encounters error while installation, as shown in image below.

Please carry out fresh installation (uninstall all component as stated earlier in
Trouble Shooting Installation point 2 and 3). (It is recommended to always do
fresh install if process break while installation.)

Fig: 5 - Error encountered while installation

3. Please note
1. User Name:


2. Password : openfoam

ESI Property


OpenFOAM Installation in Windows

ESI Property