Facet in the model disappears

Asked by Xue

Hello everyone!
I am trying to compact a mixed specimen of ball and polyhedra. In this process, I generate a facet as a compaction plate above the specimen. But when the platen was in contact with the specimen, it disappeared immediately.

Here is the script:
from yade import pack,qt,plot,utils,polyhedra_utils,ymport,export,pack,timing
from yade import *
import numpy
from pprint import pprint
import random
import math
from random import uniform
from random import randint
from math import *

matP = PolyhedraMat()
matP.density = 2650 #kg/m^3
matP.young = 5.5E9#Pa 5.5E9
#matP.young = 2.75 #Pa 1E7
matP.poisson = 0.25 # 20000/1E7
matP.frictionAngle = 0.7 #rad0.7
O.materials.append(matP)

steel= PolyhedraMat()
steel.density = 2600 #kg/m^3
steel.young = 15E9 #inital steel was 15E9
steel.poisson = 0.21
steel.frictionAngle = 0.2 #rad
O.materials.append(steel)

sphereballast = CohFrictMat()#
sphereballast.density = 2000
#sphereballast.young = 5.5E8
sphereballast.young = 3E8
sphereballast.possion = 0.5
sphereballast.frictionAngle = 0.364 #rad0.364
sphereballast.alphaKr = 2
sphereballast.etaRoll = 1
sphereballast.isCohesive = True
O.materials.append(sphereballast)

h=0
b=0.15 #if the shape or the size of the boundary need to change, dont forget the contact number in wall's velocity.
mpi=math.pi
O.bodies.append(geom.facetBox((0,-0.2,h+0.5*b),(0.162,0.05,0.5*b),material=steel))
O.bodies.append(geom.facetBox((0,0.2,h+0.5*b),(0.162,0.05,0.5*b),material=steel))
O.bodies.append(geom.facetBox((-0.2,0,h+0.5*b),(0.05,0.162,0.5*b),material=steel))
O.bodies.append(geom.facetBox((0.2,0,h+0.5*b),(0.05,0.162,0.5*b),material=steel))
O.bodies.append(geom.facetBox((0.14,0.14,h+0.5*b),(0.05,0.162,0.5*b),orientation=Quaternion((0,0,1),mpi/4),material=steel))
O.bodies.append(geom.facetBox((-0.14,0.14,h+0.5*b),(0.05,0.162,0.5*b),orientation=Quaternion((0,0,1),-mpi/4),material=steel))
O.bodies.append(geom.facetBox((0.14,-0.14,h+0.5*b),(0.05,0.162,0.5*b),orientation=Quaternion((0,0,1),-mpi/4),material=steel))
O.bodies.append(geom.facetBox((-0.14,-0.14,h+0.5*b),(0.05,0.162,0.5*b),orientation=Quaternion((0,0,1),mpi/4),material=steel))

O.bodies.append(utils.wall((0,0,0),2,sense=0,material=steel))

O.bodies.append(ymport.textPolyhedra('/tmp/mpack1.dat',material=matP))
O.bodies.append(ymport.textExt('/tmp/mnsphere1.dat',material=sphereballast))

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Polyhedra_Aabb(),Bo1_Wall_Aabb(),Bo1_Facet_Aabb(),Bo1_Sphere_Aabb()]),
 InteractionLoop(
  [Ig2_Polyhedra_Polyhedra_PolyhedraGeom(),Ig2_Sphere_Sphere_ScGeom(),Ig2_Sphere_Polyhedra_ScGeom(), Ig2_Facet_Polyhedra_PolyhedraGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom(),Ig2_Wall_Polyhedra_PolyhedraGeom()],
  [Ip2_PolyhedraMat_PolyhedraMat_PolyhedraPhys(), Ip2_FrictMat_PolyhedraMat_FrictPhys(),Ip2_FrictMat_FrictMat_FrictPhys(),Ip2_CohFrictMat_CohFrictMat_CohFrictPhys()],
  [Law2_PolyhedraGeom_PolyhedraPhys_Volumetric(),Law2_ScGeom_FrictPhys_CundallStrack(), Law2_ScGeom6D_CohFrictPhys_CohesionMoment()],
 ),
 NewtonIntegrator(damping=0.7,gravity=(0,0,-9.8)),
 PyRunner(command='Compact()',iterPeriod=1,label='step'),
 PyRunner(command='cycle()',iterPeriod=1),
]

global a
a=1

def Compact():
 global a
 if a == 1:
  ldpltheight=max([b.state.pos[2]+b.shape.radius for b in O.bodies if isinstance(b.shape,Sphere)])
  fa1=utils.facet([(0.15,0.15,ldpltheight),(-0.15,0.15,ldpltheight),(-0.15,-0.15,ldpltheight)],wire=False,material=steel)
  O.bodies.append(fa1)
  fa2=utils.facet([(0.15,0.15,ldpltheight),(0.15,-0.15,ldpltheight),(-0.15,-0.15,ldpltheight)],wire=False,material=steel)
  O.bodies.append(fa2)
  a=a+1
 elif a == 2:
  Lastnum1=O.bodies[-2].id
  O.bodies[Lastnum1].state.blockedDOFs='xyXYZ'
  O.bodies[Lastnum1].state.angVel=(0,0,0)
  O.bodies[Lastnum1].state.vel=[0,0,-0.5]
  Lastnum=O.bodies[-1].id
  O.bodies[Lastnum].state.blockedDOFs='xyXYZ'
  O.bodies[Lastnum].state.angVel=(0,0,0)
  O.bodies[Lastnum1].state.vel=[0,0,-0.5]

O.dt=0.000001

The vanishing facets I described above are fa1 and fa2. But as you can see, the boundaries in the model are also facets, and these facets work fine.
How did the above problem arise?
xue

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Karol Brzezinski
Solved:
Last query:
Last reply:
Revision history for this message
Best Karol Brzezinski (kbrzezinski) said :
#2

Hi,

without running the example, I can suspect that facets 'fly away' after the contact because they can :)
If you want to maintain the constant speed of the facets, just prescribe the speed, don't change degrees of freedom (still all DOFs should be fixed). I guess this is what you wanted to achieve.

But if you want the facets to act as dynamic bodies in the z-direction, you can set the DOFs as you did, but you need to prescribe some mass to the facets. Otherwise, any force divided by zero mass results in infinite acceleration.

Cheers,
Karol

Revision history for this message
Xue (1q12) said :
#3

Thanks Karol Brzezinski, that solved my question.