# Solids4foam-openfoam FSI coupling: can't use stress as the exchange data

**URL:** <https://precice.discourse.group/t/solids4foam-openfoam-fsi-coupling-cant-use-stress-as-the-exchange-data/2634>\
**Category:** Official adapters and tutorials\
**Tags:** openfoam, adapters, fsi\
**Created:** [October 5, 2025, 5:45am UTC](https://precice.discourse.group/t/solids4foam-openfoam-fsi-coupling-cant-use-stress-as-the-exchange-data/2634 "2025-10-05T05:45:02Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![zyx](https://avatars.discourse-cdn.com/v4/letter/z/6a8cbe/32.png) [@zyx](https://precice.discourse.group/u/zyx)\
**Post date:** [October 5, 2025, 5:45am UTC](https://precice.discourse.group/t/solids4foam-openfoam-fsi-coupling-cant-use-stress-as-the-exchange-data/2634/1 "2025-10-05T05:45:02Z")

</div>

Hello everyone！ I am using solids4foam and OpenFOAM to simulate an FSI problem. I want to use Stress as the exchange date instead of Force. However, solids4foam displayed error messages as：

```
[31mError (deferred - will exit later) in the preCICE adapter: e[0m Reading forces is not supported.

```

The following are my config files:  
[precice-config.xml](https://precice.discourse.group/uploads/short-url/hQtUCrq3QbLdVzhq8B8ycageKEn.xml) (3.0 KB)  
[preciceDict-fluid.txt](https://precice.discourse.group/uploads/short-url/kTkIfTnfNtUb0AtWgKtbRsDKIlD.txt) (1.1 KB)  
[preciceDict-solid.txt](https://precice.discourse.group/uploads/short-url/63yEitG438GnMyo5PTgrMkEIcgW.txt) (1.0 KB)  
Could you please help me check them for errors?  
The following are the log files after running:  
[fluid.log](https://precice.discourse.group/uploads/short-url/nBibnInZhdrfHaNMdaeMNdI48fS.log) (30.5 KB)  
[slurm-solid.out](https://precice.discourse.group/uploads/short-url/mmqlk2ntXUQfRHR555qhm7i6xqS.out) (4.8 KB)  
[solid.log](https://precice.discourse.group/uploads/short-url/jwjHUoS1RNLLUHs7UAX3Dz7LxOH.log) (13.8 KB)

😊

---

<div class="post-metadata">

**Author:** ![Makis](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/makis/32/25_2.png) [@Makis](https://precice.discourse.group/u/Makis)\
**Post date:** [October 8, 2025, 9:11am UTC](https://precice.discourse.group/t/solids4foam-openfoam-fsi-coupling-cant-use-stress-as-the-exchange-data/2634/2 "2025-10-08T09:11:58Z")

</div>

Reading forces is supported since v1.2.0 of the adapter, and you do run v1.2.1 (which is good).

Have a look at our tutorial case with solids4foam:

> <https://github.com/precice/tutorials/blob/develop/perpendicular-flap/solid-solids4foam/system/preciceDict>

The error message is indeed confusing and we should refine it with suggestions:

> <https://github.com/precice/openfoam-adapter/blob/v1.2.1/FSI/ForceBase.C#L200>

It is also a bit strange that this is triggered (I need to look deeper into it). The right code should be:

> <https://github.com/precice/openfoam-adapter/blob/v1.2.1/FSI/Force.C#L44>

Could you tell me how to reproduce the issue starting from the tutorial?

However, your configs (`preciceDict`) show stresses, not forces. Could you please check again?

There is a limitation that only solid participants can read `Force` and `Stress`, and it is important to use the exact words (or start with them).

---

<div class="post-metadata">

**Author:** ![zyx](https://avatars.discourse-cdn.com/v4/letter/z/6a8cbe/32.png) [@zyx](https://precice.discourse.group/u/zyx)\
**Post date:** [October 11, 2025, 3:05am UTC](https://precice.discourse.group/t/solids4foam-openfoam-fsi-coupling-cant-use-stress-as-the-exchange-data/2634/3 "2025-10-11T03:05:00Z")

</div>

Sorry for being late to reply!  
I used a tutorial case of “perpendicular-flap” to reproduce the issue. I changed the Force to Stress in the config files. The error also displayed as “Reading forces is not supported.”  
The following are the config files:  
[precice-config.xml](https://precice.discourse.group/uploads/short-url/9cpIwGnCRn8D8Ugr6oBDujqozAj.xml) (2.8 KB)  
[preciceDict-fluid.txt](https://precice.discourse.group/uploads/short-url/prnAnIE7VDSNuA6VS3C6Wr6w7O6.txt) (661 Bytes)  
[preciceDict-solid.txt](https://precice.discourse.group/uploads/short-url/wfUMCUrmYM66kHr5kJlpHVVAq4g.txt) (942 Bytes)  
The following are the output log files:  
[fluid.log](https://precice.discourse.group/uploads/short-url/qzv49rQLANBu5XVjST8bWXN22nS.log) (6.4 KB)  
[solid.log](https://precice.discourse.group/uploads/short-url/ycwT08jmbgUdlKwZlTXP5GhdDN9.log) (5.0 KB)  
The following is the modfiled perpendicular-flap case:  
[flap-stress.zip](https://precice.discourse.group/uploads/short-url/rImiznNwySt9OURtIsuaR0mw65y.zip) (113.0 KB)  
Could you please check where they are set incorrectly? Thank you very much!

---

<div class="post-metadata">

**Author:** ![Makis](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/makis/32/25_2.png) [@Makis](https://precice.discourse.group/u/Makis)\
**Post date:** [October 13, 2025, 9:22am UTC](https://precice.discourse.group/t/solids4foam-openfoam-fsi-coupling-cant-use-stress-as-the-exchange-data/2634/4 "2025-10-13T09:22:06Z")

</div>

Now I see what you mean and what the issue is. Yes, reading stresses is not yet supported, but should be easy to add:

> <https://github.com/precice/openfoam-adapter/issues/240>
>
> https://github.com/precice/openfoam-adapter/pull/236 added the possibility to re…ad forces, effectively enabling structure solvers (such as solidDisplacementFoam or solids4Foam) to use the adapter.
> 
> It would still be nice if the adapter could also read stresses (\`Stress\`). This should hopefully not be so complicated to implement, assuming it is relatively similar to the writing part.

See the list of supported read/write fields:

> **[The OpenFOAM adapter](https://precice.org/adapter-openfoam-overview.html)**
>
> An OpenFOAM function object for CHT, FSI, and fluid-fluid coupled simulations using preCICE.

The error is indeed misleading, as you are asking for stresses, but get an error about forces. Assume “stresses” in the error message (I fixed the error message in [Fix error message for reading stresses by MakisH · Pull Request #379 · precice/openfoam-adapter · GitHub](https://github.com/precice/openfoam-adapter/pull/379/)).

---

<div class="post-metadata">

**Author:** ![zyx](https://avatars.discourse-cdn.com/v4/letter/z/6a8cbe/32.png) [@zyx](https://precice.discourse.group/u/zyx)\
**Post date:** [October 15, 2025, 12:29am UTC](https://precice.discourse.group/t/solids4foam-openfoam-fsi-coupling-cant-use-stress-as-the-exchange-data/2634/5 "2025-10-15T00:29:44Z")

</div>

Thank you for your reply!  
I am wondering if solids4foam can only write the date “displacement” and read data “Force”? So far, it doesn’t support exchanging other types of dates, such as reading “stress”, writing “displacementDelta”, or writing “velocity”, right?

---

<div class="post-metadata">

**Author:** ![zyx](https://avatars.discourse-cdn.com/v4/letter/z/6a8cbe/32.png) [@zyx](https://precice.discourse.group/u/zyx)\
**Post date:** [October 15, 2025, 3:13am UTC](https://precice.discourse.group/t/solids4foam-openfoam-fsi-coupling-cant-use-stress-as-the-exchange-data/2634/6 "2025-10-15T03:13:00Z")

</div>

Could I ask some more questions about exchanging data in an FSI simulation? Question 1:OpenFOAM fluid simulation requires ‘velocity’ data on the interface boundary, but solids4faom solid simulation can only provide ‘displacement’. Does Precice have the function to calculate point velocity using the displacement on the interface boundary and then provide the velocity to OpenFOAM?  
Question 2:Furthermore, as I understand it, fluid velocity should equal solid velocity at the interface boundary. In the tutorial, many cases only exchange displacement data. Why can velocity be ignored? Could you share your thoughts on this?  
Question 3:Also, Precice exchanges displacement and force, which is the Dirichlet–Neumann boundary condition. How is the Robin-Neumann boundary condition used, where fluid takes a combination of kinematic and dynamic interface conditions as the boundary condition? How can this be achieved?  
I would be very grateful if you could clear up my confusion! 🙏 😊

---

<div class="post-metadata">

**Author:** ![Makis](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/makis/32/25_2.png) [@Makis](https://precice.discourse.group/u/Makis)\
**Post date:** [October 30, 2025, 3:20pm UTC](https://precice.discourse.group/t/solids4foam-openfoam-fsi-coupling-cant-use-stress-as-the-exchange-data/2634/7 "2025-10-30T15:20:08Z")

</div>

> [@zyx](#):
>
> 1:OpenFOAM fluid simulation requires ‘velocity’ data on the interface boundary, but solids4faom solid simulation can only provide ‘displacement’. Does Precice have the function to calculate point velocity using the displacement on the interface boundary and then provide the velocity to OpenFOAM?

No, the adapter does not handle this explicitly.

> [@zyx](#):
>
> Question 2:Furthermore, as I understand it, fluid velocity should equal solid velocity at the interface boundary. In the tutorial, many cases only exchange displacement data. Why can velocity be ignored? Could you share your thoughts on this?

Since the velocity depends directly on the displacement (derivative), we don’t impose it. One could extend the adapter to exchange the velocity of the interface as well (in fact, we had this in first implementations), but so far we had several successful applications exchanging only displacement and force/stress.

> [@zyx](#):
>
> Question 3:Also, Precice exchanges displacement and force, which is the Dirichlet–Neumann boundary condition. How is the Robin-Neumann boundary condition used, where fluid takes a combination of kinematic and dynamic interface conditions as the boundary condition? How can this be achieved?

We don’t support such coupling for FSI in the OpenFOAM adapter at the moment, but one could extend it. In terms of preCICE, this is possible, and we already have examples of Robin coupling in CHT applications (see heat exchanger).

---

<div class="post-metadata">

**Author:** ![zyx](https://avatars.discourse-cdn.com/v4/letter/z/6a8cbe/32.png) [@zyx](https://precice.discourse.group/u/zyx)\
**Post date:** [October 31, 2025, 12:47am UTC](https://precice.discourse.group/t/solids4foam-openfoam-fsi-coupling-cant-use-stress-as-the-exchange-data/2634/8 "2025-10-31T00:47:29Z")

</div>

Thank you very much for your response, which solves my question. 😊

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/precice/original/1X/67d2a5fa6f80e597e2267ff17fa8c1673cd11caa.svg) [@system](https://precice.discourse.group/u/system)\
**Post date:** [November 3, 2025, 12:47am UTC](https://precice.discourse.group/t/solids4foam-openfoam-fsi-coupling-cant-use-stress-as-the-exchange-data/2634/9 "2025-11-03T00:47:48Z")

</div>

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