Multiple Coupling Variable for OpenFOAM

Hello,

I am currently working on FSI simulation using OpenFOAM and Deal II and want to modify the coupling variable. I want OpenFOAM adapter to read 2 variable from Deal II (displacement and acceleration). Is there a way to do that? Or is there any thread that has already discussed this (i have not found anything related to this).

Thank You

Hi @diksanm7,

that’s a good question. May I ask you to describe a bit more in detail what you want to do with the second variable? In principle, reading multiple data sets associated to the same interface is possible. However, there are currently no readers and writers for acceleration data. How do you intend process the acceleration data? You can find some general information about extending the OpenFOAM adapter in the corresponding adapter documentation Extend the OpenFOAM adapter | preCICE - The Coupling Library.

Hi @DavidSCN, thank you for the answer

So, i would like to implement some equations for the boundary interface. Normally, OpenFOAM writes the fluid stress and then to be read by Deal II directly (solid stress input = fluid stress). But i need correction for the solid stress input (solid stress input = fluid stress + correction stress) where the correction stress is also a function of acceleration from the previous time step. Currently, i am still working on creating the acceleration class for OpenFOAM adapter.

I’m not sure if there is a predefined acceleration (of what?) field available in OpenFOAM, from which you can immediately extract the data you are looking for. If you anyway want to correct the Stress data field, you can also directly add your correction contribution within the Stress data class (no need to create a new class for it) openfoam-adapter/ForceBase.C at da63afb96560be7cf2b2a18dbd53f983abc806c2 · precice/openfoam-adapter · GitHub

If you decide to create a new class you may want to consider using a summation action in preCICE (Action configurations | preCICE - The Coupling Library). Then, preCICE will handle the summation of the two distinct data fields and transfer the sum to OpenFOAM.

I mean the acceleration is from Deal II. So it will be like this,

  1. Deal II writes 2 variables which are displacement and acceleration. The displacement to be read by OpenFOAM will be corrected by function of fluid stress (solved).
  2. OpenFOAM writes fluid stress. The fluid stress to be read by deal II will be corrected by function of fluid stress (solved) and the acceleration which was written by deal II earlier. I think the acceleration does not need to be read by OpenFOAM but need to be read by the adapter only.

Any suggestion about this?

Wouldn’t it be easier to perform the acceleration correction on the deal.II side instead of the OpenFOAM side?

In case this is not possible, you can still do what you are looking for in multiple ways. You could e.g. create a dedicated buffer for the acceleration https://github.com/precice/openfoam-adapter/blob/154eb718c4708e3f65dcc3a077741314b123bcd1/Interface.H#L42-L43 and read later on data from this buffer when writing the stress. As an alternative, you could probably also use the current interface of the adapter (i.e. create an acceleration data class) and access the acceleration data during the stress computation, as the data buffer of each interface is shared among data classes. All in all, it is definitely possible, but will require changes in different places.