Temperature keeps coming up to 0K

Dear all,

Hi.

I’m having trouble setting and checking the temperature using npt ensemble.


This is my model.

After setting the top half to “top” and the bottom half to “bottom” using region and group, I want to set the upper and lower temperatures separately and then check the each temperature. But the temperature keeps saying 0K.

I will upload the log file, in file, and model picture, so could you find the cause?

Thank you.

read_restart twophase.25000.estart

# ----------------------- ATOM DEFINITION ----------------------------

region whole block 0 2 0 2 0 4 units lattice
region 1 block 0 2 0 2 0 2 units lattice
region 2 block 0 2 0 2 2 4 units lattice

# ------------------------ FORCE FIELDS ------------------------------
pair_style meam
pair_coeff * * library.meam Fe C Fe3C.meam Fe C

delete_atoms overlap 0.0001 all all

# ------------------------- SETTINGS --------------------------
group bot region 1
group top region 2

compute peratom all pe/atom
compute eatoms all reduce sum c_peratom

compute toptemp all temp/region 2
compute bottemp all temp/region 1

# ------------------------- EQUILIBRATION --------------------------

dump 2 all custom 10000 liquidtosolid.cfg id mass type xs ys zs c_peratom fx fy fz
restart 100000 save.25000.restart

reset_timestep 0
timestep 0.002 #0.002ps = 2fs

velocity top create 0.0 12321
fix sf top setforce 0.0 0.0 0.0
#velocity bot create 750.0 12321

print "###Bottom 1500K to 1100K equilibration"

fix 1 bot npt temp 800.0 550.0 100.0 iso 0.0 0.0 1000.0    #1500K에서 1100K까지 NPT
thermo 10000
thermo_style custom step c_toptemp c_bottemp temp lx ly lz press pe ke etotal

run 30000000 #60ns

unfix 1

LAMMPS (14 Dec 2021)
read_restart twophase.25000.estart
Reading restart file ...
  restart file = 14 Dec 2021, LAMMPS = 14 Dec 2021
  restoring atom style atomic from restart
  orthogonal box = (-0.14621017 -0.16457183 -0.43686622) to (9.1792102 10.331972 27.426866)
  1 by 1 by 4 MPI processor grid
  pair style meam stores no restart info
  256 atoms
  read_restart CPU = 0.015 seconds

# ----------------------- ATOM DEFINITION ----------------------------

region whole block 0 2 0 2 0 4 units lattice
region 1 block 0 2 0 2 0 2 units lattice
region 2 block 0 2 0 2 2 4 units lattice

# ------------------------ FORCE FIELDS ------------------------------
pair_style meam
pair_coeff * * library.meam Fe C Fe3C.meam Fe C
Reading MEAM library file library.meam with DATE: 2012-06-29

delete_atoms overlap 0.0001 all all
System init for delete_atoms ...
Unused restart file global fix info:
  fix style: npt, fix ID: 1
Neighbor list info ...
  update every 1 steps, delay 10 steps, check yes
  max neighbors/atom: 2000, page size: 100000
  master list distance cutoff = 6.5
  ghost atom cutoff = 6.5
  binsize = 3.25, bins = 3 4 9
  3 neighbor lists, perpetual/occasional/extra = 2 1 0
  (1) command delete_atoms, occasional, copy from (2)
      attributes: full, newton on
      pair build: copy
      stencil: none
      bin: none
  (2) pair meam, perpetual
      attributes: full, newton on
      pair build: full/bin/atomonly
      stencil: full/bin/3d
      bin: standard
  (3) pair meam, perpetual, half/full from (2)
      attributes: half, newton on
      pair build: halffull/newton
      stencil: none
      bin: none
Deleted 0 atoms, new total = 256

# ------------------------- SETTINGS --------------------------
group bot region 1
128 atoms in group bot
group top region 2
129 atoms in group top

compute peratom all pe/atom
compute eatoms all reduce sum c_peratom

compute toptemp all temp/region 2
compute bottemp all temp/region 1

# ------------------------- EQUILIBRATION --------------------------

dump 2 all custom 10000 liquidtosolid.cfg id mass type xs ys zs c_peratom fx fy fz
restart 100000 save.25000.restart

reset_timestep 0
timestep 0.002 #0.002ps = 2fs

velocity top create 0.0 12321
fix sf top setforce 0.0 0.0 0.0
#velocity bot create 750.0 12321

