Paraview count number of particles

Submitted by Tamoghna on Fri, 02/01/2013 - 12:26

Hi!

I have simulated flow of particles in the influence of gravity using LIGGGHTS. I am using ParaView for post processing.

Could anybody advice on
1. How to count the number of particles passing through a plane?
2. How to get the coordinates of the particles passing the plane?

Regards,
Tamoghna

richti83's picture

richti83 | Sat, 02/02/2013 - 18:32

This is a problem I never found a easy solution. I asked the Paraview Mailinglist a year ago but never got an answer. At the Moment I use the following work-a-round:
create a clip (cliptype BOX) at the position you want to measure the flow
you can access the point coordinates of the clipped particles via python-programmable filter
www.paraview.org/Wiki/Python_Programmable_Filter first example

to calculate massflow I usually load the result files twice with a offset of one dumpstep and do a dirty O(n) search which IDs have left the clip-area (clip both readers, attach both clips to one python programmable filter) and than sum the mass (calculated from r or dumped directly via dump custom) of the "lost" particles.

an even easier solution is to measure the flow directly in LIGGGHTS, I have documented this way here:
system/files/howto.pdf chapter 6)

I'm not an associate of DCS GmbH and not a core developer of LIGGGHTS®
ResearchGate | Contact

Tamoghna | Sun, 02/03/2013 - 05:26

Hi! Thanks for your help!!

After clipping I used the following script and it works great:

input = self.GetPolyDataInput()
output = self.GetOutput()
numPoints = input.GetNumberOfPoints()
count = vtk.vtkDoubleArray()
count.SetName('Count')
count.SetNumberOfComponents(1)
count.InsertNextValue(numPoints)
output.AddColumn(count)

The I use 'plot selection over time' to plot the count
But is there some way to get the plot to animate like as time increases the plot also increases??

Regards,
Tamoghna

g.garate | Thu, 04/25/2013 - 22:19

Tamoghna
Could you tell me the steps I need to follow to use your script?

Regards

lumasci | Tue, 11/12/2019 - 10:35

Hi,
Since this thread is pretty old, I was wondering whether there is any news regarding paraview counting ant ploting number of particles.
Any new function existing to do that / any tutorial?

This file is located into the object object kinematicCloudOutputProperties found in the folder time/uniform/lagrangian/kinematicCloud. Is there a straightforward way to extract this figure.

Best,