2D makeCloud

Asked by Riccardo carta

Hi
My task is to fill a portion of a plane with the maximum number of particles

I read about a discussion about using makeCloud in 2D but it is not working for me.
I'm using yade-daily 3+3354+42~lucid1, if I type this:

...
sp.makeCloud(minCorner=(0,0,0),maxCorner=(1,1,0),rRelFuzz=.2,num=500,periodic=False)
...

I get this:

File "2d.py", line 15, in <module>
    sp.makeCloud(minCorner=(0,0,0),maxCorner=(1,1,0),rRelFuzz=.2,num=500,periodic=False)
ValueError: The box as null volume, this is not supported. One exception is for flat box defined by min-max in periodic conditions, if hSize argument defines a non-null volume (or if the hSize argument is left undefined).

I do not understand.

Moreover, I have some problem in understanding how makeCloud works in general: what is the way to fill a box with the maximum number of spheres of the same radius (=a cloud of spheres with the minimum porosity?)??

thanks

Riccardo

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Bruno Chareyre
Solved:
Last query:
Last reply:
Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#1

Hi,
The check on input parameters was excessively restrictive. I removed it. Now the command you show works correctly (update yade-daily package) even if periodic=False.

>what is the way to fill a box with the maximum number of spheres of the same radius?

Translating you question into input parameters gives:
sp.makeCloud(minCorner=(0,0,0),maxCorner=(1,1,0),rRelFuzz=0,rMean=something)

... which works like a charm. :)

Revision history for this message
Riccardo carta (riccardo-carta) said :
#2

Thanks,
the 2D makeCloud command works well now.

Actually the second question was not really about having the same radius for all the spheres but more about the input "porosity" in makeCloud(). which is the range of this input?
moreover the command "num" seems to be uneffective: if I run this command

sp.makeCloud(minCorner=(-.1,0,-.1),maxCorner=(.1,0,.1),rMean=.01,periodic=False,num=100)

I get
WARN /build/buildd/yade-daily-3+3367+42~lucid1/pkg/dem/SpherePack.cpp:213 makeCloud: Exceeded 1000 tries to insert non-overlapping sphere to packing. Only 58 spheres was added, although you requested 100.

but the makeCloud box seems to have space for more than 58 spheres

I would like to understand if input "porosity" and "num" are somehow linked and how they affect the generation of the sphere cloud

Hope to have explained clear the issue

Thanks

Riccardo

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#3

>but the makeCloud box seems to have space for more than 58 spheres

The number of additional spheres that could fit in the voids looks very limited, and the fact that you see a few free spots does not mean that the algorithm is capable of finding them.

num, meanRad, and porosity are linked of course. Please state your problem more clearly, as for now the only thing I could do is to rephrase the documentation on how they interact.

Revision history for this message
Riccardo carta (riccardo-carta) said :
#4

ok,
using makeCloud() ,the maximum number of particles of the same radius I can put into a box defined by minCorner and maxCorner is achieved by calling the function with the default inputs:
(num=-1,porosity=.5)
am I right?

Does the porosity have something to do with the amount of void space in the makeCloud box? Because I can not see difference between porosity=0 and porosity=1 (or porosity=10)

let's now call

radius=.005
sp=pack.SpherePack()
sp.makeCloud(minCorner=(-.1,0,-.1),maxCorner=(.1,0,.1),rMean=radius)
sp.toSimulation(material=MatSp)
box=O.bodies.append(utils.geom.facetBox((0,0,0),(.1,radius,.1),material=MatBox,wallMask=31)) # the same box of makeCloud
O.engines=[
 ForceResetter(),
    InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Wall_Aabb()]),
    InteractionLoop(
        [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()],
        [Ip2_FrictMat_FrictMat_FrictPhys()],
        [Law2_ScGeom_FrictPhys_CundallStrack()]
    ),
 NewtonIntegrator(gravity=(0,0,-9.81),damping=.1)
]
O.dt=utils.PWaveTimeStep()

at the end of the run, which is a trivial gravity deposition, I see almost half of the box empty:
is the makeCloud command able to produce a particles distribution like the random one achieved in this way filling the entire box?
For example I see that regularHexa() packs spheres in such a way, but of course following a regular distribution; what I'd like to have is a random one.

Riccardo

Revision history for this message
Best Bruno Chareyre (bruno-chareyre) said :
#5

>the maximum number of particles of the same radius I can put into a box is achieved by calling the function with the default inputs: (num=-1,porosity=.5) am I right?

No. Four ways of calling the function are listed in the documentation and this is not one of them. Obviously, an infinity of combinations of number and size can give porosity=0.5, so the function doesn't know what to do. It will error out.

>Does the porosity have something to do with the amount of void space in the makeCloud box?

Yes clearly. Compare the result of these two calls for instance:
sp.makeCloud(minCorner=(-.1,0,-.1),maxCorner=(.1,0,.1),periodic=False,num=100,porosity=0.99)
sp.makeCloud(minCorner=(-.1,0,-.1),maxCorner=(.1,0,.1),periodic=False,num=100,porosity=0.6)

>is the makeCloud command able to produce a particles distribution like the random one achieved in this way filling the entire box?

No. makeCloud() is here to generate clouds, i.e. loose distributions of non-touching particles. The porosity will hardly go below 0.6. Dense packings can only be obtained after further compressing, applying gravity, growing particles, etc.

Revision history for this message
Riccardo carta (riccardo-carta) said :
#6

Thanks Chareyre, that solved my question.

Revision history for this message
Riccardo carta (riccardo-carta) said :
#7

got it!
thanks