CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Sample a volume field (http://www.cfd-online.com/Forums/openfoam-post-processing/81853-sample-volume-field.html)

gwierink November 9, 2010 04:47

Sample a volume field
 
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!

olesen November 10, 2010 10:42

Quote:

Originally Posted by gwierink (Post 282717)
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.

gwierink November 10, 2010 11:36

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!

Gitesh P May 8, 2014 07:18

Sampling data in twoPhaseEulerFoam
 
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

renatogsousa June 5, 2014 06:54

topoSet and foamToVtk
 
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.


All times are GMT -4. The time now is 08:01.