Hii,

I need to calculate the pressure of the system by subtracting centre of mass velocity contribution from Kinetic energy part! How can it be done!

M currently using

compute peratom bulk stress/atom NULL pair

Is this correct!

Nidhi.

Hii,

I need to calculate the pressure of the system by subtracting centre of mass velocity contribution from Kinetic energy part! How can it be done!

M currently using

compute peratom bulk stress/atom NULL pair

Is this correct!

Nidhi.

Hi Nidhi,

I guess you can do something like the following:

You have to do the following:

(1) compute the temperature with removing the bias (COM) velocity and give it an ID

(2) Use the ID given above to get the correct temperature to calculate the pressure [This is also given in documents for the LAMMPS Link]

So you may do the following:

compute myTemp all temp/com #To give temperature with removing COM velocity

compute peratom bulk stress/atom myTemp pair #To give you the pressure which removes the COM velocity in the first term of the formula for stress

I hope this will help you.

All the best.

Dear Harish,

For clarification in the above answer,

In Lammps documentations for stress/atom, there is a description as follows.

“The *temp-ID* argument can be used to affect the per-atom velocities used in the kinetic energy contribution to the total stress. If the kinetic energy is not included in the stress, then the temperature compute is not used and can be specified as NULL.”

If I understood correctly when we are considering only pair term in stress calculation, Lammps will not consider the temperature compute.

Thanking you in advance

Abdul Gafoor

Dear Gafoor,

If you using the NULL then it will calculate the stress with the current KE of each atom. It is always calculated in pair. Maybe the following cutout from the LAMMPS’s website will clarify your confusion:

*“The temp-ID argument can be used to affect the per-atom velocities used in the kinetic energy contribution to the total stress. If the kinetic energy is not included in the stress, than the temperature compute is not used and can be specified as NULL. If the kinetic energy is included and you wish to use atom velocities as-is, then temp-ID can also be specified as NULL.”*

Dear Nidhi,

This command defines a computation that computes the symmetric per-atom stress tensor for each atom in a group. The tensor for each atom has 6 components and is stored as a 6-element vector in the following order: xx, yy, zz, xy, xz, yz. [This is also stated in the website, the link of which I have attached in the previous email].