2
$\begingroup$

I followed the tutorial (https://github.com/lammps/lammps/blob/develop/examples/KAPPA/in.heat) to compute the thermal conductance of bilayer graphene sandwiched by Al2O3 on both sides along the z axis. Here is my input file.

variable x equal 47.59
variable y equal 41.214148966101
variable z equal 136.636
variable t equal 300.0

#Setup parameters
units metal
atom_style atomic
read_data atomic_structure_atomic
mass 1 16.0
mass 2 27.0
mass 3 12.0
mass 4 12.0
velocity all create $t 87287

pair_style hybrid/overlay lj/cut 12.0 morse 6.287 tersoff shift -0.0462
pair_coeff 1 1 lj/cut 0.00844 3.541
pair_coeff 1 2 lj/cut 0.0135951 4.02
pair_coeff 1 3 lj/cut 0.0 1.0
pair_coeff 1 4 lj/cut 0.0 1.0
pair_coeff 2 2 lj/cut 0.0218989 4.499
pair_coeff 2 3 morse 0.4691 1.738 2.246
pair_coeff 2 4 morse 0.4691 1.738 2.246
pair_coeff * * tersoff ./Copt.tersoff NULL NULL C C

neighbor 0.3 bin
neigh_modify delay 0 every 1

#energy minimization
fix 5 all box/relax iso 0.0 vmax 0.001
minimize 1.0e-4 1.0e-6 1000 100000
unfix 5

#layers for heat flux
region hot block INF INF INF INF 28.69356 42.12042884
region cold block INF INF INF INF 98.51465116 111.50565116
compute Thot all temp/region hot
compute Tcold all temp/region cold

#1st equilibirum run
fix 1 all nvt temp $t $t 100.0
thermo 10
run 100000
velocity all scale $t
unfix 1

#2nd equilibrium run
fix 1 all nve
fix hot all heat 1 1.0 region hot
fix cold all heat 1 -1.0 region cold
thermo_style custom step temp c_Thot c_Tcold
thermo_modify colname c_Thot Temp_hot colname c_Tcold Temp_cold
thermo 10
run 10000

#thermal conductivity calculation
compute ke all ke/atom
variable temp atom c_ke/1.5/8.617333262145e-5
compute layers all chunk/atom bin/1d z lower 0.02 units reduced
fix 2 all ave/chunk 10 100 1000 layers v_temp file profile.heat
variable tdiff equal f_2[20][3]-f_2[36][3]
fix ave all ave/time 10 100 1000 v_tdiff ave running start 13000

variable kappa equal 1.0/(lx*ly)*lz/f_ave
thermo_style custom step temp c_Thot c_Tcold v_tdiff f_ave
thermo_modify colname c_Thot Temp_hot colname c_Tcold Temp_cold &
              colname v_tdiff dTemp_step colname f_ave dTemp

run 200000
print "Running average thermal conductivity: $(v_kappa:%.4f)"

I received the following error message after I launched the calculation.

LAMMPS (2 Aug 2023)
variable x equal 47.59
variable y equal 41.214148966101
variable z equal 136.636
variable t equal 300.0

#Setup parameters
units metal
atom_style atomic
read_data atomic_structure_atomic
Reading data file ...
  triclinic box = (0 0 0) to (47.59 41.214149 136.636) with tilt (-23.795 0 0)
WARNING: Triclinic box skew is large. LAMMPS will run inefficiently. (../domain.cpp:220)
  1 by 1 by 1 MPI processor grid
  reading atoms ...
  19600 atoms
  read_data CPU = 0.199 seconds
mass 1 16.0
mass 2 27.0
mass 3 12.0
mass 4 12.0
velocity all create $t 87287
velocity all create 300 87287

#pair_style hybrid/overlay lj/cut 10.0 morse 6.287 tersoff shift -0.0462 kolmogorov/crespi/z 20.0
pair_style hybrid/overlay lj/cut 12.0 morse 6.287 tersoff shift -0.0462
pair_coeff 1 1 lj/cut 0.00844 3.541
pair_coeff 1 2 lj/cut 0.0135951 4.02
pair_coeff 1 3 lj/cut 0.0 1.0
pair_coeff 1 4 lj/cut 0.0 1.0
pair_coeff 2 2 lj/cut 0.0218989 4.499
pair_coeff 2 3 morse 0.4691 1.738 2.246
pair_coeff 2 4 morse 0.4691 1.738 2.246
pair_coeff * * tersoff ./Copt.tersoff NULL NULL C C

neighbor 0.3 bin
neigh_modify delay 0 every 1

#energy minimization
fix 5 all box/relax iso 0.0 vmax 0.001
minimize 1.0e-4 1.0e-6 1000 100000
Neighbor list info ...
  update: every = 1 steps, delay = 0 steps, check = yes
  max neighbors/atom: 2000, page size: 100000
  master list distance cutoff = 12.3
  ghost atom cutoff = 12.3
  binsize = 6.15, bins = 12 7 23
  6 neighbor lists, perpetual/occasional/extra = 6 0 0
  (1) pair lj/cut, perpetual, skip from (4)
      attributes: half, newton on
      pair build: skip
      stencil: none
      bin: none
  (2) pair morse, perpetual, skip from (5)
      attributes: half, newton on, cut 6.587
      pair build: skip
      stencil: none
      bin: none
  (3) pair tersoff, perpetual, skip from (6)
      attributes: full, newton on, cut 2.4
      pair build: skip
      stencil: none
      bin: none
  (4) neighbor class addition, perpetual
      attributes: half, newton on
      pair build: half/bin/newton/tri
      stencil: half/bin/3d/tri
      bin: standard
  (5) neighbor class addition, perpetual, trim from (4)
      attributes: half, newton on, cut 6.587
      pair build: trim
      stencil: none
      bin: none
  (6) neighbor class addition, perpetual
      attributes: full, newton on, cut 2.4
      pair build: full/bin/atomonly
      stencil: full/bin/3d
      bin: standard
WARNING: Energy due to 1 extra global DOFs will be included in minimizer energies
 (../min.cpp:225)
Per MPI rank memory allocation (min/avg/max) = 87.58 | 87.58 | 87.58 Mbytes
   Step          Temp          E_pair         E_mol          TotEng         Press          Volume    
         0   300            18675574       0              18676334       4.5038706e+08  267995.3     
      1000   300            355.71228      0              1115.7232      7818.4545      2143962.4    
Loop time of 192.986 on 1 procs for 1000 steps with 19600 atoms

99.8% CPU use with 1 MPI tasks x no OpenMP threads

Minimization stats:
  Stopping criterion = max iterations
  Energy initial, next-to-last, final = 
      18675574.3392642   370.713719775112   355.712282174799
  Force two-norm initial, final = 2.2600666e+08 14933.478
  Force max component initial, final = 2.2600657e+08 14933.459
  Final line search alpha, max atom move = 6.6359114e-08 0.00099097112
  Iterations, force evaluations = 1000 1000

MPI task timing breakdown:
Section |  min time  |  avg time  |  max time  |%varavg| %total
---------------------------------------------------------------
Pair    | 81.011     | 81.011     | 81.011     |   0.0 | 41.98
Neigh   | 109.55     | 109.55     | 109.55     |   0.0 | 56.77
Comm    | 0.48548    | 0.48548    | 0.48548    |   0.0 |  0.25
Output  | 0.00010763 | 0.00010763 | 0.00010763 |   0.0 |  0.00
Modify  | 0          | 0          | 0          |   0.0 |  0.00
Other   |            | 1.938      |            |       |  1.00

Nlocal:          19600 ave       19600 max       19600 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost:          13422 ave       13422 max       13422 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs:              0 ave           0 max           0 min
Histogram: 1 0 0 0 0 0 0 0 0 0

Total # of neighbors = 0
Ave neighs/atom = 0
Neighbor list builds = 539
Dangerous builds = 78
unfix 5

#layers for heat flux
region hot block INF INF INF INF 28.69356 42.12042884
region cold block INF INF INF INF 98.51465116 111.50565116
compute Thot all temp/region hot
compute Tcold all temp/region cold

#1st equilibirum run
fix 1 all nvt temp $t $t 100.0
fix 1 all nvt temp 300 $t 100.0
fix 1 all nvt temp 300 300 100.0
thermo 10
run 100000
Per MPI rank memory allocation (min/avg/max) = 95.1 | 95.1 | 95.1 Mbytes
   Step          Temp          E_pair         E_mol          TotEng         Press     
      1000   300            355.71228      0              1115.7232      7818.4545    
      1010   289.14242      383.22878      0              1115.7334      7898.4387    
      1020   262.83777      449.97678      0              1115.842       8094.8676
......
    110980   1884.322       1864.0873      1986.5247    
    110990   1881.9124      1881.575       1937.1548    
    111000   1882.1765      1886.5183      1926.9182    
Loop time of 490.656 on 1 procs for 10000 steps with 19600 atoms

Performance: 1.761 ns/day, 13.629 hours/ns, 20.381 timesteps/s, 399.465 katom-step/s
100.0% CPU use with 1 MPI tasks x no OpenMP threads

MPI task timing breakdown:
Section |  min time  |  avg time  |  max time  |%varavg| %total
---------------------------------------------------------------
Pair    | 119.07     | 119.07     | 119.07     |   0.0 | 24.27
Neigh   | 350.79     | 350.79     | 350.79     |   0.0 | 71.49
Comm    | 4.3024     | 4.3024     | 4.3024     |   0.0 |  0.88
Output  | 0.41462    | 0.41462    | 0.41462    |   0.0 |  0.08
Modify  | 13.986     | 13.986     | 13.986     |   0.0 |  2.85
Other   |            | 2.1        |            |       |  0.43

Nlocal:          19600 ave       19600 max       19600 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost:          16269 ave       16269 max       16269 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs:              0 ave           0 max           0 min
Histogram: 1 0 0 0 0 0 0 0 0 0

Total # of neighbors = 0
Ave neighs/atom = 0
Neighbor list builds = 4670
Dangerous builds = 2

#thermal conductivity calculation
compute ke all ke/atom
variable temp atom c_ke/1.5/8.617333262145e-5
compute layers all chunk/atom bin/1d z lower 1.0 units reduced
fix 2 all ave/chunk 10 100 1000 layers v_temp file profile.heat
variable tdiff equal f_2[20][3]-f_2[36][3]
fix ave all ave/time 10 100 1000 v_tdiff ave running start 13000

variable kappa equal 1.0/(lx*ly)*lz/f_ave
thermo_style custom step temp c_Thot c_Tcold v_tdiff f_ave
WARNING: New thermo_style command, previous thermo_modify settings will be lost (../output.cpp:903)
thermo_modify colname c_Thot Temp_hot colname c_Tcold Temp_cold               colname v_tdiff dTemp_step colname f_ave dTemp

run 3000000
ERROR: Thermo and fix ave not computed at compatible times (../thermo.cpp:301)
Last command: run 3000000

I ran the tutorial and the calculation could be done successfully.

Would anyone please tell me why the 'Thermo' and 'fix ave' command conflicts in my case? Thank you in advance.

$\endgroup$
2
  • $\begingroup$ Something seems not right in the log file. Are you sure the log belongs to the input file you shared? The log says the last command was run 3000000, but there is no such command in the input above it. So I suspect there were some modifications to the input in between. $\endgroup$ Commented Apr 17 at 14:14
  • $\begingroup$ @Andrey Poletayev Thank you for the reply. I altered my input file several times but I am sure that this log file belongs to the input file before I changed 3000000 to 2000000 for the 'run' command. How can I upload the temperature gradient v.s. distance figure onto the StackExchange bcause I am confused with the figure results? $\endgroup$
    – Kieran
    Commented Apr 17 at 14:28

1 Answer 1

2
$\begingroup$

You seem to be using your fix f_ave, which gets computed every 1000 steps, in your thermo_style output, which is written every 10 steps. This should not work since for some (most!) times there will be no values computed by your fix.

As a broader background, the fix ave/time with the keywords Nevery Nrepeat Nfreq set to 10 100 1000 as you have it here will only output a value every Nfreq which here is 1000 steps.

See the documentation for the fix for more details:

The Nevery, Nrepeat, and Nfreq arguments specify on what time steps the input values will be used in order to contribute to the average. The final averaged quantities are generated on time steps that are a multiple of Nfreq. The average is over Nrepeat quantities, computed in the preceding portion of the simulation every Nevery time steps. Nfreq must be a multiple of Nevery and Nevery must be non-zero even if Nrepeat = 1. Also, the time steps contributing to the average value cannot overlap, i.e. Nrepeat*Nevery can not exceed Nfreq.

For example, if Nevery = 2, Nrepeat = 6, and Nfreq = 100, then values on time steps 90, 92, 94, 96, 98, and 100 will be used to compute the final average on time step 100. Similarly for time steps 190, 192, 194, 196, 198, and 200 on time step 200, etc. If Nrepeat = 1 and Nfreq = 100, then no time averaging is done; values are simply generated on time steps 100, 200, etc.

So in your case I would reduce either Nevery or Nrepeat to ensure the consecutive points do not overlap (10 * 100 = 1000). The overlap may also result in a problem.

$\endgroup$
3
  • $\begingroup$ Thank you very much for the explanation. I revised my input file and obtained the temperature gradient but the result puzzled me. I post it into another question (mattermodeling.stackexchange.com/questions/12787/…). Would you please have a look at it and give me some more suggestions? Thank you again. $\endgroup$
    – Kieran
    Commented Apr 17 at 15:11
  • $\begingroup$ I'll try. If this answer solves this question, consider accepting the answer. $\endgroup$ Commented Apr 17 at 18:15
  • $\begingroup$ Yes, I have already accepted your answer. Thank you for your help. $\endgroup$
    – Kieran
    Commented Apr 18 at 6:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .