-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathscript_LAMMPS_Basic.inp
More file actions
139 lines (111 loc) · 4.31 KB
/
script_LAMMPS_Basic.inp
File metadata and controls
139 lines (111 loc) · 4.31 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
### command to run:
### basic setting
units metal
dimension 3
boundary p p p # y need to be periodic, otherwise the empty region of the simulation box will be removed
atom_style atomic
atom_modify map array
comm_style tiled # for load balancing we need tiled
### neighbor setting
neighbor 2 bin
### global variables
variable nrun equal 4
variable ndump equal 2
variable nThermo equal 1
variable nrunIdle equal 0*${nrun}
### set these parameters correctly, rest will be compited accordingly
variable Height equal 50 # Height of the newly created region.
variable lx equal 301 # add 1 so that 'floor' functions behave accordingly. lx>${DistanceLaserShot} for Laser
variable ly equal 501
variable lz equal 3
variable random01 equal random(0,1,123456)
lattice fcc 3.52 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1
region box block 0 ${lx} ${Height} ${ly} 0 ${lz}
create_box 2 box
### Initial atomic region
region BlockInitial block INF INF 45 200 INF INF
###create_atoms
#create_atoms 1 box
#delete_atoms group all
create_atoms 1 region BlockInitial
mass 1 58.71
mass 2 58.71
### create other regions, dummy. So that it can be deleted in the recurssive block
variable y1 equal ${Height}
variable y2 equal 3*${Height}
variable y3 equal 4*${Height}
variable y_Inside equal ${y1}+2
variable z2 equal 0.0
variable z3 equal ${lz}
region BlockDeleteAtomsBottom_01 block INF INF INF ${y1} INF INF
group GroupDeleteAtomsBottom_01 region BlockDeleteAtomsBottom_01
region BlockCreateAtomsTop_01 block INF INF ${y2} ${y3} INF INF
group GroupCreateAtomsTop_01 region BlockCreateAtomsTop_01
region BlockInside block INF INF ${y_Inside} INF INF INF
group GroupInside region BlockInside
variable nAtomsAll equal count(all)
variable nAtomsInitial equal ${nAtomsAll}
print "nAtomsInitial: ${nAtomsInitial}"
variable nAtomsNew equal count(GroupCreateAtomsTop_01)
variable nAtomsDelete equal count(GroupDeleteAtomsBottom_01)
### EAM potentials
pair_style eam/alloy
#pair_coeff * * /home/schakraborty/MyRepository/LAMMPS_02/potentials/NiAlH_jea.eam.alloy Ni Ni # in GUIDO
pair_coeff * * /mnt/f/MyRepositories/LAMMPS_02/potentials/NiAlH_jea.eam.alloy Ni Ni # in WSL
### initial velocities
variable T equal 800
variable T2 equal 2*$T # put twice the desired system temperature
compute Temperature all temp
velocity all create ${T2} 187723 temp Temperature
### compute
### CNA and centro in region all, dump 2 times, 1 in all, 1 in dumpregion
compute CNA all cna/atom 3.00
compute CENTRO all centro/atom fcc
compute PE all pe/atom
compute KE all ke/atom
compute stress all stress/atom Temperature
compute p all pressure Temperature
### Compute temperature
variable TotalKE equal ke(GroupCreateAtomsTop_01)
variable Temp02 equal (v_TotalKE/(v_nAtomsNew*8.6*1.0e-05))*(2/3) # KE=(dim/2)*N*K_b*T);)K_b = 8.6*1.0e-05 eV/K
### run
timestep 0.005
thermo ${nThermo}
thermo_style custom step temp pe ke v_Temp02
####minimize the system energy and press, statistic equilibirum
#fix systemminimize all box/relax iso 0 nreset 5 vmax 0.001
#minimize 1E-10 1E-10 2000 2000
###define fix
fix 1 all npt temp $T $T 0.2 drag 0.5 x 0.0 0.0 5 z 0.0 0.0 5 couple none
#fix 1 all nve
dump dumpCFG all cfg ${ndump} dump_*.cfg mass type xs ys zs id c_CNA c_PE c_KE vy fy
dump_modify dumpCFG first yes
dump dump02 all custom ${ndump} dump_*.dump id mass type xs ys zs id c_CNA c_PE c_KE vy fy
dump_modify dump02 first yes
### to output in a file using 'fix print'
variable Step equal step
variable Temp equal temp
variable PE equal pe
variable KE equal ke
fix extra all print ${nThermo} "${Step} ${Temp} ${PE} ${KE} ${Temp02}" &
file Output_Thermo.out screen no title "${Step} ${Temp} ${PE} ${KE} ${Temp02}"
balance 1.1 rcb # load balancing
run ${nrun} # Dynamics equiulibriation
reset_timestep 0
unfix 1
#fix 1 GroupInside nve
fix 1 GroupInside npt temp $T $T 0.2 drag 0.5 x 0.0 0.0 5 z 0.0 0.0 5 couple none
fix fPushParticles GroupCreateAtomsTop_01 addforce 0.0 0.0 0.0 every 1
fix fLangevin GroupDeleteAtomsBottom_01 langevin ${T} ${T} 0.2 123456
run ${nrun}
print "*****LAMMPS Initilization DONE******"
### to run AM script in loop
label labelSetAMLoop
variable nLoop equal floor((${ly}-${y3})/${Height})
print "Total AM Loop: ${nLoop}"
variable loop01 loop ${nLoop}
label labelAMLoop
print "loop: ${loop01}"
next loop01
jump script_LAMMPS_AM.inp
print "===ALL loop finished===="