Fix rigid/nvt/small

fix 2 pt rigid/nvt/small molecule temp 353.15 353.15 100.0
I want to use this command to form a molecule rigid and control its temperature. But in the .log file, the temperture is not the temperature I control. Why is this?

Because it is the output of compute thermo_temp all, as documented in the manual for the thermo_style command — LAMMPS documentation

If you want the output of the temperature of the group of atoms that you apply fix rigid/nvt/small to, you have to customize the output and output the corresponding temperature compute used by the fix.

compute t_pt pt temp
fix 2 pt rigid/nvt/small molecule temp 353.15 353.15 100.0
fix 3 pt ave/time 10 100 1000 c_t_pt file nvt.profile

thermo 2000
thermo_style custom step c_t_pt

Above is my output temperature command, but in the ‘nvt.profile’ file, the c_t_pt is still not the temperature I set.

It is not possible to comment further without knowing anything about your system and simulation setup and what numbers you actually get.

This is my in.file
#water from net
dimension 3

processors * * 1

boundary p p p
units real
atom_style full

neighbor 2 bin
neigh_modify delay 0 every 1 check yes
neigh_modify one 3000

read_data ptchneq.data

change_box all y final -6 86
change_box all z final 0 125

mass 1 12.017000
mass 2 12.017000
mass 3 18.998403
mass 4 15.999400
mass 5 32.065000
mass 6 15.999400
mass 7 15.999400
mass 8 1.00794
mass 9 1.00794
mass 10 12.010700
mass 11 195.09

#pair SPC
pair_style lj/cut/coul/long 15.0 15.0
pair_coeff 1 1 0.0844 3.4600 15.0
pair_coeff 1 2 0.0896 3.4665 15.0
pair_coeff 1 3 0.0647 3.2425 15.0
pair_coeff 1 4 0.0899 3.2466 15.0
pair_coeff 1 5 0.1704 3.5252 15.0
pair_coeff 1 6 0.1249 3.3128 15.0
pair_coeff 1 7 0.1249 3.3128 15.0
pair_coeff 1 8 0.0291 2.1309 15.0
pair_coeff 1 9 0.0291 2.1309 15.0
pair_coeff 1 10 0.0685 3.4300 15.0
pair_coeff 1 11 0.6258 2.9350 15.0

pair_coeff  2  2   0.0951 3.4730 15.0 
pair_coeff  2  3    0.0687 3.2490 15.0 
pair_coeff  2  4    0.0954 3.2531 15.0 
pair_coeff  2  5    0.1809 3.5317 15.0 
pair_coeff  2  6   0.1326 3.3193  15.0 
pair_coeff  2  7   0.1326 3.3193  15.0 
pair_coeff  2  8   0.0308 2.1374  15.0 
pair_coeff  2  9   0.0308 2.1374  15.0
pair_coeff  2  10  0.0727 3.4365  15.0
pair_coeff  2  11  0.6643 2.9415  15.0

pair_coeff  3   3    0.0496 3.0249 15.0 
pair_coeff  3   4    0.0689 3.0291 15.0 
pair_coeff  3   5    0.1306 3.3076 15.0 
pair_coeff  3   6   0.0957 3.0952  15.0 
pair_coeff  3   7   0.0957 3.0952  15.0 
pair_coeff  3   8   0.0223 1.91335 15.0 
pair_coeff  3   9   0.0223 1.91335 15.0
pair_coeff  3   10  0.0525 3.21245 15.0
pair_coeff  3   11  0.4797 2.71745 15.0

pair_coeff  4   4    0.0957 3.0332 15.0 
pair_coeff  4   5    0.1814 3.31175 15.0 
pair_coeff  4   6   0.1330 3.09935  15.0 
pair_coeff  4   7   0.1330 3.09935  15.0 
pair_coeff  4   8   0.0309 1.9175   15.0 
pair_coeff  4   9   0.0309 1.9175   15.0
pair_coeff  4   10  0.0729 3.2166   15.0
pair_coeff  4   11  0.6664 2.7216   15.0

pair_coeff  5   5    0.3440 3.5903  15.0 
pair_coeff  5   6   0.2521 3.3779   15.0 
pair_coeff  5   7   0.2521 3.3779   15.0 
pair_coeff  5   8   0.0587 2.19605  15.0 
pair_coeff  5   9   0.0587 2.19605  15.0
pair_coeff  5   10  0.1383 3.49515  15.0
pair_coeff  5   11  1.2634 3.00015  15.0

pair_coeff  6  6   0.1848 3.1655   15.0 
pair_coeff  6  7   0.1848 3.1655   15.0 
pair_coeff  6  8   0.0430 1.98365  15.0 
pair_coeff  6  9   0.0430 1.98365  15.0
pair_coeff  6  10  0.1014 3.28275  15.0
pair_coeff  6  11  0.9260 2.78775  15.0

