LAMMPS Fracture

From EVOCD
(Difference between revisions)
Jump to: navigation, search
(Grain boundary structure file)
 
(21 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
== Questions / Comments ==
 +
 +
Please contact me if you have any questions or comments about this tutorial.
 +
 +
Email: Mark Tschopp, [mailto:mark.tschopp@gatech.edu mark.tschopp@gatech.edu]
 +
 
== Abstract ==
 
== Abstract ==
  
This example shows how to run an atomistic simulation of fracture of an iron symmetric tilt grain boundary. A parallel molecular dynamics code, LAMMPS<ref>S. Plimpton, "Fast Parallel Algorithms for Short-Range Molecular Dynamics," J. Comp. Phys., 117, 1-19 (1995). </ref>, is used to calculate stresses at the grain boundary as the strain of the bicrystal is incrementally increased. A stress-strain curve is plotted as a result of the simulation.
+
This example shows how to run an atomistic simulation of fracture of an iron symmetric tilt grain boundary. A parallel molecular dynamics code, LAMMPS<ref>S. Plimpton, "Fast Parallel Algorithms for Short-Range Molecular Dynamics," J. Comp. Phys., 117, 1-19 (1995). </ref>, is used to calculate stresses at the grain boundary as the strain of the bicrystal is incrementally increased. Matlab is used to plot a stress-strain curve, and AtomEye<ref>J. Li, "AtomEye: an efficient atomistic configuration viewer," Modelling Simul. Mater. Sci. Eng. 11 (2003) 173. </ref>. is used to visualize the simulation.
  
 
Author(s): [http://www.hpc.msstate.edu/directory/information.php?eid=1967 Mark A. Tschopp], Nathan R. Rhodes
 
Author(s): [http://www.hpc.msstate.edu/directory/information.php?eid=1967 Mark A. Tschopp], Nathan R. Rhodes
Line 15: Line 21:
 
=== Grain boundary structure file ===
 
=== Grain boundary structure file ===
  
The grain boundary structure that was generated prior to this example can be found [[Fe_100_sig5_210.txt | here]]. Store the text in "Fe_100_sig5_210.txt" to use it.
+
The grain boundary structure that was generated prior to this example can be found [[Fe_110_sig3.txt | here]]. Store the text in "Fe_110_sig3.txt" to use it.
  
 
=== LAMMPS input script ===
 
=== LAMMPS input script ===
  
This input script was run using the November 2010 version of LAMMPS. Changes in some commands in more recent versions may require revision of the input script. This script runs the simulation with a previously generated grain boundary file, which is fed to the variable "datfile." The variable "nloop" defines how many times the strain will be increased and the number of points at which the stress is calculated. To run this script, store it in "in.gb_fracture.txt" and use "lmp_exe < in.gb_fracture.txt" in a UNIX environment where "lmp_exe" refers to the LAMMPS executable.
+
This input script was run using the November 2010 version of LAMMPS. Changes in some commands in more recent versions may require revision of the input script. This script runs the simulation with a previously generated grain boundary file, which is fed to the variable "datfile." The variable "nloop" defines how many times the strain will be increased and the number of points at which the stress is calculated. Other variables, such as the strain increment and the number of replications, can be changed in the input file. To run this script, store it in "in.gb_fracture.txt" and use "lmp_exe -var datfile Fe_110_sig3.txt -var nloop 100 < in.gb_fracture.txt
 +
" in a UNIX environment where "lmp_exe" refers to the LAMMPS executable.
 +
 
 +
Before strain is applied to the atoms, those atoms that are far from the grain boundary (defined by the variable deldist) are deleted to prevent unwanted transitions between periodic boundaries and to decrease simulation time. Then two smaller groups of atoms (width of groups defined by difference in variables deldist and fixdist) are fixed by setting their forces equal to zero. These same fixed groups are then incrementally strained until the grain boundary fractures.
  
 
{|border  ="0"
 
{|border  ="0"
 
|<pre>
 
|<pre>
 
############################################################################
 
############################################################################
# Interfacial fracture
+
# Interfacial Fracture
# Mark Tschopp, 2010
+
# Mark Tschopp, Nathan Rhodes 2011
  
# lmp_exe -var datfile Fe_100_sig52_10.txt -var strain 0.001 -var nloop 100 -var minlength 20 < in.gb_fracture.txt
+
# lmp_exe -var datfile Fe_110_sig3.txt -var nloop 100 < in.gb_fracture.txt
 +
 
 +
# Simulation deletes atoms outside of +/- deldist from GB and constrains and pulls
 +
# atoms outside of +/- fixdist from GB to fracture the GB
 
############################################################################
 
############################################################################
  
variable datfile index Fe_100_sig5_210.txt
+
#variable datfile index Fe_110_sig3.txt
 
variable strain equal 0.001
 
variable strain equal 0.001
variable nloop equal 100
+
#variable nloop equal 100
#variable repl equal 1
+
variable repx equal 1
 +
variable repz equal 1
 
variable strain2 equal "1+v_strain"
 
variable strain2 equal "1+v_strain"
 +
variable deldist equal 50
 +
variable fixdist equal 45
  
 
######################################
 
######################################
Line 58: Line 73:
 
print "lz: ${zlen}"
 
print "lz: ${zlen}"
  
# Determine number of increments for displacement grid in the in-plane GB directions
+
# Replicate simulation cell in each direction
variable xrepl equal "ceil(v_minlength / v_xlen)"
+
replicate ${repx} 1 ${repz}
variable zrepl equal "ceil(v_minlength / v_zlen)"
+
 
+
replicate ${xrepl} 1 ${zrepl}
+
  
 
######################################
 
######################################
Line 69: Line 81:
 
pair_coeff * * Fe-C_Hepburn_Ackland.eam.fs Fe C
 
pair_coeff * * Fe-C_Hepburn_Ackland.eam.fs Fe C
  
 +
# Compute stress information for Atomeye visualization
 +
compute stress all stress/atom
 +
compute stress1 all reduce sum c_stress[1]
 +
compute stress2 all reduce sum c_stress[2]
 +
compute stress3 all reduce sum c_stress[3]
 +
compute stress4 all reduce sum c_stress[4]
 +
compute stress5 all reduce sum c_stress[5]
 +
compute stress6 all reduce sum c_stress[6]
 
##########################################
 
##########################################
# Minimize first?
+
# Minimize first
 
reset_timestep 0
 
reset_timestep 0
 
thermo 10
 
thermo 10
thermo_style custom step lx ly lz press pxx pyy pzz pe
+
thermo_style custom step lx ly lz press pxx pyy pzz pe c_stress1 c_stress2 c_stress3 c_stress4 c_stress5 c_stress6
 
min_style cg
 
min_style cg
 
fix 1 all box/relax x 0.0 z 0.0 couple none vmax 0.001  
 
fix 1 all box/relax x 0.0 z 0.0 couple none vmax 0.001  
Line 79: Line 99:
 
unfix 1
 
unfix 1
  
 +
# Compute distance for each side of the grain boundary to displace
 
variable ly1 equal ly
 
variable ly1 equal ly
 
variable ly0 equal ${ly1}
 
variable ly0 equal ${ly1}
Line 93: Line 114:
 
variable p8 equal "pe"
 
variable p8 equal "pe"
  
fix equil1 all print 1 "${p1} ${p2} ${p3} ${p4} ${p5} ${p6} ${p7} ${p8}" file data.${datfile}_${minlength}.txt screen no
+
# Output stress and strain information to datafile for Matlab post-processing
 +
fix equil1 all print 1 "${p1} ${p2} ${p3} ${p4} ${p5} ${p6} ${p7} ${p8}" file data.${datfile}.txt screen no
 
fix 1 all nve
 
fix 1 all nve
 
run 1
 
run 1
Line 100: Line 122:
 
variable pressf equal ${pressf1}
 
variable pressf equal ${pressf1}
  
 +
##########################################
 +
# Create cfg files with stress in y direction for AtomEye viewing
 +
 +
dump 1 all cfg 500 ${datfile}_*.cfg id type xs ys zs c_stress[2]
 +
##########################################
 +
# CREATE REGIONS FOR BOUNDARY CONDITIONS
 +
 +
# Delete groups of atoms far from boundary
 +
region rlow block 0 200 -200 -${deldist} 0 200 units box
 +
region rhigh block 0 200 ${deldist} 200 0 200 units box
 +
group glow region rlow
 +
group ghigh region rhigh
 +
 +
delete_atoms group glow
 +
delete_atoms group ghigh
 +
 +
# Create groups to fix and displace
 +
region rgblow block 0 200 -200 -${fixdist} 0 200 units box
 +
region rgbhigh block 0 200 ${fixdist} 200 0 200 units box
 +
group gbhigh region rgbhigh
 +
group gblow region rgblow
 +
 +
# Put fixed boundary condition on edge atoms by setting forces to zero
 +
fix 2 gbhigh setforce 0 0 0
 +
fix 3 gblow setforce 0 0 0
 
##########################################
 
##########################################
 
# MS Deformation loop
 
# MS Deformation loop
Line 107: Line 154:
  
 
# Increase box bound and minimize again
 
# Increase box bound and minimize again
reset_timestep 0
+
#reset_timestep 0
#displace_box all y scale ${strain2}
+
 
#fix 1 all box/relax x 10000.0 z 10000.0 couple none vmax 0.001
+
displace_box gblow y delta -${lydelta} 0 units box
displace_box all y delta -${lydelta} ${lydelta} units box
+
displace_box gbhigh y delta 0 ${lydelta} units box
 +
 
 
minimize 1.0e-25 1.0e-25 1000 10000
 
minimize 1.0e-25 1.0e-25 1000 10000
  
Line 119: Line 167:
 
print "Pressf: ${pressf}"
 
print "Pressf: ${pressf}"
 
print "Pdiff: ${pdiff}"
 
print "Pdiff: ${pdiff}"
if ${pdiff} > 10000 then "exit"
+
#if ${pdiff} > 10000 then "exit"
 
variable pressf1 equal pyy
 
variable pressf1 equal pyy
 
variable pressf equal ${pressf1}
 
variable pressf equal ${pressf1}
Line 138: Line 186:
 
=== LAMMPS datafile ===
 
=== LAMMPS datafile ===
  
The following file, named "data.Fe_100_sig52_10.txt" should have been created in addition to the log.lammps file. This file stores strain information in the first column, stress tensor information in the second through seventh columns, and stores the total potential energy of the cell in the eight column. The simulation should have looped 100 times (as per the "nloop" variable), so there should be 100 entries (which end at a strain of 0.1) plus the initial entry of stress and strain at zero.
+
The following file, named "data.Fe_110_sig3.txt" should have been created in addition to the log.lammps file. This file stores strain information in the first column, stress tensor information in the second through seventh columns, and stores the total potential energy of the cell in the eight column. The simulation should have looped 100 times (as per the "nloop" variable), so there should be 100 entries (which end at a strain of 0.1) plus the initial entry of stress and strain at zero.
  
 
{|border  ="0"
 
{|border  ="0"
 
|<pre>
 
|<pre>
 
# Fix print output for fix equil1
 
# Fix print output for fix equil1
0 -2.219884235e-05 -0.09436668009 5.407552011e-06 1.221556825e-05 1.110009611e-09 4.462377068e-12 -48716.72405
+
0 -0.0001566341885 -0.04277905345 -0.0001735704412 -1.050347047e-06 -4.979630806e-16 -1.182662217e-15 -2403.177532
0.001 0.1468487572 0.1387359115 0.1431841846 -6.180770704e-09 -2.564170766e-12 -2.40791993e-12 -48716.76403
+
0.001 0.1410350669 0.2358351934 0.1410320946 -0.0008483136938 2.157375957e-16 5.10156062e-16 -953.8313633
0.002 0.2598702618 0.4058469325 0.2847557426 -4.808171999e-12 9.566142713e-16 -3.41722654e-15 -48716.52319
+
0.002 0.2093101255 0.4502201532 0.2093077625 -0.0008559731915 8.7476703e-16 4.741491304e-16 -953.8066728
0.003 0.3720478051 0.6731956939 0.4254156925 1.311052574e-10 3.449206559e-15 -2.636944941e-14 -48716.04581
+
0.003 0.2773789426 0.6636768305 0.2773773176 -0.0008616327062 6.889837825e-16 -3.49557936e-16 -953.7648879
0.004 0.483977058 0.9402201271 0.5652029445 -6.629325468e-12 1.129857588e-15 2.416966446e-14 -48715.3319
+
0.004 0.3452439027 0.8759462057 0.345242809 -0.00086663188 1.290557646e-16 1.847269505e-16 -953.7061129
0.005 0.5948099239 1.207643528 0.7041151176 -9.516316287e-13 2.79361336e-15 7.471854238e-15 -48714.38144
+
0.005 0.4128989894 1.086758848 0.412898328 -0.0008712926385 2.527957377e-18 4.348139418e-16 -953.6304752
 
...
 
...
 
</pre>
 
</pre>
 
|}
 
|}
 
  
 
== Post-Processing ==
 
== Post-Processing ==
Line 158: Line 205:
 
=== Stress-Strain Plot ===
 
=== Stress-Strain Plot ===
  
The stress-strain curve in Figure 1 can be generated using the following MATLAB script. Note that the definitions of stress and strain are negative. This is done to counteract the negative values of compressive stress and strain so that positive axes and a familiar shape are retained. The "exportfig" command saves the plot to a tiff files, but the plot can also be saved as a Mathcad figure once it appears.
+
The stress-strain curve in Figure 1 can be generated using the following MATLAB script. The "exportfig" command saves the plot to a tiff file, but the plot can also be saved as a Mathcad figure once it appears. The three principle stresses are plotted: pxx in red, pyy in blue, and pzz in green. The shear stresses (not plotted) are stored in the fourth, fifth, and sixth columns of the stress variable.
  
 
{|
 
{|
Line 164: Line 211:
 
{|border  ="0"
 
{|border  ="0"
 
|<pre>
 
|<pre>
% Analyze def1.txt files and plot the responses
+
%% Plot stress-strain curve from single GB fracture datafile
  
d = dir('*.def1.txt');
+
clear all
for i = 1:length(d)
+
 
 +
d = dir('data.Fe_110_sig3.txt');
 +
for i = 1%:length(d)
 
     fname = d(i).name;
 
     fname = d(i).name;
 
     A = importdata(fname);
 
     A = importdata(fname);
     strain = -A.data(:,1);
+
    %Define stress and strain
     stress = -A.data(:,2:4);
+
     strain = A.data(:,1);
      
+
     stress = A.data(:,2:7);
     plot(strain,stress(:,1),'-or','LineWidth',2,'MarkerEdgeColor','r',...
+
     %Plot data
         'MarkerFaceColor','r','MarkerSize',5),hold on
+
     plot(strain,stress(:,1),'-dr','LineWidth',2,'MarkerEdgeColor','r',...
 +
         'MarkerFaceColor','r','MarkerSize',10), hold on
 
     plot(strain,stress(:,2),'-ob','LineWidth',2,'MarkerEdgeColor','b',...
 
     plot(strain,stress(:,2),'-ob','LineWidth',2,'MarkerEdgeColor','b',...
         'MarkerFaceColor','b','MarkerSize',5),hold on
+
         'MarkerFaceColor','b','MarkerSize',5), hold on
 
     plot(strain,stress(:,3),'-og','LineWidth',2,'MarkerEdgeColor','g',...
 
     plot(strain,stress(:,3),'-og','LineWidth',2,'MarkerEdgeColor','g',...
         'MarkerFacecolor','g','MarkerSize',5),hold on
+
         'MarkerFaceColor','g','MarkerSize',5), hold on
 
     axis square
 
     axis square
     ylim([0 7])
+
     %ylim([0 10])
    xlim([0 0.2])
+
 
     set(gca,'LineWidth',2,'FontSize',24,'FontWeight','normal','FontName','Times')
 
     set(gca,'LineWidth',2,'FontSize',24,'FontWeight','normal','FontName','Times')
     set(get(gca,'xlabel'),'String','Strain','FontSize',32,'FontWeight','bold','FontName','Times')
+
     set(get(gca,'XLabel'),'String','Strain','FontSize',32,'FontWeight','bold',...
     set(get(gca,'ylabel'),'String','Stress (GPa)','FontSize',32','FontWeight','bold','FontName','Times')
+
        'FontName','Times')
 +
     set(get(gca,'YLabel'),'String','Stress (GPa)','FontSize',32,'FontWeight','bold',...
 +
        'FontName','Times')
 
     set(gcf,'Position',[1 1 round(1000) round(1000)])
 
     set(gcf,'Position',[1 1 round(1000) round(1000)])
   
+
 
     % Export the figure to a tif file
+
     %Export the figure to a tif file
     exportfig(gcf,strrep(fname,'.def1.txt','.tif'),'Format','tiff',...
+
     exportfig(gcf,strrep(fname,'_min.data','.tif'),'Format','tiff',...
 
         'Color','rgb','Resolution',300)
 
         'Color','rgb','Resolution',300)
 +
    close(1)
 
end
 
end
 
</pre>
 
</pre>
 
|}
 
|}
| [[image:Al comp sscurve.jpg|thumb|350px|Figure 1. Stress-strain curve for uniaxial compressive loading of single crystal aluminum in the <100> loading direction. ]]
+
| [[image:Fe 110 Sig3 sscurve.bmp|thumb|350px|Figure 1. Stress-strain curves for fracture of a <110> Σ3(-1 1 1) Fe symmetric tilt grain boundary. The x, y, and z principle stresses are plotted in red, blue, and green, respectively.]]
 
|}
 
|}
  
=== Deformation Movie ===
 
  
This assumes that you already have AtomEye and ImageJ downloaded. 
+
=== Visualization ===
* Visualize the dumpfile in AtomEye by typing the following command, "/A dump.tensile_0.cfg" (UNIX).
+
* Use the AtomEye options to select how you want to visualize deformation.  In this example, the centrosymmetry parameter was used to show only atoms in a non-centrosymmetric environment (see Fig. 2).
+
** Use Alt+0 to activate centrosymmetric (csym) view.
+
** Adjust threshold, or set of atoms to view, by using Shift+T. This will allow creation of a set for the current parameter (in this case, csym).
+
** Make atoms with values outside of the threshold invisible by using Ctrl+A.
+
* Press 'y' within AtomEye to produce an animation script. 
+
* The folder "Jpg" now contains snapshots of all dumpfiles.
+
* Open ImageJ
+
* Drag the folder Jpg into ImageJ
+
** Select "Convert to RGB" to keep the color from the AtomEye images.
+
** Choose "yes" to load a stack.
+
* Adjust the size as needed (Image/Adjust/Size)
+
* Adjust frame rate as desired (Image/Stacks/Animation Options)
+
* Save as Animated Gif file
+
  
 +
The simulation can be visualized in AtomEye. To do so, find the name of the first cfg file (Fe_110_sig3_224.cfg, in this case) that results from the simulation and type "~/A Fe_110_sig3_225.cfg" in a UNIX environment, where "~/A" is the location of the AtomEye file. Alt+0 will color the atoms according to pyy. Use insert and delete to scroll through the images to see the fracture.
 
{|
 
{|
| [[image:Al comp dislocation 4k.jpg|thumb|350px|Figure 2. Image of nucleated dislocation near peak stress.]]
+
| [[image:Fe 110 sig3 fracture.gif|thumb|350px|Figure 2. Movie showing the fracture of a Fe <110> sigma 3 symmetric tilt grain boundary. Atoms are colored by pyy.]]
| [[Image:Al comp 4k.gif|thumb|600px| Movie showing compressive deformation of single crystal aluminum loaded in the <100> direction at a strain rate of 10<sup>10</sup> s<sup>-1</sup> and a temperature of 300 K.  Only atoms in non-centrosymmetric environment are shown.]]
+
|}
+
 
+
== Cell Size Comparison ==
+
In order to test the difference that the number of atoms can have on a simulation, the above script was run with 32,000 and 108,000 atoms in addition 4,000 atoms. Editing the values (currently "10") in the following line in the input script will change the size of the simulation cell and the number of atoms used in the simulation. Values of "20" will result in 32,000 atoms, and values of "30" will result in 108,000 atoms.
+
 
+
{|border  ="0"
+
|<pre>
+
region whole block 0 10 0 10 0 10
+
</pre>
+
|}
+
 
+
 
+
Shown below are movies of the 4,000, 32,000,  and 108,000 atom simulations, which show only atoms in a non-centrosymmetric environment. As one might expect, more slip planes become visible as the atom count of the simulation increases.
+
 
+
{|
+
| [[Image:Al comp 4k.gif|thumb|600px| Movie showing compressive deformation of a 4,000 atom single crystal of aluminum loaded in the <100> direction. Only atoms in non-centrosymmetric environment are shown.]]
+
| [[Image:Al comp 32k.gif|thumb|600px| Movie showing compressive deformation of a 32,000 atom single crystal of aluminum loaded in the <100> direction. Only atoms in non-  centrosymmetric environment are shown.]]
+
| [[Image:Al comp 108k.gif|thumb|600px| Movie showing compressive deformation of a 108,000 atom single crystal of aluminum loaded in the <100> direction. Only atoms in non-centrosymmetric environment are shown.]]
+
|}
+
 
+
== Temperature Comparison ==
+
The temperature of the simulations also makes a difference in the outputs. To show this difference, the above simulations (previously at 300 K) were run at 10 K. In order to change the temperature of the simulation, three lines in the input script must be edited. Two lie under the 'Equilibraion' section while the third lies under 'Deformation.'
+
 
+
The velocity and fix commands shown below contain temperature data. The velocity command specifies the thermal velocity of the system while the fix command specifies the desired temperatures at the beginning and end of the simulation. In order to run the simulation at 10 K instead of 300 K, change the three '300' values to '10' in the velocity and fix command lines.
+
{|border  ="0"
+
|<pre>
+
# EQUILIBRATION
+
reset_timestep 0
+
timestep 0.001
+
velocity all create 300 12345 mom yes rot no
+
fix 1 all npt temp 300 300 1 iso 0 0 1 drag 1
+
</pre>
+
|}
+
 
+
The temperature values in the fix command under 'Deformation' also needs to be changed to '10' instead of '300.' The values are being changed again because between 'Equilibration' and 'Deformation' the fix ID 1 was unfixed. Here fix 1 is being redefined.
+
{|border  ="0"
+
|<pre>
+
# DEFORMATION
+
reset_timestep 0
+
 
+
fix 1 all npt temp 300 300 1 y 0 0 1 z 0 0 1 drag 1
+
</pre>
+
|}
+
 
+
All three simulation cell sizes were run at 10 K. Below are the movies from the simulations. Once again, only atoms in a non-centrosymmetric environment are viewable. The difference between the 300 K and 10 K simulations is that there is less non-centrosymmetry induced by thermal velocity. At 10 K, many fewer atoms are seen before slip occurs, and the slip planes are more cleary visible and absent of "noise" created by atoms that are non-centrosymmetric solely due to thermal activity.
+
 
+
{|
+
| [[Image:Al comp 10K 4k.gif|thumb|600px| Movie showing compressive deformation of a 4,000 atom single crystal of aluminum at 10 K loaded in the <100> direction. Only atoms in non-centrosymmetric environment are shown.]]
+
| [[Image:Al comp 10K 32k.gif|thumb|600px| Movie showing compressive deformation of a 32,000 atom single crystal of aluminum at 10 K loaded in the <100> direction. Only atoms in non-centrosymmetric environment are shown.]]
+
| [[Image:Al comp 10K 108k.gif|thumb|600px| Movie showing compressive deformation of a 108,000 atom single crystal of aluminum at 10 Kloaded in the <100> direction. Only atoms in non-centrosymmetric environment are shown.]]
+
 
|}
 
|}
  
Line 272: Line 259:
  
 
*[[MaterialModels:_Nanoscale | Nanoscale]]
 
*[[MaterialModels:_Nanoscale | Nanoscale]]
 +
*[[LAMMPS tutorials]]
  
 
== Acknowledgments ==
 
== Acknowledgments ==
Line 280: Line 268:
  
 
<references>
 
<references>
 +
 +
 +
[[Category: Script]]
 +
[[Category: Tutorial]]
 +
[[Category: LAMMPS]]
 +
[[Category: Input Deck]]

Latest revision as of 16:26, 16 April 2015

Contents

[edit] Questions / Comments

Please contact me if you have any questions or comments about this tutorial.

Email: Mark Tschopp, mark.tschopp@gatech.edu

[edit] Abstract

This example shows how to run an atomistic simulation of fracture of an iron symmetric tilt grain boundary. A parallel molecular dynamics code, LAMMPS[1], is used to calculate stresses at the grain boundary as the strain of the bicrystal is incrementally increased. Matlab is used to plot a stress-strain curve, and AtomEye[2]. is used to visualize the simulation.

Author(s): Mark A. Tschopp, Nathan R. Rhodes

Corresponding Author: Mark Tschopp

[edit] Input

[edit] Description of Simulation

This molecular dynamics simulation calculates the stress-strain relationship of an iron symmetric tilt grain boundary under fracture. The grain boundary structure used in this example is a <100> Σ5(210) symmetric tilt grain boundary. The potential used to generate the structure, the Hepburn and Ackland (2008) Fe-C interatomic potential[3], is also used in this script. The simulation cell is defined such that the bicrystal is pulled in the y-direction, or perpendicular to the boundary interface, to increase strain. The strain in increased for a specified number of times in a loop, and the stress is calculated at each point before the simulation loops. The stress and strain values are output to a separate file which can be imported in a graphing application for plotting.

[edit] Grain boundary structure file

The grain boundary structure that was generated prior to this example can be found here. Store the text in "Fe_110_sig3.txt" to use it.

[edit] LAMMPS input script

This input script was run using the November 2010 version of LAMMPS. Changes in some commands in more recent versions may require revision of the input script. This script runs the simulation with a previously generated grain boundary file, which is fed to the variable "datfile." The variable "nloop" defines how many times the strain will be increased and the number of points at which the stress is calculated. Other variables, such as the strain increment and the number of replications, can be changed in the input file. To run this script, store it in "in.gb_fracture.txt" and use "lmp_exe -var datfile Fe_110_sig3.txt -var nloop 100 < in.gb_fracture.txt " in a UNIX environment where "lmp_exe" refers to the LAMMPS executable.

Before strain is applied to the atoms, those atoms that are far from the grain boundary (defined by the variable deldist) are deleted to prevent unwanted transitions between periodic boundaries and to decrease simulation time. Then two smaller groups of atoms (width of groups defined by difference in variables deldist and fixdist) are fixed by setting their forces equal to zero. These same fixed groups are then incrementally strained until the grain boundary fractures.

############################################################################
# Interfacial Fracture
# Mark Tschopp, Nathan Rhodes 2011

# lmp_exe -var datfile Fe_110_sig3.txt -var nloop 100 < in.gb_fracture.txt

# Simulation deletes atoms outside of +/- deldist from GB and constrains and pulls
# atoms outside of +/- fixdist from GB to fracture the GB
############################################################################

#variable datfile index Fe_110_sig3.txt
variable strain equal 0.001
#variable nloop equal 100
variable repx equal 1
variable repz equal 1
variable strain2 equal "1+v_strain"
variable deldist equal 50
variable fixdist equal 45

######################################
# INITIALIZATION
units 		metal
dimension		3
boundary		p	p	p
atom_style		atomic
atom_modify map array

######################################
# SIMULATION CELL VARIABLES (in Angstroms)

read_data ${datfile}

#variable minlength equal 100
variable xlen equal lx
variable ylen equal ly
variable zlen equal lz

print "lx: ${xlen}"
print "ly: ${ylen}"
print "lz: ${zlen}"

# Replicate simulation cell in each direction
replicate ${repx} 1 ${repz}

######################################
# INTERATOMIC POTENTIAL
pair_style	eam/fs
pair_coeff	* * Fe-C_Hepburn_Ackland.eam.fs Fe C

# Compute stress information for Atomeye visualization
compute stress all stress/atom
compute stress1 all reduce sum c_stress[1]
compute stress2 all reduce sum c_stress[2]
compute stress3 all reduce sum c_stress[3]
compute stress4 all reduce sum c_stress[4]
compute stress5 all reduce sum c_stress[5]
compute stress6 all reduce sum c_stress[6]
##########################################
# Minimize first
reset_timestep 0
thermo		10
thermo_style custom step lx ly lz press pxx pyy pzz pe c_stress1 c_stress2 c_stress3 c_stress4 c_stress5 c_stress6
min_style cg
fix 1 all box/relax x 0.0 z 0.0 couple none vmax 0.001 
minimize 1.0e-25 1.0e-25 1000 10000
unfix 1

# Compute distance for each side of the grain boundary to displace
variable ly1 equal ly
variable ly0 equal ${ly1}
variable lydelta equal "v_strain*v_ly0/2"

# Setup file output (time in ps, pressure in GPa)
variable p1 equal "(ly-v_ly0)/v_ly0"
variable p2 equal "-pxx/10000"
variable p3 equal "-pyy/10000"
variable p4 equal "-pzz/10000"
variable p5 equal "-pxy/10000"
variable p6 equal "-pxz/10000"
variable p7 equal "-pyz/10000"
variable p8 equal "pe"

# Output stress and strain information to datafile for Matlab post-processing
fix equil1 all print 1 "${p1} ${p2} ${p3} ${p4} ${p5} ${p6} ${p7} ${p8}" file data.${datfile}.txt screen no
fix 1 all nve
run 1
unfix 1
variable pressf1 equal pyy
variable pressf equal ${pressf1}

##########################################
# Create cfg files with stress in y direction for AtomEye viewing

dump 1 all cfg 500 ${datfile}_*.cfg id type xs ys zs c_stress[2]
##########################################
# CREATE REGIONS FOR BOUNDARY CONDITIONS

# Delete groups of atoms far from boundary
region rlow block 0 200 -200 -${deldist} 0 200 units box
region rhigh block 0 200 ${deldist} 200 0 200 units box
group glow region rlow
group ghigh region rhigh

delete_atoms group glow
delete_atoms group ghigh

# Create groups to fix and displace
region rgblow block 0 200 -200 -${fixdist} 0 200 units box
region rgbhigh block 0 200 ${fixdist} 200 0 200 units box
group gbhigh region rgbhigh
group gblow region rgblow

# Put fixed boundary condition on edge atoms by setting forces to zero
fix 2 gbhigh setforce 0 0 0
fix 3 gblow setforce 0 0 0
##########################################
# MS Deformation loop

variable a loop ${nloop}
label loop

# Increase box bound and minimize again
#reset_timestep 0

displace_box gblow y delta -${lydelta} 0 units box
displace_box gbhigh y delta 0 ${lydelta} units box

minimize 1.0e-25 1.0e-25 1000 10000

run 1

print "Pressf: ${pressf}"
variable pdiff equal "pyy - v_pressf"
print "Pressf: ${pressf}"
print "Pdiff: ${pdiff}"
#if ${pdiff} > 10000 then "exit"
variable pressf1 equal pyy
variable pressf equal ${pressf1}

next a
jump in.gb_fracture.txt loop 

unfix equil1

######################################
# SIMULATION DONE
print "All done"

[edit] Output

[edit] LAMMPS datafile

The following file, named "data.Fe_110_sig3.txt" should have been created in addition to the log.lammps file. This file stores strain information in the first column, stress tensor information in the second through seventh columns, and stores the total potential energy of the cell in the eight column. The simulation should have looped 100 times (as per the "nloop" variable), so there should be 100 entries (which end at a strain of 0.1) plus the initial entry of stress and strain at zero.

# Fix print output for fix equil1
0 -0.0001566341885 -0.04277905345 -0.0001735704412 -1.050347047e-06 -4.979630806e-16 -1.182662217e-15 -2403.177532
0.001 0.1410350669 0.2358351934 0.1410320946 -0.0008483136938 2.157375957e-16 5.10156062e-16 -953.8313633
0.002 0.2093101255 0.4502201532 0.2093077625 -0.0008559731915 8.7476703e-16 4.741491304e-16 -953.8066728
0.003 0.2773789426 0.6636768305 0.2773773176 -0.0008616327062 6.889837825e-16 -3.49557936e-16 -953.7648879
0.004 0.3452439027 0.8759462057 0.345242809 -0.00086663188 1.290557646e-16 1.847269505e-16 -953.7061129
0.005 0.4128989894 1.086758848 0.412898328 -0.0008712926385 2.527957377e-18 4.348139418e-16 -953.6304752
...

[edit] Post-Processing

[edit] Stress-Strain Plot

The stress-strain curve in Figure 1 can be generated using the following MATLAB script. The "exportfig" command saves the plot to a tiff file, but the plot can also be saved as a Mathcad figure once it appears. The three principle stresses are plotted: pxx in red, pyy in blue, and pzz in green. The shear stresses (not plotted) are stored in the fourth, fifth, and sixth columns of the stress variable.

%% Plot stress-strain curve from single GB fracture datafile

clear all

d = dir('data.Fe_110_sig3.txt');
for i = 1%:length(d)
    fname = d(i).name;
    A = importdata(fname);
    %Define stress and strain
    strain = A.data(:,1);
    stress = A.data(:,2:7);
    %Plot data
    plot(strain,stress(:,1),'-dr','LineWidth',2,'MarkerEdgeColor','r',...
        'MarkerFaceColor','r','MarkerSize',10), hold on
    plot(strain,stress(:,2),'-ob','LineWidth',2,'MarkerEdgeColor','b',...
        'MarkerFaceColor','b','MarkerSize',5), hold on
    plot(strain,stress(:,3),'-og','LineWidth',2,'MarkerEdgeColor','g',...
        'MarkerFaceColor','g','MarkerSize',5), hold on
    axis square
    %ylim([0 10])
    set(gca,'LineWidth',2,'FontSize',24,'FontWeight','normal','FontName','Times')
    set(get(gca,'XLabel'),'String','Strain','FontSize',32,'FontWeight','bold',...
        'FontName','Times')
    set(get(gca,'YLabel'),'String','Stress (GPa)','FontSize',32,'FontWeight','bold',...
        'FontName','Times')
    set(gcf,'Position',[1 1 round(1000) round(1000)])

    %Export the figure to a tif file
    exportfig(gcf,strrep(fname,'_min.data','.tif'),'Format','tiff',...
        'Color','rgb','Resolution',300)
    close(1)
end
Figure 1. Stress-strain curves for fracture of a <110> Σ3(-1 1 1) Fe symmetric tilt grain boundary. The x, y, and z principle stresses are plotted in red, blue, and green, respectively.


[edit] Visualization

The simulation can be visualized in AtomEye. To do so, find the name of the first cfg file (Fe_110_sig3_224.cfg, in this case) that results from the simulation and type "~/A Fe_110_sig3_225.cfg" in a UNIX environment, where "~/A" is the location of the AtomEye file. Alt+0 will color the atoms according to pyy. Use insert and delete to scroll through the images to see the fracture.

Figure 2. Movie showing the fracture of a Fe <110> sigma 3 symmetric tilt grain boundary. Atoms are colored by pyy.

[edit] Go Back

[edit] Acknowledgments

The authors would like to acknowledge funding for this work through the Department of Energy.

[edit] References

  1. S. Plimpton, "Fast Parallel Algorithms for Short-Range Molecular Dynamics," J. Comp. Phys., 117, 1-19 (1995).
  2. J. Li, "AtomEye: an efficient atomistic configuration viewer," Modelling Simul. Mater. Sci. Eng. 11 (2003) 173.
  3. D.J. Hepburn and G.J. Ackland, "Metallic-covalent interatomic potential for carbon in iron," Phys. Rev. B 78, 165115 (2008).
Personal tools
Namespaces

Variants
Actions
home
Materials
Material Models
Design
Resources
Projects
Education
Toolbox