|
[Sponsors] |
November 30, 2012, 12:35 |
Mass Flow Rate Over a Sampled Surface
|
#1 |
Member
Brock Lee
Join Date: Sep 2012
Location: Midwest
Posts: 40
Rep Power: 14 |
Hey guys,
I'm looking to calculate the mass flow rate over a sampled surface. The current function I'm using in controlDict looks like this... Code:
faceObj1 { type faceSource; functionObjectLibs ("libfieldFunctionObjects.so"); enabled true; outputControl timeStep; // Output to log&file (true) or to file only log true; // Output field values as well valueOutput false; // Type of source: patch/faceZone/sampledSurface source sampledSurface; // if patch or faceZone: name of patch or faceZone //sourceName movingWall; //// if sampledSurface: dictionary with a sampledSurface //// Note: will not sample surface fields. sampledSurfaceDict { // Sampling on triSurface type sampledTriSurfaceMesh; surface int_1.stl; source cells; // sample cells or boundaryFaces interpolate true; } // Operation: areaAverage/sum/weightedAverage ... operation sum; fields ( phi ); } When changing the function to use a weighted average based on a sample surface and phi, I can get it to produce the following error. Code:
--> FOAM FATAL ERROR: [3] Field phi not found in database [3] [3] From function Foam::tmp<Foam::Field<Type> > Foam::fieldValues::faceSource::getFieldValues(const word&, const bool) const [3] in file fieldValues/faceSource/faceSourceTemplates.C at line 120. Last edited by GRAUPS; November 30, 2012 at 12:57. |
|
November 30, 2012, 13:29 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
That being said: something like this could be done in swak4Foam. But for the reason given above (no interpolation, orientation) using phi won't work. Instead you'd have to "emulate" it with an expression like "rho*U & Sf()" (Sf() is the surface vector of a phase) and sum it
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
December 6, 2012, 15:20 |
|
#3 |
Member
Brock Lee
Join Date: Sep 2012
Location: Midwest
Posts: 40
Rep Power: 14 |
Bernhard, thank you for your response. This is what I have so far...
Code:
flowBeforeSet { type swakExpression; valueType surface; surfaceName internal; surface { type sampledTriSurfaceMesh; surface int_1.stl; source cells; // sample cells or boundaryFaces interpolate false; } expression "rho*U & Sf()"; accumulations ( sum ); verbose true; } Do you know what could be causing this difference? Does the inclusion of Sf() in the swakExpression mean that only the values normal to the surface are being taken into account? Also, is it possible to interpolate the values being used for the mass flow calculation to perhaps get a more accurate results? When I turn interpolate on it throws an error at me. Thanks! Last edited by GRAUPS; December 6, 2012 at 15:58. |
|
December 7, 2012, 06:36 |
|
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
December 7, 2012, 11:33 |
|
#5 | |
Member
Brock Lee
Join Date: Sep 2012
Location: Midwest
Posts: 40
Rep Power: 14 |
Quote:
Code:
Expression Ratio_not_Normal : min=0.8991376591 max=0.96846234 average=0.9064741362 Expression Sampled_Mass_Flow : sum=2.775649376 Expression patchMassFlow on inlet: sum=-2.69375 Expression patchMassFlow on outlet: sum=2.693749998 Also, for reference, this is the error I receive when I turn interpolation on for the Sampled_Mass_Flow... Code:
--> FOAM FATAL ERROR: Parser Error at "1.12-11" :"Operands have different sizes: 24 and 22" "rho*U & Sf()" " " From function parsingValue in file lnInclude/CommonValueExpressionDriverI.H at line 802. FOAM exiting |
||
December 7, 2012, 21:03 |
|
#6 | ||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
With control surfaces that are not aligned to the cell faces you always have got to expect an error. How big it is depends on the circumstances but if the 90% are correct they are not favourable Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
|||
December 11, 2012, 18:15 |
|
#7 | |
Member
Brock Lee
Join Date: Sep 2012
Location: Midwest
Posts: 40
Rep Power: 14 |
Quote:
I just realized I'm a version behind on swak4foam, and reading the release changes, some of my problems have a chance of being fixed in the new release. When I get the time to recompile and update, I'll try to post back with some more recent tests. Thanks again for your help. |
||
December 12, 2012, 13:15 |
|
#8 | ||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
|||
April 21, 2021, 09:11 |
Use normal() instead of Sf()
|
#9 |
New Member
Balaji
Join Date: May 2013
Posts: 21
Rep Power: 13 |
To get the correct massflow (m3/s) you need to use the expression.
Where normal() is the normal vector of the plane expression "(area()*(normal()&U))"; It should work |
|
Tags |
functionobjects, mass flow rate, sample surface, swak4foam |
|
|
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 Rate is not converging | destgir448 | CFX | 5 | December 11, 2010 06:55 |
2D axisymmetric mass flow rate for the plain orifice atomizer | jwillie2000 | FLUENT | 2 | September 17, 2010 06:43 |
mass flow rate error | Masood | FLUENT | 0 | May 22, 2005 01:32 |
CFX4.3 -build analysis form | Chie Min | CFX | 5 | July 13, 2001 00:19 |