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

volFlowRateSurface function - triangulated surface

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

Like Tree2Likes
  • 1 Post By igor.leo93
  • 1 Post By igor.leo93

Reply
 
LinkBack Thread Tools Display Modes
Old   July 27, 2016, 21:03
Default volFlowRateSurface function - triangulated surface
  #1
New Member
 
igor.leo93's Avatar
 
Igor Leonardo
Join Date: Jul 2016
Location: Brazil - SP - SJC
Posts: 14
Rep Power: 3
igor.leo93 is on a distinguished road
Hello everyone,

I'm trying to use the function object volFlowRateSurface described here:

http://cfd.direct/openfoam/user-guid...#x31-2270006.2

Basically, i want to list the flow rate in some specific areas of my model.

From the description on the link above, i can do that with this function, by using these "specified triangulated surfaces" right?

My question is:

How to make proper use of this function, and how to create these triangulated surfaces?

So far i found out that i need to have this function called from my controlDict file like this:

Code:
functions
{
    #includeFunc volFlowRateSurface;
}
Then i need to have a file named volFlowRateSurface on my system folder.
The file in the postProcessing/flowRate folder in openFOAM, looks like this:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
    \\  /    A nd           | Web:      www.OpenFOAM.org
     \\/     M anipulation  |
-------------------------------------------------------------------------------
Description
    Calculates volumetric flow rate through a specified triangulated surface
    by interpolating velocity onto the triangles and integrating over the
    surface area.  Triangles need to be small (<= cell size) for an accurate
    result.

\*---------------------------------------------------------------------------*/

triSurface <triSurfaceFile>;

#includeEtc "caseDicts/postProcessing/flowRate/volFlowRateSurface.cfg"



// ************************************************************************* //
So apparently, it looks for a triSurfaceFile, or something...

I would be happy if someone could give some example of how to use this function, specify these triangulated surfaces, or just point out some tutorial that uses this, so i can have some reference...

Thanks everyone for the help.
I'm new to OpenFOAM, sorry if this is a silly question, and if i'm posting this on the wrong section or something. But i could not find examples of usage of this function around, nor much information on the forum.

Best regards,
Igor L.

Last edited by igor.leo93; July 29, 2016 at 20:07.
igor.leo93 is offline   Reply With Quote

Old   July 29, 2016, 20:06
Default Progress1
  #2
New Member
 
igor.leo93's Avatar
 
Igor Leonardo
Join Date: Jul 2016
Location: Brazil - SP - SJC
Posts: 14
Rep Power: 3
igor.leo93 is on a distinguished road
So i have made some progress and thought i would come and share in case someone looks for explanations on this function like i did...

So i found out the following:

1- On our volFlowRateSurface file in the system folder, we must declare a regionType, which can be of the following types:

faceZone
patch
sampledSurface

So if we choose patch, it will monitor the flow rate over a specified patch, same goes for faceZone and sampledSurface (Problem now is how exactly to create these facezones and sampledSurfaces on parts of the domain in which we want to monitor the flow rate...)

To choose where exactly we want to monitor we must declare a name, as in facezone name, or sampledsurfaceDict or patch name.

After declaring these, and running the simulation, a volFlowRateSurface folder will be created in the postProcessing folder, there will be a list of the flowrate on each timeStep.

Here is an example of a volFlowRateSurface file, this uses a sampledSurfaceDict plane, to monitor the flowrate:

Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
    \\  /    A nd           | Web:      www.OpenFOAM.org
     \\/     M anipulation  |
-------------------------------------------------------------------------------
Description
    Calculates volumetric flow rate through a specified triangulated surface
    by interpolating velocity onto the triangles and integrating over the
    surface area.  Triangles need to be small (<= cell size) for an accurate
    result.

\*---------------------------------------------------------------------------*/

triSurface <triSurfaceFile>;

#includeEtc "caseDicts/postProcessing/flowRate/volFlowRateSurface.cfg"

regionType    sampleadSurface;
name        sampleSurfaceDict;

sampledSurfaceDict
        {           
            type            plane;
            basePoint       (0.9 0 0);
            normalVector    (1 0 0);
            interpolate       false;
        }



// ************************************************************************* //
The output for this, looks like something like this:

