facet-polyhedra collision din not work

Asked by lip

hello
i have creat a fecetBox with many polyhedra in it and expect them collide with each other, but when i click the "start" button, the polyhedra just go through the facetBox. my code is as below:

from yade import polyhedra_utils,pack,plot
import random

polyMat = PolyhedraMat(density=3000,young=1e10,poisson=.5,frictionAngle=atan(0.8))
O.materials.append(polyMat)

O.bodies.append(geom.facetBox((5,5,5),(5,5,5),wallMask=31))
polyhedra_utils.fillBox((0,0,0),(10,10,10),polyMat,seed=1)

O.engines=[
   ForceResetter(),
   InsertionSortCollider([Bo1_Polyhedra_Aabb(),Bo1_Facet_Aabb()]),
   InteractionLoop(
      [Ig2_Polyhedra_Polyhedra_PolyhedraGeom(),Ig2_Facet_Polyhedra_PolyhedraGeom()],
      [Ip2_PolyhedraMat_PolyhedraMat_PolyhedraPhys()],
      [Law2_PolyhedraGeom_PolyhedraPhys_Volumetric()]
   ),
   NewtonIntegrator(gravity=(0,0,-9.81),damping=0.4),
   # call the checkUnbalanced function (defined below) every 2 seconds
   PyRunner(command='checkUnbalanced()',realPeriod=2),
   # call the addPlotData function every 200 steps
   PyRunner(command='addPlotData()',iterPeriod=100)
]
O.dt=.5*PWaveTimeStep()

# enable energy tracking; any simulation parts supporting it
# can create and update arbitrary energy types, which can be
# accessed as O.energy['energyName'] subsequently
O.trackEnergy=True

# if the unbalanced forces goes below .05, the packing
# is considered stabilized, therefore we stop collected
# data history and stop
def checkUnbalanced():
   if unbalancedForce()<.05:
      O.pause()
      plot.saveDataTxt('bbb.txt.bz2')
      # plot.saveGnuplot('bbb') is also possible

# collect history of data which will be plotted
def addPlotData():
   # each item is given a names, by which it can be the unsed in plot.plots
   # the **O.energy converts dictionary-like O.energy to plot.addData arguments
   plot.addData(i=O.iter,unbalanced=unbalancedForce(),**O.energy)

# define how to plot data: 'i' (step number) on the x-axis, unbalanced force
# on the left y-axis, all energies on the right y-axis
# (O.energy.keys is function which will be called to get all defined energies)
# None separates left and right y-axis
plot.plots={'i':('unbalanced',None,O.energy.keys)}

# show the plot on the screen, and update while the simulation runs
plot.plot()

O.saveTmp()
##end

i have no idea why this situation happend because when i tried with sphere, everything is just fine. i would appreciate it if you can help me!

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
Jan Stránský (honzik) said :
#1

Hello,
the same problems as in [1]:
1) use lower value for time step (1e-3 worked OK for me), suggested by a warning using PWaveTimeStep without any spheres.
2) for debugging, try "step" instead of "play" first. It would reveal, that the particles travel half of the facet box in one step and there is no way how they could interact with facets..
cheers
Jan

[1] https://answers.launchpad.net/yade/+question/677941

Revision history for this message
lip (mr.xie) said :
#2

thank you for your advice, it do solve my problem. but i still have a problem. When translate the facetBox to wall, the polyhedra contact the wall and then stoped, my code is as below:

from yade import polyhedra_utils,pack,plot
import random

m = PolyhedraMat()
m.density = 2600 # kg/m^3
m.young = 1E6 # Pa
m.poisson = 20000 / 1E6
m.frictionAngle = 0.6 # rad

O.bodies.append(utils.wall(-1, axis=2, sense=0, material=m))
# generate randomly spheres with uniform radius distribution
polyhedra_utils.fillBox((0,0,0),(10,10,10),m,seed=1)

O.engines=[
   ForceResetter(),
   InsertionSortCollider([Bo1_Polyhedra_Aabb(),Bo1_Wall_Aabb(),Bo1_Facet_Aabb()]),
   InteractionLoop(
      # handle sphere+sphere and facet+sphere collisions
      [Ig2_Wall_Polyhedra_PolyhedraGeom(),Ig2_Polyhedra_Polyhedra_PolyhedraGeom(),Ig2_Facet_Polyhedra_PolyhedraGeom()],
      [Ip2_PolyhedraMat_PolyhedraMat_PolyhedraPhys()],
      [Law2_PolyhedraGeom_PolyhedraPhys_Volumetric()]
   ),
   NewtonIntegrator(gravity=(0,0,-2.81),damping=0.4),
   # call the checkUnbalanced function (defined below) every 2 seconds
   PyRunner(command='checkUnbalanced()',realPeriod=2),
   # call the addPlotData function every 200 steps
   PyRunner(command='addPlotData()',iterPeriod=100)
]
O.dt=1e-3

# enable energy tracking; any simulation parts supporting it
# can create and update arbitrary energy types, which can be
# accessed as O.energy['energyName'] subsequently
O.trackEnergy=True

# if the unbalanced forces goes below .05, the packing
# is considered stabilized, therefore we stop collected
# data history and stop
def checkUnbalanced():
   if unbalancedForce()<.05:
      O.pause()
      plot.saveDataTxt('bbb.txt.bz2')
      # plot.saveGnuplot('bbb') is also possible

# collect history of data which will be plotted
def addPlotData():
   # each item is given a names, by which it can be the unsed in plot.plots
   # the **O.energy converts dictionary-like O.energy to plot.addData arguments
   plot.addData(i=O.iter,unbalanced=unbalancedForce(),**O.energy)

# define how to plot data: 'i' (step number) on the x-axis, unbalanced force
# on the left y-axis, all energies on the right y-axis
# (O.energy.keys is function which will be called to get all defined energies)
# None separates left and right y-axis
plot.plots={'i':('unbalanced',None,O.energy.keys)}

# show the plot on the screen, and update while the simulation runs
plot.plot()

O.saveTmp()
##end
i would appreciate it if you can help me.

Revision history for this message
Jan Stránský (honzik) said :
#3

> When translate the facetBox to wall, the polyhedra contact the wall and then stoped

what is the difference from the case of facets?
I think this behavior is reasonable, a single particle would rebounce, but is pushed back by many particles from top..
You can try to play with single polyhedra first to get feeling how it interact with facet/wall.
cheers
Jan

Can you help with this problem?

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

To post a message you must log in.