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

sample utility of OF2.3.1 provides less points

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 1, 2015, 09:38
Question sample utility of OF2.3.1 provides less points
  #1
New Member
 
anonymous
Join Date: May 2013
Posts: 6
Rep Power: 10
aCFDuser is on a distinguished road
Hi all

I was using OF v2.2.1 and I did the post-processing with the sample utility, with a cloud of points. Results were nice. After upgrading to v2.3.1, I run this utility on the same CFD results (and same sampleDict) but now I get less points. I tested on different models (i.e. different sampleDicts) and I always get less points. Also, the number of missing points seems random among cases but repeating the sample utility twice in the same case, gives me the same missing points.

Any ideas?
Thanks in advance
aCFDuser is offline   Reply With Quote

Old   August 21, 2015, 11:39
Default
  #2
New Member
 
Diogo Ramalho
Join Date: May 2015
Posts: 2
Rep Power: 0
dramalho is on a distinguished road
Hy,

I have the same problem with sampleDict. Trying to plot the pressure around an airfoil using a point cloud with the right coordinates.


Since I get the coordinates of the points from a geometry that is converted into *.stl files I have tried to create an offset to this geometry to avoid some coordinates that might get into the geometry in my *.stl file (the conversion to *.stl could put the points inside the geometry) but got no success.

I also have tried 50, 100, and 200 points but the output is always half the numbers of point I input to sampleDict.


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

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

// 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 vtk;

// 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 : like 'cell' but uses 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 cellPoint;

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

