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

post processing on a specified surface

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

Like Tree7Likes
  • 6 Post By SirWombat
  • 1 Post By doubtsincfd

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 5, 2012, 07:47
Default post processing on a specified surface
  #1
New Member
 
Matteo Longoni
Join Date: Jul 2011
Location: Monza
Posts: 3
Rep Power: 14
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, 06:12
Default sample on a surface
  #2
Member
 
Jan
Join Date: Dec 2009
Location: Berlin
Posts: 50
Rep Power: 19
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, bennn, JR22 and 3 others like this.
__________________
~~~_/)~~~
SirWombat is offline   Reply With Quote

Old   July 9, 2012, 04:15
Default
  #3
New Member
 
Matteo Longoni
Join Date: Jul 2011
Location: Monza
Posts: 3
Rep Power: 14
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: 3
Rep Power: 13
hatchet is on a distinguished road
Hi Jan,

I tried your advice. It works very well.
But I´ve 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: 19
SirWombat is on a distinguished road
Send a message via Skype™ to SirWombat
Hi Falko,

have a look at Bernhard post in this thread: http://www.cfd-online.com/Forums/ope...gnitude-u.html

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: 3
Rep Power: 13
hatchet is on a distinguished road
Hi Jan,

thanks for your answer.

But I can´t use swak4foam because I´m not allowed to install something. So I´ve 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: 16
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, 14: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: 134
Rep Power: 17
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

Old   July 15, 2019, 10:42
Default
  #9
Member
 
George Pichurov
Join Date: Jul 2010
Posts: 52
Rep Power: 15
jorkolino is on a distinguished road
What if I want to create a surface by coordinates? I have a case and I want to create an internal plane, whose boundary coordinates I know. Regards.
jorkolino is offline   Reply With Quote

Old   April 12, 2020, 17:07
Default
  #10
New Member
 
Joseph Tipton
Join Date: Jun 2010
Posts: 27
Rep Power: 15
jtipton2 is on a distinguished road
Quote:
Originally Posted by jorkolino View Post
What if I want to create a surface by coordinates? I have a case and I want to create an internal plane, whose boundary coordinates I know. Regards.
See this post:

Pressure difference across 2 internal faces
jtipton2 is offline   Reply With Quote

Old   March 31, 2021, 12:02
Default difference between cell and boundaryFaces
  #11
New Member
 
zein elserfy
Join Date: May 2018
Posts: 25
Rep Power: 7
zeinelserfy is on a distinguished road
Quote:
Originally Posted by JR22 View Post
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;
    }
    .
    .
    .
);
.
.
.
what is the difference in interpolation between cell or boundaryFaces as source??
zeinelserfy is offline   Reply With Quote

Reply

Tags
sampledict, samplesurfacedict

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ansys Post processing ano999 ANSYS 1 May 27, 2011 17:24
NO model vs post processing in coal combustion,CFX sakalido CFX 1 April 15, 2011 15: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 17:42
post processing in CFD MANISH BHARGAVA Main CFD Forum 0 October 17, 1998 21:51


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