Compute the kinetic energy of a specific group in Gromacs

GROMACS version:
GROMACS modification: Yes/No

I am using the NEMD method to calculate the thermal conductivity of water in Gromacs. I have three groups in the simulation: hot water, cold water, and free water. I want to calculate the kinetic energy of each group.

Here is the method I used:

  1. Using gmx select to isolate the group, producing an index file.

  2. With the convert-tpr command, I can create a modified .tpr file centered on the selected group.

  3. The gmx trjconv command extracts the group’s coordinates from the entire trajectory to obtain a group-specific trajectory.

  4. With the modified .tpr file and the group-specific trajectory, the gmx mdrun command with the -rerun option recalculates the energies for the specific group, generating a new energy file. This energy data can then be extracted and analyzed using gmx energy.

However, there is no option for the kinetic energy. What I got is attached. Any suggestions would be very appreciated!

If the trajectory passed to -rerun does not have velocities (like an .xtc file), then you will not be able to get kinetic energy values.

Hi Dr. Lemkul,

Thank you for your prompt response. I used a .trr file for the -rerun option and checked its contents using the gmx check command. The file contains velocities but lacks force data. Could the absence of forces be the reason I’m not obtaining kinetic energy values?

image

I’ve updated the .trr file to include force data, but I’m still not seeing an option for kinetic energy.

With rerun you can not get kinetic information.

You can use gmx traj to compute the temperature of groups using a trr file with velocities. For water you need to multiply the temperature by a factor 1.5 to take the constraints into account that gmx traj ignores.

Hello Hess,

Thank you for your reply. Based on your reply, I have a couple of questions:

  1. I utilized water as the basis for developing a protocol to predict thermal conductivity. How can I adapt this factor to other molecules?

  2. I attempted to calculate translational and rotational kinetic energy using the gmx traj command. Is this factor also applicable to kinetic energy calculations?

Thank you in advance for your help.

gmx traj does not know about constraints. Thus you need to correct the temperature of a group by the factor #atoms3/(#atoms3 - #constraints).

The translational and rotational kinetic energy are only for the COM of a group, so not useful for you, I would think.