// 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
//      patchSeed: random sampling on set of patches. Points slightly off
//                 face centre.
sets
(
/*    lineX1
    {
        type        uniform;
        axis        distance;

        //- cavity. Slightly perturbed so not to align with face or edge.
        start       (0.0201 0.05101 0.00501);
        end         (0.0601 0.05101 0.00501);
        nPoints     10;
    }

    lineX2
    {
        type        face;
        axis        x;

        //- cavity
        start       (0.0001 0.0525 0.00501);
        end         (0.0999 0.0525 0.00501);
    }
*/
    somePoints
    {
        type    cloud;
        axis    xyz;
        points  ((8.4638  -1.6865  0)(8.4638  -1.6865  0)(8.2362  -1.5877  0)(8.2362  -1.5877  0)(8.0081  -1.49  0)(8.0081  -1.49  0)(7.7796  -1.3933  0)(7.7796  -1.3933  0)(7.5506  -1.2976  0)(7.5506  -1.2976  0)(7.3213  -1.203  0)(7.3213  -1.203  0)(7.0915  -1.1093  0)(7.0915  -1.1093  0)(6.8614  -1.0165  0)(6.8614  -1.0165  0)(6.6308  -0.9247  0)(6.6308  -0.9247  0)(6.3999  -0.8338  0)(6.3999  -0.8338  0)(6.1687  -0.7439  0)(6.1687  -0.7439  0)(5.9371  -0.6549  0)(5.9371  -0.6549  0)(5.7051  -0.5668  0)(5.7051  -0.5668  0)(5.4727  -0.4797  0)(5.4727  -0.4797  0)(5.24  -0.3936  0)(5.24  -0.3936  0)(5.007  -0.3084  0)(5.007  -0.3084  0)(4.7735  -0.2243  0)(4.7735  -0.2243  0)(4.5397  -0.1413  0)(4.5397  -0.1413  0)(4.3054  -0.0595  0)(4.3054  -0.0595  0)(4.0708  0.0212  0)(4.0708  0.0212  0)(3.8357  0.1007  0)(3.8357  0.1007  0)(3.6002  0.1788  0)(3.6002  0.1788  0)(3.3642  0.2556  0)(3.3642  0.2556  0)(3.1278  0.3308  0)(3.1278  0.3308  0)(2.8908  0.4044  0)(2.8908  0.4044  0)(2.6533  0.4764  0)(2.6533  0.4764  0)(2.4153  0.5465  0)(2.4153  0.5465  0)(2.1767  0.6146  0)(2.1767  0.6146  0)(1.9375  0.6806  0)(1.9375  0.6806  0)(1.6977  0.7442  0)(1.6977  0.7442  0)(1.4572  0.8054  0)(1.4572  0.8054  0)(1.2161  0.8639  0)(1.2161  0.8639  0)(0.9742  0.9194  0)(0.9742  0.9194  0)(0.7316  0.9716  0)(0.7316  0.9716  0)(0.4883  1.0203  0)(0.4883  1.0203  0)(0.2443  1.0651  0)(0.2443  1.0651  0)(-0.0005  1.1056  0)(-0.0005  1.1056  0)(-0.2461  1.1412  0)(-0.2461  1.1412  0)(-0.4924  1.1715  0)(-0.4924  1.1715  0)(-0.7393  1.1957  0)(-0.7393  1.1957  0)(-0.9868  1.2129  0)(-0.9868  1.2129  0)(-1.2348  1.222  0)(-1.2348  1.222  0)(-1.4829  1.2216  0)(-1.4829  1.2216  0)(-1.7307  1.2097  0)(-1.7307  1.2097  0)(-1.9774  1.1833  0)(-1.9774  1.1833  0)(-2.2213  1.138  0)(-2.2213  1.138  0)(-2.4586  1.0663  0)(-2.4586  1.0663  0)(-2.6799  0.9551  0)(-2.6799  0.9551  0)(-2.8576  0.7842  0)(-2.8576  0.7842  0)(-2.9359  0.552  0)(-2.9359  0.552  0)(-2.8875  0.311  0)(-2.8875  0.311  0)(-2.7523  0.104  0)(-2.7523  0.104  0)(-2.5753  -0.0696  0)(-2.5753  -0.0696  0)(-2.377  -0.2186  0)(-2.377  -0.2186  0)(-2.1662  -0.3495  0)(-2.1662  -0.3495  0)(-1.9474  -0.4663  0)(-1.9474  -0.4663  0)(-1.7228  -0.5718  0)(-1.7228  -0.5718  0)(-1.4941  -0.6679  0)(-1.4941  -0.6679  0)(-1.2621  -0.756  0)(-1.2621  -0.756  0)(-1.0276  -0.8371  0)(-1.0276  -0.8371  0)(-0.791  -0.912  0)(-0.791  -0.912  0)(-0.5528  -0.9815  0)(-0.5528  -0.9815  0)(-0.3133  -1.0461  0)(-0.3133  -1.0461  0)(-0.0725  -1.1062  0)(-0.0725  -1.1062  0)(0.1691  -1.1623  0)(0.1691  -1.1623  0)(0.4117  -1.2147  0)(0.4117  -1.2147  0)(0.6549  -1.2637  0)(0.6549  -1.2637  0)(0.8988  -1.3097  0)(0.8988  -1.3097  0)(1.1432  -1.3527  0)(1.1432  -1.3527  0)(1.388  -1.3932  0)(1.388  -1.3932  0)(1.6332  -1.4312  0)(1.6332  -1.4312  0)(1.8787  -1.4669  0)(1.8787  -1.4669  0)(2.1246  -1.5006  0)(2.1246  -1.5006  0)(2.3707  -1.5322  0)(2.3707  -1.5322  0)(2.617  -1.5621  0)(2.617  -1.5621  0)(2.8636  -1.5902  0)(2.8636  -1.5902  0)(3.1103  -1.6168  0)(3.1103  -1.6168  0)(3.3571  -1.6418  0)(3.3571  -1.6418  0)(3.6041  -1.6654  0)(3.6041  -1.6654  0)(3.8513  -1.6877  0)(3.8513  -1.6877  0)(4.0985  -1.7087  0)(4.0985  -1.7087  0)(4.3459  -1.7285  0)(4.3459  -1.7285  0)(4.5933  -1.7471  0)(4.5933  -1.7471  0)(4.8408  -1.7646  0)(4.8408  -1.7646  0)(5.0884  -1.781  0)(5.0884  -1.781  0)(5.3361  -1.7964  0)(5.3361  -1.7964  0)(5.5838  -1.8107  0)(5.5838  -1.8107  0)(5.8316  -1.824  0)(5.8316  -1.824  0)(6.0794  -1.8364  0)(6.0794  -1.8364  0)(6.3273  -1.8477  0)(6.3273  -1.8477  0)(6.5752  -1.858  0)(6.5752  -1.858  0)(6.8231  -1.8673  0)(6.8231  -1.8673  0)(7.0711  -1.8756  0)(7.0711  -1.8756  0)(7.3192  -1.8829  0)(7.3192  -1.8829  0)(7.5672  -1.8891  0)(7.5672  -1.8891  0)(7.8153  -1.8942  0)(7.8153  -1.8942  0)(8.0634  -1.8982  0)(8.0634  -1.8982  0)(8.3115  -1.901  0)(8.3115  -1.901  0)(8.5597  -1.9026  0)(8.5597  -1.9026  0)(8.6904  -1.7873  0)(8.6904  -1.7873  0));
    }
/*
    somePatchPoints
    {
        // Sample nearest points on selected patches. Looks only up to
        // maxDistance away. Any sampling point not found will get value
        // pTraits<Type>::max (usually VGREAT)
        // Use with interpolations:
        // - cell (cell value)
        // - cellPatchConstrained (boundary value)
        // - cellPoint (interpolated boundary value)
        type        patchCloud;
        axis        xyz;
        points      ((0.049 0.099 0.005)(0.051 0.054 0.005));
        maxDistance 0.1;    // maximum distance to search
        patches     (".*Wall.*");
    }

    patchSeed
    {
        type        patchSeed;
        patches     (".*Wall.*");
        // Number of points to seed. Divided amongst all processors according
        // to fraction of patches they hold.
        maxPoints   100;
    }
*/
);

