|
[Sponsors] |
Computing mass flow rate on an arbitrary plane |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
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 post-processing? 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: 249
Rep Power: 17 |
A while ago I did this with EnSight but is was a post-treatment.
|
|
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 post-processing.
|
|
February 10, 2014, 04:39 |
|
#4 |
Senior Member
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 249
Rep Power: 17 |
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: 13 |
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: 249
Rep Power: 17 |
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: 650
Rep Power: 22 |
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 |
|
|
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 |