CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Computing mass flow rate on an arbitrary plane

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 9, 2014, 19:05
Default Computing mass flow rate on an arbitrary plane
  #1
jvc
New Member
 
Jamie Canino
Join Date: Feb 2014
Posts: 2
Rep Power: 0
jvc is on a distinguished road
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 post-processing? I'm running a solver that is based on interPhaseChangeFoam.

Thanks for the help.
jvc is offline   Reply With Quote

Old   February 9, 2014, 20:43
Default
  #2
Senior Member
 
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 237
Rep Power: 9
fredo490 is on a distinguished road
A while ago I did this with EnSight but is was a post-treatment.
fredo490 is offline   Reply With Quote

Old   February 9, 2014, 21:16
Default
  #3
jvc
New Member
 
Jamie Canino
Join Date: Feb 2014
Posts: 2
Rep Power: 0
jvc is on a distinguished road
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 post-processing.
jvc is offline   Reply With Quote

Old   February 10, 2014, 04:39
Default
  #4
Senior Member
 
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 237
Rep Power: 9
fredo490 is on a distinguished road
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.
fredo490 is offline   Reply With Quote

Old   February 10, 2014, 04:55
Default
  #5
Member
 
phil
Join Date: Oct 2013
Posts: 36
Rep Power: 5
gelbebanane is on a distinguished road
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.;

   }
edit the patches and you are done. You will get a post processing folder containing a file with the mass flows for each timestep live.
gelbebanane is offline   Reply With Quote

Old   February 10, 2014, 07:05
Default
  #6
Senior Member
 
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 237
Rep Power: 9
fredo490 is on a distinguished road
Quote:
Originally Posted by jvc View Post
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
....
The problem remain the same... Your code only works for a "patch".
fredo490 is offline   Reply With Quote

Old   February 10, 2014, 10:16
Default
  #7
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 392
Rep Power: 11
jherb is on a distinguished road
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).
jherb is offline   Reply With Quote

Reply

Tags
mass flow rate

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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 Post-Processing 7 March 25, 2012 19:41
Calculation of mass flow rate through a plane titio OpenFOAM Post-Processing 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


All times are GMT -4. The time now is 20:28.