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

volFlowRateSurface function - triangulated surface

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

Like Tree10Likes
  • 4 Post By igor.leo93
  • 5 Post By igor.leo93
  • 1 Post By igor.leo93

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 27, 2016, 22:03
Default volFlowRateSurface function - triangulated surface
  #1
New Member
 
igor.leo93's Avatar
 
Igor Leonardo
Join Date: Jul 2016
Location: Brazil - SP - SJC
Posts: 20
Rep Power: 5
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 21:07.
igor.leo93 is offline   Reply With Quote

Old   July 29, 2016, 21:06
Default Progress1
  #2
New Member
 
igor.leo93's Avatar
 
Igor Leonardo
Join Date: Jul 2016
Location: Brazil - SP - SJC
Posts: 20
Rep Power: 5
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.
igor.leo93 is offline   Reply With Quote

Old   August 16, 2016, 21:24
Smile Solution
  #3
New Member
 
igor.leo93's Avatar
 
Igor Leonardo
Join Date: Jul 2016
Location: Brazil - SP - SJC
Posts: 20
Rep Power: 5
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, 65 views)
igor.leo93 is offline   Reply With Quote

Old   August 17, 2016, 03:16
Default
  #4
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,379
Rep Power: 25
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, 09:36
Default interpolattion
  #5
New Member
 
igor.leo93's Avatar
 
Igor Leonardo
Join Date: Jul 2016
Location: Brazil - SP - SJC
Posts: 20
Rep Power: 5
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, 72 views)
LeeRuns likes this.
igor.leo93 is offline   Reply With Quote

Old   March 16, 2017, 09:00
Default
  #6
New Member
 
Join Date: Sep 2010
Posts: 11
Rep Power: 11
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, 11:05
Default
  #7
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 12
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, 10:26
Default Surface report in single file
  #8
Member
 
Bruno Lebon
Join Date: Dec 2012
Posts: 31
Rep Power: 9
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

Old   February 1, 2018, 12:30
Default checking the results
  #9
New Member
 
Ali Mohammadi
Join Date: Oct 2017
Posts: 15
Rep Power: 4
cfd lover is on a distinguished road
Quote:
Originally Posted by student666 View Post
Just to understand,does it interpolate U mag? I see a vector notation on your .dat file
So how have you checked your flowrat?

Have you tested more this postProcessing utility?
Thanks
Michele

I checked the results of this utility with the result of flow rate in paraview and they were the same.
cfd lover is offline   Reply With Quote

Old   May 26, 2018, 12:34
Default
  #10
New Member
 
Ameya
Join Date: Jan 2018
Posts: 4
Rep Power: 4
ameya2310 is on a distinguished road
Hello Everyone,

I wish to calculate volumetric flow rates out of my control volume (which is rectangular shaped domain, with multiple circular outlets on one face) As the outlets are more that 100 in number I have included them into one zone called outlet.
Now i wish to calculate flow rates through each individual outlet.

I was wondering if there is a way to define sampledSurface (like the way a plane is defined in above posts), the centers of the circular outlets,Diameters are known).

If anyone can refer to similar tutorial, sample file, that would be great. I basically want to know the correct syntax for defining a circular sample surface at a particular location in my geometry.

Thanks in advance.

Last edited by ameya2310; May 26, 2018 at 13:07. Reason: incomplete
ameya2310 is offline   Reply With Quote

Old   May 27, 2018, 04:00
Default flow rate in multiple outlets
  #11
New Member
 
Ali Mohammadi
Join Date: Oct 2017
Posts: 15
Rep Power: 4
cfd lover is on a distinguished road
Hi ameya
I can suggest you a simple way which i have used it my self. my domain had 16 outlets which i named from outlet 1 to outlet 16. I wrote a for loop code and used the flow rate patch command to calculate the flow rate from outlet 1 to outlet 16.
best regards
Ali
cfd lover is offline   Reply With Quote

Old   May 30, 2018, 13:17
Default
  #12
New Member
 
Ameya
Join Date: Jan 2018
Posts: 4
Rep Power: 4
ameya2310 is on a distinguished road
Hello, Thanks for the reply Ali,
Your suggestions sounds great, I will try writing the code.

Actually my problem is that, I have more that 100 outlets and defining 100 outlets seperately is tedious, so I was wondering if there is a way around that.

Anyways Thanks a lot.
ameya2310 is offline   Reply With Quote

Old   March 15, 2019, 09:43
Default Using .stl file
  #13
New Member
 
Matthieu ZUBIALDE
Join Date: Mar 2019
Posts: 1
Rep Power: 0
mzubiald is on a distinguished road
Hello all,
I am also trying to calculate the flow rate over a specified plane. But in my case, this specified plane is defined with a .stl file.
I used the following code in the volFlowRateSurface file.

My question is: how can I define multiples surfaces (corresponding to multiples .stl files) in this code to calculate flow rates through these surfaces ?

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.

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

regionType        sampledSurface;
name               mySurface;

sampledSurfaceDict
{
    type            sampledTriSurfaceMesh;
    surface         mySurface.stl;
    source          cells;
    interpolate     true;
}

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

// ************************************************************************* //
mzubiald is offline   Reply With Quote

Reply

Tags
functionobjects, triangulated surfaces, volflowratesurface

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
compressible flow in turbocharger riesotto OpenFOAM 50 May 26, 2014 02:47
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 06:42
LiencubiclowRemodel nzy102 OpenFOAM Bugs 14 January 10, 2012 09:53
[Other] 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 13, 2001 00:19


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