Why am I not able to see any translatory motion?

Asked by Hashir Ahmad

I have constructed a geometry in which a cylinder is inserted in an box(surrounded by walls leaving the top open) and I am applying downward force on the cylinder. But I am not able to see any motion or displacement of the particles.

Here's my code:
o = Omega()

def createStoneColumn(centerBottom, centerTop, radCyl, radSpheres, variance, color):
 cylpred = pack.inCylinder(centerBottom, centerTop, radius=radCyl)
 packing = pack.randomDensePack(cylpred, spheresInCell = 250, radius=radSpheres, rRelFuzz=variance, color=color, returnSpherePack = False)
 return O.bodies.append(packing)

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

idBox = createSandBox(2,1,1,0.75e-1,0,(1,0.917,0.659))
idStone = createStoneColumn((1,0.5,0.5),(1,1.5,0.5),0.3,0.5e-1,0,(1,0.646,0.361))

center = (1,0.5,0.5)
extents = (1,0.5,0.5)
wMask = 55
co = (0,0,1)
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))

print len(O.bodies)

o.engines = [
  ForceResetter(),
  InsertionSortCollider([Bo1_Sphere_Aabb()],verletDist=1.0,label='collider'),
  InteractionLoop(
    [Ig2_Sphere_Sphere_ScGeom()],
    [Ip2_FrictMat_FrictMat_FrictPhys()],
    [Law2_ScGeom_FrictPhys_CundallStrack()],
  ),
  NewtonIntegrator(damping=0,gravity=[0,0,-9.81],label='newtonInt'),
  TranslationEngine(translationAxis=[0,-1,0],velocity=-2.0,ids=idStone,dead=False,label='translat'),

  CombinedKinematicEngine(ids=idStone,label='combEngine',dead=True) +
    ServoPIDController(axis=[0,-1,0],maxVelocity=2.0,iterPeriod=1000,ids=idStone,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='switchTranslationEngine()',iterPeriod=45000, nDo = 2, label='switchEng'),
]

O.step()

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

Please help!

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
Last query:
Last reply:
Revision history for this message
Best Jan Stránský (honzik) said :
#1

Hi,

you can test the displacement by Body.state.displ(), e.g.
print max(b.state.displ().norm() for b in O.bodies) to test the value of displacement. You will see that the dislpacements are nonzero.

To make them visible, you cen either set dispScale in Display tab in controller to exagerate displacement, or you can also set larger time step to make the simulation "faster" and make the displacements visible immediatelly (depending on young value, for 25e6 I see it immediatally)
O.dt = .5*PWaveTimeStep() # it is a good idea anyway

cheers
Jan

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

Thanks Jan Stránský, that solved my question.