Specify makeClumpCloud composition

Asked by Szabó Bence

Hello Yade mates,

I would like to model the soil using makeClumpLoud with different spherePacks at once.
My question is is it possible to specify (in this code) the exact percentage of c1 and c2?
E.g 30% c1 and 70% c2

Thanks for your advices in advance.
Bence

My code:

from yade import pack

O.bodies.append(geom.facetBox((0,0,0),(0.6,1,0.8),wallMask=55,fixed=True))

sp=pack.SpherePack()
c1=pack.SpherePack([((0,0,0),.05),((0.1,0,0),0.05),((0.2,0,0),.05)])
sp=pack.SpherePack()
c2=pack.SpherePack([((0,0,0),.05),((0.1,0,0),0.05)])
sp.makeClumpCloud((-0.5,-1,-0.8),(0.5,1,0.8),[c1,c2],num=-1)
sp.toSimulation()

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,-9.81,0),damping=0.2),
]

O.dt=.5*PWaveTimeStep()
O.saveTmp()

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Karol Brzezinski
Solved:
Last query:
Last reply:
Revision history for this message
Best Karol Brzezinski (kbrzezinski) said :
#1

Hi Bence,

the simplest way to do this is to repeat c1 three times and c2 seven times in the list passed to makeClumpCloud(). However, you won't get exactly 30%, rather approximately 30%.

Cheers,
Karol

##################
from yade import pack

O.bodies.append(geom.facetBox((0,0,0),(0.6,1,0.8),wallMask=55,fixed=True))

sp=pack.SpherePack()
c1=pack.SpherePack([((0,0,0),.05),((0.1,0,0),0.05),((0.2,0,0),.05)])
sp=pack.SpherePack()
c2=pack.SpherePack([((0,0,0),.05),((0.1,0,0),0.05)])
sp.makeClumpCloud((-0.5,-1,-0.8),(0.5,1,0.8),[c1,c1,c1,c2,c2,c2,c2,c2,c2,c2],num=-1)
sp.toSimulation()

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,-9.81,0),damping=0.2),
]

O.dt=.5*PWaveTimeStep()
O.saveTmp()

c1_count = 0
c2_count = 0

for b in O.bodies:
 if isinstance(b.shape,Clump):
  if b.state.mass >1.5:
   c1_count += 1
  else:
   c2_count += 1

print("C1/(C1+C2) = {:.2f}".format(c1_count/(c1_count+c2_count)))

Revision history for this message
Szabó Bence (bencusur) said :
#2

Thanks Karol Brzezinski, that solved my question.

Revision history for this message
Szabó Bence (bencusur) said :
#3

Hi Karol,

Thanks for your advice, thats helped me.

Best wishes,
Bence