|
[Sponsors] |
![]() |
![]() |
#1 |
Senior Member
|
Hi foamers,
I am starting to feel desesperate guys. I am trying to calculate the mass flow through a plane that it is not a patch, as the massCalcFlow does. Is there any way of this the easy way, say using foamCalc or some other utility that I am not aware of. If not possible to do that easily, I will do it in the code, and I will contribute it to the community, if I manage to do it. Can anyone help me out. Thanks in advance, António Martins PS: OpenFOAM really needs a good documentation, but it seems capitalism and common good do not mix very well... and the problems with the documentation site only helped the commercial software even more.... |
|
![]() |
![]() |
![]() |
![]() |
#2 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40 ![]() ![]() |
Quote:
Note that this is all much easier when sampling on a patch, since you can simply use the phi directly there. Nonetheless, this code fragment should give you a few ideas (I hope). Code:
// defined somewhere in the surrounding class: PtrList<sampledPlane> gammaPlanes_; void Foam::massFlowInfo::calculateAndWrite ( const volVectorField& U, const volScalarField& rho ) const { forAll(gammaPlanes_, planeI) { const sampledPlane& pln = gammaPlanes_[planeI]; label nFaces = pln.faces().size(); reduce(nFaces, sumOp<label>()); if (nFaces) { // the velocity normal to the plane scalarField Uproj = pln.project ( pln.sample(U) ); scalar U_mean = pln.average(Uproj); scalarField rhoU = pln.sample(rho) * Uproj; scalar massFlow = pln.integrate(rhoU); Info<< pln.name() << nl << " area = " << pln.area() << nl << " massFlow = " << massFlow << " (" << (massFlow * 3600) << " kg/h)" << nl << " U_mean = " << U_mean << endl; } else { Info<< pln.name() << nl << " area = " << 0 << endl; } } } |
||
![]() |
![]() |
![]() |
![]() |
#3 |
Senior Member
|
Thanks olesen. I will try the code and I will let you know if its worked.
Thanks, Titio |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0 ![]() ![]() |
Was this resolved? if so, please share how you made this possible.
|
|
![]() |
![]() |
![]() |
![]() |
#5 |
Member
Robin Gilbert
Join Date: Jan 2010
Posts: 66
Rep Power: 16 ![]() |
try swak4Foam:
http://openfoamwiki.net/index.php/Contrib/swak4Foam to calculate flow rate through internal faceZone this works. i have tried it. to calculate the flow through a patch u can use calcMassFlow: http://openfoamwiki.net/index.php/Contrib_calcMassFlow |
|
![]() |
![]() |
![]() |
![]() |
#7 | |
New Member
Join Date: Nov 2009
Posts: 17
Rep Power: 16 ![]() |
Quote:
The code is very helpful, but I wonder also how the parts related to construction of sampledPlane's is implemented. Normally sampledPlane's are constructed on runtime using the sampleDict with runtimeselectiontable. I don't know how to construct them in a regular way with the direction vectors and basepoints. Any suggestion would be a lot of help. Best, Asim |
||
![]() |
![]() |
![]() |
![]() |
#8 |
New Member
Join Date: Nov 2009
Posts: 17
Rep Power: 16 ![]() |
Ok I found the answer. I have to create cuttingPlane's and construct sampledPlane's using those cuttingPlane's...
|
|
![]() |
![]() |
![]() |
![]() |
#9 |
New Member
karundev
Join Date: Jun 2017
Location: India
Posts: 25
Rep Power: 9 ![]() |
||
![]() |
![]() |
![]() |
![]() |
#10 |
Senior Member
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13 ![]() |
||
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mass Flow Rate Error | jallison | FLUENT | 1 | May 16, 2011 16:22 |
mass flow rate (CFX post) | sanchezz | CFX | 2 | January 14, 2010 06:54 |
Mass Flow Rate | student87 | CFX | 4 | January 2, 2010 04:45 |
Surface Integral - Mass Flow Rate | Venkatesh V | FLUENT | 3 | October 10, 2008 16:18 |
mass flow rate error | Masood | FLUENT | 0 | May 22, 2005 00:32 |