[OLD] OpenFOAM for Windows Installation - ladybug-tools/butterfly GitHub Wiki
Read below or click on the image below to watch the video on YouTube
In order to use butterfly you need to install OpenFOAM for Windows.The current release of Butterfly works with OpenFOAM v1612 which can be downloaded from this page. Once you download the file, follow the installation instruction from this page.
Read OpenFOAM installation procedure and prerequisites carefully and make sure that OpenFOAM is installed correctly before moving forward. You won't be able to run CFD analysis if OpenFOAM is not installed correctly. Here is the text from the link which is formatted to be easier to read.
If you're using Windows 10 on PC or Mac check additional notes here.
About OpenFOAM Windows Version v1612+
This OpenFOAM Windows version benefits from useful comments in the Social Media to improve the installation procedure, multiple version management and compilation environment following the first Windows environment release by OpenCFD Ltd of v2.4.0. It is based on Linux container technology. It enables Windows users to run Linux pre-compiled or user-compiled executables of OpenFOAM, thereby guaranteeing identical results in both Linux and Windows environments.
The Installer creates an OpenFOAM working environment C:\Program Files(x86)\ESI\OpenFOAM
.
The file OF_Windows_Guide_V1612.pdf
in Document
contains details about the setup and additional guidance. Tutorial Guide, User Guide and Programmers Guide are also located in Documents folder inside the installation folder.
Paraview
Paraview is a freely available post-processing tool, and can be used to post-process OpenFOAM results. Please note that Paraview is not bundled with this OpenFOAM Installer. User can download the latest version directly from http://www.paraview.org/download/
Pre-requisites
- 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 10 it can be checked via the Task Manager.
- 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.
Existing Users of OpenFOAM v1606.+ for Windows:
OpenFOAM-1606+ is based on new docker version . If user wants to upgrade to released OpenFOAM version v1612+, he needs to uninstall earlier version of OpenFOAM+ as well as docker, git and virtual box, before installing OpenFOAM-v1606+ OpenFOAM, is based on docker container technology, thereby guaranteeing identical results in both Linux and Windows.
Installation Procedure
-
Run the OpenFOAM-installer executable. It will install Docker (including VirtualBox, Git), the precompiled v1606+ OpenFOAM executable image and creates the working environment. Please note that this process can take several minutes depending on your system memory.
-
When the installation is complete, please click on the
OF_Create_Env
shortcut on the Desktop. A shell will open and close automatically, completing setup of the user working environment. This step is mandatory only on the first occasion of OpenFOAM for Windows installation. -
Click on the "OpenFOAM_Start" shortcut on the Desktop to start the OpenFOAM environment. (Press
Enter
if the bash shell seems to hang.) -
You can click on "OpenFOAM_Start" shortcut multiple time to open as many terminal to work on simultaneously.
Note: In case you have opened multiple shell to work on OpenFOAM, then please note that typing "exit" command from terminal takes user from from 'ofuser' to root. Further typing exit command will close the terminal and close docker-machine, hence killing any job or work going on other openfoam terminal. In case you want to close unnecessary terminal, please close it by clicking close button on top of right hand side terminal.)
Uninstallation Procedure
-
In the Control Panel > Programs (Uninstall a program), click on OpenFOAM4Windows to uninstall.
-
You should additionally remove the following files manually.
C:\Users\$UserName\.docker
C:\Users\$UserName\.VirtualBox
(Please note if you are using Virtual box for other purpose , then you may not want to delete .VirtualBox folder)
- You may also choose to uninstall third party tools such as Docker as well git and VirtualBox.
Working with OpenFOAM in the Working Folder
-
Please note paragraphs 2 and 3 of the Installation Procedure.
-
The Working Folder is a shared folder with your username (C:\Users%UserName%) and its content will be available to the container.
-
Copy your case (tutorials, etc.) to the Working Folder C:\User%UserName%, and run OpenFOAM as normal from the command line.
-
Post-processing
a. You will need to install Paraview, as mentioned at the start of this document.
b. On simulation completion, create a file with the suffix .foam
(e.g 'touch a.foam') inside case folder.
c. Launch Paraview, browse the case folder and open the file with suffix .foam
to start visualizing the case.
Trouble Shooting Guide
- OpenFOAM_Start shortcut is not working?
a. Check whether virtualization is enabled. (See instruction in Pre-requisites, paragraph 1)
-
The Installation is taking too long?
a. If the Installer is taking too long in
loading OpenFOAM image
,- Check your memory. The installation time usually depends on the memory allocated to
default
in VirtualBox. By default, it is half of your system memory. - If it takes longer than typically 15-20 mins, follow the steps below (though this is not strictly recommended; and remember to reverse these steps at the end);
i. Close the shell
loading OpenFOAM image
. Automatically, another shell will open which say 'wrapping the installation'. Let it complete.ii. Right click and open VirtualBox (as Administrator). Make sure that default is in
Power off
mode.iii. Open VirtualBox again (as a normal user, not Administrator),select
default
click on Settings > System, and then increase the memory allocated to 3/4 of maximum. ClickOk
to save the setting.iv. Uninstall OpenFOAM4Windows from the Control Panel.
v. Install OpenFOAM, but deselect the boot2docker installation.
- Check your memory. The installation time usually depends on the memory allocated to
-
Please refer to OF_Windows_Guide.pdf in installation folder under Document folder for more details.
-
If the installation no longer works correctly and you want to reinstall it by following Uninstallation procedure.
Advanced Use (Development platform including compilation guidance)
New in OpenFOAM4Windows v1612+
-
This OpenFOAM installation environment provides you with both a working and a development platform. To compile modified source code, please do as follows:
i. Login as
root
(su root) with password0fuser2016
ii. Go to
/opt/OpenFOAM/OpenFOAM-v1612+
iii. Run
./Allwmake
(it will create the full dependency list and object files).iv. Go to the folder with modified source code, and compile the changed files.
-
Please note that the following third-party utility version have been used to compile OpenFOAM-v1612+
i. openmpi-1.10.4
ii. Gcc-4.8.5
iii. CGAL-4.9
iv. boost_1_62_0
v. scotch-6.0.3
-
Images is based Centos 6.6. Root password for account is
ofuser2016
. User can further install any desired utility/software by using yum command
N.B. Please send any suggestions you might have on this README file or other comments on the OpenFOAM4Windows environment to [email protected]