yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #22263
[Question #688955]: mass after simulation
New question #688955 on Yade:
https://answers.launchpad.net/yade/+question/688955
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
#######
from yade import pack
#Altura de caida del material
hc=0
#centro
x=0
y=0
z=0
radius=.5
#EQUIPO
#coordenadas centro
x=0
y=0
z=0
#coordenadas extension
f=0.45
a=0.50
h=1
#estrutura del equipo de pluviacion
O.bodies.append(geom.facetBox((x,y,z),(f,a,(h+hc)),wallMask=31,wire=True))
pred=pack.inAlignedBox((0,0,0),(.5,.5,.5))
sphere=pack.randomDensePack(pred,radius=0.0475,color=(1,1,1))
O.bodies.append(sphere)
f=geom.facetCylinder((0,0,0),.3,1,wallMask=6)
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()
Vtotal=((pi*radius*radius)*1)
print "Porosidad calculada por Yade=", utils.porosity(Vtotal)
mass=sum([b.state.mass for b in O.bodies])
print "Masa del especimen=", (mass)
--
You received this question notification because your team yade-users is
an answer contact for Yade.