Marcus N. Bannerman
School of Engineering, University of Aberdeen
m.campbellbannerman@abdn.ac.uk
https://DynamOMD.com is an open-source general Event-Driven
Particle Dynamics (EDPD)
package.
How general can EDPD be?
Hard-spheres are the most well-known EDPD potential and have many direct applications,
E.g. Granular-damper systems in microgravity with a spring forcing the box.
M. N. Bannerman, J. E. Kollmer, A.
Sack, M. Heckel, P. Mueller, and T. Poeschel, “Movers and shakers: Granular damping in
microgravity,” Phys. Rev. E, 84, 011301 (2011)
Parallel hard-cubes are a toy system that have a visible but
continuous "freezing" transition which remains diffusive.
1:
Hoover, W. G., Hoover, C. G., Bannerman, M. N.
'Single-Speed Molecular Dynamics of Hard Parallel
Squares and Cubes'. J. Stat. Phys. 136
(4), 715-732 (2009)
The thin hard rod model has no excluded volume (ideal
gas) yet it has complex transport
coefficients. Cannot be simulated without EDMD.
Frenkel, D., 'Molecular Dynamics Study of Infinitely
Thin Hard Rods: Scaling Behavior of Transport
Properties'. Phys. Rev. Lett. 47,
1025 (1981)
Flexibly bonded polymers with replica-exchange, PMF calculations, and multi-canonical sampling methods is available. M. N. Bannerman, J.E. Magee, and L. Lue, “Structure and stability of helices in square-well homopolymers,” Phys. Rev. E, 80, 021801 (2009)
We can solve rigid-body assemblies of spheres, assymmetric stepped potentials, and have compression/shear dynamics.
Say we're simulating bouncing hard spheres from a catapult in a gravitational field.
Assuming no aerodynamic drag, the exact solution to the projectile motion is a parabola:
When it hits the ground at a time we have:
The time of this "event" is a root of the overlap equation, : (note $f<0$ is an overlap, $f=0$ is contact, and $f>0$ is not overlapping)
In this case, this is a simple quadratic with two roots:
Event-detection is driven by root finding.
DynamO has root finding algorithms for arbitrary order polynomials, and transcendental functions with bounding functions, but they must be fast AND not miss any roots! This is hard.
Consider two duelling catapults:
We calculate for all possible events: The earliest event is the next event!
Event processing is driven by sorting.
When we update this list, we want events to only update a few particles, to stay fast! This is restrictive (no barostats), and sorting the event list is done in $\mathcal{O}(1)$ time!
What actually happens at an event?
Consider a two-body event between particle and particle , which has an energy change of .
Conservation of momentum requires:
The impulse,
, is a solution to
the conservation of energy balance:
Event execution is driven by root finding for an impulse.
Actually this bit is trivial even for rotating bodies.
Note, we do not decide the time of the simulation! We decide how many events to run it for and the time is calculated.
Modern EDPD algorithms are quite complex.
Initially, the simulation is run in synchronous mode, then time-warp is enabled (with the same simulation speed). Only the required updates to the particles are shown.
Much of what is presented so far is well established,
what is unique about
DynamO?
Stability and
generality.
Even though EDPD is analytic, computers are not exact. Round-off error occurs at the limits of the machine precision.
Although this appears insignificant, catasrophic cancellation can occur and the simulation can fail completely1.
Consider repeated bounces of the projectile: Using a constant coefficient of restitution we have:
The velocity on impact/event decays to zero, and an infinite number of events happens in a finite time.
This "inelastic collapse" is not an instability, but a phenomena of the inelastic hard-sphere model.
Trying to simulate an "inelastic collapse" highlights a catastrophic numerical issue, the particle falls through the floor.
Although should equal after an event, limitations of the precision of the computer leave it at .
As , numerical precision is lost and the argument of the square-root can turn negative!
This gives no real-roots (or events) and the projectile falls through the ground!
This is not just an edge case, this problem is systemic.
It even plauges elastic/molecular systems for certain
sequences of rare ($P=10^{-10}$) events:
Machine precision is not enough to stop particles entering forbidden/invalid states, which may get rapidly worse.
Previous approaches typically attempt to prevent overlaps from forming using small adjustments, but round-off error is inherent and cannot be easily overcome.
Events, by their nature, move a system approaching an invalid state towards a valid state.
An algorithm that always moves towards a valid state is: Events occur at time, $t$, if particles are in contact, $f(t)=0$, or in an invalid state, $f(t)<0$, and this state is deterioriating $\dot{f}(t)<0$.
This appears to be stable in all cases, and correctly simulates inelastic collapse1.
Applying this stable algorithm requires finding the roots of the overlap function $f(t)$, and its time derivative $\dot{f}(t)$. These functions become increasingly complex. For example,
We'll now look at an interesting application of DynamO which needs its speed.
Water is an excellent heat-transfer medium, but has a relatively poor thermal conductivity, particularly compared to solids such as copper.
J. Buongiorno, D. C. Venerus, N. Prabhat,
T. McKrell, J. Townsend, R. Christianson,
Y. V. Tolmachev, P. Keblinski, Lin-wen Hu,
J. L. Alvarado, I. C. Bang, S. W. Bishnoi,
M. Bonetti, F. Botz, A. Cecere, Y. Chang,
G. Chen, H. Chen, S. J. Chung, M. K. Chyu,
S. K. Das, R. Di Paola, Y. Ding, F. Dubois,
G. Dzido, J. Eapen, W. Escher, D. Funfschilling,
Q. Galand, J. Gao, P. E. Gharagozloo,
K. E. Goodson, J. G. Gutierrez, H. Hong,
M. Horton, K. S. Hwang, C. S. Iorio, S. P. Jang,
A. B. Jarzebski, Y. Jiang, L. Jin, S. Kabelac,
A. Kamath, M. A. Kedzierski, L. G. Kieng,
C. Kim, J.-H. Kim, S. Kim, S. H. Lee,
K. C. Leong, I. Manna, B. Michel, R. Ni,
H. E. Patel, J. Philip, D. Poulikakos,
C. Reynaud, R. Savino, P. K. Singh, P. Song,
T. Sundararajan, E. Timofeeva, T. Tritcak,
A. N. Turanov, S. Van Vaerenbergh, D. Wen,
S. Witharana, C. Yang, W.-H. Yeh, X.-Z. Zhao,
and S.-Q. Zhou
“A benchmark study
on the thermal conductivity of
nanofluids”,
J. Appl. Phys., 106,
094312 (2009)
Conclusions from history:
Questions from history:
Coupled kinetic theory and hydrodynamic simulation of two heated walls ($k_B\,T=\{1,\,1.5\}$) ten NP diameters apart contacting a size ratio 1:0.5, mass ratio 1:0.5, $\rho=0.2$, $k_B\,T=1$ system.
10:1 size, 1000:1 mass, binary HS at constant volume fraction $\phi$ or constant pressure $p$. Symbols are MD and lines are from kinetic theory.1
Graphical illustration of heat flux via thermophoresis. Momentum conservation causes equal and opposite fluxes of mass. If there is a heat capacity imbalance, this results in a flux.
Can we simulate "real" contact forces using EDPD?
We recently demonstrated elastic forces can be "stepped".
Conversion of a potential first requires the steps to be placed.
Optimal placement was determined to be at fixed changes in the potential energy, $\Delta U$ (analogue of timestep, $\Delta t$!).
Optimal energies are given by equating the second virial contribution, which is a volumetric average at $T\to\infty$:
These stepped approximations can closely reproduce the phase behaviour of the LJ system:
And the dynamics, for example, the shear viscosity:
Molecular forces are too soft and EDPD is inefficient at high density: harder, granular potentials are more efficient.
We have worked on a spring-dashpot force as an example implementation of viscous forces.
Previous work1 in this direction focussed on single-event collision dynamics and required storing "history". It also demonstrated the importance of considering individual particle trajectories.
A pair of colliding particles under with an elastic spring is simulated to test the trajectory.
For a single collision, the key parameter is where it lands on the final step (inset). $\tau = KE_{final}/(U_{final+1}-U_{final})$
There is an issue in the last step: for vanishing remaining energy the particles become stuck! ("elastic collapse"?).
By
enforcing a minimum kinetic energy (immediately bouncing
$\tau<\alpha$, where $\alpha=1/9$ in the last step), the average collision time is correct.
Published dissipative forces in EDPD have so far been limited to inelastic coefficients.
To implement arbitrary dissipative forces cheaply, it should be approximated using an impulse/energy loss at each step:
Where $\Delta r$ is the width of the step the particle is leaving. No step-change = no energy loss (quasi-static elastic limit/no inelastic collapse).
Even for high inelasticiy ($\gamma$ set such that $e_{exact}=0.4$) this simple approach
is accurate with minor time scattering.
Relatively small numbers of steps are acceptable, with
collision time showing the most scatter.
Maximum distance is rigidly enforced.
And the model demonstrates the required constant
coefficient of restitution for spring-dashpot particles.
DynamO has a compile-time Computer Algebra System (CAS) library. It allows simple definitions of overlap functions:
Variable<'t'> t;
Vector<> rij, vij, aij;
double diam2_ij;
/*...*/
delta_t = nextroot(pow<2>(rij+t*(vij+aij*t/2))-diam2_ij, t);
The compiler will transform the overlap function to create derivatives, and select different classes of root finding.
The library can find all roots of -order polynomials and certain classes of other functions in a stable way, allowing a wide range of models/events to be detected.
For up to 3rd order polynomials, solution by radicals is used. Solution by radicals is too numerically unstable for 4th order and impossible for 5th order.
For higher order polynomials, roots are bounded using Local Max Quadratic estimates1, then bisected using Sturm's method to avoid repeated transformations of the polynomial.
For transcendental overlap functions, the roots are bounded using a bounding object with a polynomial overlap function. The bounds are then updated using a "worst case" polynomial approximation constructed using Taylor's theorem. This is accelerated using standard numerical root finding techniques.
"Sleeping particles" algorithm allows free simulation of stationary particles. Possible massive speed-ups in heaps, rolling drums, etc.