# Growing Courant number in OpenFOAM FSI simulation

**URL:** <https://precice.discourse.group/t/growing-courant-number-in-openfoam-fsi-simulation/902>\
**Category:** Using preCICE\
**Tags:** openfoam, calculix, fsi\
**Created:** [February 9, 2022, 10:46am UTC](https://precice.discourse.group/t/growing-courant-number-in-openfoam-fsi-simulation/902 "2022-02-09T10:46:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rachaelesmith](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/rachaelesmith/32/682_2.png) [@rachaelesmith](https://precice.discourse.group/u/rachaelesmith)\
**Post date:** [February 9, 2022, 10:46am UTC](https://precice.discourse.group/t/growing-courant-number-in-openfoam-fsi-simulation/902/1 "2022-02-09T10:46:04Z")

</div>

Hi,

I have an ongoing issue with an FSI simulation that keeps going unstable on the OpenFOAM side - the max Courant number grows very large and the simulation crashes. I ran a successful version of this case with a coarser mesh in OpenFOAM, the issues then arose when I started using finer meshes (I did adjust the timestep to account for the change in the initial Courant number, which is below 0.5 at the start of the simulation). I have tried changing many of the OpenFOAM settings in fvSchemes and fvSolution with no success, and I am not sure if the issue is in OpenFOAM or preCICE. Does anyone have any advice? I can attach more of the case files if that would help.

[precice-config.xml](https://precice.discourse.group/uploads/short-url/lp4iAwgkp95MEF3LCly4ejxDdKR.xml) (2.7 KB)  
[log.fluid.tar](https://precice.discourse.group/uploads/short-url/v2aZJGwU0ZOfk0Vx31cP5yt7qrt.tar) (2.9 MB)

Thanks,  
Rachael

---

<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:** [February 11, 2022, 7:34pm UTC](https://precice.discourse.group/t/growing-courant-number-in-openfoam-fsi-simulation/902/2 "2022-02-11T19:34:17Z")

</div>

Hi @rachaelesmith,

I see that this simulation is running for quite some iterations and that you are using `DisplacementDelta`. I could imagine that there could be some accumulation of numerical error. Have you also tried coupling absolute displacements? Did you face any problems with that?

---

<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:** [February 13, 2022, 8:17pm UTC](https://precice.discourse.group/t/growing-courant-number-in-openfoam-fsi-simulation/902/3 "2022-02-13T20:17:00Z")

</div>

@rachaelesmith we recently released a new version of the CalculiX adapter (v2.19.0), you could also try if this fixes anything.

---

<div class="post-metadata">

**Author:** ![Stan](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/stan/32/599_2.png) [@Stan](https://precice.discourse.group/u/Stan)\
**Post date:** [February 15, 2022, 2:34am UTC](https://precice.discourse.group/t/growing-courant-number-in-openfoam-fsi-simulation/902/4 "2022-02-15T02:34:17Z")

</div>

Hi @Makis , I have the same issue while simulating a FSI case using OpenFOAM and our in-house solver with preCICE. Our solver converged well but the courant number became increasingly large at around 9s and then the OpenFOAM crashed at 9.26s. The log file of OpenFOAM solver and the configuration file are attached here. Since the log file is too large, I delete some content in it.  
[olaFlow\_part.zip](https://precice.discourse.group/uploads/short-url/wyKK2lvCQHk8uoBgfmkRHqPxUlQ.zip) (2.3 MB)  
[precice-config.xml](https://precice.discourse.group/uploads/short-url/uzp60w8fukRRstRzCnjUHNRPLzR.xml) (2.6 KB)  
Is it because the mesh deformation gets so large that the courant number rapidly increases and OpenFOAM crashes? Could you please share any hints on how to make the fluid mesh withstand larger deformation?

 ![InitialMesh](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/8/8cf3746fac371e19c67829e711e2790ff3cda581.jpeg) Initial mesh ![FinalMesh](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/1/1c28bdda958d03b6c7d284e0fbdf37d453c47699.jpeg) Final mesh

---

<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:** [February 15, 2022, 9:47am UTC](https://precice.discourse.group/t/growing-courant-number-in-openfoam-fsi-simulation/902/5 "2022-02-15T09:47:38Z")

</div>

Actually, in both cases, @rachaelesmith and @Stan could you check the quality of the deformed mesh? I guess that some very skewed cells could result in the Courant number increasing.

---

<div class="post-metadata">

**Author:** ![Stan](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/stan/32/599_2.png) [@Stan](https://precice.discourse.group/u/Stan)\
**Post date:** [February 16, 2022, 2:54pm UTC](https://precice.discourse.group/t/growing-courant-number-in-openfoam-fsi-simulation/902/6 "2022-02-16T14:54:12Z")

</div>

Hi @Makis , thanks for your reply!  
I used ‘checkMesh’ for the latest time and the log file has been uploaded. There are a severely non-orthogonal face and a highly skew face. Can we come to the conclusion that this is the reason why the Courant number increases rapidly?  
[checkMesh\_final.log](https://precice.discourse.group/uploads/short-url/7rNAERliQ0tuVGtZiyq6AyMwYaW.log) (3.2 KB)

---

<div class="post-metadata">

**Author:** ![Andres](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/andres/32/968_2.png) [@Andres](https://precice.discourse.group/u/Andres)\
**Post date:** [February 16, 2022, 3:51pm UTC](https://precice.discourse.group/t/growing-courant-number-in-openfoam-fsi-simulation/902/7 "2022-02-16T15:51:36Z")

</div>

Hi @Stan

To verify that hypothesis you could run the `CourantNo` function of the `postProcess` utility to get a Courant number field for the whole domain and for each timestep and contrast that with the skew / non-ortho face you obtained with `checkMesh` (use `foamToVTK -faceSet skewFaces` and `foamToVTK -faceSet nonOrthoFaces` to visualize them with ParaView). Look at the `Co` of those cells with that problematic face. That should help you determine if that’s the cause.

> Could you please share any hints on how to make the fluid mesh withstand larger deformation?

In my experience, when you are having problems with the mesh’s deformation making the domain larger sometimes helps.

Regards  
Andrés

---

<div class="post-metadata">

**Author:** ![Stan](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/stan/32/599_2.png) [@Stan](https://precice.discourse.group/u/Stan)\
**Post date:** [February 17, 2022, 2:27am UTC](https://precice.discourse.group/t/growing-courant-number-in-openfoam-fsi-simulation/902/8 "2022-02-17T02:27:22Z")

</div>

Hi @Andres  
Thanks for your suggestion. It’s very helpful to me. 😃

Best  
Stan
