CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Paraview & paraFoam (
-   -   How to calculate the fluid flow through a surface (

lynx April 14, 2008 11:23

Hello Foamers, i have a pro
Hello Foamers,

i have a problem. I'm not able to calculate the fluid flow through a surface (inlet or outlet for example).

At my domain i have several inlets and outlets with different settings. ("pressureInlet", "inlet" and "fixedVelocityOutlet")
To see if paraView calculates right, i let it calulate the fluid flow at the "inlet"- and the "fixedVelocityOutlet"-patch. (one by one - not at same time). Because so i can compare the paraView result value for the fluid flow with the theoretical value which i set up through the magnitude of the surface area and the given velocity there (dV/dt=A*U). (they should be equal)

My procedure:
I clicked on "Filter" in the menu and selected "Extract Parts" by clicking on it. Then i chose my "inlet"-patch (for example) and clicked on "Accept". Now with "ExtractParts0" highlightened i clicked on "Generate a Glyph" and the velocity-vectors from this patch (surface) are shown. Last i clicked on "Integrate a Vectorfield" to yield the fluid flow through this surface. But now i get the problem. the calulated value does not match the theoretical value.

My questions are:
1)Did i anything (or all) wrong?
2)What are the units (dimension) of this value there? (my theor. fluid flow value was in [m/h] - so i calculated it to [m/s], cause foam uses [m] als length units (as i likely too)
In fact i expected a value arround 160000 m/h and paraView showed me a value arround 120.000 [???]
3)Is the "." (dot) a sign for the 1000er value or the comma for the value?

Thank you in advance for your help.

gschaider April 14, 2008 14:53

Don't know how to do it in par
Don't know how to do it in paraview.
I usually do it with this utility:
(it should compile as posted under 1.4, if not: tell me so.) (there is a more advanced version floating around on the message board)


gaby April 18, 2008 04:25

Hello!! Don't know how to d

Don't know how to do it in paraview.

You can go to the discussion:

There is the application "calcMassFlow" (by Philippose Rajan), and the steps that you must follow. It works very nice.

I hope it will work for you.


johannes April 19, 2008 09:31

Hi Oliver, there is an easy
Hi Oliver,

there is an easy way to calculate the volume flow in ParaView using the filter "Surface Flow".

Unfortunately, it doesn't work with standard OpenFOAM files, so you have to convert your case to VTK format first.

Then you can open the .vtk file of the patch you want to determine the flow through and apply the Surface Flow filter. It will print out the volume flow in m/s.

If you want to calculate the flow at various timesteps and are using ParaView 3.*, be sure to open the top level .vtk file (e.g. "outlet_..vtk") in a patch directory and not a timestep specific file (e.g. "outlet_10.vtk").

You may get an error regarding missing vectors when applying the filter and/or viewing timestep "0". The reason is: After converting an OpenFOAM case to VTK the first timestep does not contain any fields and thus no volume flow can be calculated. So nothing to worry about.

Best regards,

t.oliveira January 20, 2016 12:58

You can also try using a function object. See this post for instructions:

All times are GMT -4. The time now is 13:01.