View Issue Details

IDProjectCategoryView StatusLast Update
0002997OpenFOAMBugpublic2018-06-27 22:25
Reporterprojectionist Assigned Tohenry  
PrioritylowSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformUbuntuOSUbuntuOS Version16.04
Fixed in Versiondev 
Summary0002997: Sampling pressure with rhoPimpleFoam -postProcess fails
DescriptionDuring post-processing a compressible simulation I came across some weird behaviour, when I sampled data using the -postProcess flag of the solver.

I ran the simulation with rhoPimpleFoam, and sampled the data after completion using rhoPimpleFoam -postProcess.

The velocity was sampled as expected, however, the pressure was not.


Running the sampling with postProcess, however, sampled velocity and pressure correctly.


I did not investigate whether this affects other solvers with their -postProcess flag as well. However, I suspect that the issue at hand lies in the post-processing feature of the solver.
Steps To ReproduceRun the angledDuct tutorial case; place the attached sampleDict in the system directory; and sample the solution data. I ran the following two commands:

rhoPimpleFoam -postProcess -fields '(p U)' -func sampleDict
postProcess -fields '(p U)' -func sampleDict

rename the postProcessing folder after running the first command, to be able to compare the result of sampling.
Additional InformationSampled data using the solver with the -postProcess flag

x,y,z,p
-0.15,0.001,0.01,100000
-0.148485,0.001,0.01,100000
-0.14697,0.001,0.01,100000
-0.145455,0.001,0.01,100000
...


x,y,z,U_0,U_1,U_2
-0.15,0.001,0.01,47.3489,-2.23236,-0.0188989
-0.148485,0.001,0.01,47.3489,-2.23236,-0.0188989
-0.14697,0.001,0.01,47.3487,-2.23218,-0.0150814
-0.145455,0.001,0.01,47.3487,-2.23218,-0.0150814



Sampled data using the app postProcess

x,y,z,p
-0.15,0.001,0.01,100048
-0.148485,0.001,0.01,100048
-0.14697,0.001,0.01,100047
-0.145455,0.001,0.01,100047
...


x,y,z,U_0,U_1,U_2
-0.15,0.001,0.01,47.3489,-2.23236,-0.0188989
-0.148485,0.001,0.01,47.3489,-2.23236,-0.0188989
-0.14697,0.001,0.01,47.3487,-2.23218,-0.0150814
-0.145455,0.001,0.01,47.3487,-2.23218,-0.0150814


TagsNo tags attached.

Activities

projectionist

2018-06-27 16:50

reporter  

sampleDict (3,759 bytes)   
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      sampleDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

    type sets;
    libs ("libsampling.so");

// Set output format : choice of
//      xmgr
//      jplot
//      gnuplot
//      raw
//      vtk
//      csv
setFormat csv;

// Surface output format. Choice of
//      null        : suppress output
//      ensight     : Ensight Gold format, one field per case file
//      foamFile    : separate points, faces and values file
//      dx          : DX scalar or vector format
//      vtk         : VTK ascii format
//      raw         : x y z value format for use with e.g. gnuplot 'splot'.
//
// Note:
// other formats such as obj, stl, etc can also be written (by proxy)
// but without any values!
surfaceFormat null;

// optionally define extra controls for the output formats
formatOptions
{
    ensight
    {
        format  ascii;
    }
}

// interpolationScheme. choice of
//      cell          : use cell-centre value only; constant over cells (default)
//      cellPoint     : use cell-centre and vertex values
//      cellPointFace : use cell-centre, vertex and face values.
//      pointMVC      : use point values only (Mean Value Coordinates)
//      cellPatchConstrained : use cell-centre except on boundary faces where
//        it uses the boundary value. For use with e.g. patchCloudSet.
// 1] vertex values determined from neighbouring cell-centre values
// 2] face values determined using the current face interpolation scheme
//    for the field (linear, gamma, etc.)
interpolationScheme cell;

// Fields to sample.
fields
(
    U
    p
);

// Set sampling definition: choice of
//      uniform             evenly distributed points on line
//      face                one point per face intersection
//      midPoint            one point per cell, inbetween two face intersections
//      midPointAndFace     combination of face and midPoint
//
//      polyLine            specified points, not nessecary on line, uses
//                          tracking
//      cloud               specified points, uses findCell
//      triSurfaceMeshPointSet  points of triSurface
//
// axis: how to write point coordinate. Choice of
// - x/y/z: x/y/z coordinate only
// - xyz: three columns
//  (probably does not make sense for anything but raw)
// - distance: distance from start of sampling line (if uses line) or
//             distance from first specified sampling point
//
// type specific:
//      uniform, face, midPoint, midPointAndFace : start and end coordinate
//      uniform: extra number of sampling points
//      polyLine, cloud: list of coordinates
//      patchCloud: list of coordinates and set of patches to look for nearest
sets
(
    /// fyi: Overall domain bounding box (-0.15 0 -0.025) (0.141421 0.176777 0.025)
    lineZ1
    {
        type        uniform;
        nPoints     100;
        axis        xyz;

        start       (-0.15 0.001 0.01);
        end         (0.0 0.001 0.01);
    }
);


// Surface sampling definition
surfaces
(
);


// *********************************************************************** //
sampleDict (3,759 bytes)   

henry

2018-06-27 18:08

manager   ~0009836

Thanks for the report, I have reproduced the problem and isolated it, will push a fix later today.

henry

2018-06-27 22:25

manager   ~0009839

Resolved by commit 42dde9014c78fe2d2381ee89bdd728f4d2634a7b

Issue History

Date Modified Username Field Change
2018-06-27 16:50 projectionist New Issue
2018-06-27 16:50 projectionist File Added: sampleDict
2018-06-27 18:08 henry Note Added: 0009836
2018-06-27 22:25 henry Assigned To => henry
2018-06-27 22:25 henry Status new => resolved
2018-06-27 22:25 henry Resolution open => fixed
2018-06-27 22:25 henry Fixed in Version => dev
2018-06-27 22:25 henry Note Added: 0009839