← Back to team overview

yade-users team mailing list archive

Re: [Question #171223]: Strange behavior of spheres colliding with a moving facet

 

Question #171223 on Yade changed:
https://answers.launchpad.net/yade/+question/171223

Christian Jakob posted a new comment:
Hello,

I think there is a time step problem. If the time step is to big, the
overlap between the sphere and the facet becomes too big within one
step. So it is possible, that the sphere gets a very big contact force
and bounces back much faster, than it hits. I created a very small
script for you, where you can see the effect:

#!/usr/bin/python
# -*- coding: utf-8 -*-

from yade import qt

#define material properties:
rho 	= 1000	#density
fric 	= 2		#friction coefficient
fric_angle = atan(fric)	#friction angle in radian
stiff_n = 1e8
stiff_s = 1e8
c_n 	= 0.0	#normal viscous damping
c_s 	= 0.0	#shear viscous damping
l_d		= 0.7	#local damping 


#define a material:
MyMaterial = O.materials.append(ViscElMat(kn=stiff_n, ks=stiff_s, \
cn=c_n, cs=c_s, density=rho, frictionAngle=fric_angle))

#create a sphere:
O.bodies.append(utils.sphere(center=(0,0,1), radius=0.5, material=MyMaterial))

#create a plane facet:
O.bodies.append(geom.facetBox(center=(0,0,0), extents=(1,1,0), fixed=True, material=MyMaterial))

#define engines:
O.engines=[
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),	#Axis-aligned bounding box
	InteractionLoop(
		[Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Facet_Sphere_ScGeom()],			#Interaction geometry
		[Ip2_ViscElMat_ViscElMat_ViscElPhys()],	#Interaction physics
		[Law2_ScGeom_ViscElPhys_Basic()],		#Contact law
	),
	GravityEngine(gravity=(0,0,-9.81)),
	NewtonIntegrator(damping=l_d),
	#qt.SnapshotEngine(fileBase='/home/me/YADE/my-yade-projects/sphere-and-facet/snaps/test-',label='snapper',iterPeriod=10),
]

#show geometry:
v=qt.View(); v.axes=True
v.viewDir=Vector3(0,1,-.05)
v.eyePosition=Vector3(0,-5,.5)

O.dt = 1e-3
O.run(1000)

#O.dt = 1e-6
#O.run(1000000)

#raw_input('press ENTER')
#utils.makeVideo(snapper.snapshots,out="video-sphere-and-facet.avi",fps=24)

#END of script##############################################

If you first run it with O.dt = 1e-3, the sphere bounces back very fast.
If you run it with O.dt = 1e-6, it seems to behave normal (bzr2877).
The same behavior should occur with using a fixed sphere instead of a facet (I did not test it)!

@Bruno:
I detected an bug in your new collider version!
If I run the script with O.dt = 1e-6 with bzr2877 the collision is ok, but with bzr2921 the sphere bounces back very fast, like in the O.dt = 1e-3 case. 

I hope it helps,

Christian

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.