Dimensions of packing

Asked by Othman Sh

Hi All,

I have a code that generate a cloud of spheres in a cylinder facet and then compact the spheres to a certain porosity. After compaction, I would like to know the height of the compacted spheres. Can you please give some suggestions on how to do that?

Below is my code.

Thank you,
Othman

from yade import plot,pack, export, ymport

targetp = .3 ##specify the targeted porosity

##specimen geometry
radiuscyl=.05
heightcyl=.203*4
SphereRadius = .0045
# material parameters

O.materials.append(FrictMat(young = 5e10, poisson = 0.15,frictionAngle = atan(.2), density=1920))

############################ spheres #############################

sp=pack.SpherePack()
sp.makeCloud((0,0,0),(.3,.3,1),rMean=SphereRadius,rRelFuzz=.3,periodic=True)
#### cylinder extraction
pred=pack.inCylinder((.2,.2,0),(.2,.2,heightcyl),radiuscyl)
spFilter=filterSpherePack(pred,sp,Material=Material, returnSpherePack=True)
spFilter.toSimulation()
print ('porosity = ', utils.porosity())

############################ facets #############################

facets=geom.facetCylinder((.2,.2,heightcyl/2),radiuscyl,heightcyl,segmentsNumber=50,wallMask=4)

cylinder=O.bodies.append(facets)
yade.qt.View()

##creating disks

d1=geom.facetCylinder((.2,.2,heightcyl),radiuscyl-.001,0,segmentsNumber=50,wallMask=1)
d2=geom.facetCylinder((.2,.2,0),radiuscyl-.001,0,segmentsNumber=50,wallMask=1)

disk1IDs= O.bodies.append(d1)
disk2IDs= O.bodies.append(d2)

for i in disk1IDs:
 body= O.bodies[i]
 body.state.vel = (0,0,-10)

for n in disk2IDs:
 body= O.bodies[n]
 body.state.vel = (0,0,10)

############################ compaction #############################
O.dt=.5*utils.PWaveTimeStep()
enlargeFactor=1.5
O.engines=[
 ForceResetter(),
 InsertionSortCollider([
  Bo1_Sphere_Aabb(aabbEnlargeFactor=enlargeFactor,label='bo1s'),
  Bo1_Facet_Aabb()
 ]),
 InteractionLoop(
  [
   Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=enlargeFactor,label='ss2d3dg'),
   Ig2_Facet_Sphere_ScGeom(),
  ],
  [

   Ip2_FrictMat_FrictMat_FrictPhys(),
   Ip2_FrictMat_FrictMat_FrictPhys(),
  ],
  [

   Law2_ScGeom_FrictPhys_CundallStrack(),
  ],
 ),
 #PyRunner(iterPeriod=1,command="addForces()"),
 NewtonIntegrator(damping=.3),

 PyRunner(iterPeriod=500,command='stop()'),
 PyRunner(command='P()',iterPeriod=500)
]

# reset interaction detection enlargement
bo1s.aabbEnlargeFactor=ss2d3dg.interactionDetectionFactor=1.0
def P():
   print ('porosity = ', utils.porosity())

def stop():
   if utils.porosity()<targetp:
 O.pause()
 print 'Finished'
 for i in disk1IDs: O.bodies.erase(i)
 for i in disk2IDs: O.bodies.erase(i)
 for i in cylinder: O.bodies.erase(i)
 print ('unbalanced forces = ', utils.unbalancedForce())

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Othman Sh
Solved:
Last query:
Last reply:
Revision history for this message
Robert Caulk (rcaulk) said :
#1

Hello,

You can use utils.aabbExtrema() to retrieve packing dimensions [1].

[1]https://yade-dev.gitlab.io/trunk/yade.utils.html#yade._utils.aabbExtrema

Revision history for this message
Jérôme Duriez (jduriez) said :
#2

Hi,

And one step shorter than aabbExtrema() : aabbDim() !

https://yade-dev.gitlab.io/trunk/yade.utils.html#yade.utils.aabbDim

Revision history for this message
Othman Sh (othman-sh) said :
#3

You guys are awesome!. Thank you. That solved my problem.

Best,
Othman