# 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:** 1\
**Showing post:** 7

<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.

---

_[View the full topic](https://precice.discourse.group/t/problem-in-solving-openfoam-with-calculix/1416)._
