openfoam/modules
2023-05-10 19:14:51 +02:00
..
adios@d51b1c14da SUBMODULE: updates for adios, cfmesh, OpenQBMM, external-solver 2022-12-13 11:18:54 +01:00
avalanche@f97d2c3513 SUBMODULE: update avalanche (compilation change only) 2023-02-17 13:24:29 +01:00
cfmesh@8faa204aed SUBMODULE: updates for adios, cfmesh, OpenQBMM, external-solver 2022-12-13 11:18:54 +01:00
doc DOC: update modules/README.md and Cross-Compile-mingw information 2020-06-17 00:01:22 +02:00
external-solver@94874d0d60 SUBMODULE: minor updates for external-solver 2023-03-02 12:37:06 +01:00
OpenQBMM@ec923f2487 SUBMODULE: updates for adios, cfmesh, OpenQBMM, external-solver 2022-12-13 11:18:54 +01:00
visualization@8c0c81f563 SUBMODULE: removed catalyst handling for paraview 5.5 and earlier 2023-05-10 19:14:51 +02:00
Allwmake COMP: add -pthread for AMD compiler rule 2021-12-15 19:13:27 +01:00
list-modules COMP: add -pthread for AMD compiler rule 2021-12-15 19:13:27 +01:00
README.md DOC: misc updates to doc files 2020-06-23 10:18:32 +02:00

[[TOC]]

OpenFOAM Modules

This directory is a location for additional OpenFOAM components or tools to placed and have them built as part of the normal OpenFOAM build process. It is assumed that each subdirectory contain an appropriate Allwmake (or Allwmake.override) file.

Build locations

Any individual module will normally also be able to exist outside of the module directory structure and will typically build into user locations ($FOAM_USER_APPBIN, $FOAM_USER_LIBBIN).

When compiled from the top-level OpenFOAM Allwmake or the modules/Allwmake, they should build into OpenFOAM project locations ($FOAM_APPBIN, $FOAM_LIBBIN). This can be adjusted by supplying an alternative -prefix= to the corresponding Allwmake command.

Command Install location
./Allwmake -prefix=user $FOAM_USER_APPBIN, $FOAM_USER_LIBBIN
./Allwmake -prefix=group $FOAM_SITE_APPBIN, $FOAM_SITE_LIBBIN
./Allwmake -prefix=openfoam $FOAM_APPBIN, $FOAM_LIBBIN
./Allwmake -prefix=/some/pathname /some/pathname/bin, /some/pathname/lib

Adding additional components

These additional components may be added as git submodules, by script or by hand.

git

On the first use, it will be necessary to register the submodules:

git submodule init

This will clone the relevant submodules from their respective repositories.

The following will indicate the current state:

git submodule status

On the first use, or after merging upstream changes in the OpenFOAM repository, it will be necessary to update the submodules:

git submodule update

A quick overview of git submodule can be in this blog with full details in the manpage.

An easy way to see which submodules are actually in use:

cat .gitmodules

Which will reveal content resembling the following:

[submodule "avalanche"]
    path = modules/avalanche
    url = https://develop.openfoam.com/Community/avalanche.git
[submodule "cfmesh"]
    path = modules/cfmesh
    url = https://develop.openfoam.com/Community/integration-cfmesh.git
...

Documentation (doxygen)

To build the doxygen information for the components, it is also necessary to link the directories to the doc/ subdirectory. This is a purely manual operation.

Developer Information

Build locations

To accomodate building into various locations, the module code should be adapted with the following changes:

  • Make/files

    ...
    EXE = $(FOAM_MODULE_APPBIN)/someExecutable
    
    LIB = $(FOAM_MODULE_LIBBIN)/libSomeLibrary
    
  • Make/options should include this

    include $(GENERAL_RULES)/module-path-user
    ...
    

The following changes to Make/options are universally applicable (ie, work with older or other versions of OpenFOAM), but more verbose.

  • Make/options with the following
    sinclude $(GENERAL_RULES)/module-path-user
    
    /* Failsafe - user locations */
    ifeq (,$(FOAM_MODULE_APPBIN))
    FOAM_MODULE_APPBIN = $(FOAM_USER_APPBIN)
    endif
    ifeq (,$(FOAM_MODULE_LIBBIN))
    FOAM_MODULE_LIBBIN = $(FOAM_USER_LIBBIN)
    endif
    ...