Skip to content

Multiple OpenFOAM forks

Elwardi edited this page Nov 6, 2022 · 2 revisions

Working with multiple OpenFOAM forks

Typically you'll be working with only one OpenFOAM fork per project. But if you want to write code that works with at least some of the forks, the following workflow is recommended:

What needs to be changed

Probably you'll need to change:

  • Cases under cases directory to be compatible with the version you're using.
  • Make/options files to compile test drivers, taking into consideration each fork's way of linking things.

You don't have to worry about the second issue because this file is actually supplied with your tests - you can have multiple branches of your tests (you'll probably need multiple branches to support multiple forks in your code anyway).

The cleanest way to do this is by:

  • Keeping a base branch (eg. master) which works with one of the forks.
  • Branch off for the other forks, commit changes to the cases directory only.
  • All other changes you make to the repository go into master.
  • Rebase your branches on top of master every time master gets new commits (or as often as you like).

Then you can adjust CI jobs to run only the associated OpenFOAM fork checks on the branches.

You can follow this model in your code too; branch off to a fork-specific branch and only commit implementation changes there. That way you can at least have a consistent interface through all supported forks.

Clone this wiki locally