|
[Sponsors] |
Area/Mass weighted average at any arbitrary location |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 23, 2012, 05:51 |
Area/Mass weighted average at any arbitrary location
|
#1 |
New Member
Join Date: Sep 2012
Posts: 5
Rep Power: 13 |
Hello all,
I am trying to calculate area weighted average of velocity and pressure at any given time and arbitrary location. I was not able to find any utility for doing it. I saw this link http://openfoamwiki.net/index.php/Co...unctionObjects but to use it you need to know the name of patches (which i only know for the boundary patches (eg inlet outlet). What if I want it at centre of my grid?. I have to do it for lots of time interval so using parafoam integration function is also not efficient. Currently I calculate it using matlab by taking sample points at that location. But it will be very helpful if someone can highlight a method so that it can be done directly from open foam. Thanks & Regards |
|
September 23, 2012, 10:18 |
|
#2 | |
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 |
||
September 23, 2012, 12:26 |
|
#3 |
New Member
Join Date: Sep 2012
Posts: 5
Rep Power: 13 |
Thanks for your reply..but i couldn't understand your suggestion...simplefunctionobject has utility named patchaverage by which i can do this area weighted calculation but the problem is that we have to give the name of patch to it (which is only available for boundaries)...let us say i have a channel flow so i will have patches named inlet, outlet, top wall, bottom wall but how about if i want to calculate area weight average at centre of channel (i dnt know the patch name here), i tried to create a interior boundary in mesh formation in gambit and named it there as x=0.5 but when i convert it into openfoam format it is just treated it as internal patch and doesnt differentiate it or list it in the boundary file...
|
|
September 23, 2012, 18:05 |
|
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
And on these faceZones or faceSets swak can do calculations like the mass flow.
__________________
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 |
||
September 24, 2012, 05:05 |
|
#5 |
Member
|
Are you looking for probeLocations? There is a post-processing tool that need a probesDict in the system folder, but you can also use it during runtime by adding this to your controlDict:
Code:
functions ( probes { type probes; functionObjectLibs ("libsampling.so"); fields ( p_rgh U ); probeLocations ( (1.0 0 0) (1.5 0 0) (2.0 0 0) (1.0 0 0.5) (1.5 0 1.0) (2.0 0 1.5) ); outputControl timeStep; outputInterval 10; } ) You can then plot those using gnuplot, i.e. by the command "gnuplot --persist" (persist to keep the window open after plotting) Code:
set xlabel 'time [s]' set ylabel 'pressure [Pa]' plot 'probes/0/p_rgh' u 1:2 t '1st probe location' w lines,\ 'probes/0/p_rgh' u 1:3 t '2nd probe location' w lines,\ 'probes/0/p_rgh' u 1:4 t '3rd probe location' w lines,\ 'probes/0/p_rgh' u 1:5 t '1st probe location' w lines Is that what you wanted? Greetings Jan
__________________
~~~_/)~~~ |
|
September 24, 2012, 13:27 |
|
#6 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
The original posting started with "I am trying to calculate area weighted average" so I think probes are not the solution here.
__________________
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 |
|
September 24, 2012, 14:14 |
|
#7 |
New Member
Join Date: Sep 2012
Posts: 5
Rep Power: 13 |
i dont think probesDict will serve the purpose as it gives the values of U and P at a particular point over the time...I get that along a plane/line (in 2d) using sampleDict...i want to perform calculations like patchaverage along a line/plane...problem is i dont know how to reference a patch which is not a boundary
@Gschaider I didnt see any directory named files zone or any other which contains the information of the line/plane i defined in gambit...i used fluentMesh2foam command.... |
|
September 24, 2012, 14:30 |
|
#8 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
fluentMeshToFoam -h and pick an option that you like
__________________
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 |
||
September 26, 2012, 05:51 |
|
#9 |
New Member
Join Date: Sep 2012
Posts: 5
Rep Power: 13 |
It didnt work I named two lines in gambit with a boundary type interior and then i used fluentMeshToFoam -writeSets and also fluentMeshToFoam -writeZones but I couldnt find anything in the set folder that could be used to reference in patchAverage utility also the facezones and cellzones file were empty
|
|
September 26, 2012, 06:06 |
|
#10 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
The zones-files are there but empty? Strange Have you tried the "other" fluent-converter?
__________________
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 |
||
September 26, 2012, 06:41 |
|
#11 |
New Member
Join Date: Sep 2012
Posts: 5
Rep Power: 13 |
Building boundary and internal patches.
Creating patch 0 for zone: 3 start: 1 end: 100 type: pressure-outlet name: pressure_outlet.4 Creating patch 1 for zone: 4 start: 101 end: 400 type: axis name: axis.3 Creating patch 2 for zone: 5 start: 401 end: 500 type: velocity-inlet name: velocity_inlet.2 Creating patch 3 for zone: 6 start: 501 end: 800 type: wall name: wall Creating patch 4 for zone: 8 start: 801 end: 60400 type: interior name: default-interior Creating patch for front and back planes Adding new patch pressure_outlet.4 of type patch as patch 0 Adding new patch axis.3 of type symmetryPlane as patch 1 Adding new patch velocity_inlet.2 of type patch as patch 2 Adding new patch wall of type wall as patch 3 Patch default-interior is internal to the mesh and is not being added to the boundary. Adding new patch frontAndBackPlanes of type empty as patch 4 this is what i get when i run fluentMeshToFoam -writeZones and when i run writesets there is a folder named sets in which u have the boundary files and default interior file (but no file abt the dummy lines i made) the facezones file reads like this FoamFile { version 2.0; format ascii; class regIOobject; location "constant/polyMesh"; object faceZones; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 0 () I am sorry but i dnt know any other converter which can convert a .msh file into openfoam format |
|
September 26, 2012, 07:02 |
|
#12 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Check whether your interior boundary is actually in the mesh. Either have a look at the end of the msh-file (as far as I remember the boundaries are listed there) or grep for the name you gave 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 |
||
January 13, 2015, 14:25 |
|
#13 | |
New Member
Luca Franceschini
Join Date: Aug 2012
Posts: 29
Rep Power: 13 |
Quote:
I am also trying to do computations on planes inside the domain. But i have some difficulties on creating the faceSets/Zones required. According to you which is the best way to create 10 of such arbitrary planes? Thank you a lot |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Area weighted or mass weighted average | SAM | Main CFD Forum | 31 | April 30, 2018 04:12 |
Diffference between mass weighted average and Area | giogio | FLUENT | 9 | March 6, 2018 08:24 |
PLOTING weighted average vs distance | Vorch | FLUENT | 0 | May 28, 2012 16:29 |
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug | unoder | OpenFOAM Installation | 11 | January 30, 2008 20:30 |
area weighted average | Sireesha Pasari | FLUENT | 1 | April 4, 2004 13:06 |