# Problem in solving Openfoam with Calculix

**URL:** <https://precice.discourse.group/t/problem-in-solving-openfoam-with-calculix/1416>\
**Category:** Official adapters and tutorials\
**Tags:** openfoam, adapters\
**Created:** [May 16, 2023, 12:02pm UTC](https://precice.discourse.group/t/problem-in-solving-openfoam-with-calculix/1416 "2023-05-16T12:02:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![pranavd](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@pranavd](https://precice.discourse.group/u/pranavd)\
**Post date:** [May 16, 2023, 12:02pm UTC](https://precice.discourse.group/t/problem-in-solving-openfoam-with-calculix/1416/1 "2023-05-16T12:02:29Z")

</div>

Hi everyone,  
I’m facing a problem while solving the fluid model with coupling. Before the error message I can see that the fluid model and nodes with foam file were created

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

Will there be any error in my mapping methods??

 ![image](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/c/cb8b695aeed28d396d56ca6d14d1f51fd45162f3.png)  
 ![image](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/e/ec934378a640611207aa6a1ddd6c657db8615b8e.png)

Thanks in advance 🙂

---

<div class="post-metadata">

**Author:** ![pugal456](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/pugal456/32/470_2.png) [@pugal456](https://precice.discourse.group/u/pugal456)\
**Post date:** [May 16, 2023, 1:19pm UTC](https://precice.discourse.group/t/problem-in-solving-openfoam-with-calculix/1416/2 "2023-05-16T13:19:34Z")

</div>

Dear Pranav

It’s an interesting problem, I am also looking forward to the solution.

---

<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:** [May 16, 2023, 2:04pm UTC](https://precice.discourse.group/t/problem-in-solving-openfoam-with-calculix/1416/3 "2023-05-16T14:04:17Z")

</div>

Hi both!

Which OpenFOAM solver from which OpenFOAM version are you using?

Do you get the same issue with one of the tutorials (e.g., the perpendicular flap)?

This error typically means that the solver you are using does not allow mesh motion.

---

<div class="post-metadata">

**Author:** ![pranavd](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@pranavd](https://precice.discourse.group/u/pranavd)\
**Post date:** [May 17, 2023, 12:34am UTC](https://precice.discourse.group/t/problem-in-solving-openfoam-with-calculix/1416/4 "2023-05-17T00:34:38Z")

</div>

Hi Dr,  
Thank you for replying, I’m currently using OpenFOAM 10 with it’s appropriate preCICE’s OpenFOAM 10 adapter. There is no issue with the tutorials (updated tutorials for OpenFOAM 10).

Literally by our problem statement, there is a static fluid in a elastic shell tube. So, Will there be any mis-assumptions from my side on modelling the fluid participant?

If yes, Can you please suggest a suitable OpenFOAM solver which I can use for this problem…

 ![image](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/4/4fe0baf68007099b194cdecc0c67e735e0c23937.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:** [May 17, 2023, 10:10am UTC](https://precice.discourse.group/t/problem-in-solving-openfoam-with-calculix/1416/5 "2023-05-17T10:10:16Z")

</div>

pimpleFoam is a typical choice for incompressible flows. Which solver are you using?

---

<div class="post-metadata">

**Author:** ![pranavd](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@pranavd](https://precice.discourse.group/u/pranavd)\
**Post date:** [May 19, 2023, 10:33am UTC](https://precice.discourse.group/t/problem-in-solving-openfoam-with-calculix/1416/6 "2023-05-19T10:33:29Z")

</div>

Dear GC,

Greetings!

Pranav here

I appreciate your support. I am using pimpleFOAM solver, as recommended in the discourse forum. Being a newbie to this coupling technique, I intend to follow the instructions provided by preCICE based on their tutorials.

Introducing my model, it is a biomechanics application of tissue encapsulated with fluid and peripheral elastic fibres (similar to a balloon filled with water and enclosed by elastic rings).

Initially, I have assumed that there is a static fluid enclosed by an elastic shell with a cyliderical shape. Applying normal load to the cylindrical top with the bottom fixed. The purpose of this study is to examine the pressure pattern and stress over time.

I request your suggestion and guidance to fix our model.

This is our first attempt at FSI through preCICE coupling. We are interested in solving the problem and enjoying the use of the tool for further research.

Please accept my sincere thanks in advance.

[ivdShell.zip](https://precice.discourse.group/uploads/short-url/ftAyW0h2VvIAJBFWHtaIEgNaiNz.zip) (522.7 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:** [May 22, 2023, 8:19am UTC](https://precice.discourse.group/t/problem-in-solving-openfoam-with-calculix/1416/7 "2023-05-22T08:19:40Z")

</div>

I am trying to run your case using `run.sh` inside `fluid-openfoam` (using OpenFOAM 10).  
Comparing your files to the `elastic-tube-3d` tutorial, I see that you are calling `blockMesh`, but you don’t provide a `system/blockMeshDict`.

I see that there is already a directory `constant/polyMesh`, so the I am skipping the `blockMesh` and directly running `pimpleFoam`. With that, I get:

```plaintext
--> FOAM FATAL ERROR: 
Solution convergence criteria specified in PIMPLE.residualControl must be given as single values. Corrector loop convergence criteria, if appropriate, are specified as dictionaries in PIMPLE.<loopName>ResidualControl.

    From function bool Foam::singleRegionConvergenceControl::readResidualControls()
    in file cfdTools/general/solutionControl/convergenceControl/singleRegionConvergenceControl/singleRegionConvergenceControl.C at line 73.

FOAM exiting

```

Removing the `PIMPLE.residualControl` from your `system/fvSolution` (this probably needs to be adjusted to OpenFOAM 10 syntax), I get to the next error:

```plaintext
---[precice] ERROR: Data with name "DisplacementData" is not defined on mesh "Fluid-Mesh-Nodes". Please add <use-data name="DisplacementData"/> under <mesh name="Fluid-Mesh-Nodes"/>.

```

This is a typo: In `system/preciceDict`, it seems like you have changed the following:

```diff
    readData
    (
- DisplacementDelta
+ DisplacementData
    );

```

You also have another typo further down:

```diff
  Interface2
  {
    mesh Fluid-Mesh-Faces;
- patches (interface);
+ patches (inteface);

```

With these changes, the case seems to be running for a while, till I get the following error in CalculiX:

```plaintext
 average force= 0.000027
 time avg. forc= 0.000014
 largest residual force= 0.000000 in node 4 and dof 3
 largest increment of disp= 0.000000e+00
 largest correction to disp= 0.000000e+00

 convergence

Adapter writing coupling data...
Adapter calling advance()...
---[precice] ERROR: advance() cannot be called with a timestep size of 0.

```

This error sounds familiar: [OpenFOAM-CalculiX: Timestep Error - #5 by mattfrei](https://precice.discourse.group/t/openfoam-calculix-timestep-error/1245/5) Please take it from here and update this thread with your findings.

There are also further changes in the CalculiX case, which I cannot evaluate.

**Further notes:**

- In `system/fvSolution`, you have set `PIMPLE.nOuterCorrecters 50;`. This seems like an arbitrary choice for now (it should probably be nOuterCorrect **o** rs, not nOuterCorrect **e** rs), which could make the simulation quite slower. I suggest removing it.
- You have also changed in the `system/controlDict`:

```diff
- writeControl timeStep;
+ writeControl runTime;
- writeInterval 10;
+ writeInterval 0.10;

```

I think you intended to get more frequent results, but this leads to no results for me till at least 0.01s simulation time, when CalculiX fails.
- What I did, was to use [meld](https://meldmerge.org/) to compare your case with the `elastic-tube-3d` tutorial. This tool may be useful for you as well.

---

<div class="post-metadata">

**Author:** ![pranavd](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@pranavd](https://precice.discourse.group/u/pranavd)\
**Post date:** [May 23, 2023, 12:37pm UTC](https://precice.discourse.group/t/problem-in-solving-openfoam-with-calculix/1416/8 "2023-05-23T12:37:17Z")

</div>

Thank you so much GC for your help and spending your valuable time for us. I hope we can sort out CalculiX error soon and will post here if there is any other possible solution for that problem which may help others too 🙂 .

---

<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:** [May 26, 2023, 12:37pm UTC](https://precice.discourse.group/t/problem-in-solving-openfoam-with-calculix/1416/9 "2023-05-26T12:37:22Z")

</div>

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