CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Spatial average of viscosity (https://www.cfd-online.com/Forums/openfoam-post-processing/217755-spatial-average-viscosity.html)

nskelly May 23, 2019 06:19

Spatial average of viscosity
 
Hi,

I have ran some shear thinning simulations of a backward facing step in OpenFOAM and would like to calculate the spatial average of viscosity across the domain.

Is this possible to do in paraview? I know of the postSpanwiseAverage toolbox but this seems to just average the velocity.

The other alternative is to use Matlab, but I am a bit unsure how to do it in there also as it would read in cell data but the points are not uniform due to the meshing.

Any help would be great.

agustinvo June 13, 2019 06:09

Hi,


did you created you mesh with blockMesh? If you know python, try to use fluidfoam, and you can load the cells in the order they where created (with blockMesh is more or less evident in function or the order of your blocks), and perform the average after some matrix manipulation.

yambanshee June 19, 2019 06:31

In parafoam, you can use the filter 'integrate variables' with the option 'divide cell data by volume' turned on. This will open a spreadsheat view up, and by selecting the attribute 'cell values' in the drop down menu, you can get all your properties spatially averaged.

If you would like to do it in a software like matlab, i would recommend using the filter meshQuality and setting Hex/quad/etc... to volume, and then saving that filter as a csv. This will give you all your fields per cell, along with that cell's volume.

In 1d, a simlar process can be used with the filter 'arcLength', which I use to create circumferentially averaged data with varying heights.

Regards!


All times are GMT -4. The time now is 12:37.