Unable to place new sphere after 5000 attempts

Asked by bruna

Hello everyone!

I'm still learning yade-dem and I am trying to fill a cylinder with a determined type of soil with especific porosity and PSD. For this, I created a cylinder and to fill it up, I tryed to use the CircularFactory engine. Unfortunately, always I run the script the following message appears and nothing happens:

Unable to place new sphere after 5000 attempts

I can't realize where my mistake is.
Please, I would like to know where my mistake is or if there is a better way to fill my cylinder with spheres.
Thanks a lot,

Bruna.

Here is the script:

# -*- coding: utf-8 -*-

O.bodies.append(geom.facetCylinder(center=(0.,0.,0.5), radius=.5, height=1., wallMask=6))
O.bodies.append(utils.sphere((0.,0.,0.05),radius=.05))

O.engines=[
    ForceResetter(),
    InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Wall_Aabb(),Bo1_Facet_Aabb()]),
    InteractionLoop(
        [Ig2_Sphere_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
        [Ip2_FrictMat_FrictMat_FrictPhys()],
        [Law2_ScGeom_FrictPhys_CundallStrack()]
    ),
    NewtonIntegrator(damping=.2,gravity=(0.,0.,-9.81),label='newton'),
    CircularFactory(center=(0,0,1),radius=.5,massFlowRate=500.,PSDcum=[0.01,0.25,0.40,0.45,0.50,0.55,0.60,1.0],PSDsizes=[0.0075,0.0095,0.019,0.025,0.0375,0.05,0.075,0.1],exactDiam=True,color=(0,0,1),goalMass=1800,vMin=100,vMax=100,vAngle=0,normalVel=(0,0,-1))
]

O.dt=0.5*utils.PWaveTimeStep()

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jérôme Duriez (jduriez) said :
#1

Hi,

According to the source code of CircularFactory [*], sphere packing creation here consists in filling the defined volume with spheres, through repeted random attempts:
for each new sphere creation trial, it is checked that the new sphere does not overlap with existing ones. Otherwise the new sphere is not created.
If new sphere creation is at some point unsuccessfull after a given maximum attempt number (seems to be 5000), procedure stops and you end up with a packing not corresponding to what you asked for (or no packing at all maybe)

This procedure is quite classical in Yade (e.g. makeCloud() function uses a similar one). It is simply not possible to obtain any desired packing within any volume through such random geometrical packing algorithm. Solution is usually to modify the required PSD parameters, so that the random filling without overlaps has more chances to be successfull.

[*] https://github.com/yade/trunk/blob/51d5727f14cb0b38c807b22e93d6fec1b0ead862/pkg/dem/SpheresFactory.cpp with your error message at line 154. I understand it may sound tough for newcomers, but it is the magic of opensource codes..

Can you help with this problem?

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

To post a message you must log in.