Users manual

For the codes generated during

The course of the PhD

Of

Tarek Ragab

Under the Supervision

Of

Professor Cemal Basaran

May 2010

Molecular Dynamics Simulation codes

  1. Generation codes

Generation codes are the Matlab codes written by Tarek Ragab to generate the input file named “coord.d” required for the Fortran code for the MD simulations.

There are two types of generation codes included on the CD. One for generating the geometry of a perfect carbon nanotube fixing the two ends of the tube. This file is called “CNT.m”. The other one is for generating the geometry of a carbon nanotube fixed from one and free from the other end except for one atom used to unravel the nanotube, and the location of that atom is changed to be outside the tube itself. This file is called “unravel.m”.

In order to control the input data to these codes, the file should be opened using Matlab editor and then changes should be made as required to the “input data” section at the beginning of the file.

The following are the list of parameters that can be changed in the code and their names:

n: The index n of the chirality vector Ch of the carbon nanotube

m: The index m of the chirality vector Ch of the carbon nanotube

a0: The distance between two carbon atoms in angstroms

nucells: Number of unit cells in the Z direction

nfixed: Number of unit cells to fix at each end of the nanotubes

type: Type of atoms (use 0 for moving atoms and 1 for thermostat atoms)

temp Temperature(for calculating the velocities of the atoms) in kelvins

ttime Total analysis time in femto-second

delta Time increment for MD analysis in Femto-seconds.

To run the code change the variables as required and then press F5, this will generate a file called “coord.d” in the location where the source file exists.

The Generated file “coord.d” then has to be moved to the MD simulation folder named Execute.

For the unraveling the previous explanation still holds.

  1. Simulations codes

Simulation codes are Fortran77 codes are generated by researchers from Unversity of Florida and are based on the 2nd generation Reactive empirical bond order. In order to debug anything in the potential itself, you have to be familiar with its theoretical back ground. Tarek Ragab added sum parts to the code that can apply stretching to the nanotube at different strain rates, calculate the stresses based on engineering stresses and virial stresses, and finally output the results of the stresses calculated in a file called “stresses.d”.

For using the code itself without using the additions made by Tarek Ragab, you need to read the user’s manual attached in this CD called “Brenner's Code.mht”.

To run the simulation you have to build and run the file named “main.f” in the folder execute.

Before running the file “main.f” you need to have the file “coord.d” generated by the file “CNT.m” or “unravel.m” ready. Also you need to modify the file “input.d” according to the instructions given in the file “Brenner's Code.mht” to adjust the number of time steps and the simulation temperature, and the number of time steps between writing the data in the output file called “output.d”

After running the code a DOS black screen will show up and will keep showing number that doesn’t have any physical meaning, but it only means that the simulation is still running. Once the simulation stops, due to an error or due to the end of the simulation time that screen will close automatically, and output files will be generated in the folder “execute”

The output files are “output.d” which gives the evolution of the temperature and the total energy of the system as a function of the total number of time steps. Also another output file is “stresses.d” which gives the evolution of the virial stresses and engineering stresses as function of simulated time steps.

The output files “output.d” and “stresses.d” can be opened using Excel and then charts can be generated as required.

In this code the stretching of the carbon nanotubes or the unraveling of the end of the nanotubes is applied through applying a displacement increment every certain number of time steps. To control the number of time steps between appling the displacement increment, you have to open the file named “main.f” and then change the following line as required:

if (mod(LSTEP,50).eq.0) call stretch

Here in the line shown the displacement increment is applied every 50 time steps. This can be changed as required.

. To apply the displacement increment, this is done through the file called “strech.f” written in FORTRAN code.

To change how the displacement increment is applied we show this in the code below in the file “stretch.d”

C

C move upper atoms up

C

do i=1,80

r0(i,3) = r0(i,3)-0.00025

enddo

C

C move lower atoms down

C

do i=281,np

r0(i,3) = r0(i,3)+0.00025

enddo

Here in the above code the atom 1 to 80 are stretched by avalue of 0.00025 angstroms. To change the value of the displacement increment you just have to change the value of 0.00025 to whatever value you like. Also atoms 281 to the last numbered atom in the simulation are stretched with the same value in the opposite direction. If it is needed to stretch the carbon nanotube just from one end you can either delete the upper atoms part or the lower atoms part as required.

To control how the stresses is calculated, this is done from the file “stresses.f” located in the folder execute

In the file “stresses.d” you have to specify the length of the carbon nanotube denoted by the parameter “tlength” in meters and the area of the nanotube denoted by the parameter “area” in meters. This two parameter are located at the beginning of the code found in the file “stresses.f” and have to specified correctly.

Also in the file “stresses.f” the number of steps used to average the stresses has to be specified. To specify them the following lines have to be changed by the new number of time steps required to be used for averaging:

str1ave=str1ave+stress1/50.0E0

str2ave=str2ave+stress2/50.0E0

str3ave=str3ave+stress3/50.0E0

str4ave=str4ave+stress4/50.0E0

In these lines the stresses are averaged over the range of 50 time steps.

Monte Carlo Simulation codes

  1. Energy dispersion code

This codeis the Matlab codes written by Tarek Ragab to generate theenergy dispersion relation and the density of states for any carbon nanotubes required for the MC simulations.

In order to control the input data to these codes, the file should be opened using Matlab editor and then changes should be made as required to the “input data” and “list of parameters” section at the beginning of the file.

