Solvent Temperature abd Pressure

Dear All,

I am using LAMMPS version 7Aug2019.

I want to calculate the temperature of the solvent (water & K+ & I-) and I have divided the simulation domain with spherical bins. The K+ and I- atoms are distributed randomly in the water domain.

I want to use “ave/chunk” and “temp” commands to calculate the temperature of the solvent.

According to the LAMMPS document, it seems that I should use “adof 2” to the “temp” command in order to remove the degree of freedom and compute the water temperature correctly.

I have used the following commands to calculate the solvate temperature:

mass 1 1.008 # H

mass 2 15.99 # O

mass 3 39.098 # K

mass 4 126.9 # I

group solvate type 1 2 3 4

Compute cc1 solvate chunk/atom bin/sphere 0 0 0 10 100 9 units box

Fix 1 solvate ave/chunk 10 100 1000 cc1 temp adof 2.0 file Temp.txt

however, I do not know that using “adof 2.0” affects the temperature calculation of the solvate or not.

Does it calculate the solvate temperature correctly or I should change these commands?

In addition, I have used the following commands to compute the stress tensor. I want to use them in order to find the mean pressure of each spherical bin.

As much as I know, these commands calculate the stress tensor in the cartesian coordinates. Is LAMMPS capable to calculate the pressure inside spherical bins?

compute p solvate stress/atom NULL

Compute cc4 solvate chunk/atom bin/sphere 0 0 0 10 100 9 units box

Fix 4 solvate ave/chunk 10 100 1000 cc4 c_p[1] c_p[2] c_p[3] c_p[4] c_p[5] c_p[6] file pressure.txt

Best Regards,

Hamid

Dear All,

I am using LAMMPS version 7Aug2019.

I want to calculate the temperature of the solvent (water & K+ & I-) and I have divided the simulation domain with spherical bins. The K+ and I- atoms are distributed randomly in the water domain.

I want to use “ave/chunk” and “temp” commands to calculate the temperature of the solvent.

According to the LAMMPS document, it seems that I should use “adof 2” to the “temp” command in order to remove the degree of freedom and compute the water temperature correctly.

I have used the following commands to calculate the solvate temperature:

mass 1 1.008 # H

mass 2 15.99 # O

mass 3 39.098 # K

mass 4 126.9 # I

group solvate type 1 2 3 4

Compute cc1 solvate chunk/atom bin/sphere 0 0 0 10 100 9 units box

Fix 1 solvate ave/chunk 10 100 1000 cc1 temp adof 2.0 file Temp.txt

however, I do not know that using “adof 2.0” affects the temperature calculation of the solvate or not.

this setup, as a whole, is an ill defined problem. The binning is per-atom and thus the number of degrees of freedom to remove from each bin varies depending on how many atoms of a water molecule are contained. On top of that, you are missing ions and water, so you cannot remove degrees of freedom from them.

The only way that this may work would be rather complex to set up:

  • first compute the temperature per-chunk for each water molecule on its own and then use compute chunk/spread/atom to spread this value to all water atoms
  • then also compute the temperature per atom for the ions
  • if you use the correct group, the computed value will set to zero of the atoms outside the group and thus you can have an atom style variable that is the sum of those two computes which will have the per-atom contribution to the temperature and could then be used for per-atom binning

Please note that this will not add up to the exact total temperature, since that will also consider translational invariance of the entire system, which cannot be done with spatial binning.

Does it calculate the solvate temperature correctly or I should change these commands?

In addition, I have used the following commands to compute the stress tensor. I want to use them in order to find the mean pressure of each spherical bin.

As much as I know, these commands calculate the stress tensor in the cartesian coordinates. Is LAMMPS capable to calculate the pressure inside spherical bins?

LAMMPS computes the virial, which is computed at the site of the respective atom from the per-atom forces that are readily available. Pressure is then computed from the sum of the virial contributions and the volume they are contained in. This is a meaningful approximation to the “macroscopic” pressure only if the volume is sufficiently large and the sampling of space sufficiently homogenous. There are other approaches to computing local pressure/stress, but they are not as easily accessible in an MD code as the virial.

Axel.