Code:
# Region type : sampledSurface sampleSurfaceDict
#   Faces  : 4000
#   Area   : 3.138364e-02
#        Time    areaNormalIntegrate(U)
            1    (1.686720e+00 0.000000e+00 0.000000e+00)
            2    (1.832342e+00 0.000000e+00 0.000000e+00)
            3    (1.859946e+00 0.000000e+00 0.000000e+00)
            4    (1.735812e+00 0.000000e+00 0.000000e+00)
            5    (1.672361e+00 0.000000e+00 0.000000e+00)
            6    (1.693844e+00 0.000000e+00 0.000000e+00)
            7    (1.701347e+00 0.000000e+00 0.000000e+00)
            8    (1.712168e+00 0.000000e+00 0.000000e+00)
            9    (1.720110e+00 0.000000e+00 0.000000e+00)
           10    (1.724886e+00 0.000000e+00 0.000000e+00)
           11    (1.728143e+00 0.000000e+00 0.000000e+00)
           12    (1.730597e+00 0.000000e+00 0.000000e+00)
           13    (1.731944e+00 0.000000e+00 0.000000e+00)
           14    (1.730392e+00 0.000000e+00 0.000000e+00)
           15    (1.724115e+00 0.000000e+00 0.000000e+00)
           16    (1.720754e+00 0.000000e+00 0.000000e+00)
           17    (1.719241e+00 0.000000e+00 0.000000e+00)
I will keep investigating this, and posting my progress, i hope this helps someone.

Best regards,
Igor L.
manuc likes this.
igor.leo93 is offline   Reply With Quote

Old   August 16, 2016, 20:24
Smile Solution
  #3
New Member
 
igor.leo93's Avatar
 
Igor Leonardo
Join Date: Jul 2016
Location: Brazil - SP - SJC
Posts: 14
Rep Power: 3
igor.leo93 is on a distinguished road
Ok so i found out how to calculate the flow rate over a specified plane.

For this task, one can use sampledSurfaces, which will be created from setting a plane with 3 points -> 1-Origin, 2-3- Vertexes (See attachment)

As simple as that, we can create many surfaces with any orientation and monitor the flow rate. The results will be listed for all the surfaces on the postProcessing dict as i mentioned before.

Just remember to "call" the functions on the control dict.

I leave here a example of a volFlowRateSurface for anyone who might need.
By the way, OpenFOAM 4, being used.

Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
    \\  /    A nd           | Web:      www.OpenFOAM.org
     \\/     M anipulation  |
-------------------------------------------------------------------------------
Description
    Calculates volumetric flow rate through a specified triangulated surface
    by interpolating velocity onto the triangles and integrating over the
    surface area.  Triangles need to be small (<= cell size) for an accurate
    result.

\*---------------------------------------------------------------------------*/

triSurface <triSurfaceFile>;

#includeEtc "caseDicts/postProcessing/flowRate/volFlowRateSurface.cfg"

regionType    sampledSurface;
name        sampleSurfaceDict;

sampledSurfaceDict
        {           
                type cuttingPlane;
                planeType           embeddedPoints;
                embeddedPointsDict
                {
                        point1    (0.9 -0.2 -0.2);  
                        point2    (0.9 0.2 -0.2);
            point3    (0.9 0.2 0.2);
                }
                source cells; // sample cells or boundaryFaces
                interpolate false;
        }



// ************************************************************************* //
I hope this helps others, it took me about a week to figure all this out lol.

Best regards for everyone.
Igor Carvalho.
Attached Images
File Type: png Screenshot from 2016-08-16 21:22:18.png (11.0 KB, 26 views)
student666 likes this.
igor.leo93 is offline   Reply With Quote

Old   August 17, 2016, 02:16
Default
  #4
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,266
Rep Power: 23
akidess will become famous soon enough
Are you sure the plane will be bounded using embeddedPoints? Furthermore, when using a sampling plane perhaps you should use interpolated values.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   August 17, 2016, 08:36
Default interpolattion
  #5
New Member
 
igor.leo93's Avatar
 
Igor Leonardo
Join Date: Jul 2016
Location: Brazil - SP - SJC
Posts: 14
Rep Power: 3
igor.leo93 is on a distinguished road
Hello akidess,
I used this exactly setup for my model, which was a simple tube, and the flow rate i obtained was indeed correct.

