CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Calculate volume average of volScalarField

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes
  • 5 Post By gschaider
  • 1 Post By hjasak

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 21, 2006, 10:21
Default One easy question. How to calc
  #1
Member
 
Dihao Tang
Join Date: Mar 2009
Posts: 78
Rep Power: 17
tangd is on a distinguished road
One easy question. How to calculate volume average of a volScalarField? I think the average() is not the function I want. Can somebody tell me? Thanks!
tangd is offline   Reply With Quote

Old   August 21, 2006, 11:38
Default That's the problem with easy q
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
That's the problem with easy questions. Nobody wants to answer them because you can only embarrass yourself by saying somthing stupid.

Nevertheless:

sum(mesh.V()*myField)/sum(mesh.V())

(weighted average of the cell-values)
__________________
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
gschaider is offline   Reply With Quote

Old   August 21, 2006, 11:49
Default volScalarField a = ...; a
  #3
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough

volScalarField a = ...;

a.weightedAverage(mesh.V());


Hrv
lpz456 likes this.
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   May 1, 2013, 14:37
Default
  #4
Member
 
pooyan
Join Date: Nov 2011
Posts: 62
Rep Power: 15
sam1364 is on a distinguished road
so, what about surface average of a scalar field at specified boundary patch (like inlet)

how can I include that in my source code?




Quote:
Originally Posted by hjasak View Post

volScalarField a = ...;

a.weightedAverage(mesh.V());


Hrv
sam1364 is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
calculate the average velocity of particles robert FLUENT 0 August 1, 2008 10:44
how to calculate the average kumar Main CFD Forum 0 July 13, 2006 13:17
calculate average in Paraview alain Main CFD Forum 0 March 14, 2006 06:49
how to calculate the average pressure lenson Siemens 0 March 4, 2005 04:24
calculate average magnitude Ethan Siemens 1 June 3, 2003 13:34


All times are GMT -4. The time now is 15:32.