TinyDEM: Minimal open granular DEM code with sliding, rolling and twisting friction
Roman Vetter
TL;DR
TinyDEM tackles the need for an accessible, minimal open-source discrete element method (DEM) implementation in 3D that includes full frictional torque exchange and quaternion-based orientations. It presents a compact, ~600-line C++11 solver with OpenMP, implementing the Hertz–Mindlin visco-elastic contact model with Coulomb friction, and a unified particle–mesh collision routine that enables complex rigid geometries. The work contributes all three torque modes (sliding, rolling, twisting), a robust SPIRAL quaternion integration scheme, and a transparent, dependency-free codebase suitable for education and rapid prototyping, backed by performance benchmarks on multi-core CPUs. This lightweight, permissively licensed distribution provides a practical platform for learning, method development, and extending DEM capabilities toward more complex particle dynamics.
Abstract
This article introduces TinyDEM, a lightweight implementation of a full-fledged discrete element method (DEM) solver in 3D. Newton's damped equations of motion are solved explicitly for translations and rotations of a polydisperse ensemble of dry, soft, granular spherical particles, using quaternions to represent their orientation in space without gimbal lock. Particle collisions are modeled as inelastic and frictional, including full exchange of torque. With a general particle-mesh collision routine, complex rigid geometries can be simulated. TinyDEM is designed to be a compact standalone program written in simple C++11, devoid of explicit pointer arithmetics and advanced concepts such as manual memory management or polymorphism. It is parallelized with OpenMP and published freely under the 3-clause BSD license. TinyDEM can serve as an entry point into classical DEM simulations or as a foundation for more complex models of particle dynamics.
