Why do the particles go up when all the forces(including gravity) are applied in the downward direction?

Asked by Hashir Ahmad

I have constructed a rectangular box of particles with walls surrounding it and opened at the top. I applied some downward force on a facetCylinder with wallMask=2(i.e a circular plate) kept on the top of the box. When the facetCylinder reaches the bottom of the box, all the particles in the box move up and come out of the box. Here's my code:

from yade import pack
from yade import ymport

def createSandBox(length, height, width, radSpheres, variance, color):
 boxpred = pack.inAlignedBox((0,0.5,-0.5),(length,height,width))
 packing = pack.randomDensePack(boxpred, spheresInCell = 250, radius=radSpheres, rRelFuzz=variance, color=color, returnSpherePack = False)
 return O.bodies.append(packing)

idBox = createSandBox(2,1.5,0.5,1e-1,0,(1,0.917,0.659))
mWalls = O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=0,density=0))

idBoxWalls = O.bodies.append(geom.facetBox(center,extents,orientation=Quaternion((0,0,0),0),wallMask=wMask, color=co, material=mWalls, wire=True))
idCylWalls = O.bodies.append(geom.facetCylinder((1,1,-0.25),0.3,0.5,wallMask=2,material=mWalls,segmentsNumber=20,color=co))

o.engines = [
  ForceResetter(),
  InsertionSortCollider([Bo1_Sphere_Aabb(), Bo1_Facet_Aabb()],verletDist=1.0,label='collider'),
  InteractionLoop(
    [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
    [Ip2_FrictMat_FrictMat_FrictPhys()],
    [Law2_ScGeom_FrictPhys_CundallStrack()],
  ),
  NewtonIntegrator(damping=0,gravity=[0,0,9.81],label='newtonInt'),
  TranslationEngine(translationAxis=[0,0,1],velocity=3.0,ids=idCylWalls, label='translat'),
  CombinedKinematicEngine(ids=idCylWalls,label='combEngine',dead=True) +
    ServoPIDController(axis=[0,0,1],maxVelocity=5.0,iterPeriod=1000,ids=idCylWalls,target=1.0e7,kP=1.0,kI=1.0,kD=1.0) +
    RotationEngine(rotationAxis=(0,0,1), angularVelocity=10.0, rotateAroundZero=True, zeroPoint=(0,0,0)),
  #PyRunner(command='addPlotData()',iterPeriod=100, label='graph'),
  PyRunner(command='switchTranslationEngine()',iterPeriod=45000, nDo = 2, label='switchEng'),
]
O.step()
qt.View()

def switchTranslationEngine():
  print "\nSwitch from TranslationEngine engine to ServoPIDController"
  translat.dead = True
  combEngine.dead = False

I want the particles to only redistribute. And the ones at the top to move up by some distance.

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

Hi Hashir,
please try the scripts to be working before posting them. Here I got "NameError: name 'young' is not defined".
thanks
Jan

Revision history for this message
Hashir Ahmad (hash.ir) said :
#2

Hi Jan

Sorry for that. You can put "young = 5e6".

Revision history for this message
Robert Caulk (rcaulk) said :
#3

Hello Hashir,

You apply gravity in the upward direction with:

NewtonIntegrator(damping=0,gravity=[0,0,9.81],label='newtonInt')

If you want gravity to act in the downward direction, you should use -9.81.

Cheers,

Robert

Can you help with this problem?

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

To post a message you must log in.