generate two different radius particle in a box

Asked by JayBosco

Hi everyone,

I've just started using yade recently,and now i have a question about how to regenerate small particles of another size in a box that has already generated large particles?

For example,i have a cube box with sides of 2000mm,and I want to generate large particles with an average size of 100mm.After that,I hope to regenerate into small particles with an average particle size of 5mm in the cube box that has generated the above particles.In addition, I have a question here. If this requirement can be realized, are the small particle size generated in the pores of the large particle size?

thank you for you help!

Question information

English Edit question
Yade Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Karol Brzezinski (kbrzezinski) said :


this question has been asked a couple of times. Check out those topics [1,2]

Best wishes,


Revision history for this message
JayBosco (jaybosco) said :


The information you provided is useful to me, but i am still have some questions. If i can use the method randomDensePack to replace the method makeCloud use in the topics [1,2] you gave to me? Because I want to generate particles of small size to fill the pores of dense particles of large size, but i don't know how to achieve it by method randomDensePack.


Revision history for this message
Karol Brzezinski (kbrzezinski) said :


I don't think that you can do this with randomDensePack (I am not sure though). I think that the simplest approach would be to:
- generate packing with makeCloud() inside a bigger cube,
- generate six walls around the packing and compress the packing until some condition is reached (stress or porosity, etc.)
- export your packing to an external file.

If you need a more specific answer, you should share more details [1]. Especially, after you try to implement some solution by yourself.



Revision history for this message
Robert Caulk (rcaulk) said :


No, you cannot use randomDensePack to do this. But you can very easily replicate randomDensePack action by increasing particle radii yourself according to the stresses on the walls.

Add a pyrunner to your engines list:


Then add the following function to your script:

## Set mn,mx. They should be the values you used to create the aabbWalls. 'walls' should be a list of the ids of your walls.
multiplier = 1.001

def addStress():
        global multiplier
        preStress = 5e3
 pressure = 0

 for i in walls:
  f = O.bodies[i]
  a = mn[0]*mn[1]
  force = O.forces.f(,sync=True)
  pressure = pressure + np.linalg.norm(force)/a

 stabCoeff = abs((abs(pressure/len(walls))-preStress)/preStress)
 facetStress = abs(pressure/len(walls))
 print('unbalanced force:',unbalancedForce(),'avg top pressure ',facetStress ,'stability coeff ',stabCoeff)
 multiplier = 1+(preStress-facetStress)/preStress * (maxMultiplier-1.)
 if multiplier <= 0.95: multiplier=0.95
 print('multiplier adjusted up to ', multiplier)

        if stabCoeff<0.001:
            print('packing finished, export it to file ;)')
            loadSample.dead = 1

I hope it is obvious that this should not be active during any scientific simulation, this is just to achieve a dense packing. Best practice would be to export this packing to file using export.textExt() and then import that packing into whatever you need to do. I leave the export/import up to you as homework ;).



Revision history for this message
Jan Stránský (honzik) said :


> I've just started using yade recently

welcome :-)

you can try something like (not tested):
sp = pack.randomDensePack(...,returnSpherePack=True) # big particles
sp.makeCloud(...) # small particles


Can you help with this problem?

Provide an answer of your own, or ask JayBosco for more information if necessary.

To post a message you must log in.