-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathin.walls
182 lines (153 loc) · 5.94 KB
/
in.walls
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#########################################################################
#
# LJ FLUID BETWEEN WALLS
#
# Author: Diego Duque
#
# #######################################################################
########################################
#
# Initialization
#
########################################
# define units
units lj
# specify periodic boundary conditions
boundary p p p
# define time step
timestep 0.005
# specify parameters for neighbor list
# rnbr = rcut + 0.3
neighbor 0.3 bin
# This command sets parameters that affect the building of pairwise neighbor
# lists. All atom pairs within a neighbor cutoff distance equal to the their
# force cutoff plus the skin distance are stored in the list. Typically, the
# larger the skin distance, the less often neighbor lists need to be built, but
# more pairs must be checked for possible force interactions every timestep.
########################################
#
# Regions, groups and atoms
#
########################################
# fcc = body-centered cubic structure
# density 1.1
lattice fcc 1.1
# define regions
region simbox block 0.0 15.0 0.0 15.0 0.0 30.0
region wallUpper block 0.0 14.5 0.0 14.5 20.0 25.0
region wallBottom block 0.0 14.5 0.0 14.5 5.0 10.0
region springsUpper block 0.0 14.5 0.0 14.5 25.0 25.0
region springsBottom block 0.0 14.5 0.0 14.5 5.0 5.0
region bulk block 1.0 13.0 1.0 13.0 12.0 18.0
############
# Sometimes we need to specify the number of particles:
#############
# define simulation volume
# If I want N = 512 atoms
# and I want a density of rho = 0.5 atoms/lj-sigma^3
# Then I can determine the size of a cube by
# size = (N/rho)^(1/3)
#########################################
# create simulation box
# create_box N region-ID
# N = # of atom types to use in this simulation
create_box 2 simbox
# place atoms of type 1 in "wallUpper" and "wallBottom"
create_atoms 1 region wallUpper
create_atoms 1 region wallBottom
mass 1 1.0
# create the group "wall"
group upper region wallUpper
group lower region wallBottom
group wall union upper lower
set group wall type 1
# create the group "wallSpring"
group springsUpper region springsUpper
group springsBottom region springsBottom
group wallSpring union springsUpper springsBottom
set group wallSpring type 1
# specify initial positions of atoms between walls.
# place atoms of type 2 in "bulk".
lattice sc 0.8
create_atoms 2 region bulk
mass 2 1.0
# create the group "fluid"
group fluid subtract all wall wallSpring
set group fluid type 2
# create the group "lowerWallNoSprings" and "upperWallNoSprings"
group lowerWallNoSprings subtract all wallSpring upper fluid
group upperWallNoSprings subtract all wallSpring lower fluid
########################################
#
# Interaction potential
#
########################################
# specify interaction potential
# pairwise interaction via the Lennard-Jones potential with a cut-off at 2.5 lj-sigma
pair_style lj/cut 2.5
# Type 1: Solid. Type 2: Fluid.
# pair_coef type_i type_j epsilon sigma rcut
# specify parameters between atoms of type 1 with an atom of type 1
pair_coeff 1 1 20.0 1.0 2.5
# ... between atoms of type 2 and 2
pair_coeff 2 2 1.0 1.0 2.5
# ... between atoms of type 1 and 2
pair_coeff 1 2 1.0 1.0 2.5
pair_modify shift yes
#The shift keyword determines whether a Lennard-Jones potential is shifted at its cutoff to 0.0. If so, this adds an
#energy term to each pairwise interaction which will be included in the thermodynamic output, but does not affect
#pair forces or atom trajectories. See the doc page for individual pair styles to see which ones support this option.
# Set each component of force on each atom in the group to the specified values fx,fy,fz.
# fix ID group-ID setforce fx fy fz
fix force wallSpring setforce 0.0 0.0 0.0
########################################
#
# SIMULATION - Equilibration in microcanonical ensemble with langevin thermostat. Then, in microcanonical ensemble, change the temperature of group lowerWallNoSprings
#
########################################
###################
# EQUILIBRATION
###################
# microcanonical ensemble
fix nve all nve
# langevin thermostat
# fix ID group-ID langevin Tstart Tstop damp seed
fix langFluid fluid langevin 1.5 1.5 0.5 3216
fix langLowerWall lowerWallNoSprings langevin 1.5 1.5 0.5 3215
fix langUpperWall upperWallNoSprings langevin 1.5 1.5 0.5 6586
# compute the temperature of the groups "lowerWallNoSprings", "upperWallNoSprings" and "fluid".
compute tempLower lowerWallNoSprings temp
compute tempUpper upperWallNoSprings temp
compute tempFluid fluid temp
# create vmd input to visualize the system during the process.
dump movie all atom 100 movie.lammpstrj
# specify thermodynamic properties to be output
thermo_style custom step temp c_tempFluid c_tempLower c_tempUpper pe ke etotal
# report instantaneous thermo values
thermo 100
# run simulation
run 30000
# unfix langevin thermostat
unfix langFluid
unfix langLowerWall
unfix langUpperWall
# save equilibartion process
write_restart restart.equilibration
##################
# PRODUCTION
##################
# compute potencial energy per atom and kinetic energy per atom.
compute pe all pe/atom
compute ke all ke/atom
# save positions and energy per atom in group fluid every 1 step (filename = output.lammps).
dump energies all custom 100 production.energy id x y z c_pe c_ke
# save positions (filename = output.positions)
dump positions all custom 100 production.positions id type x y z
# save velocities (filename = output.velocities)
dump velocities all custom 100 production.velocities id type vx vy vz
# run simulation
run 5000
# change the temperature group lower
velocity lowerWallNoSprings create 10.0 87462 dist gaussian
# run simulation
run 300000