/*
// Surface sampling definition
//
// 1] patches are not triangulated by default
// 2] planes are always triangulated
// 3] iso-surfaces are always triangulated
surfaces
(
    constantPlane
    {
        type            plane;    // always triangulated
        basePoint       (0.0501 0.0501 0.005);
        normalVector    (0.1 0.1 1);

        //- Optional: restrict to a particular zone
        // zone        zone1;

        //- Optional: do not triangulate (only for surfaceFormats that support
        //            polygons)
        //triangulate     false;
    }

    interpolatedPlane
    {
        type            plane;    // always triangulated
        // make plane relative to the coordinateSystem (Cartesian)
        coordinateSystem
        {
            origin      (0.0501 0.0501 0.005);
        }
        basePoint       (0 0 0);
        normalVector    (0.1 0.1 1);
        interpolate     true;
    }

    walls_constant
    {
        type            patch;
        patches         ( ".*Wall.*" );
        // Optional: whether to leave as faces (=default) or triangulate
        // triangulate     false;
    }

    walls_interpolated
    {
        type            patch;
        patches         ( ".*Wall.*" );
        interpolate     true;
        // Optional: whether to leave as faces (=default) or triangulate
        // triangulate     false;
    }

    nearWalls_interpolated
    {
        // Sample cell values off patch. Does not need to be the near-wall
        // cell, can be arbitrarily far away.
        type            patchInternalField;
        patches         ( ".*Wall.*" );
        interpolate     true;


        // Optional: specify how to obtain sampling points from the patch
        //           face centres (default is 'normal')
        //
        //  //- Specify distance to offset in normal direction
        offsetMode  normal;
        distance    0.1;
        //
        //  //- Specify single uniform offset
        //  offsetMode  uniform;
        //  offset      (0 0 0.0001);
        //
        //  //- Specify offset per patch face
        //  offsetMode  nonuniform;
        //  offsets     ((0 0 0.0001) (0 0 0.0002));


        // Optional: whether to leave as faces (=default) or triangulate
        // triangulate     false;
    }

    interpolatedIso
    {
        // Iso surface for interpolated values only
        type            isoSurface;    // always triangulated
        isoField        rho;
        isoValue        0.5;
        interpolate     true;

        //zone            ABC;          // Optional: zone only
        //exposedPatchName fixedWalls;  // Optional: zone only

        // regularise      false;    // Optional: do not simplify
        // mergeTol        1e-10;    // Optional: fraction of mesh bounding box
                                     // to merge points (default=1e-6)
    }
    constantIso
    {
        // Iso surface for constant values.
        // Triangles guaranteed not to cross cells.
        type            isoSurfaceCell;    // always triangulated
        isoField        rho;
        isoValue        0.5;
        interpolate     false;
        regularise      false;              // do not simplify
        // mergeTol        1e-10;    // Optional: fraction of mesh bounding box
                                     // to merge points (default=1e-6)
    }

    triangleCut
    {
        // Cutingplane using iso surface
        type            cuttingPlane;
        planeType       pointAndNormal;
        pointAndNormalDict
        {
            basePoint       (0.4 0 0.4);
            normalVector    (1 0.2 0.2);
        }
        interpolate     true;

        //zone            ABC;          // Optional: zone only
        //exposedPatchName fixedWalls;  // Optional: zone only

        // regularise      false;    // Optional: do not simplify
        // mergeTol        1e-10;    // Optional: fraction of mesh bounding box
                                     // to merge points (default=1e-6)
    }

    distance
    {
        // Isosurface from signed/unsigned distance to surface
        type            distanceSurface;
        signed          true;

        // Definition of surface
        surfaceType     triSurfaceMesh;
        surfaceName     integrationPlane.stl;
        // Distance to surface
        distance        0.0;

        //cell            false;// optional: use isoSurface instead
                                // of isoSurfaceCell
        interpolate     false;
        regularise      false;  // Optional: do not simplify
        // mergeTol 1e-10;      // Optional: fraction of mesh bounding box
                                // to merge points (default=1e-6)
    }

    triSurfaceSampling
    {
        // Sampling on triSurface
        type        sampledTriSurfaceMesh;
        surface     integrationPlane.stl;
        source      boundaryFaces;  // What to sample: cells (nearest cell)
                                    // insideCells (only triangles inside cell)
                                    // boundaryFaces (nearest boundary face)
        interpolate true;
    }
);

*/
// *********************************************************************** //
Any help would be appreciated.

