# sampling on cellSet

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

 May 22, 2013, 02:44 sampling on cellSet #1 Senior Member   Tarak Join Date: Aug 2010 Location: State College, PA Posts: 110 Rep Power: 8 Hii, I need to use the "sample" utility to sample field values in a cellSet. Can someone please tell me the entries needed in sampleDict to do this? Thanks

May 22, 2013, 03:47
#2
Senior Member

T Chourushi
Join Date: Jul 2009
Location: India
Posts: 319
Blog Entries: 1
Rep Power: 10
Quote:
 Originally Posted by Tarak Hii, I need to use the "sample" utility to sample field values in a cellSet. Can someone please tell me the entries needed in sampleDict to do this? Thanks

SampleDict

 May 22, 2013, 11:13 #3 Senior Member   Tarak Join Date: Aug 2010 Location: State College, PA Posts: 110 Rep Power: 8 Hii Tushar, Thanks for your reply. If I understand correctly, the link talks about sampling on a patch, which I can do by writing something like surfaces ( airfoil { type patch; patches (airfoil);; // interpolate false; } ); inside sampleDict. But I need to sample data along a cellSet (not patch)

May 23, 2013, 00:33
#4
Senior Member

T Chourushi
Join Date: Jul 2009
Location: India
Posts: 319
Blog Entries: 1
Rep Power: 10
Quote:
 Originally Posted by Tarak Hii Tushar, Thanks for your reply. If I understand correctly, the link talks about sampling on a patch, which I can do by writing something like surfaces ( airfoil { type patch; patches (airfoil);; // interpolate false; } ); inside sampleDict. But I need to sample data along a cellSet (not patch)
By the cellSet do you mean to say a line/surface inside the fluid domain?

If suppose you want to plot along a line follow the below shown procedure.

Make your sampleDict like the one shown below:

interpolationScheme cellPoint;

setFormat raw;

surfaceFormat raw;

sets
(
name
{
type uniform;
axis y;
start (0 0 0.0005);
end (0 0.425 0.0005);
nPoints 800; }
);
fields (U p);

In a similar fashion you can progress for the surface with some changes like surfaces instead of sets, type patch..etc.

 May 23, 2013, 01:09 #5 Senior Member   Tarak Join Date: Aug 2010 Location: State College, PA Posts: 110 Rep Power: 8 Hii Tushar, Thanks for your reply. By cellSet I meant the list of cells which we can create based on multiple criteria (See section 5.1 of http://openfoamwiki.net/index.php/TopoSet).

May 23, 2013, 01:40
#6
Senior Member

T Chourushi
Join Date: Jul 2009
Location: India
Posts: 319
Blog Entries: 1
Rep Power: 10
Quote:
 Originally Posted by Tarak Hii Tushar, Thanks for your reply. By cellSet I meant the list of cells which we can create based on multiple criteria (See section 5.1 of http://openfoamwiki.net/index.php/TopoSet).

Hi Tarak,

Thanks for explaining..
Try looking at the already available topoSetDict with the OF. \$tutorial/incompressible/pimpleFoam/TjunctionFan/system/ .
May be bad co-ordinates could be sometimes a problem with the effecting running of utility.

 July 9, 2013, 16:18 #7 Senior Member   Francois Beaubert Join Date: Mar 2009 Location: Lille, France Posts: 142 Rep Power: 9 Tarak, Did you find a solution to sample your data on a cellSet/faceSet ? Thanks Regards François

 July 9, 2013, 17:44 sampling of cellSet #8 New Member   Ashvin Chaudhari Join Date: Aug 2011 Location: Finland Posts: 22 Rep Power: 7 Hi, One can first run the topoSetDict and try to make a cellSet. Below is the code to keep in topoSetDict in order to make box typed cellSet. Code: ```actions ( { name c0; // name of the cellSet type cellSet; action new; source boxToCell; //box type of cellSet sourceInfo { box (1 0.5 0) (3 1.5 0.5); //size or dimensions of the Box, you may change this } } );``` After creating the cellSet, one can run following command to produce a VTK file of that cellSet, e.g., Code: `foamToVTK -cellSet c0 -latestTime` Hope this helps ! - Ashvin

 July 11, 2013, 07:34 #9 Senior Member   Francois Beaubert Join Date: Mar 2009 Location: Lille, France Posts: 142 Rep Power: 9 Thanks Ashvin for your tip. Indeed it's possible to obtain VTK file from cellSet with foamToVTK but i'm looking for something different: I'll like to obtain a raw file of the sampled cellSet which I can load into python. Is it possible to do it without writing a parser to convert the VTK file to raw data ? Have a nice day Regards Francois

 July 14, 2013, 21:34 #10 Senior Member   Tarak Join Date: Aug 2010 Location: State College, PA Posts: 110 Rep Power: 8 Hii Francois, No, I couldn't find a solution. Please let me know if you have one.

 August 21, 2013, 10:08 Simple sampling using cellSet #11 New Member   Johan Roenby Join Date: May 2011 Location: Denmark Posts: 25 Rep Power: 10 Dear Tarak Maybe I misunderstood something, but I think what you are trying to do is straight forward: The cellSet you create e.g. with topoSet will be in a file, say, /constant/polyMesh/sets/c0. This contains a list of cell indices, e.g. for all cells having centres within a box defined in your topoSetDict. If the field that you want to sample is a volVectorField (such as the velocity field U) or volScalarField (such as the pressure field p) then the file /

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post beauty FLUENT 7 October 22, 2016 06:01 Grimoli OpenFOAM Pre-Processing 1 April 14, 2013 08:54 buffi OpenFOAM Post-Processing 0 December 17, 2012 05:19 RugbyGandalf OpenFOAM Meshing & Mesh Conversion 2 December 17, 2012 03:34 JimKnopf OpenFOAM Post-Processing 0 May 27, 2011 04:10

All times are GMT -4. The time now is 23:52.