CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   volume weighted average (http://www.cfd-online.com/Forums/openfoam/78196-volume-weighted-average.html)

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?

Thanks

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):
Code:

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

Regards,
Stefan

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,
Guilherme


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