How to debug the OpenFOAM adapter?

First of all, some general comments:

  • Debugging partitioned simulations is anyway complicated. Going with a debugger (such as gdb, as mentioned above, or any other debugger/interface you want) is always a good idea, but you will need more results-oriented simulation. In that case, remember that the adapter needs to be compiled with debug symbols (-g flag, you can add it, e.g., in the Make/options file next to the include paths, so that every object file is built with debug symbols enabled. I guess this should be enough.). You may also want to have a debug build of OpenFOAM, to get more insight there.
  • Exports really help when debugging any partitioned simulation, as mentioned above.
  • You may also want to work with the simplest coupling and mapping available (explicit coupling, nearest-neighbor mapping, uni-directional coupling), without subcycling (set the solver time step size to be equal to the coupling time window size).
  • You can set the results writing period of OpenFOAM to be the same as the solver time step size.

On more specific parts of your questions:

The adapter does not print these, you need to use the preCICE exports.

As mentioned above, you can start an application with additional options from inside gdb. See also this discussion.

This is now going to a different direction, which is not needed, but did you also start your solid solver from inside its own subdirectory? Remember that the exchange-directory is applied to both participants.

1 Like