宏观上常见的测量材料力学性能的方法包括纳米压痕、拉伸(压缩)实验、剪切实验、冲击实验以及疲劳实验。纳米压痕实验通过记录压头加载以及卸载阶段的力-位移曲线来测量材料的硬度、杨氏模量、硬化效应以及蠕变行为。拉伸、压缩以及剪切实验可通过应力-应变曲线得到材料的拉伸弹性模量、剪切模型以及五种强度。宏观实验难以准确描述材料塑性变形阶段,尤其是与塑性变形有关的内部位错运动只能在原子尺度下观察到。因此借助分子动力学手段可探讨小尺度下材料微观结构以及位错对于其力学性能影响的作用机制。因此下面介绍了如何在LAMMPS中实现常见的材料力学性能测量手段。
文章目录
- 一、模拟效果—物理过程展示
- 二、物理模型——Lammps构建体系
- 三、模拟细节-Lammps In文件—模型构建
- 四、模拟细节-Lammps In文件—物理过程模拟
- 1、势函数参数
- 2、模拟过程实现
- 五、全部In文件下载
- 六、纳米压痕—后处理分析(补充内容)
一、模拟效果—物理过程展示
二、物理模型——Lammps构建体系
建模时需要将基体材料分为牛顿层、恒温层、固定层 。
三、模拟细节-Lammps In文件—模型构建
###############################################################
### 输入文件intial.in ###
### 建模时需要将基体材料分为牛顿层、恒温层、固定层 ###
#############################################################
#---------------------------------------全局设置-------------------------
dimension 3
units metal
boundary p p f
atom_style atomic
########################################################################
#---------------------------------------建模----------------------------
variable a equal 3.615 #晶格常数值
variable lx equal 220 #盒子
variable ly equal 220 #三个方向
variable lz equal 400 #大小
###创建盒子
lattice fcc $a orient x 1 0 0 orient y 0 1 0 orient z 0 0 1
region box block 0.0 ${lx} 0 ${lx} 0.0 ${lz} units box
create_box 4 box
###创建基体原子
region boundary_layer_down block INF INF INF INF INF 20 units box
region thermostat_layer block INF INF INF INF 20 40.0 units box
region newtonian_layer block INF INF INF INF 40 220 units box
region substracte union 3 boundary_layer_down thermostat_layer newtonian_layer units box
create_atoms 1 region substracte units box
###创建压头原子(这里的纳米压痕用的是实际压头)
lattice diamond 3.57
region indent sphere 110 110 280 50 units box
create_atoms 4 region indent units box
###设定原子质量
mass 1 63.55 #Cu
mass 2 63.55 #Cu
mass 3 63.55 #Cu
mass 4 12.01 #C
#----------------------------------------划分组----------------------------------
group boundary_layer_down region boundary_layer_down
group thermostat_layer region thermostat_layer
group newtonian_layer region newtonian_layer
group tool region indent
set group boundary_layer_down type 1
set group thermostat_layer type 2
set group newtonian_layer type 3
set group tool type 4
write_data intial.data
四、模拟细节-Lammps In文件—物理过程模拟
1、势函数参数
###########################################################################################
### 势函数设置文件potential.in ####
### 这里忽略了压头原子之间的作用力是因为金刚石比铜硬的多,这样处理可以节约计算资源 ####
#########################################################################################
#interaction
#Cu-Cu eam
#C-C NONE
#Cu-C Morse 9.025 0.087 5.14 2.05
pair_style hybrid eam morse 9.025
pair_coeff 1*3 1*3 eam Cu_u3.eam
pair_coeff 3 4 morse 0.087 5.14 2.05
pair_coeff 1*2 4 none
pair_coeff 4 4 none
2、模拟过程实现
#This is an input script to simulate nanoindentation of pure Cu, created by Wang Li
########################################################################
### in文件拆分成三个部分,分别是: ###
### 1. 模型设置文件 initial.in ###
### 2. 势函数设置文件 potential.in ###
### 3. 运行文件 run.in ###
### 可根据需要修改基体材料大小以及势函数,在模型设置文件中修改即可 ###
#####################################################################
#--------------------------------设置输出文件-----------------------
clear
shell mkdir output output/relax output/indentation
#read_restart relax.restart
include initial.in
include potential.in
variable tstp equal 0.001
variable T equal 293
variable thermo_step equal 1000
variable relax_step equal 500000
#---------------------------------弛豫-----------------------------
neighbor 3.0 bin
neigh_modify delay 5
compute newTemp thermostat_layer temp
fix 1 all nve
fix 2 boundary_layer_down setforce 0.0 0.0 0.0
velocity newtonian_layer set NULL NULL NULL
velocity thermostat_layer create $T 5812775 temp newTemp
fix 3 thermostat_layer temp/rescale 10 $T $T 10 1
fix_modify 3 temp newTemp
timestep ${tstp}
thermo ${thermo_step}
thermo_modify temp newTemp
thermo_style custom step c_newTemp press pe ke etotal
run ${relax_step}
write_data ./output/relax/relax.data
write_restart ./output/relax/relax.restart
#####################################################################
reset_timestep 0
#-----------------------------压痕实现-----------------------
variable depth equal 30 #压入深度为30埃
variable distance equal 10 #压头与表面的初始距离为10埃
variable loadv equal 0.1 #加载速度为0.1埃/ps
variable load_step equal (v_depth+v_distance)/v_loadv/(${tstp})
variable hold_step equal 20000
###计算压入深度
variable dis equal xcm(tool,z)
variable initial_dis equal ${dis}
variable disp equal -(v_dis-(${initial_dis}))
###计算压入载荷
#方法一
variable m1 equal fcm(tool,z) #用压头质心的受力计算载荷
variable unit equal 1.602*1.0e-3 #单位换算成μN
variable load1 equal v_m1*(${unit})
#方法二
compute forcez tool property/atom fz
compute m2 tool reduce sum c_forcez #也可以用压头z方向受到的合力计算载荷
variable load2 equal c_m2*(${unit})
#----------------------------------加载过程-------------------
dump 1 all custom 10000 ./output/indentation/Indentation.lammpstrj id type x y z
fix 5 tool move linear 0.0 0.0 -${loadv} units box
fix 6 all print 100 "${disp} ${load1} ${load2}" file ./output/indentation/load_disp.txt
run ${load_step}
#-----------------------------------保持阶段-------------------
fix 7 tool move linear 0 0 0 units box
run ${hold_step}
#-----------------------------------卸载过程--------------------
fix 7 tool move linear 0.0 0.0 ${loadv} units box
run ${load_step}
五、全部In文件下载
链接(点击下载) 提取码:wmth