CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

Problem with sampling in a specific zone in parallel

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 9, 2021, 12:10
Default Problem with sampling in a specific zone in parallel
  #1
New Member
 
Junming Duan
Join Date: Sep 2021
Posts: 1
Rep Power: 0
Junming Duan is on a distinguished road
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!
Junming Duan is offline   Reply With Quote

Old   January 6, 2022, 14:00
Default
  #2
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
jherb is on a distinguished road
Perhaps you missed the -parallel option?
Your command should probably look like:
Code:
mpirun -n 36 pimpleFoam -postProcess -parallel
jherb is offline   Reply With Quote

Reply

Tags
parallel, sampling


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in parallel processing [Process affinity not being set] Roh FLUENT 4 October 26, 2023 03:42
SU2-7.0.1 on ubuntu 18.04 hyunko SU2 Installation 7 March 16, 2020 04:37
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem Attesz OpenFOAM Meshing & Mesh Conversion 12 May 2, 2013 10:52
[ICEM] Export ICEM mesh to Gambit / Fluent romekr ANSYS Meshing & Geometry 1 November 26, 2011 12:11
Fluent incident radiation problem Michael Schwarz Main CFD Forum 0 October 21, 1999 05:56


All times are GMT -4. The time now is 02:03.