Constraining molecules in simulations (such as with constant bond lengths and/or angles) reduces their degrees of freedom (DoF), which in turn affects temperature calculations in those simulations. When local temperatures are measured, e.g., from a set of atoms in a subvolume or from velocities in one Cartesian direction, the result can appear to unphysically violate equipartition of the kinetic energy if the local DoF are not correctly calculated. Here, we determine how to correctly calculate local temperatures from arbitrary Cartesian component kinetic energies, accounting for general geometric constraints, by self-consistently evaluating the DoF of atoms subjected to those constraints. The method is validated on a variety of test systems, including systems subject to a temperature gradient and those confined between walls. It is also shown to provide a sensitive test for the breakdown of kinetic energy equipartition caused by the approximate nature of numerical integration or insufficient equilibration times. As a practical demonstration, we show that kinetic energy equipartition between C and H atoms connected by rigid bonds can be violated even at the commonly used time step of 2 fs and that this equipartition violation appears to usefully indicate configurational overheating.
Read full abstract