CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Calculate volume average of volScalarField (https://www.cfd-online.com/Forums/openfoam-solving/60064-calculate-volume-average-volscalarfield.html)

tangd August 21, 2006 09:21

One easy question. How to calc
 
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!

gschaider August 21, 2006 10:38

That's the problem with easy q
 
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)

hjasak August 21, 2006 10:49

volScalarField a = ...; a
 

volScalarField a = ...;

a.weightedAverage(mesh.V());


Hrv

sam1364 May 1, 2013 13:37

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 (Post 178545)

volScalarField a = ...;

a.weightedAverage(mesh.V());


Hrv



All times are GMT -4. The time now is 14:47.