How to pack sphere full box ?

Asked by veerawat on 2020-02-18

Hello my friend .i am a new one of member .i want to put a sphere in to full box.Please help me. This is my code

from yade import pack, plot

# create rectangular box from facets
O.bodies.append(geom.facetBox((.5,.5,.5),(.5,.5,.5),wallMask=63))

# create empty sphere packing
# sphere packing is not equivalent to particles in simulation, it contains only the pure geometry

O.materials.append(FrictMat(density=1000,young=1e4,poisson=0.3,frictionAngle=radians(30),label='sphereMat'))

# sphere packing is not equivalent to particles in simulation, it contains only the pure geometry
sp=pack.SpherePack()
# generate randomly spheres with uniform radius distribution
O.materials.append(FrictMat(density=1000,young=1e4,poisson=0.3,frictionAngle=radians(30),label='sphereMat'))

sp.makeCloud((0,0,0),(1,1,1),rMean=.03,rRelFuzz=.01,num=10000,seed=10000)
# add the sphere pack to the simulation
sp.toSimulation()

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
 InteractionLoop(
  # handle sphere+sphere and facet+sphere collisions
  [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()]
 ),
 NewtonIntegrator(gravity=(0,0,-9.81),damping=0.4),
 # call the checkUnbalanced function (defined below) every 2 seconds

]
O.dt=.5*PWaveTimeStep()

#
O.saveTmp()

What should i chage ?

Thank you for helping

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
2020-02-18
Last reply:
2020-02-19
Jan Stránský (honzik) said : #1

Hello,

> What should i chage ?

You should read [1].
You should be more specific, first of all telling what actually is wrong.
Using a better English would also help, e.g. "a sphere" would normally mean "some (not very specific) ONE sphere". In that case, do not use makeCloud, but create a sphere according to your needs e.g. as
###
from random import random as r
O.bodies.append(sphere((r(),r(),r()),r()))
###

> i want to put a sphere in to full box.

what does "put" mean?
what does "a sphere" mean?
what does "full box" mean?

cheers
Jan

[1] https://www.yade-dem.org/wiki/Howtoask

veerawat (suesan) said : #2

sorry for my English sir. it's hard for me. i try the best. so i made a box by this code

O.bodies.append(geom.facetBox((.5,.5,.5),(.5,.5,.5),wallMask=63))

and then i made a particle sphere of sand by this code

O.materials.append(FrictMat(density=1000,young=1e4,poisson=0.3,frictionAngle=radians(30),label='sphereMat'))

# sphere packing is not equivalent to particles in simulation, it contains only the pure geometry
sp=pack.SpherePack()
# generate randomly spheres with uniform radius distribution
O.materials.append(FrictMat(density=1000,young=1e4,poisson=0.3,frictionAngle=radians(30),label='sphereMat'))

sp.makeCloud((0,0,0),(1,1,1),rMean=.03,rRelFuzz=.01,num=10000,seed=10000)
# add the sphere pack to the simulation
sp.toSimulation()

So when i play it .particle in the box are not full . what should i change ? what is it wrong ?

Jan Stránský (honzik) said : #3

> sorry for my English sir. it's hard for me. i try the best.

it is a bit difficult for us, too, but it is OK and actually in your case English is not the biggest problem..

> particle in the box are not full

particle or particles? (please concentrate at least on the most basics of English)
what does "particle ... are not full" mean?

Do you want the BOX to be full of particles? If yes:
- makeCloud create loose packing. If you apply gravity, it is significantly "compacted"
- solution:
   - use pack.randomDensePack instead
   - use larger are in makeCloud, like sp.makeCloud((0,0,0),(1,1,3),...)

cheers
Jan

Can you help with this problem?

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

To post a message you must log in.