
[Sponsors] 
February 9, 2014, 19:05 
Computing mass flow rate on an arbitrary plane

#1 
New Member
Jamie Canino
Join Date: Feb 2014
Posts: 2
Rep Power: 0 
I need to compute the mass flow rate for a compressible unsteady flow through an arbitrary plane in my computational domain at each time step. I can compute the mass flow rate at a boundary fairly easily using
patchName = runTime.controlDict().lookupOrDefault<word>("inlet Name","inlet"); label patchIn = mesh.boundaryMesh().findPatchID(patchName); scalar massflow = Foam::sum(rhoPhi.boundaryField()[patchID]); Foam::reduce(massflow, sumOp<scalar>()); My problem is how to find the cells in the domain that I want without having a patch. Is there a way to define a "fake" patch just for postprocessing? I'm running a solver that is based on interPhaseChangeFoam. Thanks for the help. 

February 9, 2014, 20:43 

#2 
Senior Member
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 237
Rep Power: 9 
A while ago I did this with EnSight but is was a posttreatment.


February 9, 2014, 21:16 

#3 
New Member
Jamie Canino
Join Date: Feb 2014
Posts: 2
Rep Power: 0 
Since I need the mass flow rate every time step (or at least every few time steps) I was hoping there would be a way to do it without postprocessing.


February 10, 2014, 04:39 

#4 
Senior Member
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 237
Rep Power: 9 
As far as I know, many people have asked the same question (for years) and none has found a solution. If you really want to do it, you will have to code it from scratch
Otherwise you can try to create an "interior patch" like Fluent has. EnSight can do it with a little effort and I guess once it is set up, it will work for all time steps. 

February 10, 2014, 04:55 

#5 
Member
phil
Join Date: Oct 2013
Posts: 36
Rep Power: 5 
Hi,
i solved it that way: Install "swak4foam" and then add this to your "controlDict" Code:
functions ( //MASSENDURCHSATZ massFlow { type patchMassFlow; functionObjectLibs ( "libsimpleFunctionObjects.so" ); verbose true; patches ( inlet outlet ); factor 1.; } 

February 10, 2014, 07:05 

#6 
Senior Member
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 237
Rep Power: 9 
The problem remain the same... Your code only works for a "patch".


February 10, 2014, 10:16 

#7 
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 392
Rep Power: 11 
Have a look at this thesis:
http://brage.bibsys.no/uis/bitstream...unn%20Elin.pdf and search for createSampledSurface There is a special section about sampling on surfaces (if I understood it correctly also inside the flow domain). 

Tags 
mass flow rate 
Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Mass flow rate: calculation v/s computation  beguxa  FLUENT  4  June 8, 2013 16:17 
Mass Flow rate through a plane  titio  OpenFOAM PostProcessing  7  March 25, 2012 19:41 
Calculation of mass flow rate through a plane  titio  OpenFOAM PostProcessing  2  September 28, 2010 00:28 
mass flow in is not equal to mass flow out  saii  CFX  2  September 18, 2009 08:07 
mass flow rate error  Masood  FLUENT  0  May 22, 2005 00:32 