Computational Materials Modelling Using LAMMPS: Basic Nickel simulation

Basic Nickel simulation

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 applicable to the entire system>
#================================================
region forbox block 0 35.2 0 35.2 0 35.2 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> <3.52 is the argument for the scale keyword, while the other a1, a2 a3 are the three lattice vectors: This is followed by the basis commands giving the location of atoms in one unit cell.>
lattice fcc 3.52 #lattice constant for nickel is 3.52
#=======================================================================
create_atoms 1 region forbox  basis 1 1 basis 2 1 basis 3 1 basis 4 1 units box
mass 1 58.69 #<Mass of atom type 1 is 58.69 [mass units grams/mole]>
pair_style eam
#Provide the name of the potential
pair_coeff 1 1 Ni_u3.eam
#=======================================================================
group Ni type 1 #<Group all the Nickel types (nickel type is of type 1). All atoms of type 1 are in group with the name 'Ni'
minimize 1e-25 1e-19 10000 10000 #<Minimize the energy using a conjugate gradient step.
print "Finished Minimizing"
#minimize etol ftol maxiter for minimizer maxiter for force_energy valuation
variable ener equal pe
#=========================================================
timestep  0.001
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.
fix 1 all nve
dump dump_1 all custom 100 dump.in id type x y z ix iy iz vx vy vz #<Dump all the atoms to the file dump.in>
variable poten equal pe-${ener}
thermo_style  custom step time temp pe ke etotal press vol v_poten
#What to print in the logfile.txt?
#=========================================================
thermo 100 #How frequently to print the thermodynamic information#
run 10000 # run with active settings as many runs as required. timestep*No. of. steps =10ps
undump dump_1 # Stop dumping information to the dump file.
unfix 1
# Unfix the NVE. Additional lines if any will assume that this fix is off.
#end
#-------------------------------------------------------------------------------------------------------------------------

Visit LAMMPS Manual for detailed explanation of various commands used.

Visualisation


Explanation

1. In my previous blogs for Argon simulation, I would have mentioned the interatomic potentials inside the input script itself. The reason was, the number of potential values was too small. But generally, it won't be like that. The potential values itself will be described in a separate file. In these cases, we will direct LAMMPS to read the potential values directly from that potential file. If you can see in pair_coeff  command I have mentioned a file name (Ni_u3.eam) instead of some values. So this is the second method of mentioning potential values.

2. But for running this simulation successfully you need to have Ni_u3.eam with you. This potential file is by default gets downloaded when you download LAMMPS. It will be stored in the potential file of your LAMMPS folder. If it is not available you can download, not only this potential file but also whatever the file you want from interatomic potential repository

If you have any troubles running the script do mention it in the comment section and keep visiting the blog!


No comments:

Post a Comment