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

Computing mass flow rate on an arbitrary plane

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread 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: 249
Rep Power: 17
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: 249
Rep Power: 17
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: 13
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: 249
Rep Power: 17
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: 650
Rep Power: 22
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


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mass flow rate: calculation v/s computation beguxa FLUENT 5 December 2, 2018 22:02
mass flow in is not equal to mass flow out saii CFX 12 March 19, 2018 06:21
Mass Flow rate through a plane titio OpenFOAM Post-Processing 9 August 22, 2017 04:46
Calculation of mass flow rate through a plane titio OpenFOAM Post-Processing 2 September 28, 2010 01:28
mass flow rate error Masood FLUENT 0 May 22, 2005 01:32


All times are GMT -4. The time now is 02:47.