OpenFOAM 1.5.x on Windows
For the latest version of our Windows patch for OpenFOAM visit "OpenFOAM 2.2.x on Windows".
We have updated our Windows patch for OpenFOAM to match the latest OpenFOAM release (v1.5.x). Be warned - to build OpenFOAM for Windows with a cross compiler requires expert knowledge of Linux utilities and compilers.
OpenFOAM GUI
Are you looking for a GUI driven, integrated simulation environment for Windows, Linux, and Mac incorporating a selection of the RANS OpenFOAM solvers and various import/export filters?
Patch Build Process
The following steps are required to produce a native Windows version of OpenFOAM 1.5.x using a cross compiler:
- Configure, build, install and test a MinGW cross compiler for Windows running on Linux. I used the build-mingw script.
- Add
#include_next <float.h>
to the end of
"lib/gcc/mingw32/4.2.3/include/float.h" and remove it from
"mingw32/include/float.h" to include the right "float.h". - Install the OpenFOAM 1.5.x source (git Commit: 316c16a7cda8318061508cd4822037bf4685033c, Date: March 25, 2009) distribution on Linux
- Install the Third Party source pack and only compile the zlib library.
- Patch (using the Linux patch command) the OpenFOAM 1.5.x source distribution with our MinGW Windows modifications [last updated April 16, 2009 to v3].
- Copy wmkdep and dirToString from wmake/rules/linuxGcc to wmake/rules/linuxmingw32.
- Modify (or set environment variables) and source the etc/bashrc-mingw32 script to match your OpenFOAM 1.5.x source location.
- Build using Allwmake in the OpenFOAM-1.5.x directory on Linux.
- Transfer the OpenFOAM executables (applications/bin/linuxmingw32DPOpt/*.exe) and libraries (lib/linuxmingw32DPOpt/*.dll) to the Windows computer.
- Launch a Windows command prompt to run OpenFOAM.
Note that this latest version (v3) can now compile snappyHexMesh.
On the Windows computer ensure the following:
- The WM_PROJECT_DIR and USERNAME variables are set.
- The etc directory from the original source distribution is within the WM_PROJECT_DIR.
- The PATH variable is set to include the OpenFOAM executable and library locations.
Constraints
With this method of building OpenFOAM for Windows the following features (there maybe more) are unavailable:
- job control scripts in bin (such as foamSolverSweeps)
- parallel
The following applications and libraries are unlikely to build:
- libccmio
- metis and any dependents
Tips
You may need to copy foamFlex++ from a Linux OpenFOAM build to the MinGW build (applications/bin/linuxmingw32DPOpt).
Comments
OpenFOAM 1.5.x Windows Patch v2 Available
The latest patch (v2), in the build process above, ensures that readline is disabled in
applications/utilities/mesh/manipulation/setSet
for MinGW. If a system has/usr/include/readline/readline.h
then prior to this patch readline would be enabled and cause the build to fail. Thanks to Alexandre Pereira for reporting this problem.Windows OpenFOAM
Hello,
couldn't you make available the built windows version? It would be of great help to many interested people (like me :) ). Thanks
Good Question
We are currently developing a new Caedium add-on RANS Flow that will use a subset of the OpenFOAM solvers and libraries (binaries) for both Windows and Linux.
We aren't planning on releasing the entire standalone OpenFOAM system for Windows (600MB) due to bandwidth constraints and limited support resources - our focus is on developing Caedium.
As with all GPL software, anyone is welcome to use or modify our patch and release binaries at their expense.
The best option would be to incorporate our patch into the official OpenFOAM source and binary release. If are willing to fund this effort (either in-part or entirely) please contact OpenCFD directly.
Getting more things building and running
Hello to you good people at Symscape,
Thank you very much for your patches and tutorials, and in the spirit of sharing, I've posted my findings.
I've managed to get a bit further into cross-compiling OpenFOAM-1.5.x, and posted my developments here:
http://openfoam.cfd-online.com/forum/messages/1/7046.html?1232142105#POS...
I hope you can trim the edges and merge my patches with your patch, because with all of these, OpenFOAM 1.5.x can run even nearer of it's Linux capability in Windows! Sadly, except for speed...
Any questions you may have, you've got my email. And there is always the forum!
Once again, thank you very much!
Getting more things building and running - cleaner patches
Hello again,
I've updated the patches and created a tutorial for them, based on Symscape's v2 patch, and will enable building more stuff that was missing on the cross-compiled OpenFOAM 1.5.x, including using snappyHexMesh and parallel. Sadly, I couldn't get MPI to run properly, probably due to firewall issues.
Feel free to incorporate the total or part of these patches into yours!
Thank you very much and I hope these can help furthermore!
New Policy
After numerous requests for the Windows binaries, we are pleased to announce a Windows installer is now available for purchase at "OpenFlow: OpenFOAM for Windows."
It turns out by stripping the binaries of symbols and using aggressive compression within the installer the entire package can be reduced down to 41.3MB.
OpenFOAM 1.5.x Windows Patch v3 Available
The latest patch (v3), is based on a more recent OpenFOAM 1.5.x update (see the main article for details) from the git repository. Noteworthy is that snappyHexMesh no longer depends directly on Metis and can therefore be compiled for Windows.