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

Sample a volume field

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 9, 2010, 03:47
Default Sample a volume field
  #1
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 382
Rep Power: 8
gwierink is on a distinguished road
Dear all,

I would like to "sample a volume", i.e. write out a volumetric field as raw data. I normally use the sample utility, but that samples points, lines, and surfaces. Does anyone know a trick to write out a volumetric field in the same way sample writes out e.g. a surface? Is the only option writing a "volume function" in the sample utility or python scripting with paraview? Thanks in advance!
__________________
Regards, Gijs
gwierink is offline   Reply With Quote

Old   November 10, 2010, 09:42
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 774
Rep Power: 17
olesen will become famous soon enough
Quote:
Originally Posted by gwierink View Post
Dear all,

I would like to "sample a volume", i.e. write out a volumetric field as raw data. I normally use the sample utility, but that samples points, lines, and surfaces. Does anyone know a trick to write out a volumetric field in the same way sample writes out e.g. a surface? Is the only option writing a "volume function" in the sample utility or python scripting with paraview? Thanks in advance!

"foamToVTK -cellSet" might help.
olesen is offline   Reply With Quote

Old   November 10, 2010, 10:36
Default
  #3
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 382
Rep Power: 8
gwierink is on a distinguished road
Hi Mark,

Thanks for your reply.

I would like to get the alpha field with xyz coordinates out of a twoPhaseEulerFoam case. So, what I now tried is to run cellSet with the following cellSetDict:

Code:
// Name of set to operate on
name alpha;//c0;

// One of clear/new/invert/add/delete|subset/list
action new;

// Actions to apply to cellSet. These are all the topoSetSource's ending
// in ..ToCell (see the meshTools library).

topoSetSources
(
    // Cells with cell centre within box
    boxToCell
    {
       box   (0 0 0) (1 1.5 1);
    }

    // values of field within certain range
    fieldToCell
    {
        fieldName   alpha;//U;      // Note: uses mag(U) since volVectorField
        min         0.0;
        max         1.0;
    }
);
This created a list of cellID's (?) in constant/polyMesh/sets/alpha. Then I did
Code:
foamToVTK -cellSet alpha
which seemingly created the same VTK case but named alpha. Am I doing something wrong here to get out xyz-alpha or overlooking something? Many thanks in advance!
__________________
Regards, Gijs
gwierink is offline   Reply With Quote

Old   May 8, 2014, 07:18
Default Sampling data in twoPhaseEulerFoam
  #4
Member
 
Gitesh
Join Date: Jan 2010
Location: Finland
Posts: 60
Rep Power: 6
Gitesh P is on a distinguished road
Hello,

I want to store volume averaged values of some fields (i.e., alpha, k and epsilon) only in particular area of interest (around the interface region) in twoPhaseEulerFoam.

Does we have any utility in OpenFOAM which can be useful to achieve the data?

Thanks in advanced!

With regards,
GP
Gitesh P is offline   Reply With Quote

Old   June 5, 2014, 06:54
Default topoSet and foamToVtk
  #5
New Member
 
Renato Sousa
Join Date: Jul 2013
Posts: 2
Rep Power: 0
renatogsousa is on a distinguished road
take a look at topoSet utility with topoSetDict, I'm still exploring it but it might create a set with the cells that you want according to different filter options.
then use the foamToVtk with the -cellSet option to extract the values from your set.
renatogsousa is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to compare volume scalar field with constant values sachin OpenFOAM Running, Solving & CFD 3 November 24, 2009 13:09
FloWorks (Flow Express) Volume Goal Setting Issue rbigelow FloEFD, FloWorks & FloTHERM 1 November 16, 2009 01:32
FloWorks (Flow Express) Volume Goal Setting rbigelow Main CFD Forum 0 November 13, 2009 14:28
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 06:51
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 11:55


All times are GMT -4. The time now is 19:38.