# mass after simulation

Asked by Estefany Carmona Alvarez on 2020-02-24

I have the following code, but I want to calculate the mass and porosity of the particles left in the cylinder after the deposition of the material.
Can someone help me with the function I should use? or how can I build the code for this function.

Thanks

postscript: the algorithm comments are in Spanish

#######
# Algorithm
#######

#Altura de caida del material
hc=0

#centro
x=0
y=0
z=0

#EQUIPO

x=0
y=0
z=0

f=0.45
a=0.50
h=1

#estrutura del equipo de pluviacion

pred=pack.inAlignedBox((0,0,0),(.5,.5,.5))
O.bodies.append(sphere)

O.bodies.append(f)

O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),
Bo1_Facet_Aabb(),
Bo1_Cylinder_Aabb(),
Bo1_Wall_Aabb()
]),
InteractionLoop(
# handle sphere+sphere and facet+sphere collisions
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]
),
#GravityEngine(gravity=(0,0,-9.81)),
NewtonIntegrator(gravity=(0,0,-9.81),damping=0.4),
PyRunner(command='checkUnbalanced()',realPeriod=1)

]
O.dt=PWaveTimeStep()

def checkUnbalanced():
if unbalancedForce()<0.05: O.pause()

mass=sum([b.state.mass for b in O.bodies])
print "Masa del especimen=", (mass)

## Question information

Language:
English Edit question
Status:
For:
Assignee:
No assignee Edit question
Last query:
2020-02-24
2020-02-24
 Jan Stránský (honzik) said on 2020-02-24: #1

Hello,
how to filter particles in cylinders, see ,
how to calculate their mass, see  (calculating volume is very similar),
how to calculate porosity, see e.g. wikipedia ,

cheers
Jan