Using precice with 2 different interfaces in 1 OpenFOAM mesh


I have an Openfoam mesh, with 2 boundaries, which I want to couple to seperate solvers. So in my case I have a part of a wall, which has to be coupled to 1 Nutils script and another part of the wall, which has to be coupled to another Nutils script. (practically this has no use in this case, however I want to complicate the situation and first test it out with this simple case.)

I could not find an example of this or a thread, which has done this before. Is it possible to do? and if so, in Openfoam do I have to define the two separate interfaces as seen in the txt file I will provide below?
preciceDict.txt (727 Bytes)

I am not sure if I should define ‘mesh’ as OpenFOAM-Mesh2 in the Interface2 part. However otherwise I cannot see how I can specify, which interface to use in the precice-config.xml file, since it uses OpenFOAM-Mesh to couple it to the Nutils script and not the name Interface1.

Thank you in advance.

Kind regards,


Hi @CarsvO,

I think what you are trying to do it very similar to our heat exchanger tutorial. There, we are coupling one CalculiX participant with two OpenFOAM participants.

In your case, you should definitely define two different patches in OpenFOAM for the different parts of the interface, to be able to refer to them separately.

You may also need to define different data names for each participant (see the heat exchanger precice-config.xml).

Hey @MakisH,

Thank you for your reply. That will be very helpfull. I am only not sure, whether it is then okay to define the 2 different participants in one precicedict like this? (I added the file below).

preciceDict.txt (790 Bytes)

Kind regards,


Actually this is not correct: there should be only one instance of each top-level dictionary in one preciceDict. What you had before was is the right direction.

Okay thank you, I am gonna work with that! But this would mean there would be 1 participant right? (I cannot define another one at participant) since in my case I have only one openfoam file case.

Since you only have one OpenFOAM simulation, you only have one OpenFOAM participant. One participant can have multiple interfaces. In this case, interface1 talks to Nutils1, and interface2 to Nutils2 (arbitrary names).

Yes, I think I have figured it out. It is running now thank you. I had some problems with there being no error, but the simulation wouldnt start. It seems that the coupling scheme has to be parallel instead of serial, when using 2 interfaces at the same time. I haven’t checked the results yet, however thank you for helping me!

A quick extra question: Does the position of the interface in the coordinate system in Nutils have to match the position of the interface in the OpenFOAM coordinate system?

Yes, you need a parallel scheme for handling multiple participants. There is even a specific coupling scheme for multiple participants:

You can also find and try an upcoming tutorial here:

The interface should be reasonably close, at least for what preCICE knows. What you want to avoid is e.g. having the interface in different axes. You can export your preCICE meshes and check if everything is fine.

Okay, thank you very much for your help!

1 Like

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