Problem
- In this section we will try to simulate 500 atoms of carbon, in periodic(x,y,z) cubic box of dimentions 606060.Using LAMMPS code
Disclaimer:
- Please dont rely on the accuracy of data generated here in this sections, these examples are here only for a basic understanding of lammps.
Avogadro
- first open Avogadro GUI based softwere and then select Caron atom place any were in your work environment.
- Now go to Files > Export > Molecule
- And select save as type Gaussian Z-matrix input
- Now we have single atom in Z matrix format and it will look like this
- Now save this as .zmat format as required by fftool
- Now we will make c.ff file that contain about mass charge and force field parameters about atoms
- Now we will use these two file as input for fftool and we will create lammps data file
- type the following code
1
python3 fftool 500 c.zmat -b 60
FFtool for lammps data file
- At this point you have lammps data file (Please do proper research to find LJ parameters for C atom)
- Now we will lammps script for the simulation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
clear
units real
boundary p p p
atom_style full
pair_style lj/cut 12.0
read_data data.lmp
#read_restart restart.nve.2000100
pair_coeff 1 1 0.065583 3.400000 # C C
minimize 1.0e-4 1.0e-6 100 1000
neighbor 2.0 bin
neigh_modify delay 0 every 1 check yes
timestep 1.0
thermo_style custom step time etotal ke pe evdwl temp press vol density
thermo 10000
dump dcd all dcd 1000 C_500.dcd
dump_modify dcd unwrap yes
velocity all create 298.15 90066 dist gaussian
fix mynve all nve
run 2000000
unfix mynve
write_restart restart.nve.*
fix mynvt all nvt temp 298.15 298.15 100.0
run 2000000
unfix mynvt
write_restart restart.npt.*
fix mynpt all npt temp 298.15 298.15 100.0 iso 1.0 1.0 1000
run 10000000
unfix mynpt
write_restart restart.npt.*
- Above given script will run the simulation for total of 14 nanosecond
- 2 ns in NVE, 2ns in NVT and 10ns in NPT
Visualisation in VMD softwere
- After the simulation is over you will get .dcd file (snapshot of coordinates)
- Open VMD and go to Externsion > TkConsole and type the following
1
topo readlammpsdata data.lmp
1
pbc box
- After that select the molecule and go to File > Load Data into Molecule after all frames are loaded then again in console type
1
pbc wrap -all