An impact simulation got an error

Asked by Huihuang Xia

Hi,
I simulated a steel ball impacted on a particle assembly at a high speed, but my code got an error, that is the steel ball not move. My codes is as follows, please help me to solve this problem. Many thanks!

from yade import pack
##### define materials for particles and mill #####
rock=O.materials.append(CohFrictMat(young=5.98e7,poisson=0.3,density=2678,frictionAngle=0.5,normalCohesion=1.2e10,shearCohesion=1.2e9,momentRotationLaw=True))
steel=O.materials.append(FrictMat(young=3.06e11,poisson=0.29,density=7861,frictionAngle=0.545))

##### create partciles assembly #####
pred=pack.inAlignedBox((-0.1,-0.1,-0.1),(0.1,0.1,0.1))
spheres=pack.randomDensePack(pred,radius=0.005,rRelFuzz=0.3,spheresInCell=1500,material=rock,color=(1,0,1))
O.bodies.append(spheres)
##### create a rigid ball #####
ball=O.bodies.append(sphere(center=(0,0,0.5),radius=0.1,color=(0,1,1),material=steel))
ball.blockedDOFs='xyXYZ'
ball.state.vel=Vector3(0,0,-1) ##### set velocity along axis-Z
O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom6D(interactionDetectionFactor=1.1)],
  [Ip2_FrictMat_FrictMat_FrictPhys(),Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True)],
  [Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
 ),
 NewtonIntegrator(damping=0.3,gravity=(0,0,-9.81))
]

from yade import qt
qt.View()
qt.Controller()
#qt.Renderer().shape=0
#qt.Renderer().intrPhys=1
O.dt=0.001*PWaveTimeStep()

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

Hello,
next time please put the error message in the question, here it would have
been possible to answer directly without testing the script :-)

O.bodies.append returns id(s) of appended bodies, not bodies themselves. So
just modify the code in the following way:

ball_id = O.bodies.append(...)
ball = O.bodies[ball_id]
...

another point, PWaveTimeStep() returns theoretical critical time step, it
is a good idea to multiply it by 0.8 or 0.5, but there is no need to make
the time ste 1000x smaller..

cheers
Jan

2016-11-16 12:47 GMT+01:00 Huihuang Xia <
<email address hidden>>:

> New question #404127 on Yade:
> https://answers.launchpad.net/yade/+question/404127
>
> Hi,
> I simulated a steel ball impacted on a particle assembly at a high speed,
> but my code got an error, that is the steel ball not move. My codes is as
> follows, please help me to solve this problem. Many thanks!
>
>
> from yade import pack
> ##### define materials for particles and mill #####
> rock=O.materials.append(CohFrictMat(young=5.98e7,poisson=0.3,density=2678,
> frictionAngle=0.5,normalCohesion=1.2e10,shearCohesion=1.2e9,
> momentRotationLaw=True))
> steel=O.materials.append(FrictMat(young=3.06e11,poisson=0.29,density=7861,
> frictionAngle=0.545))
>
> ##### create partciles assembly #####
> pred=pack.inAlignedBox((-0.1,-0.1,-0.1),(0.1,0.1,0.1))
> spheres=pack.randomDensePack(pred,radius=0.005,rRelFuzz=0.
> 3,spheresInCell=1500,material=rock,color=(1,0,1))
> O.bodies.append(spheres)
> ##### create a rigid ball #####
> ball=O.bodies.append(sphere(center=(0,0,0.5),radius=0.1,
> color=(0,1,1),material=steel))
> ball.blockedDOFs='xyXYZ'
> ball.state.vel=Vector3(0,0,-1) ##### set velocity along axis-Z
> O.engines=[
> ForceResetter(),
> InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
> InteractionLoop(
> [Ig2_Sphere_Sphere_ScGeom6D(interactionDetectionFactor=1.
> 1)],
> [Ip2_FrictMat_FrictMat_FrictPhys(),Ip2_CohFrictMat_
> CohFrictMat_CohFrictPhys(setCohesionNow=True)],
> [Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom6D_
> CohFrictPhys_CohesionMoment()]
> ),
> NewtonIntegrator(damping=0.3,gravity=(0,0,-9.81))
> ]
>
> from yade import qt
> qt.View()
> qt.Controller()
> #qt.Renderer().shape=0
> #qt.Renderer().intrPhys=1
> O.dt=0.001*PWaveTimeStep()
>
> --
> You received this question notification because your team yade-users is
> an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Huihuang Xia (huihuangxia) said :
#2

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