Perform Nanoindentation on Al-Mg Alloy: Difference between revisions
| (25 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<P ALIGN="CENTER"> |
<P ALIGN="CENTER"> |
||
<FONT SIZE="+3" color="darkred"><STRONG> |
<FONT SIZE="+3" color="darkred"><STRONG> |
||
Nanoindentation on Al-Mg Alloy using LAMMPS </STRONG></font></P> |
|||
<DIV> |
<DIV> |
||
<P ALIGN="CENTER"><STRONG>Yifan Wang</STRONG></P> |
<P ALIGN="CENTER"><STRONG>Yifan Wang</STRONG></P> |
||
| Line 27: | Line 27: | ||
According to the phase diagram of Al-Mg alloy (Fig.1), the solubility of Mg in Al is smaller than 1% at room temperature. For our case, since the atomic concentration is 0.67%, we can generate the sample by first creating pure FCC Al metal, and then randomly exchange required Al atoms to Mg. |
According to the phase diagram of Al-Mg alloy (Fig.1), the solubility of Mg in Al is smaller than 1% at room temperature. For our case, since the atomic concentration is 0.67%, we can generate the sample by first creating pure FCC Al metal, and then randomly exchange required Al atoms to Mg. |
||
[[Image:Al-Mg_phase_diagram.jpg | |
[[Image:Al-Mg_phase_diagram.jpg | thumb | 500px | center | Fig.1 Phase Diagram of Aluminum-Magnesium (Murray, 1982)]] |
||
[[Image:Al-Mg_size_factor.jpg | |
[[Image:Al-Mg_size_factor.jpg | thumb | 500px | center | Fig.2 Size Factors of Al-Mg solid solution (Cai&Nix, 2016)]] |
||
However, the size factor of Mg as the solute in Al is not negligible (Fig.2). We have to consider the volume change of the sample by adding Mg into pure Al. There are two ways to account for the size effect: |
However, the size factor of Mg as the solute in Al is not negligible (Fig.2). We have to consider the volume change of the sample by adding Mg into pure Al. There are two ways to account for the size effect: |
||
| Line 50: | Line 50: | ||
region BOX block -40.0 40.0 -40.0 40.0 -80.0 0.0 units lattice |
region BOX block -40.0 40.0 -40.0 40.0 -80.0 0.0 units lattice |
||
Here the lattice constant 4.053 is the size after we consider the size effect, and 80 lattice distance is around 32.4nm. Note that if we change the indentation surface to other FCC planes ((110), (111), etc.), we should change the orientation in lattice definition, for example we take (110) plane as the indentation surface |
Here the lattice constant 4.053 is the size after we consider the size effect, and 80 lattice distance is around 32.4nm. Note that if we change the indentation surface to other FCC planes ((110), (111), etc.), we should change the orientation in lattice definition, for example if we take (110) plane as the indentation surface, the setting should be: |
||
lattice fcc 4.053 orient x 0.707 0 -0.707 orient y 0 1 0 orient z 0.707 0 0.707 |
lattice fcc 4.053 orient x 0.707 0 -0.707 orient y 0 1 0 orient z 0.707 0 0.707 |
||
| Line 73: | Line 73: | ||
We can visualize the sample as shown in Fig.3. |
We can visualize the sample as shown in Fig.3. |
||
[[Image:Al-Mg_sample.jpg | |
[[Image:Al-Mg_sample.jpg | thumb | 300px | center | Fig.3 Visualization of the Al-Mg alloy sample. Red: Al atoms; Blue: Mg atoms]] |
||
== Perform MD Simulation of Nanoindentation on The Alloy Sample == |
== Perform MD Simulation of Nanoindentation on The Alloy Sample == |
||
| Line 97: | Line 97: | ||
We have tested the K value ranging from 1 to 1000. Note that with this force field function, the indenter is not an elastic sphere. The effective elastic modulus of the indenter is shown in Fig.4. We can see that the K value does not have significant influence on the effective modulus of the indenter. In our simulation, we choose K = 1.0eV/Å for all the simulation. |
We have tested the K value ranging from 1 to 1000. Note that with this force field function, the indenter is not an elastic sphere. The effective elastic modulus of the indenter is shown in Fig.4. We can see that the K value does not have significant influence on the effective modulus of the indenter. In our simulation, we choose K = 1.0eV/Å for all the simulation. |
||
[[Image:Indenter_K_Modulus.png | |
[[Image:Indenter_K_Modulus.png | thumb | 500px | center | Fig.4 The Effective Modulus of the Indenter in Terms of the Indent Depth.]] |
||
=== Fix the bottom === |
=== Fix the bottom === |
||
| Line 116: | Line 116: | ||
=== Loading and Unloading === |
=== Loading and Unloading === |
||
Fig.5 is a diagram showing the loading process of the nanoindentation. |
|||
[[Image:example_nanoindentation.png | thumb | 150px | center | Fig.5 Loading of the nanoindentation process]] |
|||
In LAMMPS, the command used for indentation is "fix indent". This command can use the information of time steps and thus perform dynamic indentation during the MD simulation. |
In LAMMPS, the command used for indentation is "fix indent". This command can use the information of time steps and thus perform dynamic indentation during the MD simulation. |
||
| Line 147: | Line 151: | ||
variable depth equal (2*${loading_steps}-step)*dt*${indent_rate} |
variable depth equal (2*${loading_steps}-step)*dt*${indent_rate} |
||
variable z equal "v_indent_R - v_depth" |
variable z equal "v_indent_R - v_depth" |
||
fix indent all indent ${indent_K} sphere 0.0 0.0 v_z ${ |
fix indent all indent ${indent_K} sphere 0.0 0.0 v_z ${indenter_R} units box |
||
run ${loading_steps} |
run ${loading_steps} |
||
== Post processing == |
|||
| ⚫ | |||
LAMMPS provides multiple ways to output the results of MD simulation. In this section, we discuss the two mostly used output: "dump" and "thermo". |
|||
=== Retrieve the dislocation structure from MD simulation === |
|||
To obtain the dislocation structure, we need the detailed atom location information during the simulation. In LAMMPS, "dump" command is designed for the output of the atom profile. |
|||
Simply add the following lines before the "run" command, the atom profile will be dumped into dump file "dump.${timestep}.indent" for further analysis. |
|||
variable dumpfreq equal 1000 |
|||
dump loading all atom ${dumpfreq} dump.*.indent |
|||
run 40000 |
|||
If you want to set different dump frequency for unloading, you have to cancel the previous dump setting, and set up a different dump setting. |
|||
undump loading |
|||
dump unloading all atom 100 dump.*.unload |
|||
run 40000 |
|||
undump unloading |
|||
For more settings about dump command, please read LAMMPS manual (http://lammps.sandia.gov/doc/dump.html). |
|||
After we get the atom profiles during the simulation, we can perform the dislocation analysis and get the dislocation structure, as shown in Fig.6: |
|||
[[Image:dislocation_analysis.png | thumb | 500px | center | Fig.6 dislocation nucleation during nanoindentation]] |
|||
| ⚫ | |||
As we discussed in section 3.3, the responsive force on the indenter is recorded in variable "f_indent[3]", the indentation depth is calculated and recorded in variable "v_depth". Therefore, we add the following lines before the "run" command in section 3.3, then we can retrieve the forth-depth curve from the simulation: |
|||
thermo 100 # output per 100 timestep |
|||
thermo_style custom step v_depth f_indent[3] |
|||
Then the information of timestep, depth and indentation force will be recorded in the log file. More details of "thermo" command can be found in LAMMPS official manual (http://lammps.sandia.gov/doc/thermo.html) |
|||
The force-depth curves for different indentation direction are shown below in Fig.7. |
|||
[[Image:FD_curve_orientation.png | thumb | 500px | center | Fig.7 Force-depth curve of nanoindation performed on different orientations]] |
|||
In addition, because we have periodic boundary condition on both x- and y- direction, there are actually infinite indenter images exerting infinite force on the sample. Therefore, the sample is not touching the indenter at very beginning, and the actual indentation process started at finite indentation depth. In the results, we manually corrected the indentation depth so that it starts from the position where the indenter is exactly touching the sample. |
|||
Latest revision as of 04:47, 12 October 2022
Nanoindentation on Al-Mg Alloy using LAMMPS
Yifan Wang
Created May 2017
This tutorial explains how to create an FCC sample of Al-Mg alloy and perform nanoindentation on the sample in LAMMPS.
Prerequisite
For this simulation, we will use the LAMMPS 5 Nov 2016 version. The newer version may have changes of the commands. When compiling LAMMPS, please switch on the package MANYBODY in order to use the EAM potential. More details about compiling LAMMPS, please see the manual page (http://lammps.sandia.gov/doc/Section_start.html) for more information.
Prepare The Sample of Al-Mg Alloy
In this note, we will use the following geometric parameters as an example, to show how to perform nanoindentation MD simulation in LAMMPS:
- Weight percentage: 0.6% (~0.67% atomic percentage)
- Simulation Box: 32.4x32.4x32.4nm (free surface on z-direction, pbc on x- and y-directions)
- Indenter radius: 16.2nm
Thermodynamics
According to the phase diagram of Al-Mg alloy (Fig.1), the solubility of Mg in Al is smaller than 1% at room temperature. For our case, since the atomic concentration is 0.67%, we can generate the sample by first creating pure FCC Al metal, and then randomly exchange required Al atoms to Mg.
However, the size factor of Mg as the solute in Al is not negligible (Fig.2). We have to consider the volume change of the sample by adding Mg into pure Al. There are two ways to account for the size effect:
- Relax the sample under zero pressure after we generate the Al-Mg alloy.
- Estimate the volume change theoretically from the size factor.
Although the first method is more correct in the physical sense, the relaxation process will create surface steps on the free surface which will interfere the nanoindentation process. Here we estimate the volume change by correcting the lattice constant:
| . |
For now, we use the linear size factor from King's table. For a more accurate value, a constant pressure relaxation can be performed to determine the size factor.
Generate the Sample of Al-Mg Alloy
First we generate the simulation box of 32.4x32.4x32.4nm. We set up the simulation based on the lattice so that the entire simulation box is filled with atoms. First we define the lattice in LAMMPS ( indentation surface (001) ):
lattice fcc 4.053 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 region BOX block -40.0 40.0 -40.0 40.0 -80.0 0.0 units lattice
Here the lattice constant 4.053 is the size after we consider the size effect, and 80 lattice distance is around 32.4nm. Note that if we change the indentation surface to other FCC planes ((110), (111), etc.), we should change the orientation in lattice definition, for example if we take (110) plane as the indentation surface, the setting should be:
lattice fcc 4.053 orient x 0.707 0 -0.707 orient y 0 1 0 orient z 0.707 0 0.707 region BOX block -40.0 40.0 -40.0 40.0 -80.0 0.0 units lattice
Then we create the simulation box and the Al atoms based on the region we defined:
create_box 2 BOX create_atoms 1 region BOX set region BOX type 1
And we randomly change 0.67% atoms to Mg atoms:
set region BOX type/fraction 2 0.0067 20170517 # random seed
Finally, after we add the Mg atoms, we perform relaxation to the entire sample to make the sample equilibrated. In this simulation, we use the EAM potential from Liu and Adams (1998) (https://www.ctcms.nist.gov/potentials/Download/Al-Mg-LA/almg.liu):
pair_style eam/alloy pair_coeff * * almg.liu.eam.alloy Al Mg minimize 1e-9 1e-9 10000 10000
We can visualize the sample as shown in Fig.3.
Perform MD Simulation of Nanoindentation on The Alloy Sample
Before the actual simulation, we first determine the dynamics of the indenter:
- Indenter stiffness constant K: 1.0eV/Å3
- Temperature T: 1.0K
- Indent rate: 0.81Å/ps = 81m/s
- Loading steps: 40000 (0.001ps/step)
- Indent depth: 3.24nm
Note: The units are defined by units command in LAMMPS, we use metal units (http://lammps.sandia.gov/doc/99/units.html)
The Force Field for the Indenter
In LAMMPS, a spherical indeter exerts a force of magnitude:
on each atom where K is the indenter stiffness constant, r is the distance from the atom to the center of the indenter, and R is the radius of the indenter. The force is repulsive and F(r)=0 for r>R.
We have tested the K value ranging from 1 to 1000. Note that with this force field function, the indenter is not an elastic sphere. The effective elastic modulus of the indenter is shown in Fig.4. We can see that the K value does not have significant influence on the effective modulus of the indenter. In our simulation, we choose K = 1.0eV/Å for all the simulation.
Fix the bottom
First, We define 5 bottom layers as the bottom layer, these atom layers will be fixed to support the entire sample. Otherwise the sample will move downwards during the indentation.
region fixed_region block INF INF INF INF INF -75.0 units lattice group bottom region fixed_region group mobile subtract all bottom fix bottom bottom setforce 0.0 0.0 0.0 velocity bottom set 0.0 0.0 0.0
Then we set up the temperature for the system:
compute new mobile temp velocity mobile create 1.0 20110723 temp new # create temperature fix ensemble mobile nvt temp 1.0 1.0 1.0
Loading and Unloading
Fig.5 is a diagram showing the loading process of the nanoindentation.
In LAMMPS, the command used for indentation is "fix indent". This command can use the information of time steps and thus perform dynamic indentation during the MD simulation.
1. Calculate the indentation depth
variable indent_rate equal 0.81 # indent rate = 0.81Å/ps
variable depth equal step*dt*${indent_rate}
2. Calculate the z-direction position of the indenter center for loading steps:
variable indenter_R equal 162 variable z equal "v_indenter_R - v_depth"
Note that you cannot use ${depth} in this expression, otherwise only the depth value at the first time step will be substituted here and no time step information will be kept.
3. Fix the indenter. To use the standard units defined by units command, remember to add "units box" at the end of the fix command:
variable indent_K equal 1.0
fix indent all indent ${indent_K} sphere 0.0 0.0 v_z ${indenter_R} units box
Since the indenter is a "fix" command, the responsive force of the fixed constraint can be retrieved from variable "f_indent", which is a 3-component vector that represents the responsive force of this fixed constraint. In our case, we only need the force on z-direction, i.e. f_indent[3].
4. Run MD simulation to perform the loading steps:
variable loading_steps equal 40000
run ${loading_steps}
5. Similarly, when we perform the unloading steps, we recalculate the depth and z position of the indenter:
variable depth equal (2*${loading_steps}-step)*dt*${indent_rate}
variable z equal "v_indent_R - v_depth"
fix indent all indent ${indent_K} sphere 0.0 0.0 v_z ${indenter_R} units box
run ${loading_steps}
Post processing
LAMMPS provides multiple ways to output the results of MD simulation. In this section, we discuss the two mostly used output: "dump" and "thermo".
Retrieve the dislocation structure from MD simulation
To obtain the dislocation structure, we need the detailed atom location information during the simulation. In LAMMPS, "dump" command is designed for the output of the atom profile.
Simply add the following lines before the "run" command, the atom profile will be dumped into dump file "dump.${timestep}.indent" for further analysis.
variable dumpfreq equal 1000
dump loading all atom ${dumpfreq} dump.*.indent
run 40000
If you want to set different dump frequency for unloading, you have to cancel the previous dump setting, and set up a different dump setting.
undump loading dump unloading all atom 100 dump.*.unload run 40000 undump unloading
For more settings about dump command, please read LAMMPS manual (http://lammps.sandia.gov/doc/dump.html).
After we get the atom profiles during the simulation, we can perform the dislocation analysis and get the dislocation structure, as shown in Fig.6:
Retrieve the Force-Depth Curve of Nanoindentation
As we discussed in section 3.3, the responsive force on the indenter is recorded in variable "f_indent[3]", the indentation depth is calculated and recorded in variable "v_depth". Therefore, we add the following lines before the "run" command in section 3.3, then we can retrieve the forth-depth curve from the simulation:
thermo 100 # output per 100 timestep thermo_style custom step v_depth f_indent[3]
Then the information of timestep, depth and indentation force will be recorded in the log file. More details of "thermo" command can be found in LAMMPS official manual (http://lammps.sandia.gov/doc/thermo.html)
The force-depth curves for different indentation direction are shown below in Fig.7.
In addition, because we have periodic boundary condition on both x- and y- direction, there are actually infinite indenter images exerting infinite force on the sample. Therefore, the sample is not touching the indenter at very beginning, and the actual indentation process started at finite indentation depth. In the results, we manually corrected the indentation depth so that it starts from the position where the indenter is exactly touching the sample.