Examples with Spheres¶
All the examples with spheres are in example/spheres/. Timings are given as an indication.
Example 1: Rotating drum¶
A set of spheres in a periodic rotating drum. The simulation shows how the particles interact, collide and move with the motion of the drum: segregation, convection and mixing patterns of granular materials in rotation. A second scenario without periodic conditions closes the drum with two rigid surfaces.
example/spheres/rotating-drum/rotating-drum-periodic.msp: 5,520 spheres, 20,000 steps, 15.4 s on 8 cores (OpenMP)example/spheres/rotating-drum/rotating-drum-no-periodic.msp: 27,000 spheres, 20,000 steps, 1 min 13 s on 8 coresexample/spheres/rotating-drum/rotating-drum-periodic-cohesion.msp: 1,200 spheres, 30,000 steps, 8 s on 12 cores
| Start | End |
|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
The deck of the periodic drum is described block by block in the Starter Pack.
Example 2: Rigid surface¶
Spheres falling onto a rigid surface, a virtual exploration of gravity-driven particle dynamics.
example/spheres/rigid-surface/rigid_surface.msp: 7,360 spheres, 10,000 steps, 6.6 s on 8 cores
| Start | End |
|---|---|
![]() |
![]() |
rigid_surface.msp
Example 3: Imposed velocity¶
A group of particles with an imposed velocity occupies an area; other particles fall into this area and interact with
the moving particles, which changes their trajectories. Example impose_velocity_hole by P. Lafourcade.
example/spheres/impose_velocity/impose_velocity_full.msp: 55,200 spheres, 10,000 steps, 1 min 40 s on 8 coresexample/spheres/impose_velocity/impose_velocity_hole.msp: 2,865 spheres, 2,000 steps, 1.3 s on 8 cores
| Start | End |
|---|---|
![]() |
![]() |
![]() |
![]() |
Example 4: Movable wall¶
A cluster of spheres is compacted against a rigid surface by a piston applying a stress that increases linearly with time. The block deforms and the stress propagates through it.
example/spheres/movable-wall/movable_wall.msp: 736 spheres, 30,000 steps, 4.1 s
| Start | End |
|---|---|
![]() |
![]() |
Example 5: RShape driver (STL)¶
Spheres fall onto an .stl mesh and into a box. This case shows the use of meshes with many faces, which allows any
geometry from CAD or graphic design.
example/spheres/stl-mesh/mesh_stl.msp: 5,000 spheres, 20,000 steps, 36.4 s on 8 cores
| Start | End |
|---|---|
![]() |
![]() |
Example 6: Particle generation with RSA¶
287,642 spheres generated by the parallel RSA algorithm [1] fall by gravity in a drum. A second example defines different volume fractions for particles of different sizes.
example/spheres/rsa/rsa-full.mspexample/spheres/rsa/rsa_vol_frac.msp
Note
rsa is an optional package, see Optional packages.
| Start | End |
|---|---|
![]() |
![]() |
![]() |
![]() |
Example 7: Jet¶
A velocity field is applied to the spheres from a projection on a Cartesian grid. Although not a physical scenario, a geyser-like effect is simulated with a cylindrical shape, directing the particle velocities towards a given speed. Future developments will apply non-uniform velocity fields to simulate more complex fluid configurations.
example/spheres/jet/step1.mspandstep2.msp(fewer particles than in the pictures)
| Start | End |
|---|---|
![]() |
![]() |
![]() |
![]() |
Example 8: Mirror boundary conditions¶
This example tests the mirror boundary conditions of exaNBody. They are not physical as such: all the fields are copied without processing in the ghost cells at each step (e.g. velocity, moments), except the positions (axial symmetry). They could be combined with other operators to build new boundary conditions (e.g. resetting the velocities to 0 to model a rigid surface). 33,120 spheres fall by gravity with mirror conditions in all directions.
example/spheres/mirror/mirror.msp: 33,120 spheres, 5,000 steps, 21.8 s on 8 cores
| Start | End |
|---|---|
![]() |
![]() |

























