Usage precice+openfoam adapter with Docker: QuickStart freezes without any errors

Hello everyone,

I’m trying to do my first steps in Precice.
I found that the easiest way for installation is the usage of packages in Ubuntu 20.04 OS (directly this way).
I’ve done all these steps inside the Docker container based on Ubuntu 20.04 - it was no errors at all.
To run two scripts in two terminals, I start the container in the first terminal (docker run -ti --rm precice) and I connect to this container in the second terminal (docker exec -ti <precice-container-id> bash).
In the first terminal, I run run.sh for the solid-cpp (of course, after building), in the second terminal - start run.sh for the fluid-openfoam.
What I see in the first terminal:

root@f45f1871f31c:/opt/tutorials/quickstart/solid-cpp# ./run.sh 
Rigid body: starting...

What I see in the second terminal:

root@f45f1871f31c:/opt/tutorials/quickstart/fluid-openfoam# ./run.sh 
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2306                                  |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : _fbf00d6b-20230626 OPENFOAM=2306 version=2306
Arch   : "LSB;label=32;scalar=64"
Exec   : blockMesh
Date   : Oct 16 2023
Time   : 14:33:09
Host   : f45f1871f31c
PID    : 285280
I/O    : uncollated
Case   : /opt/tutorials/quickstart/fluid-openfoam
nProcs : 1
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Creating block mesh from "system/blockMeshDict"
No non-linear block edges defined
No non-planar block faces defined
Creating topology blocks

Creating topology patches - from boundary section

Creating block mesh topology

Check topology

	Basic statistics
		Number of internal faces : 8
		Number of boundary faces : 32
		Number of defined boundary faces : 32
		Number of undefined boundary faces : 0
	Checking patch -> block consistency

Creating block offsets
Creating merge list (topological search)...

Creating polyMesh from blockMesh
Creating patches
Creating cells
Creating points with scale (1 1 1)
    Block 0 cell size :
        i : 0.01666666667 .. 0.01666666667
        j : 0.01 .. 0.01
        k : 0.2 .. 0.2

    Block 1 cell size :
        i : 0.01666666667 .. 0.01666666667
        j : 0.01 .. 0.01
        k : 0.2 .. 0.2

    Block 2 cell size :
        i : 0.01666666667 .. 0.01666666667
        j : 0.01 .. 0.01
        k : 0.2 .. 0.2

    Block 3 cell size :
        i : 0.01428571429 .. 0.01428571429
        j : 0.01 .. 0.01
        k : 0.2 .. 0.2

    Block 4 cell size :
        i : 0.01428571429 .. 0.01428571429
        j : 0.01 .. 0.01
        k : 0.2 .. 0.2

    Block 5 cell size :
        i : 0.0091669431 .. 0.0366677724
        j : 0.01 .. 0.01
        k : 0.2 .. 0.2

    Block 6 cell size :
        i : 0.0091669431 .. 0.0366677724
        j : 0.01 .. 0.01
        k : 0.2 .. 0.2

    Block 7 cell size :
        i : 0.0091669431 .. 0.0366677724
        j : 0.01 .. 0.01
        k : 0.2 .. 0.2

No patch pairs to merge

Writing polyMesh with 0 cellZones
----------------
Mesh Information
----------------
  boundingBox: (-0.2 -0.13 -0.1) (0.6 0.12 0.1)
  nPoints: 2418
  nCells: 1122
  nFaces: 4575
  nInternalFaces: 2157
----------------
Patches
----------------
  patch 0 (start: 2157 size: 1122) name: back
  patch 1 (start: 3279 size: 1122) name: front
  patch 2 (start: 4401 size: 25) name: inlet
  patch 3 (start: 4426 size: 25) name: outlet
  patch 4 (start: 4451 size: 32) name: flap
  patch 5 (start: 4483 size: 46) name: bottom
  patch 6 (start: 4529 size: 46) name: top

End

No OpenFOAM tutorials? : /usr/lib/openfoam/openfoam2306/tutorials
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2306                                  |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : _fbf00d6b-20230626 OPENFOAM=2306 version=2306
Arch   : "LSB;label=32;scalar=64"
Exec   : pimpleFoam
Date   : Oct 16 2023
Time   : 14:33:10
Host   : f45f1871f31c
PID    : 285286
I/O    : uncollated
Case   : /opt/tutorials/quickstart/fluid-openfoam
nProcs : 1
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Selecting dynamicFvMesh dynamicMotionSolverFvMesh
Selecting motion solver: displacementLaplacian
Applying motion to entire mesh
Selecting motion diffusion: quadratic
Selecting motion diffusion: inverseDistance
Selecting patchDistMethod meshWave

PIMPLE: no residual control data found. Calculations will employ 10 corrector loops

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type laminar
Selecting laminar stress model Stokes
No MRF models present

No finite volume options present
Constructing face velocity Uf

Courant Number mean: 0.01594387755 max: 0.7499999985
Courant Number mean: 0.01594387755 max: 0.7499999985

Starting time loop

forces forces:
    rho: rhoInf
    Freestream density (rhoInf) set to 10
    Not including porosity effects

---[preciceAdapter] Loaded the OpenFOAM-preCICE adapter - v1.2.3.

Looks very strange. What can be the reason of this freezing?
I’ll be very thankful for any support.

BR,
Victoria

Hi Victoria,

I am not sure why you do not see any output from preCICE, but I assume the connection is not established.

I understand that you are indeed starting both participants in the same container. Maybe there is some Docker network issue, maybe some firewall is blocking connections? Can you write a bit more about what system you are using? Is it a private laptop, a work system with restrictions, a cluster? What OS?

Ideas to try:

  • Start everything in the same session: ./run.sh & for the fluid, and then ./run.sh for the solid.
  • Use tmux to start multiple panes in the same terminal.
  • Start two containers, use Docker Compose to connect them (we do that in our system tests, but this is not a clear example to follow)

Do you also get no output on the solid side?

Hello Makis,

thank you for your answer!
I use the usual PC without any special restrictions. My host system is Fedora 38.
Docker version is 24.0.6 (build ed223bc).
I’ve tried your idea with tmux - the situation still the same.

Can you please share your Dockerfiles? I would like to debug this.

Dockerfile.txt (1.1 KB)
Yes, of course

I tried with the same Dockerfile, and it works for me… :thinking:

  • Build the image: docker buildx build --tag precice_debug .
  • Run the container once: docker run -ti precice_debug
    • Run the fluid participant: cd fluid-openfoam, openfoam2306 ./run.sh
  • Get the container id: docker ps91cb57094295
  • Connect to the container again: docker exec -ti 91cb57094295 bash
    • Run the solid participant: cd solid-cpp, cmake ., make, ./run.sh

Both participants run, the simulation completes, I get results.

I tried this too and can confirm.

Host system:
Docker 24.0.6
Linux Kernel 6.5.7