# Calculate Mass Flowrate and Mass Flow Averaged Total Pressure at inlet and outlet

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

 September 2, 2015, 07:19 Calculate Mass Flowrate and Mass Flow Averaged Total Pressure at inlet and outlet #1 Member   Sravan Kumar Join Date: May 2014 Posts: 57 Rep Power: 9 Hi Foamers, I have simulated centrifugal pump using OpenFoam 2.4.0 and working on post processing of it. I have to calculate Mass Flow Rate at Inlet and outlet patches. Also I have to calculate the Mass Flow averaged Total Pressure at inlet and Outlet patches. I have some questions though: 1) I have used patchIntegrate phi to evaluate the Mass Flow Rate at inlet and outlet. I am getting a reasonable value at outlet patch but getting value zero at inlet patch ( but inlet velocity given is ( 0 0 4.5 ) ). I dont understand why its zero. 2) What is the difference between patchAveragie and patchIntegrate ? I have used patchAverage phi but openfoam says its an error and says Only possible to average volfields but phi is surfaceScalarField 3) How the total pressure be attained and perform mass flow averaging on the inlet and outlet patches. I have gone through many forums but could not get a clear answer. I am new to CFD and using Openfoam. Any help regarding this would be great Thanks and Best Regards

 September 4, 2015, 08:03 #2 Member   Sravan Kumar Join Date: May 2014 Posts: 57 Rep Power: 9 Any help foamers !! Any suggestions or guidance is welcomed

September 19, 2015, 11:37
#3
Retired Super Moderator

Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,962
Blog Entries: 45
Rep Power: 125
Quote:
 Originally Posted by coolcrasher 1) I have used patchIntegrate phi to evaluate the Mass Flow Rate at inlet and outlet. I am getting a reasonable value at outlet patch but getting value zero at inlet patch ( but inlet velocity given is ( 0 0 4.5 ) ). I dont understand why its zero.
Without an example case, I can't even guess the reason why it's zero. Please read and follow: How to give enough info to get help

Quote:
 Originally Posted by coolcrasher 2) What is the difference between patchAveragie and patchIntegrate ? I have used patchAverage phi but openfoam says its an error and says Only possible to average volfields but phi is surfaceScalarField
patchAverage is essentially the result of dividing the integration on the surface of a patch by the total area of the patch. It only works with volume fields, because it was coded to only work with volume fields.

Quote:
 Originally Posted by coolcrasher 3) How the total pressure be attained and perform mass flow averaging on the inlet and outlet patches.
Function objects. Read the OpenFOAM User Guide on how to use them. Then check https://cpp.openfoam.org -> "FunctionObjects" (in older pages it was "Post-Processing") near the bottom of the page -> then:
• Utility function objects -> pressureTools
• Field function objects -> faceSource
I believe there are already a few examples on this already here on the forum.
__________________

Last edited by wyldckat; February 12, 2018 at 15:41. Reason: updated links and description for OpenFOAM's 'cpp' website

 September 20, 2015, 04:57 #4 Member   Sravan Kumar Join Date: May 2014 Posts: 57 Rep Power: 9 Thank you. That helped me. Any clue how to do mass flow averaging? I am using function objects but they do only area averaging

September 20, 2015, 06:42
#5
Retired Super Moderator

Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,962
Blog Entries: 45
Rep Power: 125
Quote:
 Originally Posted by coolcrasher Any clue how to do mass flow averaging? I am using function objects but they do only area averaging
Quick answer: Field function objects -> faceSource -> weightedAverage
The weight field should be rhoPhi. Partial example can be found in the tutorial "multiphase/interFoam/ras/waterChannel", the remaining configuration is shown in in the code documentation I mentioned before, namely the link to sourceforge.net.

 November 25, 2018, 21:42 #6 Senior Member   Jianrui Zeng Join Date: May 2018 Location: China Posts: 157 Rep Power: 5 I use patchAverage phi successfully ，which one should I to calculate mass flow between patchaverage and patchIntegrate？ Thank you.

 December 22, 2018, 11:19 #7 Retired Super Moderator   Bruno Santos Join Date: Mar 2009 Location: Lisbon, Portugal Posts: 10,962 Blog Entries: 45 Rep Power: 125 Quick answer: mass flow rate is calculated by using the "sum" operation on the "phi" field instead of the average one... see surfaceFieldValue: https://cpp.openfoam.org/v5/classFoa...e.html#details __________________ OpenFOAM: FAQ | Getting started Forum: How to get help, to post code/output and forum guide Read this before sending me PM