Input script
#-------------------------------------------------------------------------------------------------------------------------
units metal #What are the units you will use to specify various things in the input file?
boundary p p p #<Specify periodic boundary condition are needed in all three faces of the simulation box>
atom_style atomic #<What style of atoms is to be used in the simulation>
log logfile.txt #<Write the log file to this text file. All thermodynamic information is applicable to the entire system>
#================================================
variable stp equal 100
#Define a variable called stp and assign the value 100 to it.
# We can define many variable types and also perform calculations on them,
# from within this script. So, a lot of the post-processing could be done
# from within LAMMPS itself.
#================================================
print "The number of steps I will run is = ${stp}"
# Print this variable in some manner.
#================================================
region forbox block 0 45.8 0 45.8 0 45.8 units box
#<Refers to an abstract geometric region of space. units box refers to the fact that the size of the box is specified in the units as given in the units command. The name "forbox" refers to the region ID so that you can refer to it somewhere else in this input script.>
create_box 1 forbox #<Create the box>
#=======================================================================
#<Creates the lattice> <4.85 is the argument for the scale keyword, while the other a1, a2 a3 are the three lattice vectors: This is follwed by the basis commands giving the location of atoms in one unit cell.>
lattice custom 4.58 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 1.0 &
basis 0.0 0.0 0.0 &
basis 0.5 0.5 0.0 &
basis 0.0 0.5 0.5 &
basis 0.5 0.0 0.5
#Note the use of & to continue a large number of the basis on the next lines
#=======================================================================
create_atoms 1 region forbox basis 1 1 basis 2 1 basis 3 1 basis 4 1 units box
#<Puts the atoms in the box>
# basis 1 1 means the first basis specified belongs to atom of 'type 1'
#=======================================================================
mass 1 39.948 #<Mass of atom type 1 is 39.48 [mass units grams/mole]>
#=======================================================================
pair_style lj/cut 10
# k_B = 8.6173303e-5 eV/K #<How are atoms interacting. Provide the name of the potential and the cooresponding cut-off distance>
pair_coeff 1 1 0.01006418 3.3952 #<The coefficient of the lj potential for the interactions of atom type 1 with 1>
#=======================================================================
group ar type 1 #<Group all the argon types (argon type is of type 1). All atoms of type 1 are in group with the name 'ar'
# group and "group" together atoms in various ways. See the manual.
# All these names (or IDs) are of your choice, except you should avoid using names of the keywords
#=======================================================================
timestep 0.001
#Specify a timestep for this run. Can be changed as required
dump dump_1 all custom 1 dump.min id type x y z ix iy iz vx vy vz
#<Dump all the atoms to the file dump.min>
#<dump ID group style N filename args. See web page for details. ix iy and iz give the details of the image that the atom is presently located>
#=========================================================
run 1
minimize 1e-7 1e-9 10000 10000 #<Minimize the energy using a conjugate gradient step.
print "Finished Minimizing"
#minimize etol ftol maxiter for minimizer maxiter for force_energy valuation
#dump dump_1 all custom 1 dump.min id type x y z ix iy iz vx vy vz #<Dump all the atoms to the file dump.min>
#=========================================================
#log file_two.txt
# Open another logfile for printing thermodynamic information, from this point onwards.
thermo_style custom step time temp pe etotal press vol
#What to print in the logfile.txt?
#=========================================================
velocity all create 300 102939 dist gaussian mom yes rot yes
# Set the velocities of all the atoms so that the temperature of the system
# is 300K. Make the distribution Gaussian.
thermo 1 #How frequently to print the thermodynamic information#
variable t equal time
run ${stp} # run with active settings as many runs as required.
#run ${stp} every 10 "print '-----------------------------Time is $t' " # run as many steps as defined using the variable stp
#and then every 10 steps print the time.
#If the name of the variable is a single character, you need not use the
#flower brackets "{}".
undump dump_1 # Stop dumping the information to the dump file.
print "Printed in the new log file"
print "None of the atoms vibrate"
print "Need to have a fix"
#end
#-------------------------------------------------------------------------------------------------------------------------
Running the script
You can copy the above script and save it in ".txt" or ".in" format. For running visit my previous blogs for a detailed explanation.
Visualisation
Explanation
1. The simulation will generate 2 files namely "logfile.txt" and "dump.min". The dump file is used to generate the visualisation. Log file can be used for further processing.
2. When you see the simulation the atoms don't vibration. There is no flaw in our simulation. As the name suggests this is a static simulation. We just gave the atoms initial velocity. So it won't vibrate, and this is a typical example of molecular static simulation.
If you have any questions do mention them in the comment box or contact me via email.
2. When you see the simulation the atoms don't vibration. There is no flaw in our simulation. As the name suggests this is a static simulation. We just gave the atoms initial velocity. So it won't vibrate, and this is a typical example of molecular static simulation.
If you have any questions do mention them in the comment box or contact me via email.
what can I do with the dump ?
ReplyDelete