Thanks in advance.

Diogo Ramalho


edit: Got the problem solved. It was my fault getting the coordinates from points. No issues with sampleDict now. Sorry.

Last edited by dramalho; August 21, 2015 at 13:09.
dramalho is offline   Reply With Quote

Old   August 21, 2015, 12:32
Default
  #3
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,963
Blog Entries: 45
Rep Power: 124
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

@aCFDuser: Without at least a test case, there isn't much I can do.

@Diogo: I hate to state the obvious, but this is what matters from the file you provided:
Code:
    somePoints
    {
        type    cloud;
        axis    xyz;
        points  ((8.4638  -1.6865  0)(8.4638  -1.6865  0)(8.2362  -1.5877  0)(8.2362  -1.5877  0)(8.0081  -1.49  0)(8.0081  -1.49  0)(7.7796  -1.3933  0)(7.7796  -1.3933  0)(7.5506  -1.2976  0)(7.5506  -1.2976  0)(7.3213  -1.203  0)(7.3213  -1.203  0)(7.0915  -1.1093  0)(7.0915  -1.1093  0)(6.8614  -1.0165  0)(6.8614  -1.0165  0)(6.6308  -0.9247  0)(6.6308  -0.9247  0)(6.3999  -0.8338  0)(6.3999  -0.8338  0)(6.1687  -0.7439  0)(6.1687  -0.7439  0)(5.9371  -0.6549  0)(5.9371  -0.6549  0)(5.7051  -0.5668  0)(5.7051  -0.5668  0)(5.4727  -0.4797  0)(5.4727  -0.4797  0)(5.24  -0.3936  0)(5.24  -0.3936  0)(5.007  -0.3084  0)(5.007  -0.3084  0)(4.7735  -0.2243  0)(4.7735  -0.2243  0)(4.5397  -0.1413  0)(4.5397  -0.1413  0)(4.3054  -0.0595  0)(4.3054  -0.0595  0)(4.0708  0.0212  0)(4.0708  0.0212  0)(3.8357  0.1007  0)(3.8357  0.1007  0)(3.6002  0.1788  0)(3.6002  0.1788  0)(3.3642  0.2556  0)(3.3642  0.2556  0)(3.1278  0.3308  0)(3.1278  0.3308  0)(2.8908  0.4044  0)(2.8908  0.4044  0)(2.6533  0.4764  0)(2.6533  0.4764  0)(2.4153  0.5465  0)(2.4153  0.5465  0)(2.1767  0.6146  0)(2.1767  0.6146  0)(1.9375  0.6806  0)(1.9375  0.6806  0)(1.6977  0.7442  0)(1.6977  0.7442  0)(1.4572  0.8054  0)(1.4572  0.8054  0)(1.2161  0.8639  0)(1.2161  0.8639  0)(0.9742  0.9194  0)(0.9742  0.9194  0)(0.7316  0.9716  0)(0.7316  0.9716  0)(0.4883  1.0203  0)(0.4883  1.0203  0)(0.2443  1.0651  0)(0.2443  1.0651  0)(-0.0005  1.1056  0)(-0.0005  1.1056  0)(-0.2461  1.1412  0)(-0.2461  1.1412  0)(-0.4924  1.1715  0)(-0.4924  1.1715  0)(-0.7393  1.1957  0)(-0.7393  1.1957  0)(-0.9868  1.2129  0)(-0.9868  1.2129  0)(-1.2348  1.222  0)(-1.2348  1.222  0)(-1.4829  1.2216  0)(-1.4829  1.2216  0)(-1.7307  1.2097  0)(-1.7307  1.2097  0)(-1.9774  1.1833  0)(-1.9774  1.1833  0)(-2.2213  1.138  0)(-2.2213  1.138  0)(-2.4586  1.0663  0)(-2.4586  1.0663  0)(-2.6799  0.9551  0)(-2.6799  0.9551  0)(-2.8576  0.7842  0)(-2.8576  0.7842  0)(-2.9359  0.552  0)(-2.9359  0.552  0)(-2.8875  0.311  0)(-2.8875  0.311  0)(-2.7523  0.104  0)(-2.7523  0.104  0)(-2.5753  -0.0696  0)(-2.5753  -0.0696  0)(-2.377  -0.2186  0)(-2.377  -0.2186  0)(-2.1662  -0.3495  0)(-2.1662  -0.3495  0)(-1.9474  -0.4663  0)(-1.9474  -0.4663  0)(-1.7228  -0.5718  0)(-1.7228  -0.5718  0)(-1.4941  -0.6679  0)(-1.4941  -0.6679  0)(-1.2621  -0.756  0)(-1.2621  -0.756  0)(-1.0276  -0.8371  0)(-1.0276  -0.8371  0)(-0.791  -0.912  0)(-0.791  -0.912  0)(-0.5528  -0.9815  0)(-0.5528  -0.9815  0)(-0.3133  -1.0461  0)(-0.3133  -1.0461  0)(-0.0725  -1.1062  0)(-0.0725  -1.1062  0)(0.1691  -1.1623  0)(0.1691  -1.1623  0)(0.4117  -1.2147  0)(0.4117  -1.2147  0)(0.6549  -1.2637  0)(0.6549  -1.2637  0)(0.8988  -1.3097  0)(0.8988  -1.3097  0)(1.1432  -1.3527  0)(1.1432  -1.3527  0)(1.388  -1.3932  0)(1.388  -1.3932  0)(1.6332  -1.4312  0)(1.6332  -1.4312  0)(1.8787  -1.4669  0)(1.8787  -1.4669  0)(2.1246  -1.5006  0)(2.1246  -1.5006  0)(2.3707  -1.5322  0)(2.3707  -1.5322  0)(2.617  -1.5621  0)(2.617  -1.5621  0)(2.8636  -1.5902  0)(2.8636  -1.5902  0)(3.1103  -1.6168  0)(3.1103  -1.6168  0)(3.3571  -1.6418  0)(3.3571  -1.6418  0)(3.6041  -1.6654  0)(3.6041  -1.6654  0)(3.8513  -1.6877  0)(3.8513  -1.6877  0)(4.0985  -1.7087  0)(4.0985  -1.7087  0)(4.3459  -1.7285  0)(4.3459  -1.7285  0)(4.5933  -1.7471  0)(4.5933  -1.7471  0)(4.8408  -1.7646  0)(4.8408  -1.7646  0)(5.0884  -1.781  0)(5.0884  -1.781  0)(5.3361  -1.7964  0)(5.3361  -1.7964  0)(5.5838  -1.8107  0)(5.5838  -1.8107  0)(5.8316  -1.824  0)(5.8316  -1.824  0)(6.0794  -1.8364  0)(6.0794  -1.8364  0)(6.3273  -1.8477  0)(6.3273  -1.8477  0)(6.5752  -1.858  0)(6.5752  -1.858  0)(6.8231  -1.8673  0)(6.8231  -1.8673  0)(7.0711  -1.8756  0)(7.0711  -1.8756  0)(7.3192  -1.8829  0)(7.3192  -1.8829  0)(7.5672  -1.8891  0)(7.5672  -1.8891  0)(7.8153  -1.8942  0)(7.8153  -1.8942  0)(8.0634  -1.8982  0)(8.0634  -1.8982  0)(8.3115  -1.901  0)(8.3115  -1.901  0)(8.5597  -1.9026  0)(8.5597  -1.9026  0)(8.6904  -1.7873  0)(8.6904  -1.7873  0));
    }
