Advertisement
j0hnn1e

runtime error

Aug 14th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.93 KB | None | 0 0
  1. from yade import pack, export, plot
  2. from yade import utils, ymport
  3. import math,numpy
  4. #from yade import plot
  5. r_cyl=75
  6. h_cyl=250
  7. psdSizes,psdCumm=[2.36,4.75,6.3,9.5,12.5,19,25],[.365,.512,.596,.77,.864,.974,1] #given psd
  8. area=3.1416*(r_cyl^2) #plate area
  9. freq=0.5 #SGC compaction freq is 30rpm
  10. maxLoad=(6e5)*area #600 kPa is applied vertical load on the specimen
  11. maxLoadlower=maxLoad-100
  12. maxLoadupper=maxLoad+100
  13.  
  14. cyl1=O.bodies.append(geom.facetCylinder((0,0,0),r_cyl,h_cyl,wallMask=6))
  15. lift_size=30
  16. pred=pack.inCylinder(centerBottom=(0,0,-(h_cyl/2)+1),centerTop=(0,0,lift_size),radius=r_cyl-3)
  17. idAggregate=O.materials.append(FrictMat(density=2600,young=30e9,poisson=.4,frictionAngle=1.0472,label="aggregate")) #frictionangle in rad
  18. sp=pack.SpherePack()
  19. sp.makeCloud((-r_cyl,-r_cyl,-(h_cyl/2)),(r_cyl,r_cyl,h_cyl/2),psdSizes=psdSizes,psdCumm=psdCumm,num=14000, distributeMass=True)
  20. #sp.makeCloud((-r_cyl,-r_cyl,-(h_cyl/2)),(r_cyl,r_cyl,h_cyl/2),rMean=3,rRelFuzz=.5,num=5000)#enforce positive mass
  21. for c,r in sp:
  22.     if pred(c,r):
  23.         O.bodies.append(sphere(c,r,material=idAggregate))
  24.  
  25. print (len(O.bodies)-1) #no of spheres generated
  26.  
  27. O.engines=[
  28.    ForceResetter(),
  29.    # sphere, facet, wall
  30.    InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Wall_Aabb()]),
  31.    InteractionLoop(
  32.       # the loading plate is a wall, we need to handle sphere+sphere, sphere+facet, sphere+wall
  33.       [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()],
  34.       #[Ip2_FrictMat_FrictMat_FrictPhys()],
  35.       #[Law2_ScGeom_FrictPhys_CundallStrack()]
  36.       [Ip2_FrictMat_FrictMat_MindlinPhys(en=0.4,es=0.9)],
  37.       [Law2_ScGeom_MindlinPhys_Mindlin()]
  38.    ),
  39.    NewtonIntegrator(gravity=(0,0,-9.81),damping=0.5),
  40.    PyRunner(command='addPlotData()',iterPeriod=10)
  41. ]
  42. O.dt=0.005*PWaveTimeStep()
  43. def addPlotData():
  44.    plot.addData(unbalanced=unbalancedForce(),i=O.iter)
  45.  
  46. plot.plots={'i':('unbalanced',)}
  47. plot.plot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement