from yade import utils,pack,export,qt,geom import gts,os,random,itertools from numpy import * import yade.log #yade.log.setLevel('NewtonIntegrator',yade.log.TRACE) # Parameters tc=0.001# collision time en=.3 # normal restitution coefficient es=.3 # tangential restitution coefficient frictionAngle=radians(35)# density=2700 # facets material params=utils.getViscoelasticFromSpheresInteraction(tc,en,es) facetMat=O.materials.append(ViscElMat(frictionAngle=frictionAngle,**params)) # **params sets kn, cn, ks, cs # default spheres material dfltSpheresMat=O.materials.append(ViscElMat(density=density,frictionAngle=frictionAngle,**params)) O.dt=.05*tc # time step Rs=0.1 # particle radius # Create geometry box = O.bodies.append(geom.facetBox((0,0,0),(1,1,1),wallMask=31,material=facetMat)) # Create clumps... for j in xrange(10): clpId,sphId=O.bodies.appendClumped([utils.sphere(Vector3(0,Rs*2*i,(j+1)*Rs*2),Rs,material=dfltSpheresMat) for i in xrange(4)])
# -*- coding: utf-8 from yade import utils,pack,export,qt import gts,os def Plane(v1,v2,v3,v4): pts = [ [Vector3(v1),Vector3(v2),Vector3(v3),Vector3(v4)] ] return pack.sweptPolylines2gtsSurface(pts,capStart=True,capEnd=True) # Parameters tc=0.001# collision time en=0.3 # normal restitution coefficient es=0.3 # tangential restitution coefficient frictionAngle=radians(35)# density=2700 kw=utils.getViscoelasticFromSpheresInteraction(10e3,tc,en,es) params=utils.getViscoelasticFromSpheresInteraction(10e3,tc,en,es) # facets material facetMat=O.materials.append(ViscElMat(frictionAngle=frictionAngle,**params)) # default spheres material dfltSpheresMat=O.materials.append(ViscElMat(density=density,frictionAngle=frictionAngle)) O.dt=.2*tc # time step Rs=0.02 # mean particle radius Rf=0.01 # dispersion (Rs±Rf*Rs) nSpheres=1000# number of particles # Create geometry pln=Plane( (-.5, -.5, 0), (.5, -.5, -.05), (.5, .5, 0), (-.5, .5, -.05) ); plnIds=O.bodies.append(pack.gtsSurface2Facets(pln.faces(),material=facetMat,color=(0,1,0)))
tStartAll=time.time() for z in range(numberTests): for i in range(len(radRAD)): rR = radRAD[i] nbIter=iterN[i] O.reset() tc=0.001 en=.003 es=.003 frictionAngle=radians(35) density=2300 params=utils.getViscoelasticFromSpheresInteraction(tc,en,es) defMat=O.materials.append(ViscElMat(density=density,frictionAngle=frictionAngle,**params)) # **params sets kn, cn, ks, cs O.dt=.1*tc # time step rad=0.5 # particle radius tolerance = 0.0001 SpheresID=[] SpheresID+=O.bodies.append(pack.regularHexa(pack.inSphere((Vector3(0.0,0.0,0.0)),rad),radius=rad/rR,gap=rad/rR*0.5,material=defMat)) geometryParameters = bodiesHandling.spheresPackDimensions(SpheresID) print len(SpheresID) floorId=[] floorId+=O.bodies.append(geom.facetBox(geometryParameters['center'],geometryParameters['extends']/2.0*1.05,material=defMat)) #Floor