Different unit system for two coupled solvers

Hi there,

I’m using calculix-openfoam-adapter to simulate FSI problems. For some reason, the model can only be run with the unit of millimeters in Calculix. As you may know, we use SI unit in openfoam, e.g. meter for length. Unfortunately, I use wavefoam solver in OpenFoam, so I cannot change the unit in openfoam or else wavefoam may face a problem when generation waves.
My question is, is there a way in precice that enable a simulation with two different unit systems? (meter in openfoam and millimeter in calculix)

Thanks!

Hi @xiangli

Welcome to the forum :smiley:

For the case that two simulations are handling quantities with different units, preCICE does not have explicit functionality to handle this. preCICE will map data between participants in the magnitude that it receives them and it will be responsibility of the user to convert the received data into whichever units are required. Hence possible solutions would be to convert quantities to same units before mapping or convert them to the appropriate units after mapping them.

Hi @xiangli ,

assuming that you want to scale your case by a given constant, implementing this on this OpenFOAM side is considerable easy. You can run

 grep -rn '::read(' FSI/*.C

in the openfoam-adapter directory in order to spot every occurrence of data reading in the FSI module. Afterwards, you can simply adjust the read values by prepending the desired constant in front of the buffer variable and recompile the adapter.

You could also use a Python callback action in preCICE to convert units.
https://precice.org/configuration-action.html#python-callback-interface