{"title":"Packing3D.jl: An open-source analytical framework for computing packing density and mixing indices using partial spherical volumes","authors":"Freddie J. Barter , Christopher R.K. Windows-Yule","doi":"10.1016/j.cpc.2025.109863","DOIUrl":null,"url":null,"abstract":"<div><div>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.</div></div><div><h3>Program summary</h3><div><em>Program Title:</em> Packing3D.jl</div><div><em>CPC Library link to program files:</em> <span><span>https://doi.org/10.17632/srdxk6f77w.1</span><svg><path></path></svg></span></div><div><em>Developer's repository link:</em> <span><span>https://github.com/fjbarter/Packing3D.jl</span><svg><path></path></svg></span></div><div><em>Licensing provisions:</em> MIT</div><div><em>Programming language:</em> <span>Julia</span></div><div><em>Nature of problem:</em> Inaccuracy and discontinuity of packing density calculation by counting centres</div><div><em>Solution method:</em> Derive and implement a fast algorithm for analytically calculating particle volumes intersected by planes, providing a continuous and much more accurate measurement of packing density</div></div>","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"317 ","pages":"Article 109863"},"PeriodicalIF":3.4000,"publicationDate":"2025-09-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Computer Physics Communications","FirstCategoryId":"101","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0010465525003650","RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"COMPUTER SCIENCE, INTERDISCIPLINARY APPLICATIONS","Score":null,"Total":0}
引用次数: 0
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.
Program summary
Program Title: Packing3D.jl
CPC Library link to program files:https://doi.org/10.17632/srdxk6f77w.1
Nature of problem: Inaccuracy and discontinuity of packing density calculation by counting centres
Solution method: Derive and implement a fast algorithm for analytically calculating particle volumes intersected by planes, providing a continuous and much more accurate measurement of packing density
期刊介绍:
The focus of CPC is on contemporary computational methods and techniques and their implementation, the effectiveness of which will normally be evidenced by the author(s) within the context of a substantive problem in physics. Within this setting CPC publishes two types of paper.
Computer Programs in Physics (CPiP)
These papers describe significant computer programs to be archived in the CPC Program Library which is held in the Mendeley Data repository. The submitted software must be covered by an approved open source licence. Papers and associated computer programs that address a problem of contemporary interest in physics that cannot be solved by current software are particularly encouraged.
Computational Physics Papers (CP)
These are research papers in, but are not limited to, the following themes across computational physics and related disciplines.
mathematical and numerical methods and algorithms;
computational models including those associated with the design, control and analysis of experiments; and
algebraic computation.
Each will normally include software implementation and performance details. The software implementation should, ideally, be available via GitHub, Zenodo or an institutional repository.In addition, research papers on the impact of advanced computer architecture and special purpose computers on computing in the physical sciences and software topics related to, and of importance in, the physical sciences may be considered.