OpenFOAM adapter: Issue with several modules

Hello preCICE developers and community,

I was wondering about an error occurring if several modules (e.g. FSI FF) inside the OpenFOAM configuration are used.
The error message is the following for my case:

---[preciceAdapter] [DEBUG]   preCICE solver interface was created.
---[preciceAdapter] [DEBUG] Creating interfaces...
---[preciceAdapter] [DEBUG] Number of face centres: 63
---[preciceAdapter] [DEBUG] Interface created on mesh Fluid-Mesh2
---[preciceAdapter] [DEBUG] Adding coupling data writers...
---[preciceAdapter] [DEBUG] Added writer: Pressure.
---[preciceAdapter] [DEBUG] Added writer: Velocity.
---[preciceAdapter] [DEBUG] Adding coupling data readers...
---[preciceAdapter] [DEBUG] Number of face centres: 63
---[preciceAdapter] [DEBUG] Interface created on mesh Fluid-Mesh1
---[preciceAdapter] [DEBUG] Adding coupling data writers...
---[preciceAdapter] [DEBUG] Added writer: Force.
--> FOAM Warning : 
    From void adapterInfo(std::string, std::string)
    in file Utilities.C at line 50
    Error (deferred - will exit later) in the preCICE adapter: 
Error in the preCICE adapter: 
Unknown data type - cannot add Force.

The Pressure and Velocity is added correctly by the FF module. But for the Force something interesting is happening … The Force is added, but afterwards an error is given, that the Force can’t be added.

I assume the same is happening here:

and a similar thing happened to @Alphaoo1 combining FSI & CHT (there was a short Gitter discussion about it).

After having a look inside the OpenFOAM adapter I was wondering about a certain thing comparing the FSI.c, FF.c and CHT.c files. Inside the FSI.c file for the read/write parts the if-else only searches for the specific data names. Inside FF.c and CHT.c there is an additional else case, which gives out the corresponding error message from above, if a certain data name can’t be found. I’m not a 100% sure how the adapter works in detail, but could it happen that in the above case, the FSI module adds the force successfully and at the same time the FF module triggers the additional else case, because it does not know about the data name “Force”. It would make sense, since the FSI module doesn’t feature the additional else and thus doesn’t complain about “Pressure” and “Velocity”.
I actually deleted the else case inside the FF module and now it works without an error message, so could that be the problem?

Is this understandable in some way? :wink:

Best regards
Max

You are totally right, @MaxFirmbach! Thank you for reporting this, I transferred the main information to an issue: Using multiple modules: false errors from CHT and FF · Issue #196 · precice/openfoam-adapter · GitHub

This should be easy to fix nicely and contributions are very welcome! :smiley:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.