CFD Online Discussion Forums

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

lindner July 15, 2010 04: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 04: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 04: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 06:04.