# Installation¶

## OpenFOAM version compatibility¶

The libWMLES library supports two forks of OpenFOAM, developed by OpenCFD, and the OpenFOAM Foundation, repsectively. Curently, all releases from OpenCFD up to v2012 are supported, as well as releases 3.0.x to 9 from the Foundation. It should be stressed that supported means that it is checked that the library compiles. This should in principle entail that it also works properly, but due to time constraints and the ambitious number of versions suported, it is impossible to actually run test cases for all of them. That being said, libWMLES has been extensively used with version 3.0.x, 4.1, and v1806 of OpenFOAM. Reports regarding difficulties with running a particular version are welcome: please open an issue on Bitbucket.

The best level of testing is done for latest available release from OpenCFD, for which the test harness is run. This consists of unit and integration tests that aim to cover all the functionality of the library. A single system test is also run, which is a simulation of channel flow on a coarse grid, using the Spalding-law wall model and otherwise default parameters in the nut dictionary.

The aim is to support all new OpenCFD and Foundation releases, meaning that the amount of supported versions grows with three per year. This is likely to become unsustainable, leading to deprecation of support for the oldest versions.

## Compilation¶

Clone the repository with git or download it as an archive by navigating Downloads in the menu on Bitbucket. A prerequisite for installing is having Python installed, but no packages are needed and any modern Python version should do. To compile, run Allwmake. If you get compilation errors, please make sure your OpenFOAM environment is properly set up before opening a Bitbucket issue. In particular, take notice of the first couple of lines in the output for Allwmake, which are of the following form:

Current OpenFOAM version is v1806.
This is a clean install
OpenFOAM-version: Major 1806 Minor 0 Patch 0 (-1 == x / 0) Fork: com


As you can see, they state which version of OpenFOAM the install script has picked up. If it doesn’t correspond to your expectations, there is almost surely something fishy with you setup.

When recompiling for a different version of OpenFOAM than what was previously used, you should frist run Àllwclean. If you make several compilation attempts and things don’t work, it can be a good idea to delete Make/linux* and lnInclude to make sure you start from a clean slate.

## Running tests¶

To run the tests, Google Test and Google Mock should first be installed, see https://github.com/google/googletest. The environmental variable GTEST_DIR should point to the root directory containing both Google Test and Google Mock (i.e. the directory to which you’ve clone the googletest repo). Don’t forget to copy the compiled libraries to your FOAM_USER_LIBBIN.

The unit tests are located in the tests directory, are compiled with wmake producing the file testRunner, which could be executed to run the tests. The integration tests are located in test/integrationTests, are also compiled with wmake, and the produced executable is called testIntegration.