How to use force data without mesh between OpenFOAM and my code

Hi

My case is about a floating body with wind force, but the wind force is calculated by my code. Now I want to use the openfoam for the floating body, and the position of the floating body will get different wind force. I want to use precice only transform the position of the floating body to my code and transform the force, moment to the openfoam.

I don’t know if precice can do it, because precice seems using data based on mesh.

Any

Best regards

I mean to translate data by the dictionary an without the mesh, any one can help me or give me some advise?

Hi @smallduan,
I found myself in a similar position. According to this Github issue Handling global coupling data (not associated to a mesh), this is a planned feature but not yet available. Currently, the “official” workaround is to create a dummy mesh (one vertex at [0, 0, 0] for example) and read and write data, see preCICE global data.
Since I don’t think there is a way of having a single vertex in a patch in OpenFOAM, my solution was to use consistent mapping to write the same value from the single vertex to every node on the OpenFOAM patch.
You do probably have to modify the preCICE OpenFOAM adapter, if you want to couple other data. It is fairly straight forward, since you can copy a lot of the code used for the predefined coupling variables (forces, stress,…).

I hope this helps!

regards
David