Skip to content

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 cores
  • example/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
grid_flavor: grid_flavor_dem

includes:
  - config_spheres.msp

io_tree:
  - io_config:
     dir_name: "RigidSurfaceDir"

input_data:
  - read_xyz:
      file: input_file_rigid_surface.xyz
      bounds_mode: FILE
      enlarge_bounds: 0.0 m
  - replicate_domain:
     repeat: [1,1,10]
  - set_radius:
     rad: 0.5
  - set_quaternion
  - set_rand_velocity:
     var: 0.1
     mean: [0.0,0.0,0.0]
  - set_density:
     density: 0.02
  - set_rand_vrot_arot
  - update_inertia

setup_drivers:
  - register_surface:
     id: 0
     state: {normal: [0,0,1], offset: -0.5}
     params: { motion_type: STATIONARY }

compute_force:
  - gravity_force
  - contact_sphere:
     config: { kn: 1000, kt: 1000, kr: 0.1,mu: 0.2, damp_rate: 0.9} 
     config_driver: { kn: 1000, kt: 800, kr: 0.1,mu: 0.5, damp_rate: 0.9} 

domain:
  cell_size: 4 m
  periodic: [false,true,false]

global:
  simulation_dump_frequency: -1
  simulation_end_iteration: 10000
  simulation_log_frequency: 1000
  simulation_paraview_frequency: 1000
  dt: 0.001 s 
  rcut_inc: 0.4 m

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 cores
  • example/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.msp
  • example/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.msp and step2.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