Installation

OpenFOAM version compatibility

The libWMLES library supports the OpenFOAM fork developed by OpenCFD. Currently, releases from OpenCFD from v1806 and above are supported. There is desire to support the Foundation and foam-extend forks as well, but cannot do so due to lack of time. Please open an issue if you would be willing to work on maintaining compatibility with these forks!

The best level of testing is done for the latest available release from OpenCFD, at the moment of the release of the library. For the current release, this is version v2512. The V&V 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, meaning that the amount of supported versions grows with two 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 to the releases on GitHub. A prerequisite for installing is having Python installed, but no packages are needed and any modern Python version should do. Additionally, the library relies on the boost library, which is shipped with OpenFOAM under ThirdParty but can also be installed separately. Like OpenFOAM itself, the BOOST_ARCH_PATH environmental variable is used to locate the boost headers.

To compile, run Allwmake. Consider using the -j flag with a number of processors, to speed up the process. If you get compilation errors, please make sure your OpenFOAM environment is properly set up before opening a Github 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 your setup.

When recompiling for a different version of OpenFOAM than what was previously used, you should first run Allwclean. 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.

Compiling documentation

The documentation is built in two stages. First, Doxygen parses the source tree and generates XML under docs/xml. Then Exhale and Sphinx consume that XML and produce the final documentation under docs/build/html.

To build the documentation, install the documentation dependencies from docs/environment.yaml or docs/requirements.txt. At minimum you need Doxygen together with Sphinx, Breathe, Exhale, the Read the Docs theme, and sphinxcontrib-bibtex.

For the Doxygen stage, change to docs and run:

doxygen Doxyfile

This generates the XML used by Breathe and Exhale in docs/xml. Since the Doxygen input path is configured as ../, the command should be run from the docs directory.

For the Exhale and Sphinx stage, also run from docs:

make html

This produces the rendered HTML documentation in docs/build/html/index.html. The Sphinx configuration sets exhaleExecutesDoxygen = True, so make html will also run Doxygen automatically if you prefer to build everything in one step.

To remove generated documentation artifacts before a rebuild, run:

make clean

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 cloned 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.