#cylinderGeom.py:
#===============
#
# A GenGeo script to construct a cylinder of bonded DEM particles
#
# D. Weatherley, UQ, 2018.
#
#import the gengeo module:
from gengeo import *

#Model Parameters:
cylRadius = 5.0		#radius of the cylinder to pack with particles
cylHeight = 10.0	#length of the cylinder to pack with particles

Rmin = 0.2		#minimum DEM particle radius
Rmax = 0.5		#maximum DEM particle radius

#specify the spatial domain boundaries:
domainMinPt = Vector3 (-1.*cylRadius,0,-0)
domainMaxPt = Vector3(cylRadius,2*cylRadius,cylHeight)

#define the cylinder volume:
cylinder = CylinderVol (
   origin = Vector3 (0,cylRadius,0),
   axis = Vector3 (0,0,1),
   length = cylHeight,
   radius = cylRadius
)

#construct a neighbour table to store particles inserted into the cylinder:
mntable = MNTable3D (
   minPoint = domainMinPt,
   maxPoint = domainMaxPt,
   gridSize = 2.5*Rmax,
   numGroups = 1
)

#construct a packer for inserting particles into the neighbour table:
packer = InsertGenerator3D (
   minRadius = Rmin,
   maxRadius = Rmax,
   insertFails = 10000,
   maxIterations = 100,
   tolerance = 1.0e-6,
   seed = True
)

#generate a packing of spheres (particleTag=1) within the cylindrical volume:
packer.generatePacking (
   volume = cylinder,
   ntable = mntable,
   groupID = 0,
   tag = 1
)

#generate bonds (with bondTag = 1) between adjacent particles:
mntable.generateBonds (
   groupID = 0,
   tolerance = 1.0e-5,
   bondID = 1
)

#tag particles near the base of the cylinder with tag=2:
mntable.tagParticlesAlongPlane (
   plane = Plane (origin = Vector3(0,0,0), normal = Vector3(0,1,0)),
   distance = 1.25*Rmax,
   tag = 2,
   groupID = 0
)

#write the geometry in ESyS-Particle format:
mntable.write("cylinder.geo",1)

#write the geometry in VTK format for visualisation purposes:
mntable.write("cylinder.vtu",2)
GlossyBlue theme adapted by David Gilbert
Powered by PmWiki
www.000webhost.com