OpenFOAM 1.6.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.6.x). Be warned - to build OpenFOAM for Windows with a cross compiler requires expert knowledge of Linux utilities and compilers.
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? Then try our Caedium RANS Flow add-on.
The following steps are required to produce a native Windows version of OpenFOAM 1.6.x using a cross compiler:
- Configure, build, install and test a MinGW cross compiler for Windows running on Linux. I used the build-mingw.sh script.
#include_next <float.h>to the end of
lib/gcc/mingw32/4.4.1/include/float.h and remove it from
mingw32/include/float.h to include the right float.h.
- Install the OpenFOAM 1.6.x source distribution on Linux - git Commit: 50d2858505ca00e44776ce89cab97f9a33f098e8 Date: Dec 2 15:26:12 2009.
- Patch (using the Linux patch command) the OpenFOAM 1.6.x source distribution with our MinGW Windows modifications [last updated March 5, 2010 to v10].
- Copy wmkdep and dirToString from wmake/bin/linuxGcc to wmake/bin/linuxmingw32.
- Export environment variables and source etc/bashrc. As an example:
- Build using Allwmake in the OpenFOAM-1.6.x directory on Linux.
- Transfer the OpenFOAM executables (applications/bin/linuxmingw32*/*.exe) and libraries (lib/linuxmingw32*/*.dll) to the Windows computer.
- Launch a Windows command prompt to run OpenFOAM solvers and utilities, such as simpleFoam.exe.
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.
With this method of building OpenFOAM for Windows the following features (there maybe more) are unavailable:
- job control scripts in bin (such as foamSolverSweeps)
The following applications and libraries are unlikely to build:
- Scotch, metis, MPI and any dependents