From a5fef35ebd99ba334052e03f8c2ce02533527f06 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Tue, 7 Jun 2016 18:00:49 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15144 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- examples/KAPPA/README | 25 ++++++++++---- examples/KAPPA/in.ehex | 76 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+), 6 deletions(-) create mode 100644 examples/KAPPA/in.ehex diff --git a/examples/KAPPA/README b/examples/KAPPA/README index ba4938c291..17313b251c 100644 --- a/examples/KAPPA/README +++ b/examples/KAPPA/README @@ -1,5 +1,5 @@ -This directory has 4 scripts that compute the thermal conductivity -(kappa) of a Lennard-Jones fluid using 4 different methods. See the +This directory has 5 scripts that compute the thermal conductivity +(kappa) of a Lennard-Jones fluid using 5 different methods. See the discussion in Section 6.20 of the manual for an overview of the methods and pointers to doc pages for the commands which implement them. Citations for the various methods can also be found in the @@ -13,11 +13,12 @@ These scripts could easily be adapted to work with solids as well. ------------- -These are the 4 methods for computing thermal conductivity. The first -3 are non-equilibrium methods; the last is an equilibrium method. +These are the 5 methods for computing thermal conductivity. The first +4 are non-equilibrium methods; the last is an equilibrium method. in.langevin = thermostat 2 regions at different temperatures via fix langevin in.heat = add/subtract energy to 2 regions via fix heat +in.ehex = add/subtract energy to 2 regions via fix ehex in.mp = use fix thermal/conductivity and the Muller-Plathe method in.heatflux = use compute heat/flux and the Green-Kubo method @@ -69,7 +70,19 @@ dZ = 18.82 Kappa = 3.39 -(3) in.mp +(3) in.ehex + +dQ = (100*100) / 100 / 18.82^2 / 2 + 100*100 = 100 (time in tau) * 100 (energy delta specified in fix heat) + 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 +TBC: dTemp = 0.783 from log file for average Temp difference between 2 regions +dZ = 18.82 + +TBC: Kappa = 3.39 + +(4) in.mp dQ = 15087 / 100 / 18.82^2 / 2 15087 = cummulative delta energy, tallied by fix thermal/conductivity @@ -81,7 +94,7 @@ dZ = 18.82 Kappa = 3.45 -(4) in.heatflux +(5) in.heatflux kappa is computed directly within the script, by performing a time integration of the formulas discussed on the compute heat/flux doc diff --git a/examples/KAPPA/in.ehex b/examples/KAPPA/in.ehex new file mode 100644 index 0000000000..5620dbbe17 --- /dev/null +++ b/examples/KAPPA/in.ehex @@ -0,0 +1,76 @@ +# sample LAMMPS input script for thermal conductivity of liquid LJ +# use fix ehex to add/subtract energy from 2 regions + +# 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 rho equal 0.85 +#variable t equal 0.7 +#variable rc equal 3.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 ehex 1 100.0 region hot +fix cold all ehex 1 -100.0 region cold + +thermo_style custom step temp c_Thot c_Tcold +thermo 1000 +run 10000 + +# thermal conductivity calculation + +compute ke all ke/atom +variable temp atom c_ke/1.5 + +fix 2 all ave/spatial 10 100 1000 z lower 0.05 v_temp & + file profile.heat units reduced + +variable tdiff equal f_2[11][3]-f_2[1][3] +fix ave all ave/time 1 1 1000 v_tdiff ave running start 13000 +thermo_style custom step temp c_Thot c_Tcold v_tdiff f_ave + +run 20000