Random periodic packing with different volume fractions
I am trying to generate random periodic packing of spheres in a cube with different volume fraction. I am looking for random packing of spheres with volume fraction as one parameter. I have used yade to generate random dense packing using the script below. Is there any easy way to generate packing for different volume fractions in yade?
from yade import pack
pack.randomPeri
O.step() # to initialize bounding boxes
xImages = [] # list of "edge" particles
for b in O.bodies:
xmin,xmax = O.cell.
if xmin > xmax: # this means that bounding box crosses periodic cell. You can define various different conditions..
xImages.append(b)
pr = [[O.cell.
for i,(pos,r) in enumerate(pr):
shift = Vector3(
pr[i][0] += shift
# saves images into a file
f = open("/
f.write("x y z r\n")
f.writelines("%g %g %g %g\n"%(
f.close()
yImages = []
for b in O.bodies:
ymin,ymax = O.cell.
if ymin > ymax:
yImages.append(b)
pr1 = [[O.cell.
for i,(pos,r) in enumerate(pr1):
shift = Vector3(
pr1[i][0] += shift
# saves images into a file
f = open("/
f.write("x y z r\n")
f.writelines("%g %g %g %g\n"%(
f.close()
zImages = []
for b in O.bodies:
zmin,zmax = O.cell.
if zmin > zmax:
zImages.append(b)
pr2 = [[O.cell.
for i,(pos,r) in enumerate(pr2):
shift = Vector3(
pr2[i][0] += shift
# saves images into a file
f = open("/
f.write("x y z r\n")
f.writelines("%g %g %g %g\n"%(
f.close()
# saving normal spheres
f = open("/
f.write('x y z r\n')
for b in O.bodies:
p,r = O.cell.
f.write('%g %g %g %g\n' %(p[0],
f.close()
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Shailesh Konda for more information if necessary.