I would like to know the possibility of coupling OpenFOAM with a Python based solver, where the coupled data (data to be transferred between the participants) is not defined on a mesh and hence there is no requirement for mapping. Stated briefly, I would like to communicate a few variables (around 6 - 8) between OpenFOAM and my python based solver and would like to know how to go about doing this.
I have my own solver in OpenFOAM that solves for the lubricant flow in journal bearings and the like. I have another solver that solves for the rotordynamics of a rotating shaft based on shaft-line modeling through finite elements. The bearing is modelled as located at a single node on the shaft. From the OpenFOAM solver, I required to extract the forces that act on the shaft in the x, y and z directions (these three forces are calculated from an integral over the entire pressure field of the lubricant flow). The OpenFOAM solver send these three forces to the python solver to alter the dynamics of the rotating shaft. From the rotordynamics solver, I require to extract the displacements (x,y,z and angular displacements) of the particular node on which the bearing is located and send it to the OpenFOAM solver. The OpenFOAM solver then uses this data to set a few of its fields.
As it can be seen, none of the data that requires to be communicated between the participants depend on a mesh, and hence none of the data needs to be mapped from one mesh onto another. As far as I can tell, I require to develop my own module within the openfoam-adapter (which I have partly done), and well as find a means to communicate a few variables without having preCICE mapping it or requiring to extract mesh-ID’s etc.
How might I go about doing this? Is there a simple approach already present within preCICE to do this, as it seems much simpler than having to map data between meshes? A rather dull coupling in comparison really.
The only workaround I could think of is to write my own mapping within the preCICE source code that doesn’t do any mapping, and just passes the data along. I could use a patch from OpenFOAM side to serve as this “dummy” mesh and define arbitrary coordinates to serve as a mesh on the side of my python solver. Is that sensible?
P.S. Forgive my ignorance, what kind of a coupling is this? Is it loosely coupled, tightly/strongly coupled, etc.?