Add bond between boudnary particles and inner particles

Asked by Jiadun Liu

Dear All,

In my script, the particles are generated in three steps.
Firstly, the inner particles are generated, and the inner particles are inserted into new MNTable2D.
Secondly, the boundary particles are generated.
Thirdly, the bonds are generated.

However, there seems some long-range bond between boundary particles and inner particles.

The long-range bond could be seen in https://www.dropbox.com/s/pig6y1pdeixc4xs/long_range%20bond.png?dl=0.

The script is as follows.
from gengeo import *
# - input parameters --
# block dimensions
halfLength = 80.0

# particle size range
minRadius = 1.0
maxRadius = 5.0
# ---------------------

# corner points
minPoint = Vector3(-halfLength,-halfLength,0.0)
maxPoint = Vector3(halfLength,halfLength,0.0)
# neighbour table
mntable = MNTable2D(minPoint,maxPoint,2.5*maxRadius,1)
# block volume
box = BoxWithLines2D(minPoint,maxPoint)
# boundary lines
leftLine=Line2D(Vector3(-1.0*halfLength,halfLength,0.0),Vector3(-halfLength,-halfLength,0.0))
bottomLine=Line2D(Vector3(-halfLength,-halfLength,0.0),Vector3(halfLength,-halfLength,0.0))
rightLine=Line2D(Vector3(halfLength,-halfLength,0.0),Vector3(halfLength,halfLength,0.0))
topLine=Line2D(Vector3(halfLength,halfLength,0.0),Vector3(-halfLength,halfLength,0.0))

# add them to the box
box.addLine(leftLine)
box.addLine(bottomLine)
box.addLine(rightLine)
box.addLine(topLine)

# -- setup packer --
# iteration parameters
insertFails = 100000
maxIter = 100000
tol = 1.0e-6

# packer
packer = InsertGenerator2D( minRadius,maxRadius,insertFails,maxIter,tol,False)

# pack particles into volume
packer.generatePacking(box,mntable,0,1)

## get particleList and remove
particleList = mntable.getSphereListFromGroup(groupID=0)
ID= mntable.getNumParticles(groupID=0)
for pp in particleList:
 pp.setTag(1)
mntable.removeTaggedParticles(groupID=0,tag=1,mask=0)

##new mntable
# corner points
halfLength = 85.0
minPoint = Vector3(-halfLength,-halfLength,0.0)
maxPoint = Vector3(halfLength,halfLength,0.0)
# neighbour table
mntable = MNTable2D(minPoint,maxPoint,2.5*maxRadius,1)
# block volume
box = BoxWithLines2D(minPoint,maxPoint)
# boundary lines
leftLine=Line2D(Vector3(-1.0*halfLength,halfLength,0.0),Vector3(-halfLength,-halfLength,0.0))
bottomLine=Line2D(Vector3(-halfLength,-halfLength,0.0),Vector3(halfLength,-halfLength,0.0))
rightLine=Line2D(Vector3(halfLength,-halfLength,0.0),Vector3(halfLength,halfLength,0.0))
topLine=Line2D(Vector3(halfLength,halfLength,0.0),Vector3(-halfLength,halfLength,0.0))

# add them to the box
box.addLine(leftLine)
box.addLine(bottomLine)
box.addLine(rightLine)
box.addLine(topLine)

# renew mntable
# corner points
minPoint = Vector3(-halfLength,-halfLength,0.0)
maxPoint = Vector3(halfLength,halfLength,0.0)
# neighbour table
mntable = MNTable2D(minPoint,maxPoint,2.5*maxRadius,1)

#insert inner particles in to New MNTable
for pp in particleList:
 pp.setTag(1)
 mntable.insert(pp,0)

#generate lower left conner particle
mySphere = Sphere(centre=Vector3(-82.0,-82.0,0.0),radius=2)
mySphere.setTag (2)
mySphere.setId(ID)
mntable.insert(mySphere,0)

#dimensions for boundary particles

# block dimensions
xmin = -82.0
ymin = -82.0
zmin = -82.0

xmax = 82.0
ymax = 82.0
zmax = 82.0

xdim = xmax - xmin
ydim = ymax - ymin
zdim = zmax - zmin

# particle size range
overlap = 0.00
minRadius = 2.0 #0.8
maxRadius = 8.0 #1.2
# maximum number of particle in three directions
N_X = int(xdim/(2*minRadius))
N_Y = int(ydim/(2*minRadius))
N_Z = int(zdim/(2*minRadius))

#bottom boundary
for i in range(1,N_X):
 j = 0
 ID += 1
 mySphere = Sphere(centre=Vector3(-82+i*2*minRadius, -82, 0), radius=minRadius+overlap)
 mySphere.setTag (5)
 mySphere.setId(ID)
 mntable.insert(mySphere,0)
print "bottom boundary Id: ", ID
print "total number of particles: ",mntable.getNumParticles(groupID=0)

# create bonds between neighbouring particles:
mntable.generateBonds(0,1.0e-5,0)

# write a geometry file
mntable.write("smooth_box.geo", 1)
mntable.write("smooth_box.vtu", 2)

# write a geometry file
mntable.write("smooth_box.geo", 1)
mntable.write("smooth_box.vtu", 2)

Best regards,
Jiadun

Question information

Language:
English Edit question
Status:
Expired
For:
ESyS-Particle Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.