yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #22185
Re: [Question #688837]: calculate the mass of the particles
Question #688837 on Yade changed:
https://answers.launchpad.net/yade/+question/688837
Status: Answered => Open
Estefany Carmona Alvarez is still having a problem:
1. In this code is the actual size of the particles, which if they are
deposited in the cylinders ...
from yade import pack, plot
#Altura de caida del material
hc=0
#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))
#Mallas
#O.bodies.append(utils.wall((0,0,(.2+hc)),axis=2,color=(1,0.945,0.078),sense=-1))
#(0,0,(.2+hc)),axis=2,color(1,0.945,0.078),sense=0))
#O.bodies.append(utils.wall((0,0,.2),axis=2,sense=0))
#PROBETA
#Radio
radius=0.05
#Altura de la probeta
height=0.1
#Probeta 1
#Coordenadas centro
xp1=0.1
yp1=0
zp1=1
O.bodies.append(geom.facetCylinder((xp1,yp1,(-zp1-hc+(height/2))),
radius=radius, height=height, fixed=True, wallMask=6,
color=(0.933,0.090,.894), wire=False))
#Probeta 2
#Coordenadas centro
xp2=0.1
yp2=0
zp2=1
O.bodies.append(geom.facetCylinder((-xp2,yp2,(-zp2-hc+(height/2))),
radius=radius, height=height, fixed=True, wallMask=6, color=(0,0,1),
wire=False))
#coordenadas perimetro de particulas
#esquina inferior
xi=0.225
yi=0.225
zi=0.2
#esquina superior
xs=0.225
ys=0.25
zs=0.5
#porosidad
p=0.903
#tamices
#los diametrso y los porcentajes acumulados siempre se deben ubicar de menor a mayor
#por cada t debe haber un p
#Diametro de la abertura de tamices psdSizes
t1=0.008
t2=0.015
t3=0.030
t4=0.085
t5=0.200
t6=0.475
#Porcentajes retenidos del material psdCumm
p1=0
p2=0.002
p3=0.111
p4=0.889
p5=0.9994
p6=1
#Material
#angulo de friccion
angulo=radians(36) #radianes
#densidad del material
densidad=1418 #(kg/m3)
#Modulo de Young
young=(1e8) #Pa
#Poisson
poisson=0.5
#contenidod de vacios
porosidad=0.9
#Algoritmo YADE para el material
snd=O.materials.append(FrictMat(young=young,frictionAngle=radians(angulo),density=densidad,
#label="SndG"
))
#Algoritmo YADE para el cuerpo de las esferas
sp=pack.SpherePack()
sp.makeCloud((xi,-yi,(zi+hc)), (-xs,ys,(zs+hc)), porosity=porosidad,
psdSizes=[t1,t2,t3,t4,t5,t6], psdCumm=[p1,p2,p3,p4,p5,p6],
distributeMass=False)
sp.toSimulation(material=snd,color=(0.882,0.866,0.839))
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()
]
O.dt=PWaveTimeStep()
2. Could you please help me with more information about the function you indicated to calculate the weight of the particles that remain inside the cylinder ...
###
cyl1 = pack.inCylinder(...) # [1], predicate for a cylinder
mass = 0.0
for b in O.bodies:
if cyl1(b.state.pos): # b is inside cyl1
mass += b.state.mass
###
or a one-liner :-)
mass = sum(b.state.mass for b in O.bodies if cyl1(b.state.pos))
I am new to Yade and in the available documents there is not much
information about it.
Thanks for your help Jan !!
--
You received this question notification because your team yade-users is
an answer contact for Yade.