# Volume Average for magnitude U

 Register Blogs Members List Search Today's Posts Mark Forums Read

 October 18, 2012, 06:06 #21 Member   Simon Arne Join Date: May 2012 Posts: 42 Rep Power: 6 I never actually did any kind of wiki entry but I will try to find time at the weekend! Okay: I did a sum of the area as well and compared it to paraView: 99.71% identical size. I triple checked using the same data and I put more of the function objects in line and compared them to the results from paraView (they showed the same behaviour in pressure loss, but the values differ). Now its time to learn about the sample utility (that I so far avoided). And thanks again! I know that this is not self understanding and appreciate it.

October 18, 2012, 07:07
#22
Member

Simon Arne
Join Date: May 2012
Posts: 42
Rep Power: 6
Next step:

I defined a sampleDict with a plane exactly like in the function object and made samples of U, magU, p.
Integrating the sampled surfaces in paraView leads me to 12 m/s, so different from the areaAverage provided by the function Object.

Maybe I defined something wrong in my use of the function object, but I have no clue.
Attached Files
 master.tar.gz (23.6 KB, 2 views)

January 14, 2015, 13:26
#23
Senior Member

Illya Shevchuk
Join Date: Aug 2009
Posts: 176
Rep Power: 9
Hi Benhard,

Quote:
 Originally Posted by gschaider With the big brother of the simpleFunctionObjects: swak4Foam. Something like: Code: ```functions { velAverage { type swakExpression; functionObjectLibs ( "libsimpleSwakFunctionObjects.so" ); verbose true; variables ( "totalV=sum(vol());" ); expression "vol()*mag(U)/totalV"; accumulations ( sum ); } );``` That would be the volume-weighted average.
If I understood it correctly, vol() corresponds to mesh.V() in the OF. What would be the swak-alternative for mesh.C()? What I want to do is to calculate the center of mass
Code:
`centerMass = fvc::domainIntegrate(rho*mesh.C()) / fvc::domainIntegrate(rho)`
using function objects.

Is there any documentation containing all functions available in libsimpleSwakFunctionObjects.so and libswakFunctionObjects.so? I've tried to search for something like that, but found just small peaces in the Wiki and in the forum.

Best regards,
Ilya

January 14, 2015, 15:23
#24
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,986
Rep Power: 41
Quote:
 Originally Posted by linch Hi Benhard, If I understood it correctly, vol() corresponds to mesh.V() in the OF. What would be the swak-alternative for mesh.C()? What I want to do is to calculate the center of mass Code: `centerMass = fvc::domainIntegrate(rho*mesh.C()) / fvc::domainIntegrate(rho)` using function objects. Is there any documentation containing all functions available in libsimpleSwakFunctionObjects.so and libswakFunctionObjects.so? I've tried to search for something like that, but found just small peaces in the Wiki and in the forum. Best regards, Ilya
The equivalent for mesh.C() would be pos()

The only reference documentation of swak4Foam (that I know of ) is the "Incomplete reference Guide" that comes with the sources. Expressions are fully documented. Also some other things but no listing of the functionObjects is yet present. This readable version is linked from the swak-page on the Wiki http://sourceforge.net/p/openfoam-ex...amReference.md
__________________
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

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Ganesh FLUENT 13 January 22, 2014 05:11 anand_30 OpenFOAM Meshing & Mesh Conversion 12 December 12, 2011 05:16 paean OpenFOAM Running, Solving & CFD 0 November 14, 2008 22:14 SSL FLUENT 2 January 26, 2008 12:55 Rasmus Gjesing (Gjesing) OpenFOAM Native Meshers: blockMesh 10 April 2, 2007 14:00

All times are GMT -4. The time now is 00:21.