Soft-sphere discrete element method for crushers: Hertz-Mindlin contacts with tangential history, a numba CPU reference and a Warp CUDA path, pip-installable on Windows.
A soft-sphere discrete element method (DEM) with particle breakage for crushers: Hertz-Mindlin contacts with tangential history, analytic walls with prescribed motion (a jaw's swing plate, a cone's gyrating mantle), and particle replacement driven by the Tavares breakage model and the t10 progeny law. It installs with pip on Windows, Linux and macOS, runs on any CPU (numba) and on NVIDIA GPUs (Warp), and needs no C++ toolchain, WSL or MPI.
Version 0.05.000, the first release on PyPI. The engine is implemented and tested: the soft-sphere core (particle state, velocity-Verlet integration, the Hertz-Mindlin contact with tangential history, Coulomb sliding and Tsuji damping, rolling resistance, the uniform hash grid), analytic walls with prescribed motion and their power, feed and discharge with a closing mass balance, the machines built from them (the laboratory jaw of Barrios et al. 2020 and a parametric cone) and particle-replacement breakage (the Tavares breakage model with damage, t10 and incomplete-beta progeny, a mass-conserving replacement with bounded injected energy), on a numba CPU reference and a Warp CUDA path held equal by tests. The requirements and the validation plan are in docs/design/SDD.md.
Validation: the laboratory jaw is not reproduced. Against the jaw crusher of Barrios et al. 2020 (https://doi.org/10.3390/min10080717) the throughput band set before the run is not met. The power band is met in the steady-state window, but the energy per kilogram is a third of the measured one, so that verdict is not a sign that the energy balance is right. The record states it as it is (docs/VALIDATION.md, validation/results/jaw_barrios2020.json):
The machine passes the batch about 2.7 times faster than the experiment and delivers about a third of the energy per kilogram; the window power lands near the paper because the two errors offset. The ore is derived from the paper's single-particle tests (all 30 particles of each Fig. 6b class, the paper's median); it was changed once, after the first review, from the paper's data and text, never from the jaw result, and no ore property is tuned. The paper's own calibrated sphere (Fig. 6a) is about six times stiffer than the Table 3 contact the case uses. The overlap limit was relaxed from 0.3 to 0.5 of the smaller radius on the paper-ore runs, and 18 of the 29 window strokes exceed 0.3; one seed was run; the 3 and 9 Hz runs and a comparison ore stopped with the engine's overlap error (a jammed bed or a too-large time step: the record does not show which), and the 3 and 9 Hz points have no measurement. Seven candidate causes are listed in the record (the contact stiffness, the throw, the swing law and the nip angle, flat smooth plates, the progeny law, the extrapolated size effect, spheres passing the gap by diameter); none has been tested and none was tuned to reach a band. Treat the engine as a research tool whose contact, wall and breakage mechanics are tested and whose agreement with a real crusher is an open result. The cone case follows when its results are confirmed in an open text.
pip install crushdem # numpy only: the core, on plain Python (correct, slow) pip install "crushdem[jit]" # + numba: the CPU reference path pip install "crushdem[gpu]" # + warp-lang: the CUDA path (NVIDIA GPU) Python 3.10 to 3.13; Windows, Linux and macOS; no C++ toolchain, WSL or MPI. The extras are optional: the wheel imports and runs with numpy alone.
Two rock spheres collide head-on with a coefficient of restitution of 0.5, and the engine returns the speed they leave with. It runs in about two seconds with numpy only, no extra needed.
from crushdem import ContactTable, Material, PairParams, ParticleState, Simulation, stable_time_step rock = Material("rock", youngs_modulus=1.0e8, poisson=0.25, density=2700.0) table = ContactTable.build([rock], default=PairParams(restitution=0.5, friction=0.0)) state = ParticleState.from_arrays([[0.0, 0.0, 0.0], [0.010001, 0.0, 0.0]], [0.005, 0.005], table, vel=[[0.5, 0.0, 0.0], [-0.5, 0.0, 0.0]]) sim = Simulation(state, table, dt=stable_time_step(state, table, 0.05), gravity=(0.0, 0.0, 0.0)) sim.run(2000) after = sim.state() print(f"rebound ratio {(after.vel[1, 0] - after.vel[0, 0]) / 1.0:.4f} for a restitution of 0.5") It prints rebound ratio 0.4999 for a restitution of 0.5. The notebooks in notebooks/ take this contact apart and build up to the jaw.
A column of 2000 spheres falls onto a floor of frozen spheres and settles (with the jit extra: on plain Python this takes hours); the same call runs on the GPU with backend="warp" (check crushdem.available_backends()).
import crushdem from crushdem import Simulation, stable_time_step from crushdem.core.scenarios import settling_column state, table = settling_column(2000, seed=1, initial_speed=1.0) # spheres, and their material/contact table dt = stable_time_step(state, table, fraction=0.1) # 0.1 of the Rayleigh time of the smallest sphere sim = Simulation(state, table, dt=dt, backend="numba", seed=1) sim.run(1000) result = sim.result() print(result["state"]["n_contacts"], "contacts,", f"{result['performance']['particle_steps_per_second']:.2e}", "particle-steps/s") Simulation.write_result(result, "run.json") # validates against schemas/run.schema.json A jaw crusher The laboratory jaw of Barrios et al. 2020, fed a batch of one narrow size class (without breakage coarse rock is trapped by the gap, fine rock passes). Every machine dimension and where it comes from is in machine.provenance (docs/machines.md).
import numpy as np from crushdem import ParticleState, Simulation, stable_time_step from crushdem.machines import BARRIOS_FEED_CLASSES, barrios_contact_table, jaw_barrios2020 machine, table = jaw_barrios2020(), barrios_contact_table() feed = machine.feed([BARRIOS_FEED_CLASSES["16/13.2"]], batch_mass=0.05, seed=1) probe = ParticleState.from_arrays([[0, 0, 0]], [feed.min_radius], table) empty = ParticleState.from_arrays(np.zeros((0, 3)), np.zeros(0), table) jaw = Simulation(empty, table, dt=stable_time_step(probe, table, 0.1), feed=feed, capacity=30, seed=1, **machine.simulation_kwargs()) jaw.run_cycles(2, machine.period_s) swing = next(w for w in jaw.wall_report() if w["name"] == "swing_plate") print(f"swing plate {swing['mean_power_w']:.1f} W,", jaw.flow()["n_out"], "spheres out") The same jaw with breakage Give the run an ore and its spheres break by the Tavares model and are replaced by progeny drawn from the pool of capacity slots, which is the particle cap. The ore parameters of the jaw case, each with its source, are jaw_ore_barrios2020(); the model, its bounds and what the result reports are in docs/breakage.md.
from crushdem.machines import jaw_ore_barrios2020 ore = jaw_ore_barrios2020() feed = machine.feed([BARRIOS_FEED_CLASSES["31.5/26.5"]], batch_mass=0.15, seed=1) probe = ParticleState.from_arrays([[0, 0, 0]], [0.5 * ore.min_diameter], table) # the smallest sphere sets the time step crusher = Simulation(empty, table, dt=stable_time_step(probe, table, 0.1), feed=feed, capacity=400, ore=ore, seed=1, **machine.simulation_kwargs()) crusher.run_cycles(1, machine.period_s) b = crusher.breakage_report() print(b["n_events"], "breakages,", b["n_progeny"], "progeny,", f"{crusher.flow()['fines_kg'] * 1000:.1f} g of fines") Your own spheres: ContactTable.build([Material(...)], default=PairParams(restitution, friction)) and ParticleState.from_arrays(positions, radii, table, vel=...). The contact law and its sources are in docs/contact.md; measured speeds in docs/performance.md; the benchmark is python bench/settle.py; the jaw batch is python bench/jaw_batch.py.
Consumed by CAOS_ChancaDEM, which bakes its runs offline.
Cite the software by its release and the methods by their sources. Software: Santibanez-Leal, F., crushdem, version 0.5.0, https://github.com/fsantibanezleal/CAOS_CrushDEM (see CITATION.cff). Methods: the breakage model is Tavares, L. M. (2022), KONA Powder and Particle Journal 39, 62-83, https://doi.org/10.14356/kona.2022012; the laboratory jaw and its measurements are Barrios et al. (2020), Minerals 10(8), 717, https://doi.org/10.3390/min10080717; the contact damping is Tsuji, Tanaka and Ishida (1992), Powder Technology 71, 239-250, https://doi.org/10.1016/0032-5910(92)88030-L.
Both files in this release have provenance metadata.
DEM discrete element method crusher comminution Hertz-Mindlin mineral processing Warp numba
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Both files in this release have been uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.




