Hi there,
This script calculates the temperature of atoms and displays it as a field. For each field point, the kinetic energy of the atoms within the local region is calculated. From the kinetic energy, the temperature is calculated and this is written to the field point.
An example application of this script is to visualize the temperature field of a set of polymer molecules as a chloromethane is "fired" at the surface. In this example, a polyethylene surface was built using a constrained layer in Amorphous Cell and then equilibrated using the COMPASS forcefield in Forcite Plus. A constant volume, constant temperature ensemble with the Nose thermostat was used for the production run. The chloromethane has an initial velocity of -30 Å/ps in the z direction and a very short run of about 1ps with frames written every 5 fs was used to capture the impact of the chloromethane on the polymer surface. The frames in the figure below show the chloromethane impacting on the surface and show the temperature of the polymer atoms only.
Slices through the temperature field are shown with a mapped maximum of 700K meaning anything above 700K is shown in red. Frames (a) to (c) show the choloromethane descending with no impact on the polymer. Frames (d) to (f) show the impact with hotter areas around the impact site colored in yellow and red. Frames (g) to (i) show the chloromethane bouncing off the surface and the temperature of the polymer around the impact site returning to normal.
The trajectory used in this calculation can be downloaded from this link.
This script uses a spatial decomposition or link cell method to improve the efficiency of searching over a large number of atoms. Before the field calculation starts, the unit cell is decomposed into individual cells or zones. The nearest neighbours of each zone is calculated and stored. Then, each atom in the system is mapped to a zone and stored. When the field point is selected, the parent zone is calculated and only local atoms in that and neighbouring zones are used for the calculation. This leads to a significant improvement in calculation time compared with a brute force approach.
I intend to post more on the performance/details of the spatial decomposition approach used in the MaterialsScript Tips and Tricks forum soon. It should be easily possible to take this approach and apply it to any system where you iterate repeatedly through multiple objects.
Materials Studio: 4.2
Modules: Materials Visualizer
Cheers
Stephen