Set boundary conditions and get field from a decomposed OpenFOAM case

Hello everyone,

I am using OpenFoam coupled with a Python code for hybrid Eulerian-Lagrangian methods. I want to make my simulations faster and in order to achieve this I have to accelerate the Eulerian part of the code (OpenFoam).

I have a coupling of the OpenFoam and the Python code in every time step. The two methods are fully coupled:

  1. The boundary conditions for the OpenFOAM part are calculated and imposed using the Python code (Lagrangian solver)
  2. The solution of the Eulerian part (OpenFOAM) is transferred in the into the Lagrangian solver.

This process could be much faster, if I run the OpenFOAM part in multiple processors. However, in every time step I have to decompose and reconstruct the field in order to achieve the coupling. After having a discussion with a colleague in TU Delft, he recommended me to have a look here.
Is there any way that I can achieve the coupling without the need of decomposing and reconstructing in every time step? Can I impose the boundary conditions in the decomposed case in OpenFOAM? Can I retrieve the velocity field of OpenFOAM for a time-step without the need of recontructing the entire case?

Thank you in advance for your help!

Why do you need to reconstruct the field before coupling? Did you face any issues?

In general, the OpenFOAM adapter works in parallel. There may be some issues/inaccuracies in some cases (mainly when the interface or a patch of that is split across processes), but one would need to look at specific cases.