Skip to content

Numerical Scheme

Velocity-Verlet scheme

The time integration in exaDEM uses the velocity form of the Störmer-Verlet algorithm, better known as velocity-Verlet. It is simple, stable and accurate, and well suited to DEM simulations. At each time step:

  1. position at full time step:

    \[ \mathbf{x}(t + \Delta t) = \mathbf{x}(t) + \mathbf{v}(t)\,\Delta t + \mathbf{a}(t)\,\frac{\Delta t^2}{2} \]
  2. velocity at half time step:

    \[ \mathbf{v}\left(t + \tfrac{\Delta t}{2}\right) = \mathbf{v}(t) + \mathbf{a}(t)\,\frac{\Delta t}{2} \]
  3. acceleration at full time step \(\mathbf{a}(t + \Delta t)\), from the forces computed with the positions \(\mathbf{x}(t + \Delta t)\);

  4. velocity at full time step:

    \[ \mathbf{v}(t + \Delta t) = \mathbf{v}\left(t + \tfrac{\Delta t}{2}\right) + \frac{1}{2}\,\mathbf{a}(t + \Delta t)\,\Delta t \]

The scheme is defined in data/config/config_numerical_schemes.msp. Written out step by step (without the field-loading optimizations described below), it reads:

numerical_scheme: numerical_scheme_verlet

numerical_scheme_verlet:
  name: scheme
  body:
   - push_f_v_r: { dt_scale: 1.0 }
   - push_f_v: { dt_scale: 0.5 }
   - push_to_quaternion: { dt_scale: 1.0 }
   - check_and_update_particles
   - reset_force_moment
   - compute_force
   - force_to_accel
   - push_to_angular_acceleration
   - push_to_angular_velocity: { dt_scale: 1 }
   - push_f_v: { dt_scale: 0.5 }

Note

To avoid loading the same fields several times, some of these operators are combined into combined_compute_prolog and combined_compute_epilog, and the default configuration also interleaves the driver counterparts of several steps (push_f_v_r_driver, force_to_accel_driver, ...):

config_numerical_schemes.msp
compute_force: nop  # user-definition
reine_des_neiges: nop  # user-definition
freeze: reine_des_neiges

# define the verlet numerical scheme
numerical_scheme_verlet_macro:
  name: scheme
  body:
#    - push_f_v_r: { dt_scale: 1.0 }
#    - push_f_v: { dt_scale: 0.5 }
#    - push_to_quaternion: { dt_scale: 1.0 }
    - combined_compute_prolog
    - push_f_v_r_driver: { dt_scale: 1.0 }
    - push_f_v_driver: { dt_scale: 0.5 }
    - push_av_to_quat_driver : { dt_scale: 1.0 }
    - check_and_update_particles
    - reset_force_driver
    - reset_force_moment
    - compute_force
    - freeze
    - update_stress_tensor
    - force_to_accel 
    - force_to_accel_driver 
    - push_f_v_driver: { dt_scale: 0.5 }
#    - update_angular_acceleration 
#    - update_angular_velocity: { dt_scale: 1 }
#    - push_f_v: { dt_scale: 0.5 }
    - combined_compute_epilog

# define the verlet numerical scheme
numerical_scheme_verlet: numerical_scheme_verlet_macro

numerical_scheme: numerical_scheme_verlet

exaNBody provides generic first-order time-integration operators (exaNBody/src/exanb/push_vec3_1st_order_xform.cpp):

  • push_v_r: positions from velocities;
  • push_f_v: velocities from forces (i.e. accelerations);
  • push_f_r: positions from forces (i.e. accelerations);

and a second-order one (exaNBody/src/exanb/push_vec3_2nd_order_xform.cpp):

  • push_f_v_r: positions from both velocities and forces (i.e. accelerations).

Since positions are expressed in a reduced frame in exaDEM, xform_mode: INV_XFORM is mandatory with any operator that updates the particle positions.

Operators

Each operator is described below, so that you can reorder, add or remove them to build another time-integration scheme. For performance reasons, some of them are merged into combined_compute_prolog and combined_compute_epilog.

reset_force_moment

Resets the force and moment fields.

- reset_force_moment

force_to_accel

Computes the particle accelerations from the forces and the mass, \(\mathbf{f} = m\,\mathbf{a}\), with \(\mathbf{f}\) the sum of the forces applied to the particle.

- force_to_accel

push_to_quaternion

Updates the particle orientations \(Q\) from the angular velocities \(\omega\) and angular accelerations \(\dot\omega\). Parameter: dt_scale, coefficient applied to \(\Delta t\).

\[ Q \leftarrow Q + Q\,\omega\,\Delta t, \qquad Q \leftarrow \frac{Q}{\|Q\|}, \qquad \omega \leftarrow \omega + \dot\omega\,\frac{\Delta t^2}{2} \]
- push_to_quaternion: { dt_scale: 1.0 }

push_to_angular_velocity

Updates the angular velocities, \(\omega \leftarrow \omega + \dot\omega\,\frac{\Delta t^2}{2}\). Parameter: dt_scale, coefficient applied to \(\Delta t\).

- push_to_angular_velocity: { dt_scale: 1.0 }

Note

This operator is not used directly: it is merged into combined_compute_epilog.

push_to_angular_acceleration

Computes the angular accelerations from the moments and the inertia: the angular velocity is expressed in the body frame, \(\omega_b = \bar{Q}\,\omega\) (with \(\bar{Q}\) the conjugate of \(Q\)), \(\dot\omega_b\) is computed from the moment and the inertia, and \(\dot\omega = Q\,\dot\omega_b\).

- push_to_angular_acceleration

Note

This operator is not used directly: it is merged into combined_compute_epilog.

combined_compute_prolog

Combines, in this order and with the dt_scale values of steps 1, 2 and 3 of the scheme above (1.0, 0.5 and 1.0, not user-configurable):

  • push_f_v_r
  • push_f_v
  • push_to_quaternion
- combined_compute_prolog

combined_compute_epilog

Combines, in this order:

  • push_to_angular_acceleration
  • push_to_angular_velocity
  • push_f_v
- combined_compute_epilog