vtkWrite creates artifacts in parallel
I find the ability of writing a single VTK file during the simulation in parallel very convenient. However, VTK files written in parallel by the function object
vtkWrite contain artifacts at process boundaries. This makes further post-processing of the VTK files difficult.
Steps to reproduce
In v2112, copy, run and decompose the cavity tutorial case:
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity . cd cavity/cavity blockMesh icoFoam decomposePar -latestTime
Create a new file in
writeVTK with the following content:
type vtkWrite; libs (utilityFunctionObjects); writeControl writeTime; writeInterval 1; format binary; legacy false; decompose false; fields (U p);
Create VTK file in parallel:
mpirun -np 9 postProcess -func writeVTK -parallel
postProcessing/VTK/cavity.vtm.series in paraview
Cell Data to Point Data filter and look at the interpolated point data velocity field. The process boundaries of the nine sub domains are clearly visible. This is a problem when e.g. computing derivatives as a post-processing step.
The following figure compares the results from
foamToVTK (serial and parallel) and the
writeVTK function object (serial and parallel). Only for the parallel
writeVTK case (bottom right in the figure), the process boundaries in the velocity field become visible.
- OpenFOAM version : v2112
- Operating system : ubuntu, RedHat
- Compiler : gcc