While fix setforce 0 0 0, applying NVT to different groups got different resutls

Dear everyone,
I build a water-silver interface system. 1000 H2O molecules sit above 12500Ag atoms. The initial structure looks like,

Then I used two ways of running. While holding silver atoms immobile with fix setforce 0 0 0, I used fix ‘all’ nvt and fix ‘H2O’ nvt. But I got totally different results. The key commands are the following

#----------Force field parameters----------
pair_style      lj/cut/tip4p/long 2 1 1 1 0.1546 12.0 11.0
pair_modify     mix arithmetic tail yes
bond_style      harmonic
angle_style     harmonic
kspace_style    pppm/tip4p 1.0e-4
neighbor        2.0 bin
neigh_modify    every 1 delay 1 check yes

# TIP4P-2005 H2O H=1,O=2
# https://doi.org/10.1063/1.2121687
pair_coeff      1 1 0.0 0.0             #H-H
pair_coeff      2 2 0.1852 3.1589       #O-O
bond_coeff      1 0 0.9572              #H-O
angle_coeff     1 0 104.52              #H-O-H

# L-J potential for Ag
# https://doi.org/10.1088/0953-8984/8/45/011
pair_coeff      3 3 7.9559 2.644        #Ag-Ag

group           1 type 1 2              #H2O
group           2 type 3                #Ag

velocity        2 set 0 0 0
fix             0 2 setforce 0 0 0

The only difference is which group to be applied for NVT.
When applying to all, it is like

fix             1 all nve
fix             2 all temp/csvr ${T} ${T} ${Tdampc} ${ransed}

When applying only to water, it is like

fix             1 1 nve
fix             2 1 temp/csvr ${T} ${T} ${Tdampc} ${ransed}

I assumed the reustls should be same since all silver atoms are not moving so that water should move the exacly same way. However, it’s not. After 200ps, the result of fix all nvt is like,

And I cant understand why water is almost evenly distributed vertically.
However, if it is run by fix water nvt, it is like,

Now silver is nearly hydrophilic.

What I dont understand is that why there is such a difference in water behavior when applying thermostat to all atoms or only water atoms in the situation that silver atoms are immobile by setfore 0 0 0. The interatomic force should be exactly the same but it is not.

Please enlighten me.

Well, running

fix 1 all nvt ...

attempts to set the temperature across all atoms in the simulation to its target, and

fix 1 water nvt ...

attempts to set the temperature across group “water” atoms to its target.

From that point of view the results make perfect sense (understanding why is a fun, simple statistical mechanics exercise).

As the documentation for fix nvt says (albeit quite far down):

These fixes compute a temperature and pressure each timestep. To do this, the thermostat and barostat fixes create their own computes of style “temp” and “pressure”, … For fix nvt, the group for the new temperature compute is the same as the fix group.

EDIT: I just saw that fix temp/csvr was used instead of fix nvt for thermostatting. The exact same rules apply, and nearly identical text is contained in the documentation for fix temp/csvr.

1 Like

No, you don’t. Please be more careful with your statements.

Now I get it.
Since velocity is the measurement of temeperature in thermostat, you can only apply thermostat to the group of atoms you want to move during simulation, rather than ‘all’. Otherwise the velocity should belong to the immobile atoms will be added to the mobile atoms, thus they will be ‘heated’ to incredibly higher temperature.

1 Like