Lack of recoil in sphere-pfacet impact?

Asked by Andrea Puglisi

I am studying the interaction of pfacets with other objects, since I have it not completely clear in my mind. I've seen that pfacets interact "apparently realistically" with other pfacets. However I have an example where a sphere collides with a pfacet, bounces back correctly but does not transfer any momentum to the pfacet (no nodes or connections move after the end of the impact). Why?

This is my code

-----------------------------------------------------------------------------------------------------------------------

from yade.gridpfacet import *
from yade import pack,ymport,export,geom,bodiesHandling,qt

vr=0.2
vh=0.4
rr=0.02

phimat=30. # friction angle
E=1e8 # Young's modulus

f = open("state.dat", "w")

intf = 0

def state(si,intf):
  if (len(O.interactions.withBody(si))>0):
    forc = O.interactions.withBody(si)[0].phys.normalForce[1]
  else:
    forc = 0
  intf += forc*O.dt/O.bodies[si].state.mass
  f.write ("%d %f %f %f %f\n" % (O.iter,O.bodies[si].state.se3[0][1],O.bodies[si].state.vel[1],forc,intf))
  # tempo coord y sfera vel y sfera forza sulla sfera integr-forza
  f.flush()
  return intf

#### Engines ####
O.engines=[
        ForceResetter(),
        InsertionSortCollider([
                Bo1_Sphere_Aabb(),
                Bo1_Wall_Aabb(),
                Bo1_PFacet_Aabb(),
                Bo1_Facet_Aabb(),
        ]),
        InteractionLoop(
                [
                  Ig2_GridNode_GridNode_GridNodeGeom6D(),#internal = ScGeom6D
                 Ig2_Sphere_PFacet_ScGridCoGeom(), #cyl-facet
                 Ig2_Wall_Sphere_ScGeom(),#cyl-wall
                 Ig2_Wall_PFacet_ScGeom(),
                 Ig2_PFacet_PFacet_ScGeom(),
                 Ig2_Sphere_Sphere_ScGeom(),
                 Ig2_Facet_Sphere_ScGeom(),
                ],
                [
                  Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False),
                 Ip2_FrictMat_FrictMat_FrictPhys()
                ],
                [
                  Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),
                 Law2_ScGeom_FrictPhys_CundallStrack(),
                ]
        ),
        NewtonIntegrator(gravity=(0.,0,0),damping=0),
# qt.SnapshotEngine(fileBase='experiment',iterPeriod=2000,label='snapshot'),
        PyRunner(command='intf = state(sphId,intf)',iterPeriod=1), # call myFunction every 100 steps
]

#### Creat materials ####
O.materials.append( CohFrictMat( young=E*1e2,poisson=0.3,density=100,frictionAngle=radians(phimat),normalCohesion=1e10,shearCohesion=1e10,momentRotationLaw=True,label='cMat' ) ) # material to create the gridConnections
O.materials.append( FrictMat( young=E,poisson=0.3,density=1000,frictionAngle=radians(phimat),label='fMat' ) ) # material for general interactions

##### Create ONE WALL #####
xw = 0
yw = 0
lwall = 10*vr
hwall = 2*vh

v1=Vector3(xw,yw,0)
v2=Vector3(xw+lwall,yw,0)
v3=Vector3(xw,yw,hwall)
vertices=[v1,v2,v3]
pfacetCreator1(vertices,rr,nodesIds=[],cylIds=[],pfIds=[],wire=False,color=[1,1,1],fixed=False,materialNodes='cMat',material='fMat')

#sphId = O.bodies.append(sphere([xw+lwall/3.,yw+rr*4,hwall/3.], radius=rr,color=(1,0,0)))
sphId = O.bodies.append(sphere([0,rr*4,0], radius=rr,color=(1,0,0)))

O.bodies[sphId].state.vel = Vector3(0,-0.1,0)

#### For viewing ####
from yade import qt
qt.View()
Gl1_Sphere.stripes=True
qtr = qt.Renderer()

#### Set a time step ####
#O.dt=1e-05
O.dt=PWaveTimeStep() # non accurate time-step

#### Allows to reload the simulation ####
O.saveTmp()

Question information

Language:
English Edit question
Status:
Expired
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jérôme Duriez (jduriez) said :
#1

Hello,

for i in range(0,8):
  print O.bodies[i].state.blockedDOFs

shows that several of your bodies (including the pFacet itself) have all DOFs blocked, ie are non-dynamic [*] which is a general reason in YADE for bodies not to move even though they sustain forces.

(NB : you saw that there is a force on the sphere from the pfacet, we thus can assume -- and check if necessary -- there also is a force from the sphere on the pfacet)

I'm from far not familiar enough with pFacets to know if this is a bug in the pfacetCreator1() function you used with "fixed = False", or the "normal" behavior, or an error on your side.

I'd thus just advice here to look at pfacet examples (if not already done), and, mostly, to provide a really minimal (working) example to illustrate the behavior that annoys you. We do not need/want for instance the text file output : ideally MWE should fit in 10 lines, 20 maximum.

This would essentially help attracting other answers more familiar with pfacets ;-)

Jérôme

