LAMMPS Nanowire Deformation
(→Abstract) |
Emmanuelli (Talk | contribs) (→Go Back) |
||
(2 intermediate revisions by one user not shown) | |||
Line 364: | Line 364: | ||
*[[MaterialModels:_Nanoscale | Nanoscale]] | *[[MaterialModels:_Nanoscale | Nanoscale]] | ||
*[[LAMMPS tutorials]] | *[[LAMMPS tutorials]] | ||
+ | |||
+ | [[Category: LAMMPS]] | ||
+ | [[Category: Tutorial]] | ||
+ | [[Category: Input Deck]] | ||
+ | [[Category: Script]] |
Latest revision as of 15:39, 16 April 2015
Contents |
[edit] Questions / Comments
Please contact me if you have any questions or comments about this tutorial. I'll try to add questions and answers to the bottom of the tutorial pages as they arise.
Email: Mark Tschopp, mark.tschopp@gatech.edu
[edit] Abstract
This is a tutorial to deform a nanowire. For this tutorial, We have a Magnesium single crystal nanowire which is deformed after Symmetry Calculation, Energy and Pressure Equilibration.
Author(s): Suman Kandel, Mark A. Tschopp
Corresponding Author: Mark Tschopp
[edit] Methodology
The following input script shows how to generate a periodic nanowire and then deform it at a prescribed strain rate. Files are dumped during the simulation in two different folder; equilibration dump files and deformed dump files. The dump files can then be easily viewed and post-processed for results.
Please go through first few LAMMPS tutorials before you do this tutorial.
[edit] LAMMPS Input file
# Deforming a Nanowire. # Suman Kandel, Dr. Mark A. Tschopp, 2011. # ------------------------ INITIALIZATION ---------------------------- units metal boundary p p p atom_style atomic # ----------------------- ATOM DEFINITION ---------------------------- lattice hcp 3.20 region whole block 0 100 0 100 0 100 units box create_box 1 whole region LLF cylinder z 50 50 20 INF INF units box lattice hcp 3.20 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 create_atoms 1 region LLF #delete_atoms overlap 0.5 all all # ------------------------ FORCE FIELDS ------------------------------ pair_style eam/fs pair_coeff * * Al-Mg.eam.fs Mg # ------------------------- SETTINGS --------------------------------- #### Computes Required compute csym all centro/atom 12 compute 2 all stress/atom compute mytemp all temp compute 11 all reduce sum c_2[1] compute 12 all reduce sum c_2[2] compute 13 all reduce sum c_2[3] compute 14 all reduce sum c_2[4] compute 15 all reduce sum c_2[5] compute 16 all reduce sum c_2[6] neighbor 0.3 bin neigh_modify delay 10 thermo 100 velocity all create 100.0 16723 thermo_style custom step temp etotal press pxx pyy pzz lx ly lz shell mkdir dump shell cd dump #---------------Energy Equilibriation-------------------------- reset_timestep 0 fix 1 all nve fix 2 all temp/rescale 10 100.0 100.0 1.0 0.5 dump 1 all custom 10000 dump.equilibrate.* id type x y z run 10000 unfix 1 unfix 2 #-----------------Pressure Equilibriation----------------------- fix 1 all npt 100.0 100.0 10.0 aniso NULL NULL NULL NULL 0.0 0.0 10 drag 0.3 run 10000 unfix 1 undump 1 shell cd .. shell mkdir deform shell cd deform #--------------------Storing Initial length--------------------- variable tmp equal "lz" variable L0 equal ${tmp} print "Initial Length, L0: ${L0}" variable strain equal "v_srate/1e12" #------------Deform------------------------------ reset_timestep 0 fix 1 all deform 1 z erate 0.0001 units box fix 2 all nvt 100.0 100.0 10.0 variable strain equal "(lz - v_L0)/v_L0" variable p1 equal "v_strain" variable p2 equal "-pxx/10000" variable p3 equal "-pyy/10000" variable p4 equal "-pzz/10000" variable p5 equal "lx" variable p6 equal "ly" variable p7 equal "lz" variable p8 equal "temp" variable p9 equal "pe" variable p10 equal "ke" variable p11 equal "-pxy/10000" variable p13 equal "-pyz/10000" variable p12 equal "-pxz/10000" variable fm equal "(v_p2+v_p3+v_p4)/3" ##### Hydrostatic stress variable fv equal "sqrt((v_p2-v_p3)^2+(v_p3-v_p4)^2+(v_p4-v_p2)^2+6*(v_p11^2+v_p12^2+v_p13^2)/2)" ######Von Mises Stress variable t equal "v_fm/v_fv" variable fd equal (((v_p2-v_fm)*(v_p3-v_fm)*(v_p4-v_fm))-v_p11^2*(v_p4-v_fm)-v_p12^2*(v_p3-v_fm)-v_p13^2*(v_p2-v_fm)+2*v_p11*v_p12*v_p13)####Deviatoric Von Mises stress dump 2 all custom 10000 dump.defo.* id type x y z c_csym c_2[1] c_2[2] c_2[3] c_2[4] c_2[5] c_2[6] fix def_print all print 100 "${p1} ${p2} ${p3} ${p4} ${p5} ${p6} ${p7} ${p8} ${p9} ${p10} ${p11} ${p12} ${p13} ${fm} ${fv} ${t} ${fd}" file mg001.defo.txt screen no run 100000 |
[edit] Understanding the Script
Here is the breakdown of the input script. Go here to get help with commands used in the script. # Deforming a Nanowire. # Suman Kandel, Mark A. Tschopp, 2011. The "INITIALIZATION" section defines the style of units, the dimension (3-D here) and style of atoms. # ------------------------ INITIALIZATION ---------------------------- units metal boundary p p p atom_style atomic We use 'lattice' command to produce an array of HCP atoms, typically of Magnesium. With some commands, we cut out a block and then nanowire from that array. If we have overlapping atoms, we can delete them. # ----------------------- ATOM DEFINITION ---------------------------- lattice hcp 3.20 region whole block 0 100 0 100 0 100 units box create_box 1 whole region LLF cylinder z 50 50 20 INF INF units box lattice hcp 3.20 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 create_atoms 1 region LLF #delete_atoms overlap 0.5 all all We need to define the pair potentials for pairwise interactions. Simulation is run with the defined potential. Results vary according to potentials used. Here, we have finnis-sinclair potential used for Magnesium. # ------------------------ FORCE FIELDS ------------------------------ pair_style eam/fs pair_coeff * * Al-Mg.eam.fs Mg After Creating a nanowire and defining the pair interactions, we have to set up the the way our simulation is going to run. This section computes various properties, then defines the variables such as thermo, velocity etc. which prescribes how a simulation runs and dumps results. # ------------------------- SETTINGS --------------------------------- #### Computes Required compute csym all centro/atom 12 compute 2 all stress/atom compute mytemp all temp compute 11 all reduce sum c_2[1] compute 12 all reduce sum c_2[2] compute 13 all reduce sum c_2[3] compute 14 all reduce sum c_2[4] compute 15 all reduce sum c_2[5] compute 16 all reduce sum c_2[6] neighbor 0.3 bin neigh_modify delay 10 thermo 100 velocity all create 100.0 16723 thermo_style custom step temp etotal press pxx pyy pzz lx ly lz shell mkdir dump shell cd dump It's now time for simulation to actually run, which begins with the energy equilibration. The nanowire has to be equilibrated to constant energy before the deformation. #---------------Energy Equilibriation-------------------------- reset_timestep 0 fix 1 all nve fix 2 all temp/rescale 10 100.0 100.0 1.0 0.5 dump 1 all custom 5000 dump.equilibrate.* id type x y z run 10000 unfix 1 unfix 2 Nanowire also has to be equilibrated to constant pressure. Files are dumped after every 5000 timesteps. #-----------------Pressure Equilibriation----------------------- fix 1 all npt 100.0 100.0 10.0 aniso NULL NULL NULL NULL 0.0 0.0 10 drag 0.3 run 10000 unfix 1 undump 1 shell cd .. shell mkdir deform shell cd deform During the equilibration process for Energy and Pressure, The original length of the nanowire changes by a small value, but we want our nanowire to have original measurements before we could run the deformation on it. So this section stores the initial length of the nanowire.Strain rate must be defined for the simulation to run. #--------------------Storing Initial length--------------------- variable tmp equal "lz" variable L0 equal ${tmp} print "Initial Length, L0: ${L0}" variable strain equal "v_srate/1e12" This is last section of the simulation, but not the least. This is where deformation is actually carried out. Different variables such as strain rate, pressures, stress has been defined and then later printed in the log files. After each particular timestep of 10000, this section dumps files with the information about the nanowire at that timestep. These dumped files can be later visualized to see what happens to a nanowire during the deformation. #------------Deform------------------------------ reset_timestep 0 fix 1 all deform 1 z erate 0.0001 units box fix 2 all nvt 100.0 100.0 10.0 variable strain equal "(lz - v_L0)/v_L0" variable p1 equal "v_strain" variable p2 equal "-pxx/10000" variable p3 equal "-pyy/10000" variable p4 equal "-pzz/10000" variable p5 equal "lx" variable p6 equal "ly" variable p7 equal "lz" variable p8 equal "temp" variable p9 equal "pe" variable p10 equal "ke" variable p11 equal "-pxy/10000" variable p13 equal "-pyz/10000" variable p12 equal "-pxz/10000" variable fm equal "(v_p2+v_p3+v_p4)/3" ##### Hydrostatic stress variable fv equal "sqrt((v_p2-v_p3)^2+(v_p3-v_p4)^2+(v_p4-v_p2)^2+6*(v_p11^2+v_p12^2+v_p13^2)/2)" ######Von Mises Stress variable t equal "v_fm/v_fv" variable fd equal (((v_p2-v_fm)*(v_p3-v_fm)*(v_p4-v_fm))-v_p11^2*(v_p4-v_fm)-v_p12^2*(v_p3-v_fm)-v_p13^2*(v_p2-v_fm)+2*v_p11*v_p12*v_p13)####Deviatoric Von Mises stress dump 2 all custom 10000 dump.defo.* id type x y z c_csym c_2[1] c_2[2] c_2[3] c_2[4] c_2[5] c_2[6] fix def_print all print 100 "${p1} ${p2} ${p3} ${p4} ${p5} ${p6} ${p7} ${p8} ${p9} ${p10} ${p11} ${p12} ${p13} ${fm} ${fv} ${t} ${fd}" file mg001.defo.txt screen no run 100000 As the result of simulation, we end up getting dump, deform folders, log files and few other files which can be used for post-processing. [edit] LAMMPS LogfileHere is an example logfile that is obtained after running this script. The run time values has been cut short to few lines since it is a long simulation. The deleted lines are as similar to those you can see in this Log Script.
[edit] Questions and Answers?Q1: Hey, I just wanted to point out something that may be an error in your code. Under the "Pressure Equilibration" section, the line "fix 1 all npt 100.0 100.0 10.0 aniso NULL NULL NULL NULL 0.0 0.0 10 drag 0.3" gave me an error saying that this particular fix command was incorrect in the log.lammps file. So I changed it to "fix 1 all npt temp 100.0 100.0 10.0 aniso 0.0 0.0 10 drag 0.3" and it seemed to work. Can you explain why you left out 'temp' and why you added NULL four times after aniso?
[edit] AcknowledgmentsS. Kandel and M.A. Tschopp would like to acknowledge funding provided under DOE. [edit] Go Back |