# Setting mass flow rate boundary condition

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

 October 26, 2010, 11:24 Setting mass flow rate boundary condition #1 Senior Member     Join Date: Jan 2010 Posts: 347 Blog Entries: 2 Rep Power: 17 Dear Foamers, How can i define mass flow rate boundary instead of velocity for a case simulation in OpenFOAM?

 October 26, 2010, 13:41 #2 Senior Member   Philippose Rajan Join Date: Mar 2009 Location: Germany Posts: 552 Rep Power: 25 Hello there, A Good Evening to you :-)! To specify a flow rate instead of a velocity, you can use the boundary condition: flowRateInletVelocity For an example of how to use it, check the following file in the tutorials folder of OpenFOAM: /compressible/rhoPimpleFoam/angledDuct/0/U Hope this helps. Have a nice day ahead! Philippose koooje, pfhan, m_mousavi88 and 8 others like this.

 October 26, 2010, 14:53 #3 Senior Member     Join Date: Jan 2010 Posts: 347 Blog Entries: 2 Rep Power: 17 Dear Philippose, Thank you very much for your answer. two questions: i think it is suitable for inlet patches, isn't it? i need sth for outlet patch. if i use it for inlet, in tutorial file P type is set to zeroGradient. can we suppose it in flow which comes from a duct as zeroGradient when (as you know) it has pressure drop across the duct? Best regards, Maysam koooje likes this. Last edited by maysmech; October 26, 2010 at 15:32.

 October 26, 2010, 14:55 #4 Senior Member     Join Date: Jan 2010 Posts: 347 Blog Entries: 2 Rep Power: 17 And 3rd question: How can i calculate mass flow rate of a patch by using paraView?

 October 26, 2010, 18:10 #5 Senior Member   Philippose Rajan Join Date: Mar 2009 Location: Germany Posts: 552 Rep Power: 25 Hi again, * If I remember right, you can use the flowRateInletVelocity patch as an output simply by changing the sign of the flow rate value, to indicate that it is flowing out of the domain. * Normally, you cannot specify a fixed velocity (flow rate) and a pressure on the same boundary..... this is why, you need to provide a zeroGradient boundary condition for the pressure when you supply the flow rate as an input parameter. .... I am not sure what you imply by a pressure drop across the input boundary in a duct. * Paraview has a filter which lets you integrate a variable over a surface (I think the filter is called Surface Flow).... this should give you the flow rate, however, I remember that I had an issue trying to interpret the output of this filter..... try it out anyway.... it basically calculates the dot product of a flow field and the normal vectors of the surface. Philippose soheil_r7, mwaqas, wmrlak and 2 others like this.

 November 4, 2010, 00:55 #6 Senior Member     Join Date: Jan 2010 Posts: 347 Blog Entries: 2 Rep Power: 17 As i understand, the flow rate boundary is same as setting a fixed value velocity in the boundary and this is not useful for cases which our velocity profile is not uniform.

 November 4, 2010, 01:20 #7 Senior Member   Philippose Rajan Join Date: Mar 2009 Location: Germany Posts: 552 Rep Power: 25 Hi, The question then is, what exactly did you want to do? a. Specify a uniform flow rate at the input b. Specify a uniform velocity at the input c. Specify a non-uniform velocity profile at the input (spatially non-uniform across the input patch) d. Specify a non-uniform flow rate at the input (spatially non-uniform across the input patch) In case it was (d), how would you specify the flow rate? would it be the flow rate through each patch element face? In which case it would be something like specifying a non-uniform velocity profile where v_face = Q_face / A_face For specifying a parabolic Inlet velocity, you have the boundary condition: "parabolicVelocity" In addition, you could try to create a customised non-uniform velocity / flow inlet using the "groovyBC" library. Have a nice day ahead! Philippose

 November 4, 2010, 01:58 #8 Senior Member     Join Date: Jan 2010 Posts: 347 Blog Entries: 2 Rep Power: 17 Thanks Philippose, I want it for an outlet patch that is not uniform velocity. for example a T-junction geometry with two different outputs and i want control rate as 20% and 80% in outlets by setting mass flow rate. Best,

 December 16, 2011, 03:53 #9 Senior Member   Bernhard Join Date: Sep 2009 Location: Delft Posts: 790 Rep Power: 21 Hi Maysam, Did you ever get this to work? I am also interested in such a boundary condition with a mass flow rate that is dictated, but also keeps in some way the zero gradient condition there.

 August 21, 2013, 03:23 #10 New Member   H.Martens Join Date: Feb 2013 Posts: 2 Rep Power: 0 I am, too!

 August 21, 2013, 03:39 #11 Senior Member     Niels Nielsen Join Date: Mar 2009 Location: NJ - Denmark Posts: 556 Rep Power: 27 Hi you can use something lige this (OF22) for inlet use zeroGradient for outlet use this Code: ``` outlet { type flowRateInletVelocity; volumetricFlowRate constant -0.1; // m3/s, negative sign means out of the domain value uniform (0 0 0); }``` mwaqas likes this. __________________ Linnemann PS. I do not do personal support, so please post in the forums.