You can re-arrange the list to the following and OpenFOAM will still be able to read it:
Code:
    somePoints
    {
        type    cloud;
        axis    xyz;
        points  (
(8.4638  -1.6865  0)
(8.4638  -1.6865  0)
(8.2362  -1.5877  0)
(8.2362  -1.5877  0)
(8.0081  -1.49  0)
(8.0081  -1.49  0)
(7.7796  -1.3933  0)
(7.7796  -1.3933  0)
(7.5506  -1.2976  0)
(7.5506  -1.2976  0)
(7.3213  -1.203  0)
(7.3213  -1.203  0)
(7.0915  -1.1093  0)
(7.0915  -1.1093  0)
(6.8614  -1.0165  0)
(6.8614  -1.0165  0)
(6.6308  -0.9247  0)
(6.6308  -0.9247  0)
(6.3999  -0.8338  0)
(6.3999  -0.8338  0)
(6.1687  -0.7439  0)
(6.1687  -0.7439  0)
(5.9371  -0.6549  0)
(5.9371  -0.6549  0)
(5.7051  -0.5668  0)
(5.7051  -0.5668  0)
(5.4727  -0.4797  0)
(5.4727  -0.4797  0)
(5.24  -0.3936  0)
(5.24  -0.3936  0)
(5.007  -0.3084  0)
(5.007  -0.3084  0)
(4.7735  -0.2243  0)
(4.7735  -0.2243  0)
(4.5397  -0.1413  0)
(4.5397  -0.1413  0)
(4.3054  -0.0595  0)
(4.3054  -0.0595  0)
(4.0708  0.0212  0)
(4.0708  0.0212  0)
(3.8357  0.1007  0)
(3.8357  0.1007  0)
(3.6002  0.1788  0)
(3.6002  0.1788  0)
(3.3642  0.2556  0)
(3.3642  0.2556  0)
(3.1278  0.3308  0)
(3.1278  0.3308  0)
(2.8908  0.4044  0)
(2.8908  0.4044  0)
(2.6533  0.4764  0)
(2.6533  0.4764  0)
(2.4153  0.5465  0)
(2.4153  0.5465  0)
(2.1767  0.6146  0)
(2.1767  0.6146  0)
(1.9375  0.6806  0)
(1.9375  0.6806  0)
(1.6977  0.7442  0)
(1.6977  0.7442  0)
(1.4572  0.8054  0)
(1.4572  0.8054  0)
(1.2161  0.8639  0)
(1.2161  0.8639  0)
(0.9742  0.9194  0)
(0.9742  0.9194  0)
(0.7316  0.9716  0)
(0.7316  0.9716  0)
(0.4883  1.0203  0)
(0.4883  1.0203  0)
(0.2443  1.0651  0)
(0.2443  1.0651  0)
(-0.0005  1.1056  0)
(-0.0005  1.1056  0)
(-0.2461  1.1412  0)
(-0.2461  1.1412  0)
(-0.4924  1.1715  0)
(-0.4924  1.1715  0)
(-0.7393  1.1957  0)
(-0.7393  1.1957  0)
(-0.9868  1.2129  0)
(-0.9868  1.2129  0)
(-1.2348  1.222  0)
(-1.2348  1.222  0)
(-1.4829  1.2216  0)
(-1.4829  1.2216  0)
(-1.7307  1.2097  0)
(-1.7307  1.2097  0)
(-1.9774  1.1833  0)
(-1.9774  1.1833  0)
(-2.2213  1.138  0)
(-2.2213  1.138  0)
(-2.4586  1.0663  0)
(-2.4586  1.0663  0)
(-2.6799  0.9551  0)
(-2.6799  0.9551  0)
(-2.8576  0.7842  0)
(-2.8576  0.7842  0)
(-2.9359  0.552  0)
(-2.9359  0.552  0)
(-2.8875  0.311  0)
(-2.8875  0.311  0)
(-2.7523  0.104  0)
(-2.7523  0.104  0)
(-2.5753  -0.0696  0)
(-2.5753  -0.0696  0)
(-2.377  -0.2186  0)
(-2.377  -0.2186  0)
(-2.1662  -0.3495  0)
(-2.1662  -0.3495  0)
(-1.9474  -0.4663  0)
(-1.9474  -0.4663  0)
(-1.7228  -0.5718  0)
(-1.7228  -0.5718  0)
(-1.4941  -0.6679  0)
(-1.4941  -0.6679  0)
(-1.2621  -0.756  0)
(-1.2621  -0.756  0)
(-1.0276  -0.8371  0)
(-1.0276  -0.8371  0)
(-0.791  -0.912  0)
(-0.791  -0.912  0)
(-0.5528  -0.9815  0)
(-0.5528  -0.9815  0)
(-0.3133  -1.0461  0)
(-0.3133  -1.0461  0)
(-0.0725  -1.1062  0)
(-0.0725  -1.1062  0)
(0.1691  -1.1623  0)
(0.1691  -1.1623  0)
(0.4117  -1.2147  0)
(0.4117  -1.2147  0)
(0.6549  -1.2637  0)
(0.6549  -1.2637  0)
(0.8988  -1.3097  0)
(0.8988  -1.3097  0)
(1.1432  -1.3527  0)
(1.1432  -1.3527  0)
(1.388  -1.3932  0)
(1.388  -1.3932  0)
(1.6332  -1.4312  0)
(1.6332  -1.4312  0)
(1.8787  -1.4669  0)
(1.8787  -1.4669  0)
(2.1246  -1.5006  0)
(2.1246  -1.5006  0)
(2.3707  -1.5322  0)
(2.3707  -1.5322  0)
(2.617  -1.5621  0)
(2.617  -1.5621  0)
(2.8636  -1.5902  0)
(2.8636  -1.5902  0)
(3.1103  -1.6168  0)
(3.1103  -1.6168  0)
(3.3571  -1.6418  0)
(3.3571  -1.6418  0)
(3.6041  -1.6654  0)
(3.6041  -1.6654  0)
(3.8513  -1.6877  0)
(3.8513  -1.6877  0)
(4.0985  -1.7087  0)
(4.0985  -1.7087  0)
(4.3459  -1.7285  0)
(4.3459  -1.7285  0)
(4.5933  -1.7471  0)
(4.5933  -1.7471  0)
(4.8408  -1.7646  0)
(4.8408  -1.7646  0)
(5.0884  -1.781  0)
(5.0884  -1.781  0)
(5.3361  -1.7964  0)
(5.3361  -1.7964  0)
(5.5838  -1.8107  0)
(5.5838  -1.8107  0)
(5.8316  -1.824  0)
(5.8316  -1.824  0)
(6.0794  -1.8364  0)
(6.0794  -1.8364  0)
(6.3273  -1.8477  0)
(6.3273  -1.8477  0)
(6.5752  -1.858  0)
(6.5752  -1.858  0)
(6.8231  -1.8673  0)
(6.8231  -1.8673  0)
(7.0711  -1.8756  0)
(7.0711  -1.8756  0)
(7.3192  -1.8829  0)
(7.3192  -1.8829  0)
(7.5672  -1.8891  0)
(7.5672  -1.8891  0)
(7.8153  -1.8942  0)
(7.8153  -1.8942  0)
(8.0634  -1.8982  0)
(8.0634  -1.8982  0)
(8.3115  -1.901  0)
(8.3115  -1.901  0)
(8.5597  -1.9026  0)
(8.5597  -1.9026  0)
(8.6904  -1.7873  0)
(8.6904  -1.7873  0)
        );
    }
