← Back to team overview

yade-users team mailing list archive

[Question #679203]: Dimensions of packing

 

New question #679203 on Yade:
https://answers.launchpad.net/yade/+question/679203

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())


-- 
You received this question notification because your team yade-users is
an answer contact for Yade.