# calculate viscosity of toluene @ 308 k temperature and 1 bar pressure #------------------------Define units, dimension and boundary echo both units real dimension 3 boundary p p p #-------------------------Define inter atomic potentials atom_style full pair_style lj/gromacs 9 14 bond_style harmonic angle_style harmonic cosine/squared #------------------------Reading Data from the file #read_data "system.data" #include "system.in.settings" read_data "system.data" include "system.in.settings" #------------------------Define variable parameters variable T equal 298 variable V equal vol variable dt equal 20 variable tempset equal 298.0 # K variable presset equal 1.0 # atm variable dense equal mass(all)*10/(6.0221417930*vol) variable timestepc equal 20 # fs variable thermofac equal 100.0 variable tempdamp equal ${thermofac}*${timestepc} variable presfac equal 10000.0 variable presdamp equal ${presfac}*${timestepc} #------------------------Initial velocity and Minimization velocity all create 298.0 53244 dist gaussian mom yes rot yes minimize 1.0e-12 1.0e-12 10000 1000000 #------------------------Define time_step and thermo_style timestep ${timestepc} thermo 500 thermo_style custom step pe ke etotal temp press lx ly lz vol density v_dense #------------------------restart file--------------------- restart 1000000 viscosity.restart #------------------------Equilibrium dump dump 2 all atom 20000 dump.lammpstrj #-----------------------Define ensemble NVE group toluene type 1 fix fshake toluene shake 0.0001 10 100 b 2 3 a 3#a 1 2 3 fix 1 all nve run 500 #----------------------- fix temperature fix 2 all langevin 298.0 298.0 100 48279 run 500 unfix 1 unfix 2 fix 3 all nvt temp ${tempset} ${tempset} ${tempdamp} run 500 unfix 3 #-----------------------Define ensemble NPT (1 bar) fix 3 all nvt temp ${tempset} ${tempset} ${tempdamp} fix 5 all press/berendsen iso ${presset} ${presset} ${presdamp} modulus 10000 run 2000000 unfix 5 #------------------------SIMULATION DONE----------------- print "The simulation is done"