New question #670078 on Yade:
https://answers.launchpad.net/yade/+question/670078

Hi all,

I want to create a spherical dense packing of spheres, where the radii of the 
spheres are given by a Gaussian distribution. Since I want to assign the radii 
myself, I have seen on some questions 
(https://answers.launchpad.net/yade/+question/406741) that filterSpherePack 
should be the way to go. But I am unsure how I can make my spherePack dense 
after filling the predicate? In the question linked above it seems as I could 
do it using an isotropic compression, but when I try that all my spheres 
"explode". And since my body of spheres is also spherical, it seems to me that 
a compression from 6 different planes will only distort my sphere.

 Is there another way to achieve a densely packed spherical body with assigned 
radii? I have seen on https://answers.launchpad.net/yade/+question/211583 
that it is suggested to change the source code for spherePack, how can this be 
done? 

I am new with Yade so I greatly appreciate any help!

Cheers, Olav

Below is my script for creating the spherical loose-packed body using 
filterSpherePack:

from yade import pack
import numpy as np
## Creating a body of spheres of varying radii

# Using numpy to generate a Gaussian distribution of sphere diameters
mu, sigma=20,2  #mean and standard deviation
numParticles=1000
d=np.random.normal(mu,sigma,numParticles) #diameter array 

#Sorting the diameters
psdSizes=sorted(d)
#psdCumm=np.arange(1/numParticles,1+1/numParticles,1/numParticles)
#Creating a vector of accumulated factors of the particles
#Here we have one particle assigned to each radius
#for some reason Yade says 1/numParticles=0, so 0.001 is used instead
psdCumm=np.arange(0.001,1+0.001,0.001)

## making cloud of spheres to insert into predicate
sp=pack.SpherePack()
#giving the spheres a radius assigned by Normal distribution
sp.makeCloud((0,0,0),(200,200,200),psdSizes=psdSizes,psdCumm=psdCumm
              ,num=numParticles,porosity=0.2)

## constructing predicate
pred=pack.inSphere(center=(0,0,0),radius=100)

## packing predicate with loosely packed spheres
spheres=pack.filterSpherePack(pred,sp)

## add spheres to simulation
O.bodies.append(spheres)

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to