[Paraview] Contour volume quantification (volume fractions of a scalar in an unstructured grid)

Favre Jean jfavre at cscs.ch
Mon Oct 13 09:49:17 EDT 2014


Given the new features of the python calculator, it ought not to be difficult to compute volumes. I would do it iteratively, using an Isovolume between two different values [min, max]

However, I find that the clipper, or isovolume filter do not seem to always create consistently oriented cells. By that I mean that some cells are returned with negative volumes, and that throws off the global computation totally.

the python calculator can let you type in an expression like volume(inputs[0]), which would compute a cell-by-cell volume (left image in the attached script)

We can also do a global summation like sum(volume(inputs[0])) (right image in my script)

using well-behaved cuts (such as orthonormal cuts), and flipping the clipper's normal by toggling "inside out", I do get global volumes that add up to the full volume = 20^3 = 8000. Anything else with arbitrary cuts (as per my python scripts) show volumes which do not add up to the global volume, because of the negative volumes cells. I hope I am not making errors here. Can anyone confirm my findings about negative volumes?


-----------------
Jean / CSCS
________________________________
From: ParaView [paraview-bounces at paraview.org] on behalf of Jose Rey [onlyrey at gmail.com]
Sent: Saturday, October 11, 2014 8:33 AM
To: paraview at paraview.org
Subject: [Paraview] Contour volume quantification (volume fractions of a scalar in an unstructured grid)

Good day,

I would like to calculate the volume contained by each contour surface applied to an unstructured dataset. How do I do this?

Here is what I have:
1. An 3D unstructured grid resulting from a CFD code (OpenFOAM) with velocities (Ux, Uy, Uz)
2. Applied the "Calculator" filter to calculate Result Array = Umagnitude from the point data with the formula (U_X^2+U_Y^2+U_Z^2)^.5
    (I used point data for the calculator because I can only apply contour to point data)
3. Applied the "Contour" filter, and generated 11 volumetric contours (from 0.0 to 0.3 m/s)

Here is where I am stuck (and what I intend):
*. Trying to calculate the volume inside each contour surface

The reason I want to calculate this:
* To calculate a distribution of velocity magnitudes (where the X axis is velocity magnitude ranges /bins, and Y axis is total volume occupied by the cells in each velocity magnitude range -- not cell count as is the case of histograms)

My Paraview version:
* 4.2 running on Win64
(I also have aversion of paraview 4.1 modified to work with OpenFOAM, and installed in a Ubuntu64x-12.04 virtual box)

Thank you very much in advance,

Jose
--
Jose I. Rey
onlyrey at gmail.com<mailto:onlyrey at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: volumes.py
Type: text/x-python
Size: 6089 bytes
Desc: volumes.py
URL: <http://public.kitware.com/pipermail/paraview/attachments/20141013/b8025400/attachment.py>


More information about the ParaView mailing list