M10 Angular momentum is conserved or not
Manual 10 for MD++
Angular momentum is conserved or not?
Keonwook Kang, Seunghwa Ryu and Wei Cai
In molecular dynamics simulations, positions and velocities of atoms are updated following Newton's equations of motion. Naturally, we would expect that linear and angular momenta (of an isolated system such as NVE ensemble) are conserved during the time integration, or
where P is linear momentum and L is angular mumentum. Usually, we subtract ceter-of-mass velocity from the velocity of each atom so that the whole system can not drift and the linear momentume becomes zero.
where vCM is defined as
| . |
Similarly, we can additionaly subtract velocity component contributing rotation so that the whole system can not rotate and the angular momentum becomes zero as
| . |
The angular velocity Ω is obtained from
and moment-of-inertia matrix I is expressed as
| , |
where E3 is a 3 by 3 identity matrix.
Let's see whether MD simulation results conserve both linear and angular momenta. For the test simulation, a diamomd cubic structure of 216 silicon atoms are equilbriated under periodic boundary conditions for 10,000 steps using NVE ensemble.
| Figure 1 | |||
|---|---|---|---|
| (a) | (b) | (c) | |
The linear momentum is conserved within the machine precision in figure 1(b), while the angular momentum is not as shown in figure 1(c). According to Allen and Tildesley[1], the reason is told as
If the system is invariant to rotation about an axis, then the corresponding angular momentum component is conserved. ... In the case of the periodic boundary conditions, ... none of them were spherically symmetrical; in fact it is impossible (in Euclidean space) to construct a spherically symmetric periodic system. Hence, ... total angular momentum is not conserved in most molecular dynamics simulations.
Basically, what it says is that in most MD simulations angular momentum is no longer conserved if periodic boudary conditions are used and atoms move across the simulation cell boundary.
Let's check the above statement via another test simulation, where a Si cluster of 216 atoms are equilbrated with the same initial velocity. In this simulation, the simulation box has margin surrounding the Si cluster such that the cluster no longer sees its periodic images.
| Figure 2 | |||
|---|---|---|---|
| (a) | (b) | (c) | |
In figure 2(b) and 2(c), we can see that linear and angular momenta are conserved within the machine precision in this test simulation.
Since the angular momentum is not conserved in MD simulations under periodic boundary conditions, it is usually unnecessary to make angular momentum be zero when the velocities of atoms are initialized. However, when we perform simulations of nanowires or rods, it is desirable to prevent the rotation around wire axis. For example, if a nanowire is aligned along the z-direction, we want to let the z-component of angular momentum be zero, or Lz = 0.
In MD++ there is a variable zerorot, depending on whose value components of the angular momentum can be selletively zero. If zerorot = "x", x-component of angular momentum will be zero. If zerorot = "all", all three components of the angular momentum will be zero. The default value of zerorot is "none". The other possible values are "y" and "z".
In the next test simulation, a Si NW is aligned along the z-direction and we expect Lz = 0.
| Figure 3 | |||
|---|---|---|---|
| (a) | (b) | (c) | |
In figure 3(b) and 3(c), we can see that all three components of linear momentum and z-component of angular momentum are conserved during equilibriation.
MD++ script for this simulation is given below.
# -*-shell-script-*-
# Check linear momentum and angular momentum conservation
#*******************************************
# Definition of procedures
#*******************************************
proc initmd { n } {
#MD++ setnolog
MD++ setoverwrite
MD++ dirname = "runs/si-test-$n"
MD++ NNM = 300
}
#end of proc initmd
proc create_crystal { N } {
#--------------------------------------------
# Create Perfect Lattice Configuration
#
MD++ latticestructure = diamond-cubic
MD++ latticeconst = 5.431 #(A) for Si
MD++ latticesize = \[ 1 0 0 $N \
0 1 0 $N \
0 0 1 $N \]
MD++ makecrystal finalcnfile = perf.cn writecn
}
#--------------------------------------------
proc setup_md { } { MD++ {
equilsteps = 0 timestep = 0.001 # (ps)
atommass = 28.0855 # (g/mol) Si
DOUBLE_T = 0 equilsteps = 0
saveprop = 1 savepropfreq = 10 openpropfile #run
savecn = 0 savecnfreq = 10000
plotfreq = 20
vt2 = 2e28 #1e28 2e28 5e28
wallmass = 2e3 # atommass * NP = 14380
boxdamp = 1e-3 # optimal damping for 216 atoms and wallmass 1e-3
randseed = 12345 srand48
#MD++ srand48bytime
saveH # Use current H as reference (H0), needed for specifying stress
fixboxvec = [ 0 1 1
1 0 1
1 1 0 ]
stress = [ 0 0 0
0 0 0
0 0 0 ]
output_fmt = "curstep EPOT Tinst VIRIAL(0) VIRIAL(4) DVIRIALDexx(0) DVIRIALDexx(4)"
writeall = 1
} }
#*******************************************
# Main program starts here
#*******************************************
set T 300
initmd NW
create_crystal 5
MD++ input = \[ 3 2 0 0 5 0 \] makecylinder
MD++ input = \[1 1 1\] changeH_keepR
MD++ input = \[2 2 1\] changeH_keepR
setup_md
MD++ totalsteps = 10000
MD++ T_OBJ = $T DOUBLE_T = 1 timestep = 0.001
MD++ initvelocity_type = "Uniform" zerorot = "z" initvelocity
MD++ finalcnfile = init.cn writecn
MD++ finalcnfile = init.cfg writeatomeyecfg
MD++ ensemble_type = "NVE" integrator_type = "VVerlet"
MD++ {output_fmt = "curstep EPOT KATOM Tinst HELMP \
TSTRESSinMPa_xx TSTRESSinMPa_yy TSTRESSinMPa_zz \
TSTRESSinMPa_xy TSTRESSinMPa_xz TSTRESSinMPa_yz \
H_11 H_22 H_33 H_12 H_13 H_21 H_23 H_31 H_32 \
[MD++_Get P_com(0)] [MD++_Get P_com(1)] [MD++_Get P_com(2)] \
[MD++_Get L_com(0)] [MD++_Get L_com(1)] [MD++_Get L_com(2)]" }
MD++ run
MD++ finalcnfile = equil.cn writecn
MD++ finalcnfile = equil.cfg writeatomeyecfg
MD++ quit
Notes
- ↑ M. P. Allen and D. J. Tildesley, Computer Simulations of Liquids, Oxford Science Publications (2004) pp.72-73