# A coupling problem between Openfoam and Calculix

**URL:** <https://precice.discourse.group/t/a-coupling-problem-between-openfoam-and-calculix/1948>\
**Category:** Using preCICE\
**Tags:** openfoam, calculix, fsi\
**Created:** [June 3, 2024, 9:30am UTC](https://precice.discourse.group/t/a-coupling-problem-between-openfoam-and-calculix/1948 "2024-06-03T09:30:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cj1823149636](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/cj1823149636/32/1928_2.png) [@cj1823149636](https://precice.discourse.group/u/cj1823149636)\
**Post date:** [June 3, 2024, 9:30am UTC](https://precice.discourse.group/t/a-coupling-problem-between-openfoam-and-calculix/1948/1 "2024-06-03T09:30:59Z")

</div>

Hello everyone, I am trying to use Openfoam and Calculix to calculate a three-dimensional flexible plate problem. I set the total duration of fluid solver, structural solver, and precision coupling to 5 seconds with a fixed time step of 0.0001 seconds. When I finally calculated to 4.9999s, the following issues occurred with the structural terminal:

 ![1](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/1/160876f2d6ade6e81710e0432150d24a74071293.jpeg)  
As far as I know, this situation should occur when the solver’s solving time step is 0 or very close to 0. But I have been using fixed time steps all along, and I also calculated 4.9999s before. I don’t know what the problem is or what I set up to cause it. I need your help, thank you.

I am using Openfoam v2112 (Openfoam-adapter 1.3.0)、Calculix 2.20、precice-3.1.1.  
The following are the controlDict files, and inp input files for Openfoam and Calculix.  
[controlDict.txt](https://precice.discourse.group/uploads/short-url/ikAEN35GRSHmbfmSx4N5SB1elqy.txt) (1.6 KB)  
[precice-config.xml](https://precice.discourse.group/uploads/short-url/8yzr3WAGxpQ617C9WEWWGrz8EBE.xml) (2.5 KB)  
[new\_flap\_3d\_1.inp](https://precice.discourse.group/uploads/short-url/rF9D2lSX7qLkNY2XYnSRKSNeu6Z.inp) (1.2 MB)

---

<div class="post-metadata">

**Author:** ![Mike\_Tree](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/mike_tree/32/472_2.png) [@Mike\_Tree](https://precice.discourse.group/u/Mike_Tree)\
**Post date:** [June 6, 2024, 6:43pm UTC](https://precice.discourse.group/t/a-coupling-problem-between-openfoam-and-calculix/1948/2 "2024-06-06T18:43:49Z")

</div>

preCICE takes control over the total duration of the coupled analysis, so you can set both OpenFOAM an Calculix to run longer than 5 seconds and preCICE will shut them down at the appropriate time any way. What you’re experiencing appears to be a bug in the Calculix adapter where preCICE is being fed a 0 time step because the adapter is wrongly thinking it’s already at 5.0 seconds and that’s when the simulation should end – so it tells preCICE that the Calculix time step should be 0.0 s. The work-around may be to set lines 21291 and 21292 in your `new_flap_3d_1.inp` file to:

```
*Dynamic, Direct
0.0001, 6

```

or at least greater than or equal to 5.0001.

---

<div class="post-metadata">

**Author:** ![cj1823149636](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/cj1823149636/32/1928_2.png) [@cj1823149636](https://precice.discourse.group/u/cj1823149636)\
**Post date:** [June 7, 2024, 9:44am UTC](https://precice.discourse.group/t/a-coupling-problem-between-openfoam-and-calculix/1948/3 "2024-06-07T09:44:22Z")

</div>

Thank you for your help. I understand now！

---

<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:** [June 10, 2024, 9:45am UTC](https://precice.discourse.group/t/a-coupling-problem-between-openfoam-and-calculix/1948/4 "2024-06-10T09:45:05Z")

</div>

Closed on June 10, 2024, 9:45am UTC

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