Perform Nanoindentation on Al-Mg Alloy

From Micro and Nano Mechanics Group
Jump to navigation Jump to search

Perform Nanoindentation on an Aluminum-Magnesium Alloy

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 Al-Mg Alloy Sample

Go to the LAMMPS website (http://lammps.sandia.gov/download.html) and download the most recent stable version of the code. Put it in your Codes directory and unzip it

tar -zxvf lammps-stable.tar.gz

or

The following command can be used to checkout a specific reversion of LAMMPS from our svn server.

svn checkout -r 23 http://micro.stanford.edu/svn/LAMMPS ~/Codes/LAMMPS.svn/

1. Copy Makefile.mc2 into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands

cd ~/Codes/LAMMPS
wget http://micro.stanford.edu/mediawiki/images/f/fb/Makefile.mc2.txt -O ./src/MAKE/Makefile.mc2 

2. In any directory, type the following command

Export TARGET=sherlock

(or add it to your bash_profile not to have to type it every time you connect to the cluster)

3. In your home directory, make a folder named usr

mkdir ~/usr 

4. Download the fftw library and unzip it using the following commands

cd ~/usr
wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar
tar –zxvf fftw.tar

5. Make sure you have the modules for using mpi complier and cuda, you can load the modules by adding the below two lines to your bash_profile file.

vi ~/.bash_profile (You can use whatever text editor to open the file and add the following lines)
module load mpich/3.1.4
module load cuda 

Save the file and log out. Next time when you log in, the compilers should work for you.

Compile LAMMPS with gpu

You need first to build the GPU library. Go to your lammps/lib/gpu folder. Copy the generic linux makefile

cd ~/Codes/LAMMPS/lib/gpu
cp Makefile.linux Makefile.sherlock

You have to modify 3 lines in this file. Open it and replace the values of CUDA_HOME, CUDA_ARCH and CUDA_PREC with the following

vi Makefile.sherlock
CUDA_HOME = /share/sw/free/cuda/6.5
CUDA_ARCH = -arch=sm_35
CUDA_PREC = -D_DOUBLE_DOUBLE

Using the GPU for a LAMMPS run

Modify the input script

Request GPUs on Sherlock