yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #28858
[Question #705075]: replace by clump
New question #705075 on Yade:
https://answers.launchpad.net/yade/+question/705075
Hello everybody I have two series of small and big particles in this code. when I replaced rectangular cube clumps with big particles, length of Clumps become larger than the diameter of primary spheres .what's the reason?
Where did I go wrong?
from yade import pack
young=5e6 # contact stiffness
mn,mx=Vector3(0,0,0),Vector3(.6,.6,.6)
compFricDegree =30
O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(compFricDegree),density=2600,label='spheres'))
#O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=0,density=0,label='walls'))
O.materials.append(CohFrictMat(young=1e6,poisson=0.1,density=1400,label='trash',frictionAngle=radians(compFricDegree),
isCohesive=True,
normalCohesion=50000000,
shearCohesion=50000000,
))
## create walls around the packing
walls=aabbWalls([mn,mx],thickness=0,material='spheres')
wallIds=O.bodies.append(walls)
## use a SpherePack object to generate a random loose particles packing
sp=pack.SpherePack()
spSmall = pack.SpherePack()
spBig = pack.SpherePack()
sp.makeCloud((0,0,0),(.6,.6,.6),psdSizes=[.008,.012,.078,.08,.081],psdCumm=[0,.995,.995,.999,1],distributeMass=False,seed=1)
for ss in sp: #split SpherePack into two other packs based on the particle size
r = ss[1]
if r > .078/2:# please note that you feed diameters nor radii in psdSizes, that is why I divide it by 2
spBig.add(ss[0],ss[1])
else:
spSmall.add(ss[0],ss[1])
# add only the spheres that you want to replace and replace them with clump1
spSmall.toSimulation(material='spheres')
relRadList1 = [0.2882557656,0.406619778,0.3688555312,0.26]
relPosList1 = [[0,-0.187117,-0.09206748],[0,0.00806748,-0.0344172],[0,0.190184,0],[0.12,0,-0.18]]
#peanut:
relRadList2 = [0.29,0.27,0.3,0.28]
relPosList2 = [[0,-0.14,0.08],[0,-0.12,-0.2],[0,0.06,0.18],[0,0.07,-0.15]]
#stick:
relRadList3 = [0.21,0.23,0.23,0.31,0.23,0.29,0.22]
relPosList3 = [[0,-0.26,0.07],[0,-0.09,-0.12],[0,-0.08,0.16],[0,0.02,0],[0,0.1,-0.27],[0,0.16,0.15],[0,0.22,-0.11]]
templates= []
templates.append(clumpTemplate(relRadii=relRadList1,relPositions=relPosList1))
templates.append(clumpTemplate(relRadii=relRadList2,relPositions=relPosList2))
templates.append(clumpTemplate(relRadii=relRadList3,relPositions=relPosList3))
#### show how to use replaceByClumps():
O.bodies.replaceByClumps(templates,[0.2,0.3,0.5],discretization = 20)
for b in O.bodies:
if b.isClumpMember: b.shape.color=(1,1,1)
####product trash#####
a=[0,.006,.012,.018,.024]
b=[0,.006,.012,.018,.024,.03,.036,.042,.048,.054]
c=[0,.006]
d=[]
e=[.005]
g=e*100
for i in a:
for j in b:
for k in c:
d.append((i,j,k))
#add the remaining spheres stored in the other sphere pack
spBig.toSimulation(material='trash')
ct2 = clumpTemplate(g,d)
aa=O.bodies.replaceByClumps( [ct2] , [1], discretization = 20 )
for ii in aa:
xx=ii[1]
for jj in xx:
O.bodies[jj].shape.color=(1,1,0)
O.dt = 0
O.step()
for i in O.interactions:
i.phys.unp = i.geom.penetrationDepth
Thank you for your reply.
--
You received this question notification because your team yade-users is
an answer contact for Yade.