|
[Sponsors] |
How to calculate Volume averaged species/temperature |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 28, 2011, 12:10 |
How to calculate Volume averaged species/temperature
|
#1 |
New Member
Patrick
Join Date: Feb 2010
Posts: 10
Rep Power: 16 |
Dear All
In OpenFOAM, is there a way to estimate volume averaged temperature or species concentration for my entire flow domain. When I use the intergrate variable filter in paraFoam, I do get the integrated temperture. Can I divide this number by the domain volume to get the volume averaged temperature? Thanks |
|
September 28, 2011, 16:29 |
|
#2 | |
Senior Member
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0 |
Quote:
Dan |
||
September 28, 2011, 18:33 |
|
#3 |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22 |
Alternatively, you can use sample as a post processing tools (see the utilities folder for an example of the dictionary)
|
|
February 19, 2013, 08:59 |
surfaceAverage values
|
#4 |
Senior Member
Sören
Join Date: Mar 2012
Posts: 102
Rep Power: 14 |
Hello,
is there also a possibility to get a "surfaceAverage" instead of a patchAverage as it is described in http://openfoamwiki.net/index.php/Co...unctionObjects --> 2.3 My aim is to make a surface-sample and then -somehow- calculate the averaged value for the concentration referred to this surface or to calculate the flux of a scalar through the mentioned surface. Is this possible and is there an easy way to do that...? kind regards Last edited by despaired student; February 20, 2013 at 18:31. |
|
February 22, 2013, 16:44 |
|
#5 | |
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 |
||
April 6, 2013, 08:31 |
three different methods three different results
|
#6 | |||
Senior Member
Sören
Join Date: Mar 2012
Posts: 102
Rep Power: 14 |
Hi,
it's been some days since I've worked on this problem... Now I've tried some possibilieties (A, B, C) and all of them are delivering a different result... I've been working/looking throug the net and some examples yet but I'm becoming more confused than I'm getting a clear vision of what to do. My aims are to determine 1. the area-averaged concentration (T) of 2 surfaces (volume-averaged concentration of a user-defined region of the mesh would also be nice...if possible?) 2. the area-averaged flux (massflow per area) and the total massflow of a specific area. Is it correct to assume that area-averaged means the same as area-weighted in OpenFoam? To determine the area-averaged concentration I used three different ways (A,B,C). Can somebody explain why these three ways lead to three different results? For the massflow I haven't really tried yet. Thanks for your help. Way A: Quote:
Quote:
Quote:
|
||||
April 6, 2013, 12:59 |
|
#7 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
a) the formatting is better b) it will be there when others quote you I can only comment on example A (the swak one): that certainly does not do what you want from it. "average" in swak means (and that is because it uses the OF-functions of the same name) is "only" the arithmetic average: so a small face of the surface has the same influence as one 10 time its size (very democratic, but not very physical). So with an expression "T*area()/sum(area())" and an accumulation "sum" you might get the result you want. The latest version of swak has an accumulation weightedAverage but I'm not sure whether it works OK for sampledSurfaces. Volume averaged will work similar "T*vol()/sum(vol())" Mass flow per area: just calculate the mass-flow and divide it by "sum(area())" Don't know the difference between area-weighted and averaged in OF (would have to look that up myself)
__________________
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 6, 2013, 14:32 |
|
#8 | |
Senior Member
Sören
Join Date: Mar 2012
Posts: 102
Rep Power: 14 |
Quote:
Another very helpful OpenFoam-expert (M. Becker - maybe he'll read this one day...?) gave me the same advise on way A. Maybe someone else can tell me where the difference between way B and C is. Thanks for your comment and help! |
||
April 8, 2013, 14:27 |
strange results
|
#9 |
Senior Member
Sören
Join Date: Mar 2012
Posts: 102
Rep Power: 14 |
Hi,
after trying some methods to receive an area-averaged value for I got two results. Maybe someone can clearify why there is such a difference between my two results... I am thankful for any ideas... First I'll present the results: Method | Faces | sum(magSf) | areaAverage(T) sampledsurf-T1 | 0.10585904 test_01 | 136298 | 0.00023717965 | 0.059855598 test_02 | 63764 | 0.000237178 | 0.10585904 test_03 | 136298 | 0.00023717965 | 0.059855598 Another thing is that the value for the "Faces" differes if I use "surface type cuttingPlane" and stays constant for "surface type plane"...why? It should stay constant... Here is the code I used in the controlDict: Code:
functions { sampledsurf-T1 { type swakExpression; valueType surface; surfaceName testPlaneT1; surface { type plane; basePoint (0 0 0.0105); normalVector (0 0 1); interpolate false; } verbose true; expression "T*area()/sum(area())"; accumulations (sum); } test_01 { type faceSource; functionObjectLibs ("libfieldFunctionObjects.so"); enabled true; outputControl outputTime; // Output to log&file (true) or to file only log true; // Output field values as well valueOutput true; //true; // Type of source: patch/faceZone/sampledSurface source sampledSurface;//faceZone; sourceName face_set_10,5mm; sampledSurfaceDict { type cuttingPlane; planeType pointAndNormal; pointAndNormalDict { basePoint ( 0 0 0.0105 ); normalVector ( 0 0 1 ); } source cells; interpolate true; } // Operation: areaAverage/sum/weightedAverage ... operation areaAverage; //weightField phi; fields (T); } test_02 { type faceSource; functionObjectLibs ("libfieldFunctionObjects.so"); enabled true; outputControl outputTime; log true; valueOutput true; source sampledSurface; sourceName face_set2_10,5mm; sampledSurfaceDict { type plane; basePoint (0 0 0.0105); normalVector (0 0 1); } operation areaAverage; fields ( T ); } test_03 { type faceSource; functionObjectLibs ("libfieldFunctionObjects.so"); enabled true; outputControl outputTime; log true; valueOutput true; //true; source sampledSurface;//faceZone; sourceName face_set3_10,5mm; sampledSurfaceDict { type cuttingPlane; planeType pointAndNormal; pointAndNormalDict { basePoint ( 0 0 0.0105 ); normalVector ( 0 0 1 ); } // source cells; // interpolate true; } // Operation: areaAverage/sum/weightedAverage ... operation areaAverage; //weightField phi; fields (T); } |
|
April 8, 2013, 15:06 |
|
#10 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
As always: checking for the correct method is easiest if you know beforehand what the result will be: for instance a constant T or a T(x) (funkySetFields will help you there) where T(x) is such that you can analytically calculate the result beforehand
__________________
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 9, 2013, 07:14 |
Possibility for a reference???
|
#11 | |
Senior Member
Sören
Join Date: Mar 2012
Posts: 102
Rep Power: 14 |
Quote:
Would it be possible to use the "surfaceToPatch" - Utility to create a patch and measure the area-averaged value for T on this patch with one of the following codes: Code:
functions ( areaAverageConcentration-T { type patchAverage; functionObjectLibs ("libsimpleFunctionObjects.so"); verbose true; patches ( tolles-Patch ); fields (T); } ); (see http://openfoamwiki.net/index.php/Co...unctionObjects ) The swak4foam way using a patch would be: Code:
averagedConcentration-T { type patchExpression; accumulations ( sum ); patches ( tolles-Patch ); expression "T*area()/sum(area())"; verbose true; } If you think that this way wil not provide a proper reference to judge which one of the before mentioned results are correct then please let me know. Kind regards Last edited by despaired student; April 9, 2013 at 07:29. |
||
April 9, 2013, 08:20 |
Test results
|
#12 |
Senior Member
Sören
Join Date: Mar 2012
Posts: 102
Rep Power: 14 |
I did a little example of a rectangular channel-flow where I measured the OUTLET Patch via SWAK4FOAM and a patchAverage as described here
http://openfoamwiki.net/index.php/Co...unctionObjects Here are my results ordered the way they are written in the controlDict which you can see attached. The last results are taken 0.8 mm ahead of the others at the OUTLET-Patch. The rest are sampled ones. From this little try I would make the conclusion that using type cuttingPlane for a sampledSurface is less precise than plane or the swak-altenative... I would appreciate it if someone could confirm this conclusion... sampledSurface: 0.14318075 test_01TOutlet 0.12430655 test_02TOutlet 0.14318075 test_03TOutlet 0.12430655 areaAverageConcentration-TOutlet 0.14306758 SWAKaveragedConcentration-TOutlet 0.14306758 controlDict: Code:
libs ( "libOpenFOAM.so" // keeps paraFoam happy "libtwoPhaseInterfaceProperties.so" "libinterfaceProperties.so" "libsimpleSwakFunctionObjects.so" "libswakFunctionObjects.so" ); functions { sampledsurf-TOutlet { type swakExpression; valueType surface; surfaceName testPlaneT1; surface { type plane; basePoint (0 0.028 0.069); normalVector (0 1 0); interpolate false; } verbose true; expression "T*area()/sum(area())"; accumulations (sum); } test_01TOutlet { type faceSource; functionObjectLibs ("libfieldFunctionObjects.so"); enabled true; outputControl outputTime; // Output to log&file (true) or to file only log true; // Output field values as well valueOutput true; //true; // Type of source: patch/faceZone/sampledSurface source sampledSurface;//faceZone; sourceName face_set_10,5mm; sampledSurfaceDict { type cuttingPlane; planeType pointAndNormal; pointAndNormalDict { basePoint (0 0.028 0.069); normalVector (0 1 0); } source cells; interpolate true; } // Operation: areaAverage/sum/weightedAverage ... operation areaAverage; //weightField phi; fields (T); } test_02TOutlet { type faceSource; functionObjectLibs ("libfieldFunctionObjects.so"); enabled true; outputControl outputTime; log true; valueOutput true; source sampledSurface; sourceName face_set2_10,5mm; sampledSurfaceDict { type plane; basePoint (0 0.028 0.069); normalVector (0 1 0); } operation areaAverage; fields ( T ); } test_03TOutlet { type faceSource; functionObjectLibs ("libfieldFunctionObjects.so"); enabled true; outputControl outputTime; log true; valueOutput true; //true; source sampledSurface;//faceZone; sourceName face_set3_10,5mm; sampledSurfaceDict { type cuttingPlane; planeType pointAndNormal; pointAndNormalDict { basePoint (0 0.028 0.069); normalVector (0 1 0); } // source cells; // interpolate true; } // Operation: areaAverage/sum/weightedAverage ... operation areaAverage; //weightField phi; fields (T); } areaAverageConcentration-TOutlet { type patchAverage; functionObjectLibs ("libsimpleFunctionObjects.so"); verbose true; patches ( OUTLET ); fields (T); } SWAKaveragedConcentration-TOutlet { type patchExpression; accumulations ( sum ); patches ( OUTLET ); expression "T*area()/sum(area())"; verbose true; } } |
|
April 9, 2013, 09:45 |
|
#13 | |
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 |
||
April 9, 2013, 10:04 |
|
#14 | |
Senior Member
Sören
Join Date: Mar 2012
Posts: 102
Rep Power: 14 |
Quote:
If I got you right, in this case the cuttingPlane is less precise. Thanks again for your quick answer! |
||
April 9, 2013, 10:31 |
|
#15 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
I wouldn't say it like that. It has a better resolution and therefor gives different results. It means that the result is not resolution independent
__________________
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Negative Volume during Mesh Motion Analysis | giov_ingr | FLUENT | 2 | December 13, 2013 07:09 |
[OpenFOAM] how to calculate the m³ of a `thresholdŽ volume | happysimulant | ParaView | 2 | April 14, 2011 11:01 |
split volume | Kabo | FLUENT | 1 | January 28, 2008 08:08 |
fluent add additional zones for the mesh file | SSL | FLUENT | 2 | January 26, 2008 12:55 |
fluid hot volume in fluid cold volume | zahid | FLUENT | 4 | June 1, 2002 10:11 |