← Back to team overview

yade-users team mailing list archive

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:
Thanks Jan for your help!

> I included the code you indicated, but now I don't know where I can
check the mass of the particles or if it is necessary to include some
other function to be able to visualize this value.

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.00008
t2=0.00015
t3=0.00030
t4=0.00085
t5=0.00200
t6=0.00475

#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()

def isBodyInCylinder(body,center,radius):

	d=body.state.pos-center
	d[2]=0
	distance=d.norm()
	return distance<radius

def masses():
	mass1=mass2=0.0
	center1=(xp1,yp1,0)
	center2=(-xp2,yp2,0)
	for b in O.bodies:
		if not isinstance(b.shape,Sphere): continue
		if isBodyInCylinder(b,center1,radius):
			mass1+=b.state.mass
		if isBodyInCylinder(b,center2,radius):
			mass2+=b.state.mass
		return mass1,mass2

> In the previous answer, you mentioned some supporting documents. You
could attach them to me to consult them. They would be helpful to
understand some functions that I need and for which there is not much
information on the web.

thanks!!!

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.