LAMMPS Nanowire Deformation

From EVOCD
(Difference between revisions)
Jump to: navigation, search
(Understanding the Script)
(LAMMPS Input file)
Line 20: Line 20:
 
|<pre>
 
|<pre>
  
#Deforming a Nanowire.
+
# Deforming a Nanowire.
 +
# Suman Kandel, Dr. Mark A. Tschopp, 2011.
  
 
# ------------------------ INITIALIZATION ----------------------------
 
# ------------------------ INITIALIZATION ----------------------------

Revision as of 13:37, 18 November 2011

Contents

Abstract

This page is under construction!!!

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

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.

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 

Understanding the Script

Here is the breakdown of the input script. Go hereto get help with commands used in the script.

# Deforming a Nanowire.
# Suman Kandel, 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

LAMMPS Logfile

Here 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.


LAMMPS (25 Sep 2011)
#Deforming a Nanowire.

# ------------------------ INITIALIZATION ----------------------------
units        metal
boundary     p p p

atom_style   atomic


# ----------------------- ATOM DEFINITION ----------------------------
lattice hcp 3.20
Lattice spacing in x,y,z = 3.2 5.54256 5.22558
region whole block 0  100 0 100 0 100 units box
create_box 1 whole
Created orthogonal box = (0 0 0) to (100 100 100)
  1 by 1 by 1 processor grid
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
Lattice spacing in x,y,z = 3.2 5.54256 5.22558
create_atoms 1 region LLF
Created 5538 atoms
#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
Memory usage per processor = 3.75083 Mbytes
Step Temp TotEng Press Pxx Pyy Pzz Lx Ly Lz 
       0          100    11762.587    34252.827   -564.98021    -542.3081    103865.77          100          100          100 
     100    296.68608   -7362.9381     1190.744    80.974988    42.704342    3448.5527          100          100          100 
     200    143.26937   -7856.7089    733.12318   -358.47245   -345.92823    2903.7702          100          100          100 
     300    110.42105   -7949.5204    556.36477   -397.36502   -376.80405    2443.2634          100          100          100 
     400    105.05788   -7973.2384    686.19033   -157.18656   -147.35776    2363.1153          100          100          100 
     500    101.93437   -7990.8446    749.00004    70.107163     63.20829    2113.6847          100          100          100 
     600    96.418127   -7989.2193    833.60094    260.25192     290.3415    1950.2094          100          100          100 
     700    99.156757    -7992.619    878.98411    366.23693    384.40412    1886.3113          100          100          100 
     800    103.45223   -7995.9571    810.33924    343.50697    319.99358    1767.5172          100          100          100 
     900     98.93141   -7995.0492    681.89691    215.31441     116.7975    1713.5788          100          100          100 
    1000    102.25279   -8003.6359    437.12292   -41.026689   -120.50561    1472.9011          100          100          100 
    1100     100.8158   -8010.3386    252.35937   -207.78018   -280.22979    1245.0881          100          100          100 
    1200    101.95899   -8022.9763    125.62407   -284.36119   -344.49891    1005.7323          100          100          100 
    1300    100.87891   -8031.9585    118.68891   -205.66102   -270.83314     832.5609          100          100          100 
    1400    100.10274   -8031.7417    262.10292    -61.19085   -20.508565    868.00818          100          100          100 
    1500    97.466234    -8029.589    350.34194    113.55211    104.28686    833.18686          100          100          100 
    1600    98.956551   -8020.7912    510.28564    262.94376    311.80314    956.11002          100          100          100 
    1700    99.075467   -8012.1187     574.9002    339.66732    375.30924     1009.724          100          100          100 

Images and movies

Acknowledgments

S. Kandel and M.A. Tschopp would like to acknowledge funding provided under DOE.

References

The initial methodology was used in the following papers: Insert references here...

Go Back

Personal tools
Namespaces

Variants
Actions
home
Materials
Material Models
Design
Resources
Projects
Education
Toolbox