February 6, 2014, 02:37
#12
Member

Mehdi GHOZALI
Join Date: May 2013
Location: Dubai, UAE
Posts: 65
Rep Power: 13
Hi,

Quote:
 Originally Posted by linnemann Hi you can use something lige this (OF22) for inlet use zeroGradient for outlet use this Code: ``` outlet { type flowRateInletVelocity; volumetricFlowRate constant -0.1; // m3/s, negative sign means out of the domain value uniform (0 0 0); }```
So if I understood well, if we have a flow in the inlet and outlet (going out of the domain) we need to set inlet = zeroGradient and then put a flow in the outlet ??!!

Thank you

 May 28, 2015, 09:49 #13 New Member   James F. Join Date: May 2015 Posts: 24 Rep Power: 10 I have a quite similar problem and I cannot find the answer. I am using buoyantPimpleFoam currently. I have inlet : U is fixedValue / P is zeroGradient / T is fixedValue suction_outlet : U is zeroGradient / P is fixedValue (0.995e5) / T is zeroGradient secondary_outlet (actually, suction_outlet sucks air from this patch in addition to air from the inlet) : U is zeroGradient / P is fixedValue (1e5) / T is inletOutlet (calculated with internalField - to prevent air coming inside the domain from this patch being at 0K). I'd like to change my suction BC to have a given volumicFlowRate rather than fixed pression which is causing instability. I tryed something like : Code: ``` U suction { type flowRateInletVelocity; volumetricFlowRate constant -130; // m3/s, negative sign means out of the domain value uniform (0 0 0); } P suction {type zeroGradient}``` But then, the velocity field is 0 nearby, suction is behaving like the outlet... Do you have any advice? Thanks!! PS : What does the line " value uniform (0 0 0);" in flowRateInletVelocity stands for? EDIT - PB SOLVED: I had a unit problem. Last edited by NoradFirst2; June 9, 2015 at 07:52. Reason: Problem solved

June 15, 2016, 02:59
#14
Member

Fatemeh
Join Date: Dec 2015
Location: Isfahan,Iran
Posts: 39
Rep Power: 10
Quote:
 Originally Posted by philippose Hello there, A Good Evening to you :-)! To specify a flow rate instead of a velocity, you can use the boundary condition: flowRateInletVelocity For an example of how to use it, check the following file in the tutorials folder of OpenFOAM: /compressible/rhoPimpleFoam/angledDuct/0/U Hope this helps. Have a nice day ahead! Philippose

Hi!
I have a similar problem. Would you please tell me, when defining flowRateInletVelocity, do we have to enter discharge massFlowRate or discharge/area? I have determined it like this: type flowRateInletVelocity;
massFlowRate constant 0.2512;
but it has another part, value, what doest it want?
also, would you please tell me, if I define a slip wall for atmosphere, I should define value uniform (0 0 0) for it? why? Not that I have an open channel which I want to specify slip wall instead of atmosphere in the surface.
Thanks

 December 6, 2018, 05:42 Cyclic mass flow rate #15 New Member   Calum Roberts Join Date: Nov 2018 Posts: 3 Rep Power: 7 Hi there, I am trying to set up a cyclic case where a specific mass of water passed through the system each second. Because my patch type is cyclicAMI i cannot use the flowRateInletVelocity type. Does anyone have any ideas on how to do this? Any help would be appreciated! Calum

July 22, 2021, 11:30
#16
New Member

Masoumeh
Join Date: Oct 2019
Posts: 21
Rep Power: 6
Quote:
 Originally Posted by CalumR Hi there, I am trying to set up a cyclic case where a specific mass of water passed through the system each second. Because my patch type is cyclicAMI i cannot use the flowRateInletVelocity type. Does anyone have any ideas on how to do this? Any help would be appreciated! Calum
cyclic does not work in this condition. I suggest to change it. with discharge as negative and positive value you can run your model.