Skip to content

How to extend the adapter

Makis Chourdakis edited this page Nov 27, 2017 · 5 revisions

The OpenFOAM adapter separates the core functionality (e.g. calling preCICE methods) from the problem-specific methods (e.g. accessing fields and converting quantities). The latter is encapsulated into "modules", which add only a few lines of code in the core. The following, simplified UML diagram gives an overview:

simplified UML diagram

At the moment the adapter includes only a module for conjugate heat transfer. However, a mechanical fluid-structure interaction module is planned and additional modules can easily be developed.

In case you just want to couple a different variable, you need to create a new coupling data user class in the preciceAdapter::CHT namespace or in a new one. Then you need to add an option for it in the configuration part to add objects of it into the couplingDataWriters and couplingDataReaders whenever requested.

There are some NOTEs in the files Adapter.H, Adapter.C, CHT/CHT.C, and CHT/Temperature.H to guide you through the process.

Note: make sure to include any additional required libraries in the LIB_LIBS section of the Make/options. Since the adapter is a shared library, another missing library will trigger an "undefined symbol" runtime error.

See also issue #7: Create a module for fluid-structure interaction.

Clone this wiki locally