# Problem with sampling in a specific zone in parallel

 Register Blogs Members List Search Today's Posts Mark Forums Read

 November 9, 2021, 12:10 Problem with sampling in a specific zone in parallel #1 New Member   Junming Duan Join Date: Sep 2021 Posts: 1 Rep Power: 0 Dear all, I'm doing a simulation of flow past a rotating 2D cylinder with OpenFOAM-v2006. The center of the cylinder is at (0,0), and the whole domain is (-0.6, 0.8) \times (-0.6, 0.6). I want to extract the cell center pressure in a small part around the cylinder by using topoSet and sampling. Here is the code Code:  /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2006 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application pimpleFoam; ...... functions { Sampling_rec { type surfaces; libs ("libsampling.so"); interpolationScheme cellPointFace; surfaceFormat raw; fields (p); surfaces { rec { type plane; zone rec_extract; planeType pointAndNormal; pointAndNormalDict { point (0 0 -0.24725); normal (0 0 1); } interpolate true; triangulate false; } } timeStart 0; timeEnd 10; executeControl writeTime; executeInterval 1; writeControl writeTime; writeInterval 1; } } // ************************************************************************* // Code: /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2006 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object topoSetDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // actions ( { name rec_extract; type cellSet; action new; source boxToCell; box (-0.1 -0.2 -0.25) (0.1 0.2 -0.24); } { name rec_extract; type cellZoneSet; action new; source setToCellZone; set rec_extract; } ); // ************************************************************************* // I first use topoSet and it shows: Code: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create polyMesh for time = 0 Reading topoSetDict Time = 0 mesh not changed. Created cellSet rec_extract Applying source boxToCell Adding cells with centre within boxes 1((-0.1 -0.2 -0.25) (0.1 0.2 -0.24)) cellSet rec_extract now size 14320 Created cellZoneSet rec_extract Applying source setToCellZone Adding all cells from cellSet rec_extract ... cellZoneSet rec_extract now size 14320 End If I use pimple -postProcess, then I can see the correct file "p_rec.raw" with 14630 points under postProcessing/Sampling_rec/0. Also if I reconstruct the solution first, I can get correct file under postProcessing/Sampling_rec/0.001, postProcessing/Sampling_rec/0.002 ... But if I run "mpirun -n 36 pimpleFoam -postProcess", the files "p_rec.raw" under postProcessing/Sampling_rec/0.001, postProcessing/Sampling_rec/0.002 ... will have 22395 points. It's much larger than the region I want, and it's also not the whole domain. Do you have any idea why sampling a specific zone doesn't work in parallel? Or something I missed? Thank you in advance!

 January 6, 2022, 14:00 #2 Senior Member   Joachim Herb Join Date: Sep 2010 Posts: 631 Rep Power: 19 Perhaps you missed the -parallel option? Your command should probably look like: Code: mpirun -n 36 pimpleFoam -postProcess -parallel

 Tags parallel, sampling