print "###Bottom 1500K to 1100K equilibration"
###Bottom 1500K to 1100K equilibration

fix 1 bot npt temp 800.0 550.0 100.0 iso 0.0 0.0 1000.0    #1500K에서 1100K까지 NPT
thermo 10000
thermo_style custom step c_toptemp c_bottemp temp lx ly lz press pe ke etotal

run 30000000 #60ns
Neighbor list info ...
  update every 1 steps, delay 10 steps, check yes
  max neighbors/atom: 2000, page size: 100000
  master list distance cutoff = 6.5
  ghost atom cutoff = 6.5
  binsize = 3.25, bins = 3 4 9
  2 neighbor lists, perpetual/occasional/extra = 2 0 0
  (1) pair meam, perpetual
      attributes: full, newton on
      pair build: full/bin/atomonly
      stencil: full/bin/3d
      bin: standard
  (2) pair meam, perpetual, half/full from (1)
      attributes: half, newton on
      pair build: halffull/newton
      stencil: none
      bin: none
Per MPI rank memory allocation (min/avg/max) = 10.29 | 10.3 | 10.31 Mbytes
Step c_toptemp c_bottemp Temp Lx Ly Lz Press PotEng KinEng TotEng 
       0            0            0     1114.406    9.3254203    10.496544    27.863732    -29313.04   -1217.2959    36.732311   -1180.5636 
   10000            0            0    1042.8226    9.3218332    10.492506    27.853014   -13330.361   -1213.1912    34.372828   -1178.8184 
   20000            0            0    1086.6414    9.3122977    10.481773    27.824523   -8331.0961   -1214.8816    35.817152   -1179.0644 
   30000            0            0    947.77578    9.2984167    10.466149    27.783047    7294.5076   -1210.5024    31.239957   -1179.2624 
   40000            0            0    1036.0462    9.2830615    10.448865    27.737167    6566.8625   -1213.4206    34.149466   -1179.2711 
   50000            0            0    1064.1517    9.2691639    10.433222    27.695642    12914.389   -1215.2658    35.075864   -1180.1899 
   60000            0            0    1105.3099    9.2597143    10.422586    27.667407    15082.212   -1217.2191    36.432492   -1180.7866 
   70000            0            0    1083.9782    9.2564538    10.418916    27.657665    15718.633   -1217.4514     35.72937    -1181.722 
   80000            0            0    1088.4997    9.2595516    10.422403    27.666921     18959.77    -1218.319    35.878404   -1182.4406 
   90000            0            0    1046.8519    9.2679882    10.431899    27.692129    10374.171   -1218.0109    34.505637   -1183.5052 
  100000            0            0     941.1513    9.2790332    10.444331    27.725131    3587.0737    -1215.741    31.021605   -1184.7194 
  110000            0            0    978.29606    9.2900607    10.456743     27.75808   -1993.3871   -1217.9218    32.245946   -1185.6759 
  120000            0            0    939.04494    9.2988381    10.466623    27.784307   -4583.6872   -1217.3829    30.952177   -1186.4308 
  130000            0            0     994.4148    9.3025214    10.470769    27.795312   -20082.261   -1220.0545    32.777241   -1187.2772 
  140000            0            0    988.71052    9.3003294    10.468302    27.788762   -17778.796   -1220.8956    32.589221   -1188.3064 
  150000            0            0    874.49238    9.2924023    10.459379    27.765077   -11976.155   -1217.7822    28.824438   -1188.9578 
  160000            0            0     1023.945    9.2799242    10.445334    27.727793   -9944.3474   -1223.2125    33.750597   -1189.4619 
  170000            0            0    958.97385    9.2655181    10.429119    27.684749   -1959.3153   -1221.8163     31.60906   -1190.2072 
  180000            0            0    897.64995    9.2520284    10.413935    27.644442    12528.897    -1220.249    29.587743   -1190.6612 
  190000    1849.6552            0     951.9775    9.2415706    10.402164    27.613195    6890.0288   -1223.3706    31.378451   -1191.9921 
  200000            0            0     849.2586    9.2360519    10.395952    27.596705    20685.451   -1220.6746    27.992699   -1192.6819 
  210000            0            0    925.22315    9.2360798    10.395983    27.596789    16369.373   -1223.7024    30.496592   -1193.2058 
  220000            0            0    974.89466    9.2406508    10.401128    27.610447    3778.1281   -1226.0463    32.133831   -1193.9125 
  230000            0            0    971.03072    9.2485888    10.410063    27.634165    10683.048   -1226.1719    32.006471   -1194.1655 
  240000            0            0    843.57206    9.2579113    10.420557     27.66202   -1313.8768   -1223.3285    27.805263   -1195.5232 
  250000            0            0    871.93307    9.2662387     10.42993    27.686901    -4564.507   -1224.9134     28.74008   -1196.1733 
  260000            0            0    772.92131    9.2708327    10.435101    27.700628    -14111.57    -1223.675     25.47652   -1198.1985 
  270000            0            0    876.30729    9.2704966    10.434722    27.699624    -19759.03   -1228.4374     28.88426   -1199.5531 
  280000            0    1999.4804    743.75944    9.2645904    10.428074    27.681976   -10995.189   -1224.7692    24.515305   -1200.2539 
  290000    257.04829            0    858.34371    9.2537708    10.415896    27.649648    -4009.826   -1228.7416    28.292156   -1200.4495 
  300000            0            0    757.83619    9.2412263    10.401776    27.612166    6002.2359   -1225.7893    24.979294     -1200.81 
  310000            0            0    857.01644    9.2296127    10.388704    27.577465      8529.45   -1228.2832    28.248408   -1200.0348 
  320000    1159.4159            0    831.03976    9.2207748    10.378756    27.551058    14835.843   -1227.8133    27.392182   -1200.4211 
  330000            0            0    800.07973    9.2164696     10.37391    27.538195    21124.875   -1227.7989    26.371698   -1201.4272 
  340000            0            0    902.22997    9.2175425    10.375118    27.541401    9434.4543   -1231.4746    29.738706   -1201.7359 
  350000    2263.3822            0     852.4866    9.2234983    10.381822    27.559196     15429.83    -1230.102    28.099098   -1202.0029 
  360000    1120.1515            0    818.20503    9.2329551    10.392466    27.587452      1326.98   -1228.4738    26.969132   -1201.5047 
  370000    3877.8773            0    824.29727    9.2442613    10.405192    27.621235   -111.39561   -1228.9256     27.16994   -1201.7556 
  380000            0            0    791.16834    9.2550873    10.417378    27.653582   -5768.7688   -1227.5726    26.077966   -1201.4946 
  390000            0            0    717.22783    9.2627913    10.426049    27.676601   -7098.1272   -1225.2049    23.640788   -1201.5641 
  400000    2695.8461            0    756.94871    9.2655664    10.429173    27.684893   -12579.965   -1227.0744    24.950041   -1202.1243 
  410000            0            0    737.04337    9.2630203    10.426307    27.677285   -15231.873   -1227.0685    24.293935   -1202.7746 
  420000            0            0    841.93251    9.2549242    10.417194    27.653095    -18276.62   -1231.6298    27.751221   -1203.8786 
  430000            0            0    797.05331    9.2429447     10.40371    27.617301    1583.8275   -1229.8998    26.271943   -1203.6279 
  440000            0            0    802.10875    9.2295389    10.388621    27.577245    6107.4904   -1230.0395    26.438577   -1203.6009 
  450000    1115.0904            0    734.49166    9.2175605    10.375138    27.541455    14565.962   -1227.8831    24.209827   -1203.6733 
  460000    755.21985    2783.7666    756.23461    9.2094763    10.366039    27.517299    22692.416   -1229.4526    24.926504   -1204.5261 
  470000            0            0    788.87304    9.2072099    10.363488    27.510527    19928.471   -1230.4969     26.00231   -1204.4946 

