Sie sind auf Seite 1von 11

OpenFOAM Windows Installation

Procedure

June 2017

Email id: enquiries@opencfd.co.uk

Page 1 ESI Property


OpenFOAM Installation In Windows

OPENFOAM WINDOWS INSTALLATION


PROCEDURE

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 3
OpenFOAM Installation in Windows

OpenFOAM Windows Installation Procedure

General:
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
http://www.paraview.org/download/

Supported Platforms:
Windows 7 64 bit
Windows 8.0,8. 1 64 bit
Windows 10 64 bit

OpenFOAM is a registered trademark owned by OpenCFD Limited.

Prerequisites
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
https://www.microsoft.com/en-us/download/details.aspx?id=592#filelist

In Windows8, and Windows10 it can be checked via the Task Manager.

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


Windows7 and Windows8.)

3. Please make sure that any image in VirtualBox is in Powered off mode, if
virtualBox in already installed.

4. If you have previous of OpenFOAM installed, please uninstall OpenFOAM and


other component related to it i.e VirtualBox , git and docker.

ESI Property 4
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
below.

Fig: 1- Virtual Box Setting : System memory

ESI Property 5
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 default is in power off
stage.
4. Click on processor tab and change the number of processors required to run
OpenFOAM

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 Shared Folders

ESI Property 6
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
Docker-QuickStart-Terminal 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 default and select close-> poweroff it.

2. User need to remove these file manually to complete the whole uninstallation

C:\Users\$UserName\.docker

C:\Users\$UserName\.VirtualBox

3. 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 \Git is empty.

ESI Property 7
OpenFOAM Installation in Windows

4. 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)

Running the sample tutorial case :

o Double-click the OpenFOAM_Start shortcut on the Desktop to enter the


OpenFOAM Windows working environment. Change directory to the
workingDir folder and copy the tutorial you would like to run, for example,
by typing following commands:

cd workingDir
cp -ar $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity .
cd cavity

ESI Property 8
OpenFOAM Installation in Windows

blockMesh
icoFoam

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

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.

User need to run exit command from terminal twice to close the terminal. It
ensure smooth exit. Running exit command first time Logout from user account
ofuser and running another exit command close the terminal

Important : In OpenFOAM-1706+ , user can open multiple terminal by clicking


on the OpenFOAM_Start shortcut . User can work simultaneously on different
terminal. In case, user want to close one terminal and continue working on other,
he/she must close it by clicking close button over right hand corner. Running exit
command twice will close all openfoam terminal and kill any job running on
other terminal

ESI Property 9
OpenFOAM Installation in Windows

5. Miscellaneous Information

1. To check whether everything is working in right way. Click on Docker-


Quickstart Terminal 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.

2. Please note that password for root account is


ofuser2017

ESI Property 10
OpenFOAM Installation in Windows

ESI Property 11

Das könnte Ihnen auch gefallen