Packing3D.jl: An open-source analytical framework for computing packing density and mixing indices using partial spherical volumes
Freddie J. Barter, Christopher R. K. Windows-Yule
Published: 2025/6/10
Abstract
Accurate quantification of local packing density and mixing in simulations of particulate systems is essential for many industrial applications. Traditional methods which simply count the number of particle centres within a given volume of space (cell) introduce discontinuities at cell boundaries, leading to unreliable measurements of packing density. We introduce Packing3D.jl, an open-source Julia package providing analytic partial-volume calculations for spheres intersecting Cartesian and cylindrical meshes. We derive closed-form solutions for single, double and triple spherical-cap intersections, plus sphere-cylinder overlaps. We implement efficient mesh-generation routines, principal-cell indexing, and data-splitting functions for time-series analyses. Performance and accuracy were validated against simple cubic and face-centred cubic lattices and via boundary-shift continuity tests. Packing3D.jl converges exactly to theoretical lattice densities, eliminates discontinuities at sub-particle resolution, and scales linearly with particle count. Memory usage remains modest (40 B per particle, 48 B per cell). Packing3D.jl provides researchers with continuous, reproducible volume-fraction fields and robust mixing indices at high performance, facilitating sensitivity analyses and optimisation in granular process engineering.