I think this interpolation refers to where the plane crosses and the mesh (See attached image).

I believe if interpolation is true, it is going to interpolate the value for the flow rate between the cells, regarding the plane location.

If interpolation is false, i believe it is going to just take the nearest cell center's value.

I decided to use false interpolation because my mesh was perfect hexaedral and all, so assuming cell center values would be better, because openFOAM calculates for cell centers.

But i also think if i had choose to interpolate, values shouldn't change much, maybe i will try it later to confirm.

Since my mesh was hex and good, i think it is ok, but things may be diferent for tet mesh, what do you think? Maybe for tet interpolation really should be necessary.

Well at least this is what i think this is... correct me if i'm wrong please.

Thanks for looking at this thread,
Best regards,

Igor Carvalho
Attached Images
File Type: png Screenshot from 2016-08-17 09:33:05.png (25.8 KB, 36 views)
igor.leo93 is offline   Reply With Quote

Old   March 16, 2017, 09:00
Default
  #6
New Member
 
Join Date: Sep 2010
Posts: 3
Rep Power: 9
Gary is on a distinguished road
Very helpful, many thanks. Just to confirm with you the three points in embededPointsDict are on the tube.

Last edited by Gary; March 16, 2017 at 09:29. Reason: forgot to ask one more question
Gary is offline   Reply With Quote

Old   June 9, 2017, 10:05
Default
  #7
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 263
Rep Power: 10
student666 is on a distinguished road
Quote:
I used this exactly setup for my model, which was a simple tube, and the flow rate i obtained was indeed correct.
Just to understand,does it interpolate U mag? I see a vector notation on your .dat file
So how have you checked your flowrat?

Quote:
But i also think if i had choose to interpolate, values shouldn't change much, maybe i will try it later to confirm.
Have you tested more this postProcessing utility?
Thanks
Michele
student666 is offline   Reply With Quote

Old   August 9, 2017, 09:26
Default Surface report in single file
  #8
New Member
 
Bruno Lebon
Join Date: Dec 2012
Posts: 19
Rep Power: 7
blebon is on a distinguished road
Quote:
Originally Posted by igor.leo93 View Post
The output for this, looks like something like this:

Code:
# Region type : sampledSurface sampleSurfaceDict
#   Faces  : 4000
#   Area   : 3.138364e-02
#        Time    areaNormalIntegrate(U)
            1    (1.686720e+00 0.000000e+00 0.000000e+00)
            2    (1.832342e+00 0.000000e+00 0.000000e+00)
            3    (1.859946e+00 0.000000e+00 0.000000e+00)
            4    (1.735812e+00 0.000000e+00 0.000000e+00)
            5    (1.672361e+00 0.000000e+00 0.000000e+00)
            6    (1.693844e+00 0.000000e+00 0.000000e+00)
            7    (1.701347e+00 0.000000e+00 0.000000e+00)
            8    (1.712168e+00 0.000000e+00 0.000000e+00)
            9    (1.720110e+00 0.000000e+00 0.000000e+00)
           10    (1.724886e+00 0.000000e+00 0.000000e+00)
           11    (1.728143e+00 0.000000e+00 0.000000e+00)
           12    (1.730597e+00 0.000000e+00 0.000000e+00)
           13    (1.731944e+00 0.000000e+00 0.000000e+00)
           14    (1.730392e+00 0.000000e+00 0.000000e+00)
           15    (1.724115e+00 0.000000e+00 0.000000e+00)
           16    (1.720754e+00 0.000000e+00 0.000000e+00)
           17    (1.719241e+00 0.000000e+00 0.000000e+00)
How did you get the output in a single file? In my case, the reports are in separate files, one for each time step. I can aggregate everything using a Python script, but this is annoying (especially when there are many time steps).
blebon is offline   Reply With Quote

Reply

Tags
functionobjects, triangulated surfaces, volflowratesurface

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
compressible flow in turbocharger riesotto OpenFOAM 50 May 26, 2014 01:47
non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Native Meshers: blockMesh 7 April 17, 2013 05:42
LiencubiclowRemodel nzy102 OpenFOAM Bugs 14 January 10, 2012 09:53
mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 12 December 12, 2011 05:16
CFX4.3 -build analysis form Chie Min CFX 5 July 12, 2001 23:19


All times are GMT -4. The time now is 23:39.