# How to glue spheres to the box?

Asked by Chien-Cheng Hung on 2020-03-22

Dear all,

I am trying to simulate direct shear experiments.

In my simulation, the periodic boundary condition is applied and in addition, the top and bottom are confined by a box.
To simulate a rough boundary surface similar to the experiment conditions, I tried to glue some spheres on the box.
I thought "clump" spheres and boxes together could be a feasible way. However, it seems not to work (or maybe I did it wrong).
It turns out the spheres penetrate into the box during isotropic compression.
I also tried to glue them together by playing with cohesive, but the contact model I use is a non-cohesive Hertz contact model.

I am wondering if there are other ways I can glue the spheres and box together and therefore, the glued material can also act as confinement. Thanks!

Hereby I attach the simplified code:

##########################
from yade import pack
import math

sp=pack.SpherePack()

O.periodic=True

length=0.75
height=0.375
width=0.375
PI=1.e5
spFRIC=26.6

O.cell.hSize=Matrix3(length,0,0,0,3*height,0,0,0,width)

upBoundary=[]
lowBoundary=[]

### Creat top and bottom box
upBoundary.append(O.bodies.append(utils.box(center=(length/2,2*height+thickness,1.5*width),orientation=Quaternion(1,0,0,0),extents=(2*length,thickness/2.,width),fixed=1,wire=True,color=(1,0,0),material='boxMat')))
lowBoundary.append(O.bodies.append(utils.box(center=(length/2,height-thickness,1.5*width),orientation=Quaternion(1,0,0,0),extents=(2*length,thickness/2.,width),fixed=1,wire=True,color=(1,0,0),material='boxMat')))

### Roughness setting
wallLength=15
wallWidth=10
roughnessPara=2

### top spheres
for c in range(1, wallLength):
for d in range(0, wallWidth):

### low spheres
for a in range(1, wallLength):
for b in range(0, wallWidth):

### Clump spheres and box together
idClump1=O.bodies.clump(upBoundary)
idClump2=O.bodies.clump(lowBoundary)

sphere_id = O.bodies.append([utils.sphere(s[0],s[1],color=(0,0,1),material='boxMat') for s in sp])

effCellVol=(O.bodies[idClump1].state.pos[1]-O.bodies[idClump2].state.pos[1])*O.cell.hSize[0,0]*O.cell.hSize[2,2]
volRatio=(O.cell.hSize[0,0]*O.cell.hSize[1,1]*O.cell.hSize[2,2])/effCellVol

O.engines=[
ForceResetter()
,InsertionSortCollider([Bo1_Box_Aabb(),Bo1_Sphere_Aabb()],verletDist=-0.1,allowBiggerThanPeriod=True)
,InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Box_Sphere_ScGeom6D()],
[Ip2_FrictMat_FrictMat_MindlinPhys()],
[Law2_ScGeom_MindlinPhys_Mindlin()]
)
,GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=1,timestepSafetyCoefficient=0.8,defaultDt=utils.PWaveTimeStep())
,NewtonIntegrator(gravity=(0,0,0),damping=0.3,label='newton')
]

def triaxDone():
global phase
vol=h*O.cell.hSize[0,0]*O.cell.hSize[2,2]
contactStress=getStress(vol)
vol_s=Rmean=Rmax=nbSph=0
Rmin=1e6
for o in O.bodies:
if isinstance(o.shape,Sphere):
nbSph+=1
Rmean=Rmean/nbSph
O.pause()

#####################

Cheers,
Chien-Cheng

## Question information

Language:
English Edit question
Status:
For:
Assignee:
No assignee Edit question
Last query:
2020-03-23
2020-03-24
 Jan Stránský (honzik) said on 2020-03-23: #1

Hi,

> However, it seems not to work

please be more specific.
I have tried your code, and it seemed to work ok (the box and boundary particles behaved like rigid body)

> It turns out the spheres penetrate into the box

if this is the problem, then it is probably due to stiffness and/or loading conditions

cheers
Jan

 Chien-Cheng Hung (chiencheng) said on 2020-03-23: #2

Hi Jan,

> please be more specific. I have tried your code, and it seemed to work ok (the box and boundary particles behaved like rigid body)

Sorry for the vague description. What I mean is after pressing the "play" button, isotropic compression begins and the spheres penetrate into the box. If I use walls as top and bottom boundaries instead of the clump, I can successfully confine the spheres within the middle space without any penetrating issue happen. It's not the thing whether the box and boundary particles behaved like a rigid body or not.

> if this is the problem, then it is probably due to stiffness and/or loading conditions

I am wondering whether I can "turn off" the periodic boundary condition in the Y direction to avoid this issue. Do you know how to do that?

Thanks again!

Chien-Cheng

 Jan Stránský (honzik) said on 2020-03-24: #3

> If I use walls as top and bottom boundaries instead of the clump, I can successfully confine the spheres within the middle space without any penetrating issue happen.

I **think**, that the boundary spheres are "more sparse" and the free particles are easier penetrated than in the case of walls

> I am wondering whether I can "turn off" the periodic boundary condition in the Y direction to avoid this issue. Do you know how to do that?

I am not sure if the problem is related to periodicity in y direction..
Anyway, "turn off" periodicity in one direction is achieved by enlarging sufficiently the periodic cell

cheers
Jan

## Can you help with this problem?

To post a message you must log in.