pair_coeff  7  7   0.1848 3.1655   15.0 
pair_coeff  7  8   0.0430 1.98365  15.0 
pair_coeff  7  9   0.0430 1.98365  15.0
pair_coeff  7  10  0.1014 3.28275  15.0
pair_coeff  7  11  0.9260 2.78775  15.0

pair_coeff  8  8   0.0100 0.8018   15.0 
pair_coeff  8  9   0.0100 0.8018   15.0 
pair_coeff  8  10  0.0236 2.1009   15.0 
pair_coeff  8  11  0.2154 1.6059   15.0 

pair_coeff  9  9   0.0100 0.8018   15.0
pair_coeff  9  10  0.0236 2.1009   15.0 
pair_coeff  9  11  0.2154 1.6059   15.0

pair_coeff  10  10 0.0556 3.4000   15.0

pair_coeff 10 10 0.0000 0.0000 15.0

pair_coeff  10  11 0.5079 2.9050   15.0

pair_coeff  11  11 4.6400 2.4100   15.0

#bond and angle
bond_style harmonic
bond_coeff 1 214.6602 1.4982 #C1C1
bond_coeff 2 350.0000 1.5300 #C2C2
bond_coeff 3 350.0000 1.5300 #C1C2
bond_coeff 4 350.0000 1.4200 #C2O
bond_coeff 5 302.62975 1.3360 #CXF
bond_coeff 6 350.0000 1.8000 #C2S
bond_coeff 7 350.0000 1.4800 #SO
bond_coeff 8 250.0000 1.0000 #OwHw
bond_coeff 9 542.9783 0.9820 #OhHh

angle_style harmonic
angle_coeff 1 53.13695 122.5536 #CxCxCx
angle_coeff 2 50.16830 118.3191 #CxCxF
angle_coeff 3 54.11980 121.5020 #FCxF
angle_coeff 4 50.00000 109.4710 #CxCxO
angle_coeff 5 50.00000 125.2300 #CxOCx
angle_coeff 6 50.00000 109.5700 #OCxF
angle_coeff 7 50.00000 110.3000 #FCxS
angle_coeff 8 50.00000 116.8100 #CxCxS
angle_coeff 9 175.0000 102.6500 #CxSO
angle_coeff 10 175.0000 115.5000 #OSO
angle_coeff 11 60.0000 109.4700 #HOHw
angle_coeff 12 39.5132 113.4000 #HOWh

dihedral_style harmonic
dihedral_coeff 1 0.5000 1 3 #CxCx
dihedral_coeff 2 1.60855 -1 3 #C1C1C1C1
dihedral_coeff 3 2.0611 -1 3 #FC1C1C1
dihedral_coeff 4 2.0212 1 3 #FC1C1F
dihedral_coeff 5 0.5000 1 3 #CxO
dihedral_coeff 6 0.5000 1 3 #CxS

#charge
kspace_style pppm 0.0001

#=====================================================
group nafion type 1 2 3 4 5
group f3c type 6 8
group h3o type 7 9
group water union f3c h3o
group hn union water nafion
group cs type 10
group pt type 11

compute t_nafion nafion temp
compute t_w water temp
compute t_hn hn temp
compute t_pt pt temp
compute_modify t_pt dynamic yes
variable etotal equal etotal
variable pe equal pe

neigh_modify exclude type 10 10

#neigh_modify exclude type 11 11

#energy minimize

#nvt process
velocity nafion create 353.15 12345 temp t_nafion
velocity water create 353.15 12345 temp t_w

velocity pt create 353.15 12345 temp t_pt
run 0
velocity pt scale 353.15

fix 1 cs setforce 0.0 0.0 0.0
fix 2 pt rigid/nvt/small molecule temp 353.15 353.15 100.0
fix 3 hn nvt temp 353.15 353.15 100.0
fix 4 all wall/lj126 zhi 125.0 0.01 2.5 2.5 pbc yes
fix 5 all wall/lj126 zlo 0.0 0.01 2.5 2.5 pbc yes units box
fix 6 all ave/time 10 100 1000 c_t_hn c_t_pt v_etotal v_pe file nvt.profile

timestep 1.0
thermo 2000
thermo_style custom step c_t_hn etotal pe dt
dump 1 all atom 2000 nvt.dump
dump 2 all atom 50000 nvt-view.dump
restart 1000000 restart.*.nvt
run 6000000

write_data eq.data nocoeff

This does not help much and is not what I asked for.

How do you suppose could someone provide assistance without you providing comprehensive information?

1 Like