Simulation of Realistic Particles with Bullet Physics Engine

The traditional discrete element method (DEM) uses clumps to approximate realistic particles, which is computationally demanding when simulating many particles. In this paper, the Bullet physics engine is applied as an alternative to simulate realistic particles. Bullet was originally developed for computer games to simulate physical and mechanical processes that occur in the real world to produce realistic game experiences. Physics engines integrate a variety of techniques to simulate complex physical processes in games, such as rigid bodies (e.g., rocks, and soil particles), soft bodies (e.g., clothes), and their interactions. Therefore, physics engines have the capabilities to simulate realistic particles. This paper integrates threedimensional laser scanner and Bullet to form a realistic particle simulation framework. The soil specimen collapse process is simulated to demonstrate the capability of the proposed framework to simulate realistic particles.


Introduction
The properties of granular materials have drawn great attention from various disciplines including earth science, geotechnical engineering, chemical engineering, powder metallurgy, pharmaceuticals, food processing and others. The discrete element method (DEM) has become the preeminent numerical tool for the study of granular material behavior. Typical DEM models use circular or spherical particles mainly due to the simplicity of contact detection and force calculations (Fig. 1). However, such oversimplified particulate models cannot provide adequately accurate insight to the mechanical behavior of granular assemblies. Methods to better simulate irregular particle shapes for use in DEMs have therefore been sought (Zheng and Hryciw [1]).
Simulation of realistic particles is an important research area in many disciplines. Researchers have explored the use of idealized particle shapes, such as ellipsoids [2], spherical cylinders [3], pentagons [4], rounded-cap elongated rectangles [5], and polyhedrons [6], in DEM simulations. These works have led to significant progress in the simulation of regular particles. However, these techniques cannot simulate irregular soil particles. Clumps of overlapping spheres ( Fig. 1) are currently the most widely used method to model real soil particles (Zheng and Hryciw [1], McDowell and Harireche [7], Ferellec and McDowell [8]). The contacts between overlapped spheres are ignored and the clumps behave as rigid bodies. The DEM computational load increases markedly with increasing numbers of spheres. Therefore, the clump method cannot simulate large numbers of particles.
Physics engines were originally developed for computer games to simulate physical and mechanical processes that occur in real life to produce a realistic game experiences. Physics engines integrate a variety of techniques to simulate complex physical processes in games, such as rigid bodies (e.g., rocks, and soil particles), soft bodies (e.g., clothes), fluids (e.g., water), and their interactions. Therefore, physics engines have the capabilities to simulate realistic particles.
Physics engines were first introduced to geotechnical engineering in 2014. Izadi and Bezujian [9] used the Bullet physics engine to simulate pluviation and vibration on three-dimensional (3D) randomly-shaped polyhedrons. Pthlos et al. [10] used a physics engine, Box2D, to simulate biaxial compression tests of two-dimensional (2D) randomly-shaped polygons. Izadi and Bezuijen [11] used Bullet to simulate 3D direct shear tests on uniformsized steel spheres. These studies pioneered the applications of physics engines in granular soil simulations.
Izadi and Bezuijen [9,11] have shown that the simulation speed of Bullet is 500-1000 times faster than traditional DEM code in simulations of 3D randomlyshaped polyhedrons. Bullet uses (1) both central processing units (CPUs) and graphics processing units (GPUs) of computers, (2) triangular face tessellations to represent realistic particles, and (3) a simplified contact model to accelerate computations. Despite of many physics engines, this research used Bullet as a simulation platform due to the high computational efficiency.
Prior studies [9,11] focused on using Bullet to simulate 3D randomly-shaped polyhedrons. However, these particles cannot precisely represent realistic particles in physical granular soils. There is a lack of research addressing how to simulate realistic granular particles in Bullet. This paper will demonstrate the feasibility of using Bullet to simulate realistic particles by integrating 3D laser scanner and Bullet. 3D laser scanner is used to scan particle geometries, which are imported to Bullet to reconstruct virtual soil specimen. This study will also compare simulation strategies of Bullet and DEM.

Particle Representations
In DEM, the 3D object geometries (e.g., soil particles) are usually approximated by sphere clusters, as shown in Fig.  2(a), for contact detection and force calculation. This method cannot precisely approximate particle geometries unless a very large number of spheres is used. The sphere cluster in Fig. 2(a) consists of 754 spheres. However, the artificial bumpy surface and some inaccurate representations of sharp corners are still visible. Having more spheres in a cluster gives more precise representations of particles, but higher computational loads are then needed.
On the other hand, in computer graphics and computer-aided design, 3D object geometries are usually represented by triangular face tessellations as shown in Fig. 2(b). For example, particles scanned by a 3D laser scanner are usually stored as triangular face tessellations in the STL format. More triangular faces yield more precise representations of particles but require higher computational loads. Because Bullet can detect the contact and compute contact force between two triangular face tessellations, it can use triangular face tessellations in simulations, which precisely preserves particle shapes.

