Molecular Dynamics Simulations - Techkmomeni/Courses/Multiscale Material Design/Lec… · PI: K....

14
Molecular Dynamics Simulations Dr. Kasra Momeni www.KNanoSys.com

Transcript of Molecular Dynamics Simulations - Techkmomeni/Courses/Multiscale Material Design/Lec… · PI: K....

Page 1: Molecular Dynamics Simulations - Techkmomeni/Courses/Multiscale Material Design/Lec… · PI: K. Momeni Structure of LAMMPS Scripts •Define the Units and atom attributes •Create

Molecular DynamicsSimulations

Dr. Kasra Momeniwww.KNanoSys.com

Page 2: Molecular Dynamics Simulations - Techkmomeni/Courses/Multiscale Material Design/Lec… · PI: K. Momeni Structure of LAMMPS Scripts •Define the Units and atom attributes •Create

PI: K. Momeni

Outline• LAMMPS

AdHiMad Lab 2

Page 3: Molecular Dynamics Simulations - Techkmomeni/Courses/Multiscale Material Design/Lec… · PI: K. Momeni Structure of LAMMPS Scripts •Define the Units and atom attributes •Create

PI: K. Momeni

What is LAMMPS?• LMMPS=Large-scaleAtomic/MolecularMassivelyParallelSimulator• Open-Source(http://lammps.sandia.gov)• RunningclassicMD(althoughothercodeshaveimplementedinLAMMPSasitevolved,suchasquasi-continuummethods)

• Itutilizesparallelizationalgorithmstospeedupthesimulations• Differentfeature:MD,non-equilibriumMD,energyminimization• Abilitytorunondifferentparallelizationplatforms(GraphicProcessingUnits(GPU),MPI,OpenMP)

• Abilitytoconnecttootherscales:quantummechanics,kineticMonteCarlo,FiniteElement,...

AdHiMad Lab 3

Page 4: Molecular Dynamics Simulations - Techkmomeni/Courses/Multiscale Material Design/Lec… · PI: K. Momeni Structure of LAMMPS Scripts •Define the Units and atom attributes •Create

PI: K. Momeni

LAMMPS Feature• Extendible• Extensivedocuments/tutorials• Strongusercommunity(mailinglist:http://lammps.sandia.gov/mail.html)• Extensiveexamples• Workshops• Textbased(usingascriptinglanguagetosetupthesimulations)- Nographics- Notinteractive- Linebylinerun

AdHiMad Lab 4

Page 5: Molecular Dynamics Simulations - Techkmomeni/Courses/Multiscale Material Design/Lec… · PI: K. Momeni Structure of LAMMPS Scripts •Define the Units and atom attributes •Create

PI: K. Momeni

Structure of LAMMPS Scripts• DefinetheUnitsandatomattributes• Createsimulationcellandpositionatomsinthecell• Definegroupsofatoms(thathavethesameproperty)• Setpropertiesofatoms(velocityandmass)• Defineatomicinteractions• Definethesystemconstraints• Definethepropertiesofinterest(Youneedtodefinetheanalysisyouinterestedbeforerunningsimulations,thereislimitedpostprocessing)

• Settheoutputperiodsofthesimulation• Performingthesimulation

AdHiMad Lab 5

Page 6: Molecular Dynamics Simulations - Techkmomeni/Courses/Multiscale Material Design/Lec… · PI: K. Momeni Structure of LAMMPS Scripts •Define the Units and atom attributes •Create

PI: K. Momeni

Flow Chart of Running LAMMPS• CommandforrunningLAMMPS

• Singleprocessorrun:

LAMMPSexecutable<inputfile• Multipleprocessor(parallel)run:

mpirun -np8LAMMPSexecutable<inputfile

AdHiMad Lab 6

PreparingInputFile(s)

RunningLAMMPS(Passingthescriptfile)

lmp <input_file.in

CollectingOutputFile(s)

AnalyzingOutputFile(s)–usingin-housecodesorothers(OVITO,VMD)

Page 7: Molecular Dynamics Simulations - Techkmomeni/Courses/Multiscale Material Design/Lec… · PI: K. Momeni Structure of LAMMPS Scripts •Define the Units and atom attributes •Create

PI: K. Momeni

LAMMPS Common Commands – Initialization • Pleasetakealookatonlinedocumentationofeachcommandformoredetails• clear

• clearsallmemory• units

• unitsthatwillbeusedforthesimulation• dimension

• Dimensionofthesimulationcell• boundary

• Periodicornon-periodicboundaryconditions• atom_style

• Determinesattributesassociatedwiththeatoms.• atom_modify

• ModifycertainattributesofatomsdefinedandstoredwithinLAMMPS(otherthanwhatisspecifiedbythe atom_style )

AdHiMad Lab 7

Page 8: Molecular Dynamics Simulations - Techkmomeni/Courses/Multiscale Material Design/Lec… · PI: K. Momeni Structure of LAMMPS Scripts •Define the Units and atom attributes •Create

PI: K. Momeni

LAMMPS Common Commands – Initialization • lattice

• Typeoflattice(fcc,bcc,hcp,etc. )

• region• Specifiesthesimulationcelldimension/geometry

• create_box• Createsthesimulationboxusingthedimensionsofregion

• create_atoms• Createsatoms(ormolecules)onalattice

• replicate• replicatetheperiodiccellineachdirection

AdHiMad Lab 8

Page 9: Molecular Dynamics Simulations - Techkmomeni/Courses/Multiscale Material Design/Lec… · PI: K. Momeni Structure of LAMMPS Scripts •Define the Units and atom attributes •Create

PI: K. Momeni

LAMMPS Common Commands – Initialization • pair_style

• Specifiestheinteratomicpotential

• pair_coeff• Specifythepairwiseforcefieldcoefficients

• neighbor• setsparametersthataffectthebuildingofpairwiseneighborlists

• neigh_modify• Setstheparametersofpairwiseneighborlists

• compute• Definevariablestostorecertaincalculations

AdHiMad Lab 9

Page 10: Molecular Dynamics Simulations - Techkmomeni/Courses/Multiscale Material Design/Lec… · PI: K. Momeni Structure of LAMMPS Scripts •Define the Units and atom attributes •Create

PI: K. Momeni

LAMMPS Common Commands – Running • reset_timestep

• Resetstimestep• fix

• Setssystemconstrains• thermo

• specifiestheoutputduringtherun• thermo_style

• specifieswhattypeofoutput• min_style

• specifiesminimizationtechnique• minimize

• startstheminimization

AdHiMad Lab 10

Page 11: Molecular Dynamics Simulations - Techkmomeni/Courses/Multiscale Material Design/Lec… · PI: K. Momeni Structure of LAMMPS Scripts •Define the Units and atom attributes •Create

PI: K. Momeni

LAMMPS Common Commands – Post Process• variable

• Definesvariables

• print• Printtextorvalueofavariabel

AdHiMad Lab 11

Page 12: Molecular Dynamics Simulations - Techkmomeni/Courses/Multiscale Material Design/Lec… · PI: K. Momeni Structure of LAMMPS Scripts •Define the Units and atom attributes •Create

PI: K. Momeni

Practice Problem • PerformthesimulationsofHomework2usingLAMMPS

AdHiMad Lab 12

Page 13: Molecular Dynamics Simulations - Techkmomeni/Courses/Multiscale Material Design/Lec… · PI: K. Momeni Structure of LAMMPS Scripts •Define the Units and atom attributes •Create

PI: K. Momeni

Useful Links • LAMMPSTutorials

• http://lammps.sandia.gov/tutorials.html• https://scent.gist.ac.kr/downloads/tutorial/2012/1/Lammps_Tutorial_20120706.pdf

• http://www.u.arizona.edu/~stefanb/Files/HPCTutorials/MD-lammps-Final.pdf• http://zqex.dk/index.php/teaching/lammps-demo

• Manymoreareavailableonline

AdHiMad Lab 13

Page 14: Molecular Dynamics Simulations - Techkmomeni/Courses/Multiscale Material Design/Lec… · PI: K. Momeni Structure of LAMMPS Scripts •Define the Units and atom attributes •Create

PI: K. Momeni AdHiMad Lab 14

Questions