Facet mesh

Asked by Nishant

Dear All,

I am trying to understand the interaction between a facetbox and sphere.

A sphere falls under gravity in a box. The base of the box can be made of finer facetmesh. When the sphere interacts in the box, I expect one real interaction.

The script:
#--------------------------------------------------
#--------------------------------------------------

from yade import pack, qt, export
import numpy as np

#-----
##Defining Box
O.periodic=False

O.bodies.append(geom.facetBox(center=(0.5,0.5,0.5),extents = (0.5,0.5,0.5), wallMask=1+2+4+8+32 )) # Facetbox except the base

N_mesh = 1 # Change this to 2,3,.. to refine mesh at the bottom
for iX in range(N_mesh):
 for iY in range(N_mesh):
  O.bodies.append(geom.facetBox(center=( 1.0/float(N_mesh)*(iX+0.5), 1.0/float(N_mesh)*(iY+0.5), 0.5),extents = ( 0.5/float(N_mesh), 0.5/float(N_mesh), 0.5), wallMask=16) )

#-----
O.bodies.append([sphere((0.5,0.5,0.2001),radius=0.2)]) # add a sphere

#-----
##Engine Definition

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()],allowBiggerThanPeriod=True),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()]
   ),
 PyRunner(command = 'output()', iterPeriod = 1, label = "checker"),
 NewtonIntegrator(gravity=(0,0,-9.81),damping=0.0)
]

#-----

def output():
 if (O.iter < 20):
  count_intrs = 0.0
  for i in O.interactions:
   if i.isReal:
    count_intrs += 1.0
  print "time:", O.time, "Sphere position", (O.bodies[-1].state.pos[2]), "contacts", count_intrs, "force", O.forces.f(O.bodies[-1].id)[2]
 else:
  print "done"
  O.pause()

#-----

O.dt = 5e-1*PWaveTimeStep()
O.run()

#--------------------------------------------------
#--------------------------------------------------

When N_mesh = 1 (corresponding to facetbox with 6 sides), I get two interactions of sphere with the bottom. For N_mesh>1 (say N_mesh = 2) I get 6 interactions.

* I expect just one 'real' interaction in all cases. How can I achieve this in output?

* The force on the sphere is different for different mesh. The position in time is also slightly different for the two cases. What I am doing wrong here?

* I read sometime ago on this launchpad that facetmesh should be fine at the edges and corners for a better result - I can not find it anymore. Someone has an idea about how fine I should make a facet surface?

Look forward to your input.
Thank you
Nishant

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
Jérôme Duriez (jduriez) said :
#1

Hi,

- with N_mesh = 1, the bottom of your box is still divided into two facet bodies (with ids 10 and 11). Your sphere seems to be just in the middle, and it turns out it will interact with both halves of this bottom, ie the two facet bodies 10 and 11

Hence two interactions in this case (make your sphere fall " right in the middle" of one facet body and you would get only one interaction)

- with N_mesh = 2, the bottom of your box is divided into even more (smaller) facet bodies. There are 6 facet bodies that touch each other at the middle point of the box bottom. The sphere will interact will all of those.

Hence 6 interactions in this case

- playing with this number of bodies, forming the box bottom, then corresponds to simulating a sphere falling on a mattress made of 2, or 6, springs.
Since the springs will maybe always have the same stiffness (? you have to check I'm not familiar with facet- interactions), this could explain the different dynamics (resultant force on the sphere and its position with time) you observe in your simulations

Revision history for this message
Nishant (nishantk) said :
#2

Dear Jérôme,

Thank you for the reply.

I understand your point on number of contacts -- this can be resolved in the post-processing stage if sphere interacts with ANY member of the facetbox, count just one interaction. My issue is the force acting on the sphere.
But about the force acting on the sphere is the problem.

Consider this example:

#--------------------------------------------------

from yade import pack, qt, export
import numpy as np

#-----
##Defining Box
O.periodic=False

# No side boundaries this time, just a plane!
O.bodies.append(geom.facetBox(center=(0.5,0.5,0.5),extents = (0.5,0.5,0.5), wallMask= 16)) # Facetbox except the base

#-----
O.bodies.append([sphere((0.7,0.5,0.2001),radius=0.2)]) # add a sphere # Other case
#O.bodies.append([sphere((0.5,0.5,0.2001),radius=0.2)]) # add a sphere

#-----
##Engine Definition

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()],allowBiggerThanPeriod=True),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()]
   ),
 PyRunner(command = 'output()', iterPeriod = 1, label = "checker"),
 NewtonIntegrator(gravity=(0,0,-9.81),damping=0.0)
]

#-----

def output():
 if (O.iter < 20):
  count_intrs = 0.0
  for i in O.interactions:
   if i.isReal:
    count_intrs += 1.0
  print "time:", O.time, "Sphere position", (O.bodies[-1].state.pos[2]), "contacts", count_intrs, "force", O.forces.f(O.bodies[-1].id)[2]
 else:
  print "done"
  O.pause()

#-----

O.dt = 5e-1*PWaveTimeStep()
O.run()

#--------------------------------------------------
#--------------------------------------------------

When sphere is at (0.7,0.5,0.2001), it interacts with just one facet and this one spring (equivalent to sphere-plane interaction) - consistent with what we expect.
When it is at (0.5,0.5,0.2001), there are two springs from two facets.

So what you say is correct: different springs acting on sphere and thus different forces and different time of contact!

Do you have idea how can we resolve this issue, so that the force on sphere with time is same for the two cases?

Thanks

PS: I expect this is more complicated when a sphere just falls at the base joint made of two different materials

Revision history for this message
Best Jan Stránský (honzik) said :
#3

Hello Nishant,

> Do you have idea how can we resolve this issue

AFAIK PFacet should solve this issue, but I am not familiar with them. Please read documentation or see corresponding examples or open a new question concerning how to use PFacet in case you are interested.

cheers
Jan

Revision history for this message
Nishant (nishantk) said :
#4

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