Fig. 2.
Two representations of the realistic particle geometry in simulations: (a) The soil particle represented by a sphere cluster in DEM, and (b) The soil particle represented by a triangular face tessellation in Bullet.

Contact Model
Bullet and DEM use different contact models. DEM uses a soft contact approach, originally proposed by Cundall [12]. The soft contact model allows the contacting particles to overlap at contacts. The amount of overlapping determines the normal and frictional force following force-displacement laws as shown in Fig. 3(a).
The key input contact parameters include normal stiffness, shear stiffness, and friction coefficient. The stiffnesses are usually set at very high values in order to yield small amounts of overlapping compared to particle size. Because of the high stiffnesses, the time step size in the computation has to be small to yield small elastic rebound at each step to ensure numerical stability. This significantly increases simulation time when simulating a large number of particles.
Bullet uses contact dynamics (CD), a hard contact model developed by Moreau [13][14][15] and Jean [16][17][18]. Here, the contacting particles are not allowed to overlap. After identifying two contacting particles, the velocities before collision are used to compute the velocities after collision. Then the Newton-Euler laws of motion are used to update the positions and orientations of the two particles and compute the contact force as shown in Fig.  3(b). The time step size used in the hard contact approach can be large compared to the soft contact approach without the risk of numerical instability. This reduces simulation times, especially when simulating a large number of particles. The key input parameters include the friction coefficient and the restitution coefficient. Two objects i and j are used to explain the hard contact model. The distance between objects i and j is δn. Obviously, when δn>0 (objects i and j are separated as shown in Fig. 4(a)), there is no contact force between objects i and j. When δn=0 (objects i and j contact as shown in Fig. 4(b) and (c)), there is a normal force at the contact point, and the magnitude of the normal force fn depends on the normal components of contact velocities (relative velocity of two objects) un as: (1) Which is Signorini unilateral contact condition.  (2) where μ is the friction coefficient at the contact point. In contact dynamics, the effect of contact is irrelevant to the process during the contact; the state before the collision determines the state after the collision. Thus, a contact velocity can be split into a left-hand velocity u -, which is the velocity at a specific time t0, and a right-hand velocity u + , the velocity at the time of t0+δt. Then, contact velocities un and ut depend on the left-hand and the righthand contact velocities as: where en and et are the normal and tangential parts of the restitution coefficients.
With the relations mentioned above, the motion for each particle in a system can be determined. In a twodimensional physical system, the equations of motion of a particle depend on its mass , moment of inertia , mass center acceleration u , and angular acceleration ω as: where F and M are the vector sums of the forces and moments on all the contacts of the particle of interest respectively, and Fext and Mext represent the vector sums of external forces and moments applied on the particle of interest.
To determine the contact forces for a specific contact, the equations of motion for the contacts should be derived from the equations for the motion of particles. The conversions are written as: where u is the contact velocities matrix, U is the particle velocities matrix, F is the particle forces matrix, f is the contact forces matrix, and G is a matrix containing the information about the geometry of the neighboring particles of the particle of interest. Thus, the contact forces on a specific contact f is determined as: δn=0, ||un||>0 δn=0, ||un||=0 δn>0 where Fneighboring is the resultant of the forces applied by the neighboring particles, Frestitution is the force due to the left-hand contact velocity, and Fext is the resultant of the external forces applied on the contact of interest.

Specimen Generation
A total of 532 irregular uniform-sized particles having a size of around 30 mm are used in this study. These particles are scanned by a 3D laser scanner one by one, which are stored as "STL" files. These "STL" files were imported into Bullet to build realistic particles. The simulation parameters include particle density = 2650 kg/m 3 , particle and wall friction coefficients = 0.5, the time step = 0.01 seconds, restitution coefficient = 0, and iterations per step = 70.
After importing particle geometries in Bullet, these virtual particles are funneled into a cylinder consisting of rigid wall. The particles settle down under gravity and generate a cylindrical soil specimen as shown in Fig. 5. The simulation is performed on the laptop with the following configurations: 8 core CPUs and 16 GB memory. The force chain of the generated cylindrical soil specimen is also calculated by Bullet and shown in Fig. 6.

Particle Collapse Simulation
After removing the cylinder, the particle column collapses under gravity. After all the particles are stable, the particles form an angle of repose of 20.56° (Fig. 7). After calculation, 1413 contact points as well as the normal contact forces on the points are found. The force chain is shown in Fig. 8.
The time of simulation is around 20 seconds. We have performed the same simulation in DEM, which took around 33 hours.

Summary
In this paper, we have demonstrated the feasibility of simulating realistic particles using Bullet physics engine. The Bullet physics engine improves simulation speed and yields acceptable results. Physics engines can be promising alternative approach to DEM for realistic granular particle simulation, and have great potentiality for applications in the area of geotechnical engineering.