[*] https://yade-dem.org/doc/yade.wrapper.html?highlight=dynamic#yade.wrapper.Body.dynamic

Revision history for this message
Andrea Puglisi (andreo73) said :
#2

Dear Jérôme, thanks for your answer. Unfortunately I found no change in behavior after changing the variables O.bodies[i].state.blockedDOFs of the elements of the pfacet. Most importantly, I can exhibit many examples where the pfacet moves after interaction among themselves, even if their degrees of freedom (according to the variable blockedDOFs) are totally blocked. For instance

from yade.gridpfacet import *
from yade import pack,ymport,export,geom,bodiesHandling,qt

phimat=30. # friction angle
E=1e8 # Young's modulus

#### Engines ####
O.engines=[
        ForceResetter(),
        InsertionSortCollider([
                Bo1_Sphere_Aabb(),
                Bo1_Wall_Aabb(),
                Bo1_PFacet_Aabb(),
                Bo1_Facet_Aabb(),
        ]),
        InteractionLoop(
                [
                  Ig2_GridNode_GridNode_GridNodeGeom6D(),#internal = ScGeom6D
                 Ig2_Sphere_PFacet_ScGridCoGeom(), #cyl-facet
                 Ig2_Wall_Sphere_ScGeom(),#cyl-wall
                 Ig2_Wall_PFacet_ScGeom(),
                 Ig2_PFacet_PFacet_ScGeom(),
                 Ig2_Sphere_Sphere_ScGeom(),
                 Ig2_Facet_Sphere_ScGeom(),
                ],
                [
                  Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False),
                 Ip2_FrictMat_FrictMat_FrictPhys()
                ],
                [
                  Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),
                 Law2_ScGeom_FrictPhys_CundallStrack(),
                ]
        ),
  NewtonIntegrator(gravity=(0.,0,-0.01),damping=0),
]

O.materials.append( CohFrictMat( young=E*1e2,poisson=0.3,density=100,frictionAngle=radians(phimat),normalCohesion=1e10,shearCohesion=1e10,momentRotationLaw=True,label='cMat' ) )
O.materials.append( FrictMat( young=E,poisson=0.3,density=1000,frictionAngle=radians(phimat),label='fMat' ) )

##### Create two pfacets
rr=0.02

v1=Vector3(0,0,5)
v2=Vector3(0,1,5)
v3=Vector3(1,0,3)
vertices=[v1,v2,v3]
pfacetCreator1(vertices,rr,nodesIds=[],cylIds=[],pfIds=[],wire=False,color=[1,1,1],fixed=False,materialNodes='cMat',material='fMat')

v1=Vector3(-1,-1,0)
v2=Vector3(-1,2,0)
v3=Vector3(2,-1,0)
vertices=[v1,v2,v3]
pfacetCreator1(vertices,rr,nodesIds=[],cylIds=[],pfIds=[],wire=False,color=[1,1,1],fixed=True,materialNodes='cMat',material='fMat')

#### For viewing ####
from yade import qt
qt.View()
qtr = qt.Renderer()

#### Set a time step ####
O.dt=PWaveTimeStep() # non accurate time-step

#### Allows to reload the simulation ####
O.saveTmp()

------------------------------------------------------
(sorry I have no idea how ti make smaller examples)

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#3

Hi,
In the above example one facet is created with fixed=False, the other with fixed=True.
Consistently one is accelerated by gravity and the other is not.

What is maybe not clear for you is that only the nodes are really inertial. The so-called connections are not moving independently of the nodes, nor are the facets, so they are always non-dynamic objetcs.

Consistently (the first facet, the moving one, is composed of the first seven elements):

ade [6]: for b in O.bodies:
    print b.shape.__class__, b.state.blockedDOFs
     ...:
<class 'yade.wrapper.GridNode'>
<class 'yade.wrapper.GridNode'>
<class 'yade.wrapper.GridNode'>
<class 'yade.wrapper.GridConnection'> xyzXYZ
<class 'yade.wrapper.GridConnection'> xyzXYZ
<class 'yade.wrapper.GridConnection'> xyzXYZ
<class 'yade.wrapper.PFacet'> xyzXYZ
<class 'yade.wrapper.GridNode'> xyzXYZ
<class 'yade.wrapper.GridNode'> xyzXYZ
<class 'yade.wrapper.GridNode'> xyzXYZ
<class 'yade.wrapper.GridConnection'> xyzXYZ
<class 'yade.wrapper.GridConnection'> xyzXYZ
<class 'yade.wrapper.GridConnection'> xyzXYZ
<class 'yade.wrapper.PFacet'> xyzXYZ

Revision history for this message
Andrea Puglisi (andreo73) said :
#4

Dear Bruno, thanks for your comment. I understand what you mean and in fact I'm not surprised by the behaviour in my last posted code (pfacet-pfacet collision). My problem is with the code posted in my first message where a sphere collides with a pfacet e the (non-fixed) pfacet does not recoil. Any hint about that? Thanks
Andrea

Revision history for this message
Launchpad Janitor (janitor) said :
#5

This question was expired because it remained in the 'Open' state without activity for the last 15 days.