CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   volume weighted average (

lindner July 15, 2010 03:22

volume weighted average
Hi all,
Is there a way to get the values of volume weighted average directly in paraView? Like in the calculator filter or something.
If it's not possible is there a way to implement in the solver to show a variable weighted by volume?


herbert July 15, 2010 03:41

Hi Guilherme,

I don't know if it's possible in paraview, but inside the solver it can easy be done by by adding the following lines to the code (e.g. for a volField named A):

dimensionedScalar averagedValue = A.weightedAverage(mesh.V());
Info << "Average of A: "  << averagedValue.value() << endl;


lindner July 15, 2010 03:47

Thanks Stephan!
I will try to implement it now.
I will post if the results are bad or good.

Thanks again,

All times are GMT -4. The time now is 03:25.