# Pipe flow FSI using OpenFOAM and CalculiX

**URL:** <https://precice.discourse.group/t/pipe-flow-fsi-using-openfoam-and-calculix/1064>\
**Category:** Using preCICE\
**Tags:** communication\
**Created:** [June 8, 2022, 6:23pm UTC](https://precice.discourse.group/t/pipe-flow-fsi-using-openfoam-and-calculix/1064 "2022-06-08T18:23:19Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mishal49](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mishal49](https://precice.discourse.group/u/mishal49)\
**Post date:** [June 8, 2022, 6:23pm UTC](https://precice.discourse.group/t/pipe-flow-fsi-using-openfoam-and-calculix/1064/1 "2022-06-08T18:23:19Z")

</div>

Hello  
I was setting up an FSI case for a cylindrical pipe however, when I try to run the case, both OF and ccx stop at:  
“—[precice] Setting up master communication to coupling partner/s”  
I am not quite sure what the issue is and would appreciate any help.

[leePipe.zip](https://precice.discourse.group/uploads/short-url/9U6HDAOGVvWjC1WYaea3KNVV9Jw.zip) (5.3 MB)

---

<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:** [June 11, 2022, 9:11am UTC](https://precice.discourse.group/t/pipe-flow-fsi-using-openfoam-and-calculix/1064/2 "2022-06-11T09:11:33Z")

</div>

Hi @mishal49,

here are some things you can try: [Help! The participants are not finding each other! - #2 by Makis](https://precice.discourse.group/t/help-the-participants-are-not-finding-each-other/646/2)

---

<div class="post-metadata">

**Author:** ![mishal49](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mishal49](https://precice.discourse.group/u/mishal49)\
**Post date:** [June 11, 2022, 8:30pm UTC](https://precice.discourse.group/t/pipe-flow-fsi-using-openfoam-and-calculix/1064/3 "2022-06-11T20:30:58Z")

</div>

Hi @Makis,  
I did notice this post on using shell elements. Could this also be a potential issue? I have used shell elements in the Calculix setup.

> [@Perform 2D simulation with Calculix](https://precice.discourse.group/t/perform-2d-simulation-with-calculix/1032):
>
> Hello, I want to perform 2D FSI simulation with Calculix, I saw the test case of the perpendicular flap where the mesh provided has a thickness of 1. What happen if we put a thickness of 0.1 for the solid and we also put a thickness of 0.1 for the fluid domain ? I wanted to know if there is an explanation for this choice of thickness and if this is also working if I want to perform the HRON&TUREK FSI3 for example? I also noticed that you use solid element (C3D8I) for your test case, have you…

---

<div class="post-metadata">

**Author:** ![mishal49](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mishal49](https://precice.discourse.group/u/mishal49)\
**Post date:** [June 11, 2022, 8:41pm UTC](https://precice.discourse.group/t/pipe-flow-fsi-using-openfoam-and-calculix/1064/4 "2022-06-11T20:41:02Z")

</div>

I tried deleting the precice-run directory and re-ran the case but the solid gives the following error and the fluid one keeps running alone:

> Setting up preCICE participant Solid, using config file: config.yml  
> —[precice] This is preCICE version 2.3.0  
> —[precice] Revision info: no-info [Git failed/Not a repository]  
> —[precice] Configuration: Release (Debug and Trace log unavailable)  
> —[precice] Configuring preCICE with configuration “…/precice-config.xml”  
> —[precice] I am participant “Solid”  
> Set ID Found  
> Read data ‘Force’ found with ID # ‘3’.  
> Write data ‘DisplacementDelta’ found with ID # ‘2’.  
> —[precice] Setting up master communication to coupling partner/s  
> —[precice] Masters are connected  
> —[precice] Setting up preliminary slaves communication to coupling partner/s  
> —[precice] Receive global mesh Fluid-Mesh-Faces  
> —[precice] Prepare partition for mesh Solid-Mesh  
> —[precice] Gather mesh Solid-Mesh  
> —[precice] Send global mesh Solid-Mesh  
> —[precice] Setting up slaves communication to coupling partner/s  
> —[precice] Slaves are connected  
> terminate called after throwing an instance of ‘std::bad\_alloc’  
> what(): std::bad\_alloc  
> ./run.sh: line 6: 2139857 Aborted (core dumped) ccx\_preCICE -i tube -precice-participant Solid

---

<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:** [June 11, 2022, 9:29pm UTC](https://precice.discourse.group/t/pipe-flow-fsi-using-openfoam-and-calculix/1064/5 "2022-06-11T21:29:53Z")

</div>

I don’t know about shell elements in CalculiX, but what happens if you change that? The (very generic/cryptic) error could be related to that, but could also be some simpler technical issue related to building CalculiX/the adapter (only if you recently changed something there).

---

<div class="post-metadata">

**Author:** ![mishal49](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mishal49](https://precice.discourse.group/u/mishal49)\
**Post date:** [June 21, 2022, 3:38pm UTC](https://precice.discourse.group/t/pipe-flow-fsi-using-openfoam-and-calculix/1064/6 "2022-06-21T15:38:11Z")

</div>

Hello @Makis  
I have not really made any changes to the installation and tutorial cases are still running so I assume its something else. I changes the \*SHELL SECTION in the tube.inp file to \*SOLID SECTION but naturally, it says that I cannot use that for a tube or beam.

---

<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:** [June 21, 2022, 8:30pm UTC](https://precice.discourse.group/t/pipe-flow-fsi-using-openfoam-and-calculix/1064/7 "2022-06-21T20:30:59Z")

</div>

I actually doubt that the problem is in the CalculiX configuration, if the solvers don’t find each other in the first place. Did you already try deleting any stray `precice-run/` directory before starting?

---

<div class="post-metadata">

**Author:** ![uekerman](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/uekerman/32/2199_2.png) [@uekerman](https://precice.discourse.group/u/uekerman)\
**Post date:** [June 22, 2022, 12:00pm UTC](https://precice.discourse.group/t/pipe-flow-fsi-using-openfoam-and-calculix/1064/8 "2022-06-22T12:00:00Z")

</div>

It could very well be a problem in the CalculiX adapter.  
Shell elements should be supported IIRC.  
Maybe @boris-martin has an idea how to debug this?

---

<div class="post-metadata">

**Author:** ![boris-martin](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/boris-martin/32/705_2.png) [@boris-martin](https://precice.discourse.group/u/boris-martin)\
**Post date:** [June 22, 2022, 12:15pm UTC](https://precice.discourse.group/t/pipe-flow-fsi-using-openfoam-and-calculix/1064/9 "2022-06-22T12:15:43Z")

</div>

Hi,

Shell elements are currently supported since recent changes that haven’t yet been merged on the master branch.  
Does it work if you build the adapter from source on the “develop” branch ?

---

<div class="post-metadata">

**Author:** ![mishal49](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mishal49](https://precice.discourse.group/u/mishal49)\
**Post date:** [June 22, 2022, 2:33pm UTC](https://precice.discourse.group/t/pipe-flow-fsi-using-openfoam-and-calculix/1064/10 "2022-06-22T14:33:31Z")

</div>

Hey @Makis  
I tried this and still no luck

---

<div class="post-metadata">

**Author:** ![mishal49](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mishal49](https://precice.discourse.group/u/mishal49)\
**Post date:** [June 22, 2022, 2:35pm UTC](https://precice.discourse.group/t/pipe-flow-fsi-using-openfoam-and-calculix/1064/11 "2022-06-22T14:35:43Z")

</div>

Hey @boris-martin,  
I looked at what is on the develop branch [GitHub - precice/precice: A coupling library for partitioned multi-physics simulations, including, but not restricted to fluid-structure interaction and conjugate heat transfer simulations.](https://github.com/precice/precice).  
Should I just download the entire code or is there a specific part pertinent to the ccx adapter?

---

<div class="post-metadata">

**Author:** ![boris-martin](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/boris-martin/32/705_2.png) [@boris-martin](https://precice.discourse.group/u/boris-martin)\
**Post date:** [June 22, 2022, 3:07pm UTC](https://precice.discourse.group/t/pipe-flow-fsi-using-openfoam-and-calculix/1064/12 "2022-06-22T15:07:59Z")

</div>

I didn’t mean the develop branch of preCICE, but the develop branch of the adapter itself.  
[GitHub - precice/calculix-adapter at develop](https://github.com/precice/calculix-adapter/tree/develop), which you’d have to compile.

---

<div class="post-metadata">

**Author:** ![mishal49](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mishal49](https://precice.discourse.group/u/mishal49)\
**Post date:** [June 23, 2022, 3:08pm UTC](https://precice.discourse.group/t/pipe-flow-fsi-using-openfoam-and-calculix/1064/13 "2022-06-23T15:08:45Z")

</div>

Hello @boris-martin,  
Thank you for the link. I recompiled the new adapter yet the error persists. I get the same error that I mentioned earlier with the solid and the fluid runs on its own.

 ![image](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/d/dec47ea2bfe3bb11e86631778a5e660e6fcc89f9.png)

I also noticed that they both run perfectly fine separately but when coupled it results in this problem.  
By the way I am running this on a cluster.

I tried running it on my PC as well and it just says killed:

 ![image](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/4/4e74400bd675bf69a146c1253196d6b755b76e5b.png)

---

<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:** [June 23, 2022, 3:52pm UTC](https://precice.discourse.group/t/pipe-flow-fsi-using-openfoam-and-calculix/1064/14 "2022-06-23T15:52:46Z")

</div>

Oh, wait, I now saw the `Slaves are connected` part. I once had this issue when mixing up MPI versions, i.e., the MPI version that preCICE was compiled with and the MPI version the solvers were compiled with.

Although, CalculiX should not have anything to do with MPI.

---

<div class="post-metadata">

**Author:** ![boris-martin](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/boris-martin/32/705_2.png) [@boris-martin](https://precice.discourse.group/u/boris-martin)\
**Post date:** [June 23, 2022, 7:25pm UTC](https://precice.discourse.group/t/pipe-flow-fsi-using-openfoam-and-calculix/1064/15 "2022-06-23T19:25:35Z")

</div>

I tried running the case and both parts seem to work (or at least go further than you, I stopped after a few iterations).

---

<div class="post-metadata">

**Author:** ![mishal49](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mishal49](https://precice.discourse.group/u/mishal49)\
**Post date:** [June 23, 2022, 7:49pm UTC](https://precice.discourse.group/t/pipe-flow-fsi-using-openfoam-and-calculix/1064/16 "2022-06-23T19:49:17Z")

</div>

Wait, the case couples and runs?  
They run separately for me but not together

---

<div class="post-metadata">

**Author:** ![boris-martin](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/boris-martin/32/705_2.png) [@boris-martin](https://precice.discourse.group/u/boris-martin)\
**Post date:** [June 23, 2022, 9:06pm UTC](https://precice.discourse.group/t/pipe-flow-fsi-using-openfoam-and-calculix/1064/17 "2022-06-23T21:06:06Z")

</div>

Yes. Maybe your calculix issue will disappear once you fix the OpenFOAM side

---

<div class="post-metadata">

**Author:** ![mishal49](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mishal49](https://precice.discourse.group/u/mishal49)\
**Post date:** [June 23, 2022, 9:18pm UTC](https://precice.discourse.group/t/pipe-flow-fsi-using-openfoam-and-calculix/1064/18 "2022-06-23T21:18:16Z")

</div>

What do you think the issue with the OpenFOAM side is?  
I am not getting any errors so I’m not sure.

---

<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:** [June 24, 2022, 9:28am UTC](https://precice.discourse.group/t/pipe-flow-fsi-using-openfoam-and-calculix/1064/19 "2022-06-24T09:28:07Z")

</div>

@mishal49 can you comment on this? How did you install preCICE and OpenFOAM in this system?

---

<div class="post-metadata">

**Author:** ![mishal49](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mishal49](https://precice.discourse.group/u/mishal49)\
**Post date:** [June 27, 2022, 5:19pm UTC](https://precice.discourse.group/t/pipe-flow-fsi-using-openfoam-and-calculix/1064/20 "2022-06-27T17:19:28Z")

</div>

Hi @Makis  
I am sure I used intel/19.1.1 for preCICE, adapters and CalculiX. I installed OpenFOAM earlier so I am not sure how to check the compiler used however, it says “export WM\_MPLIB=INTELMPI” in the OF bashrc file so I assume I still used intel.  
Is this the information you were looking for?

[Next page](https://precice.discourse.group/t/pipe-flow-fsi-using-openfoam-and-calculix/1064.md?page=2)