(skip)

29900000            0            0    540.96708    9.1724487    10.324361    27.406664   -8562.6826   -1250.9334    17.830998   -1233.1024 
29910000            0            0     510.8548    9.1727005    10.324645    27.407416    -1659.003   -1250.2811    16.838457   -1233.4426 
29920000            0            0    559.38329    9.1714701     10.32326    27.403739   -6597.6171   -1252.2361    18.438021   -1233.7981 
29930000            0    2052.5001    483.88568    9.1688616    10.320324    27.395946     2286.495   -1250.0602    15.949519   -1234.1107 
29940000            0            0    503.14921    9.1653159    10.316333    27.385351    274.82299   -1250.9232    16.584471   -1234.3387 
29950000            0            0    487.35852    9.1615414    10.312084    27.374073    4214.6495   -1250.4862    16.063988   -1234.4223 
29960000            0            0    491.74993    9.1583006    10.308436     27.36439    3458.1216   -1250.8496    16.208735   -1234.6409 
29970000            0            0    480.96767    9.1562632    10.306143    27.358302    6752.4284   -1250.2924    15.853338    -1234.439 
29980000            0            0    570.79252    9.1559929    10.305839    27.357495   -461.63257   -1253.1945    18.814085   -1234.3804 
29990000            0            0    543.64258    9.1576194     10.30767    27.362355    2256.2561   -1251.9936    17.919186   -1234.0744 
30000000    539.41152            0    507.31266    9.1608988    10.311361    27.372153    3769.9598   -1250.5107    16.721704    -1233.789 
Loop time of 57813.4 on 4 procs for 30000000 steps with 256 atoms

