inertia calculation facetbox

Asked by Nishant

Hi,

I am performing compression test with a facetbox with mass. I assign masses to the 12 facets in the facetbox. Then I perform Updateclumpproperties step, and get mass and intertia of the facetbox.

Below is an example with a cube.
The mass of the box from yade is correct. I expect the interia tensor with identical components values in the three rotation axes for a cube. This is not the case though. Any idea?
---------------------------------------------
from yade import pack
import shutil, sys, imp
import numpy as np

density_box = 3000.0
Mat_box=O.materials.append(FrictMat(young=1e8,density=density_box,poisson=0.2,frictionAngle=np.arctan(0.0)))

L = 1.0;
M_total = density_box*L*L*L
box_id = []
box_id.append(O.bodies.append(geom.facetBox(center=(L/2.0,L/2.0,L/2.0),extents = (L/2.0,L/2.0,L/2.0), material = Mat_box, wallMask=63)))
box_id=sum(box_id,[])
O.bodies.clump(box_id)

for ijk in box_id:
 if isinstance(O.bodies[ijk].shape,Facet):
  O.bodies[ijk].state.mass = M_total/12.0
  O.bodies[ijk].state.inertia = (1/12.0)*(M_total/12.0)*Vector3(2.0*L*L,2.0*L*L,2.0*L*L)

O.bodies.updateClumpProperties(discretization=100)
print O.bodies[-1].state.mass
print O.bodies[-1].state.inertia

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Bruno Chareyre
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Robert Caulk (rcaulk) said :
#1

Hello,

To be honest, I am not sure. I've never seen someone clump facets together, but apparently it is possible.

If I were you, I would put a full engine list together and run a couple steps of a simulation before drawing any conclusions about body inertia. But that is a complete shot in the dark.

Best,

Robert

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

(re-posting answer sent to yade-users yesterday by mistake)
Hi,
Facets have positions which are not necessarily their center of mass, which makes the contribution mass*distance to inertia not fully consistent.

Note also (1) that discretization=100 is not a good idea since facets have no volume. Fortunately it seems to work still, for some reason, but I suggest discretization=0 to be sure.

Note also (2) that if you want to simulate dynamic polyhedra with clumped facets it will probably not work very well. Better use proper Polyhedra or clumped Pfacets.

Regards

Bruno

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

@Robert: Running the simulation for a longer time did not solve the problem.

@ Bruno: Thanks for the suggestion. I used Polyhedra, following some examples from the trunk, and is working well. Did not try Pfacets though.

Just to know: the Polyhedra in yade are dynamic in nature and are non-deformable bodies?

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

>I used Polyhedra

But this facet box you ask about is not a Polyedron (in yade's sense), right?

>the Polyhedra in yade are dynamic in nature and are non-deformable bodies?

Plain Polyhedra are dynamic rigid bodies (maybe breakable? I'm not sure now)
Pfacets polyhedra are also dynamic, they can be rigid or deformable.
Bruno

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

Thanks Bruno Chareyre, that solved my question.

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

Yes, facetbox is not a polyhedron (in yade sense).

I was looking for an object that interact with the particle bed and is dynamic in nature.
Polyhedron, so far working well.

Thank Bruno!

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

Hello,

I was understanding how polyhedron interacts with sphere in yade and encountered a problem with the dictionary of the interaction.

I created a system with one sphere and a box (made by polyhedron). The box touches the sphere from the bottom and has a velocity. I look at the interaction between the box and sphere after a time step. Below is the MWE:

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

from yade import pack,polyhedra_utils
import shutil, sys, imp
import numpy as np

#------------------- System definition ----------------------
rad_p = 0.1
Xl = 0.
Yl = 0.
Xr = 1.
Yr = 1.
Zl = rad_p
Zr = 1.
eps_pos = 1e-5
#--------------------------
O.bodies.append([sphere((0.5*(Xl+Xr)+eps_pos,0.5*(Yl+Yr),0.0),rad_p, fixed = True) ]) # Sphere object

O.bodies.append(polyhedron([(Xl,Yl,Zl),(Xr,Yl,Zl),(Xl,Yr,Zl),(Xr,Yr,Zl),(Xl,Yl,Zr),(Xr,Yl,Zr),(Xl,Yr,Zr),(Xr,Yr,Zr)],wire=False,dynamic=True)) # polyhedron which compresses the sphere
#------------------------------------

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(), Bo1_Box_Aabb(), Bo1_Wall_Aabb(), Bo1_Polyhedra_Aabb()],allowBiggerThanPeriod=True),
 InteractionLoop(
 [Ig2_Sphere_Sphere_ScGeom(), Ig2_Facet_Sphere_ScGeom(), Ig2_Wall_Sphere_ScGeom(), Ig2_Sphere_Polyhedra_ScGeom()],
 [Ip2_FrictMat_FrictMat_MindlinPhys()],
 [Law2_ScGeom_MindlinPhys_Mindlin()]
 ),
 PyRunner(command = 'load()', iterPeriod = 1, label = "checker"),
 NewtonIntegrator(gravity=(0,0,0.0),damping = 0.0)
]

def load():
 O.bodies[1].state.vel = Vector3(0,0,-1e-5)

 if ( O.iter > 3):
  O.pause()

#---------------------------
O.dt=.5e-0*PWaveTimeStep()
O.stopAtIter= int(1e6)
O.step()

#-------------------
Case I: If the sphere is positioned not at the center of box bottom face (non-zero eps_pos in the code above), O.interactions[0,1].phys.dict() gives correct interaction parameters.

Case II: When the sphere is located just at the center of the box (eps_pos = 0), there is an interaction between the two objects, but without any dictionary.

#Yade [1]: O.interactions[0,1].phys.dict()
#---------------------------------------------------------------------------
#AttributeError Traceback (most recent call last)
#/home/nishantkumar/Desktop/Yade201802b/build/bins/yade-2018.02b in <module>()
#----> 1 O.interactions[0,1].phys.dict()

#AttributeError: 'NoneType' object has no attribute 'dict'

Any reason for this?

Revision history for this message
Best Bruno Chareyre (bruno-chareyre) said :
#8
Revision history for this message
Nishant (nishantk) said :
#9

Thanks Bruno Chareyre, that solved my question.