Gengerate Sample using Gengeo

Asked by Henry

Hello All,
    I'm generating a sample using the function "generatePacking" (Gengeo), why there are so many bigger hole without particles?
   And is there any way to control the void ratio of the sample? or is there some way to expand the particles to let the void ratio reached a value like PFC3D?
   Thanks a lot!

Question information

Language:
English Edit question
Status:
Solved
For:
ESyS-Particle Edit question
Assignee:
No assignee Edit question
Solved by:
Henry
Solved:
Last query:
Last reply:
Revision history for this message
Henry (wenjiexu) said :
#1

the code of my gengeo file is :

from gengeo import *

#An example python script to generate a bonded rectangle of particles with a discrete fracture network included

width =1
height =2
maxRadius =0.05
# Define region extremities:
minPoint = Vector3(0.0,0.0,0.0)
maxPoint = Vector3(width,height,0.0)

# Define the geometrical constraints for packing
# (e.g. lines bordering a rectangular region in 2D)
# QUESTION: Is there a particular order for defining endpoints of lines?
top_line = Line2D (
   startPoint = Vector3(width,0.0,0.0),
   endPoint = minPoint
)

bottom_line = Line2D (
   startPoint = maxPoint,
   endPoint = Vector3(0.0,height,0.0)
)

left_line = Line2D (
   startPoint = Vector3(width,0.0,0.0),
   endPoint = maxPoint
)

right_line = Line2D (
   startPoint = minPoint,
   endPoint = Vector3(0.0,height,0.0)
)

# Define the Volume to be filled with spheres:
# (e.g. a BoxWithLines2D)
box = BoxWithLines2D (
   minPoint = minPoint,
   maxPoint = maxPoint
)

box.addLine(top_line)
box.addLine(bottom_line)
box.addLine(left_line)
box.addLine(right_line)

# Create a multi-group neighbour table to contain the particles:
mntable = MNTable2D (
   minPoint = minPoint,
   maxPoint = maxPoint,
   gridSize = 2.5*maxRadius,
   numGroups = 1
)

# Fill the volume with particles:
packer = InsertGenerator2D (
   minRadius = 0.01,
   maxRadius = 0.05,
   insertFails = 50000,
   maxIterations = 50000,
   tolerance = 1.0e-10
)

packer.generatePacking( volume = box, ntable = mntable, groupID = 0, tag = 0)

# create bonds between neighbouring particles:
mntable.generateBonds(
   groupID = 0,
   tolerance = maxRadius,
   bondID = 0
)

wallBot=Line2D (
   startPoint = Vector3(-0.1*width,0.0,0.0),
   endPoint = Vector3(0.1*width,0.0,0.0)
)
mntable.tagParticlesAlongLine(
   line = wallBot,
   distance = 1.1*maxRadius,
   tag = 123,
   groupID = 0
)

wallTop=Line2D (
   startPoint = Vector3(-0.1*width,height,0.0),
   endPoint = Vector3(0.1*width,height,0.0)
)
mntable.tagParticlesAlongLine(
   line = wallTop,
   distance = 1.1*maxRadius,
   tag = 456,
   groupID = 0
)

#Add a discrete fracture network
brkLine = LineSegment2D (
   startPoint = Vector3(0.2*width,0.2*height,0.0),
   endPoint = Vector3(0.8*width,0.8*height,0.0)
)

mntable.breakBondsAlongLineSegment(
   lineSegment = brkLine,
   distance = maxRadius,
   tag = 0,
   groupID = 0
)

# write a geometry file
mntable.write(
   fileName = "geo_crack.geo",
   outputStyle = 1
)
# write a vtk file
mntable.write(
   fileName = "geo_crack.vtk",
   outputStyle = 2
)

Thanks a lot

Revision history for this message
Feng Chen (fchen3-gmail) said :
#2

Hi, Henry:

Do you intend to add the fracture to your packing?

brkLine = LineSegment2D (
   startPoint = Vector3(0.2*width,0.2*height,0.0),
   endPoint = Vector3(0.8*width,0.8*height,0.0)
)

Feng

Revision history for this message
Henry (wenjiexu) said :
#3

Dear Dr.Chen,
       Thanks, the fracture is added, but my problem is that there are many large hole (no parcticals )in the packing sample. How can I generate a sample with closed packing?

 Thanks!

Henry

Revision history for this message
Dion Weatherley (d-weatherley) said :
#4

Hi Henry,

I tried out your script and reproduced the bug with missing particles. This appears to be due to a known problem in gengeo when using a maximum particle radius significantly smaller than unity. I suspect the bug is related to round-off error.

The simple fix is to rescale your linear dimensions. I used a scaling factor of 20x. Consequently, I used:
width = 20
height = 40
maxRadius = 1.0
minRadius = 0.2

Also, you need to change your two tolerance parameters (in InsertGenerator2D and generateBonds) to around 1.0e-5 or 1.0e-6. This is particularly important for MNTable2D.generateBonds(..) because a too large tolerance will cause particles that are not nearest-neighbours to be bonded together. These bonds will generally break in the first timestep of a simulation and possibly result in numerical instability.

I hope this helps.

Cheers,

Dion

Revision history for this message
Dion Weatherley (d-weatherley) said :
#5

Hi Henry,

Regarding your question re: void ratio (or packing porosity): GenGeo uses a packing algorithm to fill a volume with non-overlapping spheres. The final void ratio is largely a function of the range of particle sizes. A broader range of sizes results in a lower void ratio. For practical reasons, the minimum porosity achievable by this method is around 20-25% when using minRadius ~ 0.1 x maxRadius.

PFC3D generates particle assemblies in a very different way, by expanding particles until a "theoretical" void ratio is achieved. This can only be done by having overlapping spheres for most choices of void ratio. It is not clear to me that such a packing is a reasonable analogue for a real specimen of the same void ratio.

Cheers,

Dion

Revision history for this message
Henry (wenjiexu) said :
#6

Dear Dion,
    Many thanks for your help!
   Beat Regard!

Henry