Performance: 89.668 ns/day, 0.268 hours/ns, 518.911 timesteps/s
98.2% CPU use with 4 MPI tasks x no OpenMP threads

MPI task timing breakdown:
Section |  min time  |  avg time  |  max time  |%varavg| %total
---------------------------------------------------------------
Pair    | 53841      | 54867      | 55421      | 265.8 | 94.90
Neigh   | 130.06     | 133.41     | 138.55     |  27.9 |  0.23
Comm    | 1231.1     | 1951.8     | 3173.6     |1654.9 |  3.38
Output  | 1.1526     | 1.1628     | 1.1873     |   1.3 |  0.00
Modify  | 470.48     | 756.49     | 1434.9     |1430.2 |  1.31
Other   |            | 103.3      |            |       |  0.18

Nlocal:             64 ave          64 max          64 min
Histogram: 4 0 0 0 0 0 0 0 0 0
Nghost:            975 ave         982 max         969 min
Histogram: 1 0 0 1 1 0 0 0 0 1
Neighs:           3631 ave        4035 max        3382 min
Histogram: 1 1 0 0 1 0 0 0 0 1
FullNghs:         7262 ave        7450 max        7048 min
Histogram: 1 1 0 0 0 0 0 0 0 2

Total # of neighbors = 29048
Ave neighs/atom = 113.46875
Neighbor list builds = 403363
Dangerous builds = 3

unfix 1

Total wall time: 16:03:33

Hello,
I think you need to take a step back and make a successful simulation with a much simpler system.

Here I suspect that you should be using the metal unit system given that you use the meam potential and from the fact that your timestep seems to be expressed in ps, yet I dont see the units command anywhere, which suggests that you are in fact using the default LJ units, yet your (isotropic?) barostat seems to be assuming real units (because of the 100 and 1000 values)…

Best,
Simon

edit : and in which unit is the cut-off in the command? :

delete_atoms overlap 0.0001 all all

because it certainly canno’t be Angstrom…

Please note that the unit style is stored in and read from binary restart files. So, that one would be inherited from the previous run. And the library.meam file that is bundled with LAMMPS has a UNITS: metal metadata tag which would trigger an error, if the units setting was not metal.

However, the lattice setting is not restored with binary restarts, so that you have the default setting where units lattice and units box would be the same. But if the system is like shown in the picture, regions 1 and 2 would only represent a tiny subsystem of the whole system when looking at the box dimensions reported during restart.

Yet the bot and top regions seem to contain the whole system with the top group apparently also containing one atom that is also in the group bot. So whatever the problem is, it is likely inherited from the previous run.

Update:

Upon closer inspection, I see that the group definitions are stored in restart files, so the top and bot definitions are inherited from the previous run. The group command is incremental, thus when calling the group command on the same group atoms will be added to the group (unless they are already in it).

So a good check to see, if there are any atoms in the regions would be to change bot to newbot and top to newtop and then look at the log files, if there are any atoms in those two groups from the region definitions for regions 1 and 2. You need at least two atoms inside a region to be able to compute a temperature. Looking at the posted log file this may happen only occasionally, since c_toptemp and c_bottemp are not always zero.

My bad, I did not know that. Therefore let me correct my previous answer: if units metal are in use, distances are in Angstrom, which makes the following cutoff suspiciously small :

delete_atoms overlap 0.0001 all all

and time is in ps which makes the following barrostat probably very weak due to damping parameters of 100 ps and 1000 ps:

fix 1 bot npt temp 800.0 550.0 100.0 iso 0.0 0.0 1000.0

Best,
Simon

For seeing what has been stored it is probably a good idea to insert an info all command right after read_restart.