← Back to team overview

yade-users team mailing list archive

Re: [Question #706540]: Trouble in generating sphere packing

 

Question #706540 on Yade changed:
https://answers.launchpad.net/yade/+question/706540

    Status: Open => Answered

Karol Brzezinski proposed the following answer:
Hi Huan,

The good news is that you can cal makeCloud() multiple times with
different radii and new spheres are added to the SpherePack.

Cheers,
Karol

import random
import math
from yade import geom, pack, utils, plot, ymport

# Define material properties
youngModulus = 1e7
poissonRatio = 0.25
density = 2000

# Create material
material = O.materials.append(FrictMat(young=youngModulus, poisson=poissonRatio, density=density))

# Define cylinder with funnel parameters
center = (0, 0, 0)
diameter = 0.102
height = 0.064

# create cylindrical body with radius 0.102 m and height 0.064 m
cylinder = geom.facetCylinder(center=center, radius=diameter/2, height=height, segmentsNumber=80, wallMask=6)

# assign material to each body in the cylinder
for body in cylinder:
    body.bodyMat = material

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

# Define cylinder with funnel parameters
center1 = (0,0,height/2)
dBunker = 0.2
dOutput = 0.102
hBunker = 0
hOutput = 0.08
hPipe = 0

# create funnel as a bunker with diameter 0.102 m, height 0.064 m
funnel = geom.facetBunker(center=center1, dBunker=dBunker, dOutput=dOutput, hBunker=hBunker,hOutput=hOutput, hPipe=hPipe, segmentsNumber=80, wallMask=4)

# assign material to each body in the funnel
for body in funnel:
    body.bodyMat = material

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

###### new part
rMean1 = (0.0125+0.019)/4
rRelFuzz1 = (0.019-0.0125)/4/rMean1 
num1 = 28

# (other sizes) ....

rMean4 = (0.00475+0.00236)/4
rRelFuzz4 = (0.00475-0.00236)/4/rMean4 
num4 = 18997


sp = pack.SpherePack()
## just call makeCloud() multiple times before sending to simulation
sp.makeCloud((-dBunker/3,-dBunker/3,2*height),(dBunker/3,dBunker/3,10*height), rMean = rMean1, rRelFuzz = rRelFuzz1, num = num1)
#(...)
sp.makeCloud((-dBunker/3,-dBunker/3,2*height),(dBunker/3,dBunker/3,10*height), rMean = rMean4, rRelFuzz = rRelFuzz4, num = num4)
sp.toSimulation()

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