Do you now see the pattern? If not, notice that the problem is that your list has twice the number of points than it really needs .
Therefore, at least from this list, there are only 100 valid points.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   August 21, 2015, 14:14
Default
  #4
New Member
 
Diogo Ramalho
Join Date: May 2015
Posts: 2
Rep Power: 0
dramalho is on a distinguished road
Thanks for the quick reply Bruno.

Yes you are right about that long list of code I post above but I'm just starting with OF and there are a lot of things I still need on those files to get a quick memo when I return to them (next time I will remove all the unnecessary lines).

As I said above I already got my problem solved and I'm getting all the points I need (not more/less than the ones I input). No more problems with sampleDict.

Thanks.

Diogo Ramalho
dramalho is offline   Reply With Quote

Old   June 9, 2016, 11:51
Default
  #5
New Member
 
Dan Pearce
Join Date: May 2013
Posts: 9
Rep Power: 10
Dan Pearce is on a distinguished road
Hi all,
I thought I would resurrect this thread as I have been experiencing an unusual problem with the sample utility...I'm using OF 2.4.0 and running the sample dict on the cavitatingFoam/throttle tutorial. The only changes to the base tutorial are in controlDict to specify output as uncompressed ascii (but I don't think that is relevant here). I'm trying to sample the velocity and vapour fraction across 4 lines at different locations. The 4 lines are all vertical across the nozzle (or channel) section approximately at the start, 1/3rd, 2/3rd and end locations and I'm trying to get 100 points. Using the following sample dict gives some interesting results, the first file has 99 points, the second has 74 points, third has 74 points and the last has 100 points. I should also note that the grid is uniform so I'm confused as to why I'm not getting 100 points in all 4 files... Any insight would be appreciated.

Note that I have tried different interpolation schemes (same result), tried to vary the start and end xyz location (same result) and requested 50 points instead of 100 (in which case I get 49, 36,36 and 50 data points returned).

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.4.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      sampleDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

interpolationScheme cellPoint;

setFormat       raw;
//need to run "foamCalc components U" before in order to have Ux field

sets
(
    line1
    {
        type    uniform;
        axis    xyz;
        start   (0.005 0.0002 0.0000); //Line 1 - entrance to nozzle region
        end     (0.005 -0.0002 0.0000);
        nPoints 100;
    }
    line2
    {
        type    uniform;
        axis    xyz;
        start   (0.00567 0.0002 0.0000); //Line 2 - 1/3 of nozzle region
        end     (0.00567 -0.0002 0.0000);
        nPoints 100;
    }
    line3
    {
        type    uniform;
        axis    xyz;
        start   (0.006318 0.0002 0.0000); //Line 3 - 2/3 of nozzle region
        end     (0.006318 -0.0002 0.0000);
        nPoints 100;
    }
    line4
    {
        type    uniform;
        axis    xyz;
        start   (0.007 0.0002 0.0000); //Line 4 - end of nozzle region
        end     (0.007 -0.0002 0.0000);
        nPoints 100;
    }
);
fields (
    Ux
    alpha.vapour
    //yPlus
    //yPlusTwoPhase
    //yPlusTwoPhase2
    );



