I am trying to create a simulation within yade with different sphere radius to fall by gravity into a container
import random
import math
from yade import geom, pack, plot
# create cylindrical body with radius 6 cm and height 6.05 cm
cylinder = yade.geom.
O.bodies.
# create empty sphere packing
sp = pack.SpherePack()
# specify the radii and ratios
radii_ratios = [(0.000075, 0.04), (0.0006, 0.06), (0.00236, 0.05), (0.00475, 0.35), (0.0095, 0.20), (0.0125, 0.30)]
# generate spheres with specified radii and ratios
for r, ratio in radii_ratios:
num_spheres = int(ratio * 1000)
sp.makeCloud
# add the sphere pack to the simulation
sp.toSimulation()
O.engines = [ForceResetter(),
InsertionSort
InteractionLoop(
# handle sphere+sphere and facet+sphere collisions
),
NewtonIntegra
]
O.dt = 2 * PWaveTimeStep()
# run the simulation for 1000 steps
O.run(1000)
# calculate the volume of the packing
volume_packing = 0
num_spheres = 0
for b in O.bodies:
if isinstance(b.shape, yade.wrapper.
volume_
num_spheres += 1
# calculate the volume of the cylinder
volume_cylinder = math.pi * 0.06**2 * 0.0605
# calculate the porosity and porosity percentage
porosity = (volume_cylinder - volume_packing) / volume_cylinder
porosity_percent = porosity * 100
print("Number of spheres:", "{:.2f}
print("V Packing:", "{:.2f}
print("V Cylinder:", "{:.2f}
print("Porosity:", "{:.2f}
print("Porosity:", "{:.2f}
I was able to complete the simulation but the simulation doesn't fully packed and V packing and V cylinder are calculated as 0
Is there any guide on how to make the sphere pack better in the container?
Why does the calculation is calculated as 0?
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jan Stránský
- Solved:
- Last query:
- Last reply: