# Questions about Example KAPPA

Dear LAMMPS-User,

I have some questions about the Example KAPPA.
https://github.com/lammps/lammps/tree/master/examples/KAPPA

In the example, the input file is

# settings

variable x equal 10
variable y equal 10
variable z equal 20

variable rho equal 0.6
variable t equal 1.35
variable rc equal 2.5
variable tlo equal 1.0
variable thi equal 1.70

#variable rho equal 0.85
#variable t equal 0.7
#variable rc equal 3.0
#variable tlo equal 0.3
#variable thi equal 1.0

# setup problem

units lj
atom_style atomic

lattice fcc \${rho}
region box block 0 \$x 0 \$y 0 \$z
create_box 1 box
create_atoms 1 box
mass 1 1.0

velocity all create \$t 87287

pair_style lj/cut \${rc}
pair_coeff 1 1 1.0 1.0

neighbor 0.3 bin
neigh_modify delay 0 every 1

# heat layers

region hot block INF INF INF INF 0 1
region cold block INF INF INF INF 10 11
compute Thot all temp/region hot
compute Tcold all temp/region cold

# 1st equilibration run

fix 1 all nvt temp \$t \$t 0.5
thermo 100
run 1000

velocity all scale \$t

unfix 1

# 2nd equilibration run

fix 1 all nve
fix hot all langevin {thi} {thi} 1.0 59804 tally yes
fix cold all langevin {tlo} {tlo} 1.0 287859 tally yes
fix_modify hot temp Thot
fix_modify cold temp Tcold

variable tdiff equal c_Thot-c_Tcold
thermo_style custom step temp c_Thot c_Tcold f_hot f_cold v_tdiff
thermo 1000
run 10000

# reset langevin thermostats to zero energy accumulation

compute ke all ke/atom
variable temp atom c_ke/1.5

fix hot all langevin {thi} {thi} 1.0 59804 tally yes
fix cold all langevin {tlo} {tlo} 1.0 287859 tally yes
fix_modify hot temp Thot
fix_modify cold temp Tcold

fix ave all ave/time 10 100 1000 v_tdiff ave running
thermo_style custom step temp c_Thot c_Tcold f_hot f_cold v_tdiff f_ave

fix 2 all ave/spatial 10 100 1000 z lower 0.05 v_temp &
file profile.langevin units reduced

run 20000

and calculate the thermal conductivity by the following way.

(1) in.langevin

dQ = 8000 * 0.5*(0.905+0.947) / 100 / 18.82^2 / 2
8000 atoms
0.5*(0.905+0.947) = from log file =
ave of total in/out energy for 2 regions normalized by # of atoms
100 = 20,000 steps at 0.005 tau timestep = run time in tau
xy box area = 18.82^2
divide by 2 since energy flux goes in 2 directions due to periodic z
dTemp = 0.578 from log file for average Temp difference between 2 regions
dZ = 18.82

Kappa = 3.41

I have 2 questions.

The first question is that
ave of total in/out energy for 2 regions normalized by # of atoms = 0.5*(0.905+0.947)
How can I get 0.905 and 0.947 in the log file? I can’t find these two data in the log file
Are they from f_hot and f_cold command?

And the second question.
In this example.

fix hot all langevin {thi} {thi} 1.0 59804 tally yes
fix cold all langevin {tlo} {tlo} 1.0 287859 tally yes
fix_modify hot temp Thot
fix_modify cold temp Tcold

thermo_style custom step temp c_Thot c_Tcold f_hot f_cold v_tdiff f_ave

I want to know what kind of information that I get from f_hot and f_cold command in this example.
Temperature or energy?

Thanks a lot

Michael Hsieh

It’s possible/likely that the README has not been updated for

the most recent version of LAMMPS. I.e. the long runs

give slightly different answers after many timesteps. So the

ideas in the README are correct. The exact numbers to

use from the logfile may be different.

Steve