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

Sample utility bug? For many cloud points in the sampleDict, some are neglected!

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

Like Tree1Likes
  • 1 Post By gigilentini8

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 9, 2014, 11:42
Default Sample utility bug? For many cloud points in the sampleDict, some are neglected!
  #1
New Member
 
Join Date: May 2014
Posts: 4
Rep Power: 8
brandius is on a distinguished road
Hiya,

Problem description
With a self-written C++/OpenFOAM tool, I am outputting the coordinates of all cellCentres. This is working as expected. I copy those data into the sampleDict. It has the following appearance:
Code:
setFormat raw;

surfaceFormat raw;

formatOptions
{
    ensight
    {
        format  ascii;
    }
}

interpolationScheme cellPoint;

fields
(
    p
    U
);

sets
(
    REPoints
    {
        type    cloud;
        axis    xyz;
        points  (
MANY POINTS HERE, like:
(x_1     y_1     z_1)
);
} );
This also works as expected. After running "sample -latestTime", however, in the results, the results for some points (0.01-1%) are missing.

Why I need this
I want to write a tool that can make a statement about the grid convergence or, more precisely, about an estimation of the discretisation error.

1. I take one domain with the same boundary conditions, solvers etc. and mesh it once --> that's my base grid, the coarse grid.
2. Then I refine this twice, to get a "medium" grid and a "fine" grid.
3. I calculate all three grid cases till iterative convergence.
4. In order to make a statement on discretisation errors, I need to compare the variable values at the locations of all the cell centres of the coarse grid with the respective variable values at the same location for the medium and the fine grid.
5. I want to display my calculated values with paraFoam. For that, I create a file for a physical quantity (for example the famous "Grid Convergence Index" for all points), fill the "internal domain" with the calculated values, put some values for the boundaries and put it into the latest timeStep of the coarse grid. I can then display it with paraFoam.

The copying into the internal domain, however, is only possible, if the number of sample points is equal to the number of cells in OpenFOAM. Otherwise, some points would be missing and paraFoam rebels! In the recent case, I have over 1.700.000 cell centres and around 150 of them are missed out by sample. Of course, I don't know which ones.

