Coupled patch crash in parallel
I'm using version OF-plus from 30 September 2016 (commit a9d9107930fc1b8d39196d712de6585d50aa81d0).
I need to build a new patch that couples information from two neighbor regions. I need to couple boundary information, not internal information. It is currently working in serial and in parallel when the decomposition keeps the coupled patch cells in the same processor. However, if the decomposition splits the domains just at the coupling patch, the code crashes.
I've found an easy way to reproduce the error:
Let's imagine two cubes (left and right) with two coupled boundary conditions: left_to_right and right_to_left. Let's use the chtMultiRegionSimpleFoam solver and the compressible::turbulentTemperatureRadCoupledMixed boundary condition for temperature. Inside this boundary condition, let's add the code:
scalarField X = (Tp + nbrField)/2.0;
Then:
- If we run the case in serial everything is ok.
- If we decompose the case in 2 processors using simple decomposition, with the decomposition perpendicular to the coupled patches (thus processor 0 includes: left-bottom and right-bottom zones), everything is ok
- If we decompose the case in 2 processors using simple decomposition, with the decomposition parallel to the coupled patches (thus processor 0 includes: left-left and right-left zones), the error obtained is:
--> FOAM FATAL ERROR: [0] Field f1(0), Field f2(0) and Field f3(1600) for operation f1 = f2 + f3
Thus, in the case where the crash appears, the size of the patch is not the same from the owner and the neighbor regions. It seems that information between both processors is not shared at patch level. How can I avoid it? Is it a bug or I must call the boundary values in another way?
Thank you in advance,
Elisabet