CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Calculation of mass flow rate in OpenFOAM 2.0.1 (

rawe666 February 23, 2012 10:19

Calculation of mass flow rate in OpenFOAM 2.0.1
Hello friends,
After looking around the forums and reading some posts, I am confused with the measurement of mass flow rate in Openfoam. I want to calculate the values of my inlet and outlet patches. Could anybody can show me the proper way in OpenFoam 2.0.1? I am sorry for taking your time with that simple question.

Kind regards

robbirobocop February 23, 2012 10:37

Here you go...
This is probably one of the easier ways to do so.

rawe666 February 23, 2012 10:45

thank you for your reply I saw the post you send me. But still have a doubt are you talking about calcMassFlow utility? It seems to be it is valid for ver. 1.4

Aurelien Thinat February 23, 2012 10:46

You can just use the command "patchIntegrate phi patchname", can't you ?

rawe666 February 23, 2012 10:52

Thank you it works!

Abhinay Kulkarni February 29, 2012 04:24

Hi Aurelien,

I have used the "patchIntergrate phi Patchname" command. I want to calculate the mass flow at my oultet patch and also want to plot it over the time in paraview. I have two questions

1. Is the mass flow calculated by the patchIntergrate command stored somewhere?? or is just shown in the terminal.

2. Do you have an idea on plotting/viewing the mass flow at a particular patch in paraview?

Thank you in advance


samiam1000 February 29, 2012 08:47

Dear Abhinay,

I am interested in this feature, too.

Have you solved it, by chance?

If so, what have you done?



Abhinay Kulkarni February 29, 2012 11:22

Hi Samuele,

unfortunately i have not found a solution although i did find an interesting discussion on the forum. I did try the way suggested here but have not quite understood the method. Still searching :). Here is the link

Let me know if you figure it out.


kripalpariyangat May 15, 2012 06:14

Hi All,

You can save the data into a text file


patchIntegrate phi INLET >inletflow

This will create a file named "inletflow" in which the data will be saved at each timestep. Hope this helps :)

samiam1000 May 15, 2012 06:34

Hi all,

thanks for help.

Just a question: where should I insert the command

patchIntegrate phi INLET >inletflow
Should I insert it in a control-dict file or something like this?

Thanks a lot,


kripalpariyangat May 15, 2012 06:43

Hi Samuele,

Get inside the case folder using cd command in command prompt and then used the "patchIntegrate" command.

Note: if the case is a decomposed one, reconstruct it and then use this command


adarsh tiwari May 13, 2014 04:23

hi all,

I am relatively new in OpenFOAM and with my observation i can say that patchIntegrate gives the integrated values, but what to do if somebody is interested in calculating the average values for the same

I tried using

patchAverage phi Inlet
but it doesn't works..

Thanks and Regards,

openfoammaofnepo December 3, 2015 15:21

Hi everybody,

I meet a problem with calculating the mass flow rate. I would like to know if mass flow rate for an interior surface, instead of the boundary surfaces. Is this possible? My mesh is 3D and generated by ICEM. Actually I have made an interior surface there, but as you may know, for openfoam, this interior surface does not appear in the boundary list (constant/polymesh/boundary). So it seems that "patchIntegrate phi BC_name" doed not work for this. Anybody has some ideas for this? Thank you so much.

best regards,

Manojmech April 5, 2017 04:48

MFR in interior surfaces
Hi All,

I have to reopen this thread. I think its been 2 years since the last post. OPenfoam has developed more now. I would like to know if there is anyway to calculate mass flow rate in any of the interior surfaces ?


walakaka November 17, 2017 11:14

MassFlowRate; Inlet and Oulet Patch
Hi guys,

I am also needing to calculate the mass flow rate at the inlet and outlet to ensure that the mass is conserved.

Is there a way to do it on Openfoam4?


RobertHB November 21, 2017 10:18

Have you guys tried flowRateInletVelocity? I found this BC on

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