// ************************************************************************* //
Dan Pearce is offline   Reply With Quote

Old   April 17, 2017, 17:15
Default
  #6
New Member
 
Jorge Rivas Ordenes
Join Date: Dec 2016
Location: Chile
Posts: 12
Rep Power: 6
Coke Rivas Ordenes is on a distinguished road
Dan,

Did yo manage to make this work?

Hope you can help me out with something, can i sample instead or an axis, an area (diferent to any of the patches define in the blockMesh Dictionary)?

Thanks, hope you can help me out.
Coke Rivas Ordenes is offline   Reply With Quote

Old   May 1, 2017, 20:24
Default
  #7
New Member
 
Harshal Akolekar
Join Date: Aug 2016
Location: Melbourne
Posts: 25
Rep Power: 6
hakolekar is on a distinguished road
Any tips on this problem?
hakolekar is offline   Reply With Quote

Old   May 1, 2017, 21:25
Default
  #8
New Member
 
Jorge Rivas Ordenes
Join Date: Dec 2016
Location: Chile
Posts: 12
Rep Power: 6
Coke Rivas Ordenes is on a distinguished road
Dear hakolekar:

Quote:
Originally Posted by hakolekar View Post
Any tips on this problem?
I manage to solve the sampling of a surface in any region of the domain (is this what you are asking about?) with the following code in the controlDict/function sub-dictionary of my simulation:

Code:
 
cuttingPlane
     {
        type            surfaces;
        libs            ("libsampling.so");
        interpolationScheme cell;
        writeControl    timeStep;
        writeInterval   10;
        surfaceFormat   raw;
        fields          (U k nut p);
        surfaces
        (
            inletPlane
            {
                type cuttingPlane;
                planeType pointAndNormal;
                pointAndNormalDict
                {
                        basePoint       (481 400 400);
                        normalVector    (1 0 0);
                }
                interpolate false;
            }
        );
     }
The code above samples all the variables in the surfaces containing the point (481 400 400) and the normal vector (1 0 0). It was quite simple after getting to know about the existence of the sampling utilities.
Coke Rivas Ordenes is offline   Reply With Quote

Reply

Tags
sample, sampledict

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Sample utility bug? For many cloud points in the sampleDict, some are neglected! brandius OpenFOAM Post-Processing 9 October 10, 2017 05:00
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 09:38
Sample Utility not working in OpenFoam 1.6 titio OpenFOAM Post-Processing 6 November 15, 2014 18:04
Sample Utility not working in OpenFoam 1.6 titio OpenFOAM Post-Processing 0 February 5, 2010 12:12
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 07:36


All times are GMT -4. The time now is 12:15.