lammps/examples/VISCOSITY/in.gk.2d

66 lines
1.3 KiB
Plaintext

# sample LAMMPS input script for viscosity of 2d LJ liquid
# Green-Kubo method via fix ave/correlate
# settings
variable x equal 20
variable y equal 20
variable rho equal 0.6
variable t equal 1.0
variable rc equal 2.5
variable p equal 400 # correlation length
variable s equal 5 # sample interval
variable d equal $p*$s # dump interval
# problem setup
units lj
dimension 2
atom_style atomic
neigh_modify delay 0 every 1
lattice sq2 ${rho}
region simbox block 0 $x 0 $y -0.1 0.1
create_box 1 simbox
create_atoms 1 box
pair_style lj/cut ${rc}
pair_coeff * * 1 1
mass * 1.0
velocity all create $t 97287
# equilibration run
fix 1 all nve
fix 2 all langevin $t $t 0.1 498094
fix 3 all enforce2d
thermo $d
run 10000
velocity all scale $t
unfix 2
# Green-Kubo viscosity calculation
reset_timestep 0
variable pxy equal pxy
fix SS all ave/correlate $s $p $d &
v_pxy type auto file profile.gk.2d ave running
variable scale equal 1.0/$t*vol*$s*dt
variable v11 equal trap(f_SS[3])*${scale}
thermo_style custom step temp press pxy v_v11
run 500000
variable eta equal v_v11
print "running average viscosity: ${eta}"