How to fill a container with particles in STL format?

Asked by Irfaan Peerun on 2019-08-25

Hi everyone,

I have a single particle (irregular geometry) which is in STL format and I want to use it as a replacement for spheres to fill a container. Similar to the makecloud function.

I am aware that STL format can only be imported as facets.
The input command I used to import the single particle in STL format is as follows:
particle1 = O.bodies.append(ymport.stl('/directory of file.stl'))

The script below is a sample for generating spheres in a container. Greatly appreciate if anyone could provide some guidance on how to fill the container with the single particle, which is in STL format.

#Particle Generation Script
O=Omega()

# add a material type FrictMat
O.materials.append(FrictMat(young = 1E7, poisson = 0.25, frictionAngle = 0.6, density = 2650))

# Corners of the box
x_min, y_min, z_min = 0.0, 0.0, 0.0
x_max, y_max, z_max = 0.5, 0.2, 0.3

## Generate a container
# top wall
O.bodies.append(utils.box(center = [(x_min + x_max)/2, (y_min + y_max)/2, z_max], extents = [(-x_min +
x_max)/2, (-y_min + y_max)/2, 0], fixed = True, wire=True))
# bottom wall
O.bodies.append(utils.box(center = [(x_min + x_max)/2, (y_min + y_max)/2, z_min], extents = [(-x_min +
x_max)/2, (-y_min + y_max)/2, 0], fixed=True, wire=True))
# left wall
O.bodies.append(utils.box(center = [x_min, (y_min + y_max)/2, (z_min + z_max)/2], extents=[0, (-y_min
+ y_max)/2, (-z_min + z_max)/2], fixed=True, wire=True))
# right wall
O.bodies.append(utils.box(center = [x_max, (y_min + y_max)/2, (z_min + z_max)/2], extents=[0, (-y_min
+ y_max)/2, (-z_min + z_max)/2], fixed=True, wire=True))
# front wall
O.bodies.append(utils.box(center = [(x_min + x_max)/2, y_min, (z_min + z_max)/2], extents = [(-x_min +
x_max)/2, 0, (-z_min + z_max)/2], fixed=True, wire=True))
# behind wall
O.bodies.append(utils.box(center = [(x_min + x_max)/2, y_max, (z_min + z_max)/2], extents = [(-x_min +
x_max)/2, 0, (-z_min + z_max)/2], fixed=True, wire=True))

# Generate a cloud of spheres
sp=yade._packSpheres.SpherePack()
sp.makeCloud(Vector3(x_min, y_min, z_min), Vector3(x_max, y_max, z_max), 0.006, 0.2)
O.bodies.append([utils.sphere(s[0], s[1]) for s in sp])

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Irfaan Peerun
Solved:
2019-08-29
Last query:
2019-08-29
Last reply:
Irfaan Peerun (irfaan) said : #1

Just an update:

I have found that .stl would produce a facet and there can be no interaction between facet to facet.
Hence, I am going to use sphere clumping to reproduce similar geometry and volume of the .stl surface.

Irfaan Peerun (irfaan) said : #2

solved