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

post processing on a specified surface

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

Like Tree3Likes
  • 2 Post By SirWombat
  • 1 Post By doubtsincfd

Reply
 
LinkBack Thread Tools Display Modes
Old   July 5, 2012, 06:47
Default post processing on a specified surface
  #1
New Member
 
Matteo Longoni
Join Date: Jul 2011
Location: Monza
Posts: 3
Rep Power: 6
teolong is on a distinguished road
Hi,

I was wondering if anybody knows how to generate fields output (p,U,k) on surfaces that do not belong to boundaries, from a 3D simpleFoam calculation. I'm thinking on something like the cuttingPlane post processing function, but restricted to a user defined surface, someway given.

I had a look at sampleDict and sampleSurfaceDict, but I couldn't manage to make them work.

Matteo
teolong is offline   Reply With Quote

Old   July 7, 2012, 05:12
Default sample on a surface
  #2
Member
 
Jan
Join Date: Dec 2009
Location: Berlin
Posts: 50
Rep Power: 9
SirWombat is on a distinguished road
Send a message via Skype™ to SirWombat
Hi Matteo

that is actually easily done. You will need a STL-File of your surface. Put that in the directory: "constant/trisurface/"

Then create a "sampleDict"-File in the "system/" folder e.g. like the one below.

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1.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
    U
);

surfaces
(
    triSurfaceSampling
    {
        // Sampling on triSurface
        type        sampledTriSurfaceMesh;
        surface     YOURSURFACE.stl;
        source      boundaryFaces;  // sample cells or boundaryFaces
        interpolate true;
    }
);


// *********************************************************************** //
I assume you will use paraview/paraFoam for postprocessing, so the example will generate a "vtk"-File, selected under "surfaceFormat"

change "YOURSURFACE.stl" to the name of your surface. Finally put the fields of interest under "fields to sample". In the example I was interested in U (velocity) and p (pressure).

You can then create that field after (!) you ran the simulation. Make sure the case is reconstructed if you use parallel processing. Then use the following for a surfacefield of the last computed timestep:

Code:
sample -latestTime
You will find a "vtk"-file under the corresponding time in the folder "surfaces/" in your case-folder


Hope that helps!

Greetings,
Jan
kiddmax and JR22 like this.
__________________
~~~_/)~~~
SirWombat is offline   Reply With Quote

Old   July 9, 2012, 03:15
Default
  #3
New Member
 
Matteo Longoni
Join Date: Jul 2011
Location: Monza
Posts: 3
Rep Power: 6
teolong is on a distinguished road
Thanks Jan for your detailed reply,
it worked perfectly.

Cheers,

Matteo
teolong is offline   Reply With Quote

Old   November 12, 2012, 04:45
Default
  #4
New Member
 
Falko Kunze
Join Date: Nov 2012
Location: Dahlum, Germany
Posts: 2
Rep Power: 0
hatchet is on a distinguished road
Hi Jan,

I tried your advice. It works very well.
But Ive one more question.

First my sampleDict looks like yours. So I get in /surfaces two files with the results of my stl. But I want the results averaged over the face and not for every cell. How does that work?


Greets
hatchet is offline   Reply With Quote

Old   November 12, 2012, 07:41
Default
  #5
Member
 
Jan
Join Date: Dec 2009
Location: Berlin
Posts: 50
Rep Power: 9
SirWombat is on a distinguished road
Send a message via Skype™ to SirWombat
Hi Falko,

have a look at Bernhard post in this thread: Volume Average for magnitude U

Instead of the built-in functions, you'll have to use swak4foam. But thats almost as easily done!

G Jan
__________________
~~~_/)~~~
SirWombat is offline   Reply With Quote

Old   November 13, 2012, 04:22
Default
  #6
New Member
 
Falko Kunze
Join Date: Nov 2012
Location: Dahlum, Germany
Posts: 2
Rep Power: 0
hatchet is on a distinguished road
Hi Jan,

thanks for your answer.

But I cant use swak4foam because Im not allowed to install something. So Ive to use the standard options.


Greets
hatchet is offline   Reply With Quote

Old   November 13, 2012, 17:44
Default
  #7
Senior Member
 
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 7
doubtsincfd is on a distinguished road
you can use http://www.openfoam.org/version2.0.0...me-control.php

See the controlDict in tutorials/incompressible/pisoFoam/les/pitzDaily/system

You will find a bunch of stuff you can do without swak

Also see this:

http://openfoamwiki.net/index.php/Ca...nction_Objects
SirWombat likes this.
doubtsincfd is offline   Reply With Quote

Old   May 1, 2013, 13:46
Question sampleDict interpolates solution at STL, how to minimize interpolation errors?
  #8
Senior Member
 
JR22's Avatar
 
Jose Rey
Join Date: Oct 2012
Posts: 125
Rep Power: 8
JR22 will become famous soon enough
Hi Jan, thank you very much for your recipe. I generated planes with paraview (changing the resolution, applying the triangulate filter, and saving as STL-text). Then, I used your recipe, works wonderfully. I had more than one STL surface, and for some reason, the cells interpolation was better than boundaryFaces.

However, the interpolation by the sample postprocessing utility is not that clean. To overcome this, I tried adding the same STL files to my snappyHexMeshDict as refinementSurfaces but simpleFoam expects a patch and gives me an error. The best I could do was to use the STLs as refinementRegions with the type distance option to get a bit better resolution in the area; in other words:

Is there a way to get snappyHexMesh to generate mesh vertices at the STL edges/cells, so that interpolation is minimal and results have less errors?


sampleDict:
Code:
.
.
.

surfaces
(
    mySurface1
    {
        // Sampling on triSurface
        type        sampledTriSurfaceMesh;
        surface     mySurface1.stl;
        source      cells;  // sample cells or boundaryFaces
        interpolate true;
    }
    mySurface2
    {
        // Sampling on triSurface
        type        sampledTriSurfaceMesh;
        surface     mySurface2.stl;
        source      cells;  // sample cells or boundaryFaces
        interpolate true;
    }
    .
    .
    .
);
.
.
.
Quote:
Originally Posted by SirWombat View Post
that is actually easily done. You will need a STL-File of your surface. Put that in the directory: "constant/trisurface/"
Then create a "sampleDict"-File in the "system/" folder e.g. like the one below.
JR22 is offline   Reply With Quote

Reply

Tags
sampledict, samplesurfacedict

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
Ansys Post processing ano999 ANSYS 1 May 27, 2011 16:24
NO model vs post processing in coal combustion,CFX sakalido CFX 1 April 15, 2011 14:07
Post Processing free surface flows Chris Wetton CFX 2 February 14, 2008 09:14
Tecplot for CFX post processing pantangi goud CFX 2 August 24, 2005 16:42
post processing in CFD MANISH BHARGAVA Main CFD Forum 0 October 17, 1998 20:51


All times are GMT -4. The time now is 17:55.