Problems with psdSizes and psdCumm in makeCloud function

Asked by weijie

Dear all,

I used the makeCloud function to generate spheres according to psdSizes and psdCumm, and replaced some of the spheres with polyhedra.

The psd parameters I used are: psdSizes=[0.01,0.015,0.025],psdCumm=(0,0.5,1), according to my understanding, the distribution of the small balls is:
size ratio (%)
0-0.01 0
0.01-0.015 50
0.015-0.025 50

But I found that the size of all the generated balls is below 0.015. What is the reason?In addition, there are the following warnings when generating the sphere: The size distribution has been scaled down, how to solve this?

Below is my MWS.

Thanks in advance.
Jie

################################
from yade import polyhedra_utils,pack,plot,utils,export,qt
import numpy as np
import math
import random
#Material
m = FrictMat(young=7.2e7,poisson=.2,density=2.5e3)
n = PolyhedraMat(young=7.2e7,poisson=.2,density=2.5e3)
O.materials.append((m,n))
#Dimensions
meanSize = 0.05
wallThickness = 0.5*meanSize
distanceToCentre = 0.05
lengthOfBase =0.25
heightOfBase = 0.6
#-------------------------------------------
#Make Cloud
sp=pack.SpherePack()
mn,mx=Vector3(-0.5*(lengthOfBase-wallThickness),0.5*meanSize,-0.5*(lengthOfBase-wallThickness)),Vector3(0.5*(lengthOfBase-wallThickness),1*heightOfBase,0.5*(lengthOfBase-wallThickness))
sp.makeCloud(mn,mx,psdSizes=[0.01,0.015,0.025],psdCumm=(0,0.5,1),num=1000)
for center,radius in sp:
    if radius<0.015:
        t = sphere(center,radius,material=m)
        O.bodies.append(t)
    if radius >0.015 and radius < 0.025:
        t=polyhedra_utils.polyhedra(material=n,size=(0.01,0.01,0.01),seed=1)
        t.state.pos = center # sets polyhedron position according to sphere position
        O.bodies.append(t)

#count numbers
countSPs=0
for b in O.bodies:
 if isinstance(b.shape,Sphere):
  countSPs=countSPs+1
print("number of PotentialBlocks = ", countSPs)
countPol=0
for b in O.bodies:
 if isinstance(b.shape,Polyhedra):
  countPol=countPol+1
print("number of Polyhedra = ", countPol)

from yade import qt
v=qt.View()
v.sceneRadius=10.0
v.ortho=True # I activate orthotropic projection, to make visual comparisons easier
O.saveTmp()

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,

If YADE warns you the size have been scaled down, maybe it's not surprising that you do not get the sizes you asked for ;-)

Reason is that you assigned altogether
- size of the cloud: mn and max attributes
- the number of the spheres
- their volume

And it was impossible for makeCloud to randomly insert that many spheres with these sizes in that volume, without the spheres touching each other.

Solution is to change your use of the function, eg enlarging the mn,max attributes defining the cloud "box".

Can you help with this problem?

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

To post a message you must log in.