how to create a group to which the particles of the same size belong**

Submitted by wangyin47 on Sun, 06/19/2016 - 03:36

I m trying to create a group based on the particle size, which will be used to postprocessing for mass fraction evaulation. Can anyone give me a guide.
Thanks in advance.

richti83's picture

richti83 | Mon, 06/20/2016 - 07:58

You could do this by assigning different groups in the particle/template/sphere part. But I would do this directly in Postprozessing with a ParaviewPythonProgrammableFilter, adapt this script which sums only all masses in a dumpfile per step.

import math
input = self.GetInputDataObject(0, 0)
output = self.GetOutputDataObject(0)
COUNT=input.GetNumberOfPoints()
pd=input.GetPointData()
m=0
v=0
v0=3.02
for i in xrange(COUNT):

m=m+pd.GetArray("Mass").GetValue(i)
r=round(pd.GetArray("radius").GetValue(i),4)
vp=math.pi*4.0/3.0*r*r*r
v=v+vp


p=v/v0
r=m/v
outputarray = vtk.vtkStringArray()
outputarray.SetName("Text")
outputarray.SetNumberOfTuples(1)
outputarray.SetValue(0,"%1.3fkg\n%1.3fm3\np=%1.3f" % (m,v,p))
output.GetRowData().AddArray(outputarray)

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