← Back to team overview

yade-users team mailing list archive

Re: [Question #678425]: kenetic Energy of particles

 

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

    Status: Answered => Solved

hafsa confirmed that the question is solved:
thank you Jan ,
for the person who want to plot average kinetic energy of spheres there's code :
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=100,command='plotAddData()')
    
 ]

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

#energy kenetic
O.trackEnergy=True
n = len([b for b in O.bodies if isinstance(b.shape,Sphere)])
print(n)
def plotAddData():
   #e = kineticEnergy()
   plot.addData(i=O.iter,e =kineticEnergy()/n,**O.energy)

plot.plots={'i':['e']+O.energy.keys()}
plot.plot()
plot.live=True

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