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

Uniform surface sampling?

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By kingjewel1
  • 2 Post By RebelLion

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 16, 2016, 11:30
Default Uniform surface sampling?
  #1
New Member
 
Anon
Join Date: Mar 2016
Posts: 6
Rep Power: 10
RebelLion is on a distinguished road
Hello,

I would like to export field values from a nonuniform grid using a uniform sampling grid.

Any suggestions?

mapFields seems terribly inefficient since it only does one time step at a time (I have a few 100 time steps I want to export)

the sample utility 'works' but I don't see how to specify uniform sampling for a surface.

Thanks for your help!
RebelLion is offline   Reply With Quote

Old   March 16, 2016, 11:45
Default
  #2
Senior Member
 
Join Date: Jul 2009
Posts: 260
Rep Power: 17
kingjewel1 is on a distinguished road
Quote:
Originally Posted by RebelLion View Post
Hello,

I would like to export field values from a nonuniform grid using a uniform sampling grid.

Any suggestions?

mapFields seems terribly inefficient since it only does one time step at a time (I have a few 100 time steps I want to export)

the sample utility 'works' but I don't see how to specify uniform sampling for a surface.

Thanks for your help!
Are you wanting to sample a solid surface e.g. a wall? Or a plane you have defined?

For the former you can't as far as I know. You need to change it to a patch then use sample.

Once you've changed your solid object to a patch (in your processor/constant/polymesh/boundary files) use:

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;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

setFormat raw;
surfaceFormat vtk;

interpolationScheme cellPoint;

// Fields to sample.
fields
(
    p
);

sets
(
);

surfaces
(
    cubes
    {
        type             patch;
        patches         ("cubes");
    }
);


// *********************************************************************** //
For the second use something like this:

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;
    object      sampleDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


setFormat raw;
surfaceFormat vtk;

// optionally define extra controls for the output formats
formatOptions
{
    ensight
    {
        format  ascii;
    }
}


sets
(
    
);


surfaces
(
    constantPlane
    {
        type            plane;    // always triangulated
        basePoint       (0 0 3.5);
        normalVector    (0 0 1);

    }

   

);


// *********************************************************************** //
manoj_nav likes this.
kingjewel1 is offline   Reply With Quote

Old   March 16, 2016, 12:14
Default
  #3
New Member
 
Anon
Join Date: Mar 2016
Posts: 6
Rep Power: 10
RebelLion is on a distinguished road
Hi kingjewel1. Thanks for the reply.

My goal is to export field values of a plane I define. I can do that using your second suggestion.

My problem is that I want the exported results to be interpolated onto a uniform grid. When exporting a 1D line set, uniform distribution is a sampleDict option but I can not find similar functionality for 2D surfaces. Any other ideas? or even other post-processing suggestions?

Thanks again!
RebelLion is offline   Reply With Quote

Old   June 21, 2016, 07:56
Default
  #4
New Member
 
Lu ZHOU
Join Date: Jul 2014
Location: Lyon, France
Posts: 12
Rep Power: 11
lzhou is on a distinguished road
Hello,

Have you got a solution for your question ? I am trying to do the same thing.

Thanks !

Lu ZHOU
lzhou is offline   Reply With Quote

Old   June 21, 2016, 17:43
Default
  #5
New Member
 
Anon
Join Date: Mar 2016
Posts: 6
Rep Power: 10
RebelLion is on a distinguished road
One way I found to do so is to define a plane source (under source menu) and then use the filter Resample with Dataset. To setup the filter use your data as the "input" and the plane as the "source". Sample periodicity is set under the plane properties, X Resolution and Y Resolution.

Good luck and let me know if you have any further questions
lzhou and RicardoFE95 like this.
RebelLion is offline   Reply With Quote

Reply


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
dsmcFoam setup hherbol OpenFOAM Pre-Processing 1 November 19, 2021 01:52
[Gmsh] Error : Self intersecting surface mesh, computing intersections & Error : Impossible velan OpenFOAM Meshing & Mesh Conversion 3 October 22, 2015 11:05
Is there a bug when running createBaffles in parallel??? zfaraday OpenFOAM Pre-Processing 1 May 12, 2015 13:32
Time continuity error & FAN patch Zephiro88 OpenFOAM Running, Solving & CFD 4 April 22, 2015 12:39
OpenFOAM solution is diverging for stress analysis in two-pahse microstructure. Sargam05 OpenFOAM 16 April 30, 2013 16:18


All times are GMT -4. The time now is 18:07.