← Back to team overview

yade-users team mailing list archive

[Question #678425]: kenetic Energy of particles

 

New question #678425 on Yade:
https://answers.launchpad.net/yade/+question/678425

hi everyone ,
i wrote code about falling spheres in cylinder and now i want to know  the average kinetic energy of all spheres .
this is what i obtain :

AttributeError                            Traceback (most recent call last)
/usr/bin/yade in <module>()

/usr/bin/yade in plotAddData()
     41    for b in O.bodies:
     42       if (type(b.shape)==Sphere):
---> 43          Ek = b. O.energy['kinetic']
     44          plot.addData(i=O.iter,Ek=Ek,**O.energy)
     45 

AttributeError: 'Body' object has no attribute 'O'
In [1]: exit

my code is :
from yade import pack,plot

#material of cylinder
Mat1 = O.materials.append(ViscElMat(kn=10.0e4,ks=10.0e4,frictionAngle=0.455,density=2650.0))

# create the big sphere
big_sphr=O.bodies.append(utils.sphere((0,0,.3),1.,fixed=False,color=(1,0,0),highlight=True))

# create sphere packing
sp=pack.SpherePack()
sp.makeCloud((-7.2,-7.2,1.),(7.2,7.2,58.7),rMean=.5,rRelFuzz=0,num=6000)
sp.toSimulation(color=(0,1,0))

# create Cylinder 
Cylinder=O.bodies.append(geom.facetCylinder((0,0,1.),10.0,height=60.0,wallMask=6,segmentsNumber=64,material=Mat1))

# interactions 
O.engines=[
    ForceResetter(),
    InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
    InteractionLoop(
      
        [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
        [Ip2_FrictMat_FrictMat_FrictPhys()],
        [Law2_ScGeom_FrictPhys_CundallStrack()]
    ),
    NewtonIntegrator(gravity=(0,0,-9.81),damping=0.3),
    PyRunner(iterPeriod=10,command="plotAddData()",label='energy'),
 ]

O.dt=utils.PWaveTimeStep()
O.saveTmp()

#energy kenetic
O.trackEnergy=True

def plotAddData():
   for b in O.bodies:
      if (type(b.shape)==Sphere):
         Ek = b. O.energy['kinetic']
         plot.addData(i=O.iter,Ek=Ek,**O.energy)

plot.plots={'time':('energy')}
plot.plot()

yade.qt.View()

any suggestions ? thank's in advance.
cordially  
Any suggestions ?
 


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