How you could help
You can help me in two ways:
1. Either you have a workaround for sample (maybe it's a known sample problem that can be bypassed).
2. Or you see a more elegant way to suit my needs, without using the utility sample. Maybe there is a more-straightforward C++/OpenFOAM solution for getting the variable values for three different grids on the same coordinates.



PS:
In the latest case, I also get a warning during the run time of the sample utility. However, even without this error, the above described swallowing of points happens.

Code:
--> FOAM Warning : 
    From function tetIndices polyMeshTetDecomposition::triangleTetIndices(const polyMesh&, label, label, label)
    in file meshes/polyMesh/polyMeshTetDecomposition/polyMeshTetDecomposition.C at line 643
    No base point for face 1127060, 6(1862489 1862486 1860125 1860122 1863381 1863375), produces a valid tet decomposition.
brandius is offline   Reply With Quote

Old   September 14, 2014, 16:09
Default Missing output from sample utility
  #2
New Member
 
Jim Conger
Join Date: Jan 2014
Location: California, USA
Posts: 21
Rep Power: 8
james.conger is on a distinguished road
I have run into the same thing. The annoying thing is that the omitted points are missing altogether rather than being listed in the 'sample' output with some sort of 'no data' or -999 flag. I get around the problem to interpolating the missing entries from nearest neighbors when post-processing the 'sample' output. This requires locating all the missing points by comparing the x,y,z location of all of the requested points with that of the 'sample' output. I do this using a bit of Python code.
james.conger is offline   Reply With Quote

Old   September 25, 2014, 10:55
Default
  #3
New Member
 
Join Date: May 2014
Posts: 4
Rep Power: 8
brandius is on a distinguished road
Hi James,

yes, that is certainly an option. I had hoped that there might be a simpler option. It's sad that there seems to be a programming bug somewhere in the sample code. I might program a similar utility to sample if I'll have the time and motivation, using the C++ member functions of OpenFOAM. Otherwise I'll use your workaround.

If anyone else has another idea, I'd be happy to here it!

Bye
Marcus
brandius is offline   Reply With Quote

Old   January 19, 2015, 15:11
Default
  #4
Member
 
Join Date: Aug 2012
Posts: 33
Rep Power: 10
gigilentini8 is on a distinguished road
same issue here. makes me crazy
Why do some points are not sampled?

Any news on this? Do you think it can be considered a bug?
If so, it's quite serious. Point evaluation are one of the most important thing and, at least without interpolation ("Cell") they shuold always be provided correctly
gigilentini8 is offline   Reply With Quote

Old   January 20, 2015, 02:50
Default
  #5
Member
 
Duong A. Hoang
Join Date: Apr 2009
Location: Delft, Netherlands
Posts: 93
Rep Power: 13
duongquaphim is on a distinguished road
Send a message via Yahoo to duongquaphim
Hi,

Why dont you use mapFields for your purpose? It can be use to map the result from one mesh to another with similar geometry. Of course, this solution only works if you accept the interpolation error during the process.

Duong
duongquaphim is offline   Reply With Quote

Old   November 27, 2015, 09:11
Default
  #6
Senior Member
 
Join Date: Jul 2009
Posts: 260
Rep Power: 14
kingjewel1 is on a distinguished road
Has anyone worked out what's going on with this yet? All I want is a uniformly distributed line of points. Sometimes some are missing but they're almost always unordered. Is there a workaround?
kingjewel1 is offline   Reply With Quote

Old   July 15, 2016, 05:35
Default
  #7
New Member
 
Bah.Mah
Join Date: Jun 2016
Posts: 18
Rep Power: 6
R.Mah is on a distinguished road
Hallo, does any one had found the solution , Im still struggling on that
R.Mah is offline   Reply With Quote

Old   July 15, 2016, 08:13
Default
  #8
Member
 
Join Date: Aug 2012
Posts: 33
Rep Power: 10
gigilentini8 is on a distinguished road
not sure if this has been solved in the new versions.
anybody checked?
if the problem is still there, the only option is to dig into the code to understand when the missing points are removed

any clue?
R.Mah likes this.
gigilentini8 is offline   Reply With Quote

Old   October 9, 2017, 10:02
Default sampling issue reasons
  #9
New Member
 
Join Date: Sep 2017
Posts: 2
Rep Power: 0
saakwave is on a distinguished road
I have noted that missing of sampling points happens in two cases:

1. Round off errors of coordinates near the end of model. If the coordinates given in ccx, ccy and ccz (which already seem to have a minor round-off error) are close to the end regions of the geometry (like wall of a pipe) this almost always happens and the coordinates have to be adjusted a little. You may reduce the coordinate magnitudes by some small amount to ensure everything is within the geometry.

2. Copying data between different applications like excel or other sometimes gives this issue.
saakwave is offline   Reply With Quote

Old   October 10, 2017, 05:00
Default
  #10
Member
 
Join Date: Aug 2012
Posts: 33
Rep Power: 10
gigilentini8 is on a distinguished road
from what I remember the problem was more serious and happened also in the internal part of the mesh, very likely when points are close to faces.
it would be interesting to know if this has been solved in the new versions...
gigilentini8 is offline   Reply With Quote

Reply

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
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 09:38
sample utility stops sampling once the line leaves the domain Zymon OpenFOAM 1 May 2, 2012 04:51
interpolation with a cuttingPlane for sample utility lbordier OpenFOAM 1 February 14, 2012 13:53
bug in Rcomponents utility cedric_duprat OpenFOAM Bugs 1 May 7, 2009 02:56
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 07:36


All times are GMT -4. The time now is 05:16.