The following are the list of parameters that can be changed in the code and their names:

ttransfer integral or hopping integral for the Pi-bond

soverlap integral

a0distance between two carbon atoms

mchiral vector index m

nchiral vector index n

To run the code change the variables as required and then press F5, this will generate a file many variables in the opened workspace.

Among the generated variables, the variable e and dedk are the most important and have to be saved as an input for the scattering rates generation codes.

The location where the specified variables is to be saved is so important and has to be known and specified latter in the file “scattering7.m” for the generation of the scattering rates.

  1. Phonon dispersion code

This codeis the Matlab codes written by Tarek Ragab to generate the phonon dispersion relation and the density of states for the phonons for any carbon nanotubes required for the MC simulations.

This code uses a force constant 4th neighbor interaction with the values of the force constants given at the beginning of the file as the variables “KK1”, “KK2”, “KK3” and “KK4”.

In order to control the input data to these codes, the file should be opened using Matlab editor and then changes should be made as required to the “input data” section at the beginning of the file.

The following are the list of parameters that can be changed in the code and their names:

mchiral vector index m

nchiral vector index n

To run the code change the variables as required and then press F5, this will generate a file many variables in the opened workspace.

Among the generated variables, the variable “w1”, “w2”, “w3”, “w4”, “w5” and “w6” are the most important and have to be saved as an input after some manipulations for the scattering rates generation codes.

The location where the specified variables is to be saved is so important and has to be known and specified latter in the file “scattering7.m” for the generation of the scattering rates.

The Variables “w1”, “w2”, “w3”, “w4”, “w5” and “w6” are the six phonon dispersion branches, and the number of subbands in each of the variables depends on the chirality of the nanotube.

Each of the variables “w1”, “w2”, “w3”, “w4”, “w5” and “w6” is attributed with its eigenvalue “eigv1”, “eigv2”, “eigv3”, “eigv4”, “eigv5” and ““eigv6” which has 6 values.

 The longitudinal optical phonons and the longitudinal Acoustic phonons have to extracted from the variables “w1”, “w2”, “w3”, “w4”, “w5” and “w6” using its eigenvalue “eigv1”, “eigv2”, “eigv3”, “eigv4”, “eigv5” and ““eigv6”. This can be extracted from more than one variable.

 The longitudinal optical phonons and the longitudinal Acoustic phonons have to be saved as a Matlab variables named “LO” and “LA” in the same folder chosen to save the variables generated in the energy dispersion part.

The slope of the “LA” and “LO” variables have to be calculated and generated in new variables named “LAdedq” and “LOdedq”

The slope variables named “LAdedq” and “LOdedq” have to be saved in the same folder as the other variables for input to the scattering rate code.

  1. Scattering rates code

This codeis the Matlab codes written by Tarek Ragab to generate the scattering rate at different states and the final states available for every initial state for any carbon nanotubes required for the MC simulations.

This code uses deformation potential approximations with it values given at the beginning of the file as the variables “DLA” and “DLO”.

In order to control the input data to these codes, the file should be opened using Matlab editor and then changes should be made as required to the “input data” section at the beginning of the file.

The following are the list of parameters that can be changed in the code and their names:

nnTotal number of subbands including degenerates(Have to be

consistent to the energy and phonon dispersion relation uploaded)

tempTemperature in Kelvin (independent variable)

eEElectric field force (ev/Angstrom) (independent variable)

The location of ALL the variables generated in the previous two sections and required for this code to run must be assigned at the beginning of the code as in the following section as the bolded text:

open E:\(10,10)\LA.mat; %Mesh for LA branches

LA=ans;

LA=LA.LA;

open E:\(10,10)\LO.mat; %Mesh for LO branches

LO=ans;

LO=LO.LO;

open E:\(10,10)\e.mat; %Mesh for electron-Energy branches

E=ans;

E=E.e;

open E:\(10,10)\LAdedq.mat; %Mesh for LA branches

LAdedq=ans;

LAdedq=LAdedq.LAdedq;

open E:(10,10)\LOdedq.mat; %Mesh for LO branches

LOdedq=ans;

LOdedq=LOdedq.LOdedq;

open E:(10,10)\dedk.mat; %Mesh for electron-Energy branches

dedk=ans;

dedk=dedk.dedk;

To run the code change the variables as required and then press F5, this will generate a file many variables in the opened workspace.

After the file ends running, all the output variables should be saved as one workspace file named “input.mat” for the next code “MonteCarlo.m”

  1. Monte Carlo Simulation code

This codeis the Matlab codes written by Tarek Ragab to an Ensemble Monte Carlo simulation and calculate cumulative energy and cumulative momentum transferred to the lattice for any carbon nanotubes required for the MC simulations.

In order to control the input data to these codes, the file should be opened using Matlab editor and then changes should be made as required to the “input data” section at the beginning of the file.

The following are the list of parameters that can be changed in the code and their names:

nnumber of electrons to be simulated

Lsimulated length of the nanotube in angstrom

eEElectric field force in ev/Angstrom

dttime step in seconds(has to be less than the scattering time)

ttotal simulation time

nsteptotal number of simulation steps

temperaturechoose only a value given in the array temp(in kelvin)

To run the code change the variables as required and then press F5, this will generate a file many variables in the opened workspace.

The main output of this code is the cumulative momentum and energy transferred to the lattice and these are saved in the variables “commom” and “comenergy”, respectively.