我想尝试用Lammps绘制铜纳米颗粒的应力和应变曲线。
这是我的代码。
我不知道这是否正确。
有谁能够帮我?
它有fix nve
用于放松,但在此之前有fix nvt
,而这两个fix
不能放在一起。
# tensile test
echo both
dimension 3
boundary s p p
units metal
atom_style atomic
##########create box#######
region copperbox block -80 80 -40 40 -40 40 units box
create_box 1 copperbox
lattice fcc 3.61
region copper block -60 60 -20 20 -20 20 units box
create_atoms 1 region copper
mass 1 63.546
thermo_modify lost ignore
region left block -60 -50 -20 20 -20 20 units box
group left region left
region right block 50 60 -20 20 -20 20 units box
group right region right
group middle subtract all left right
timestep 0.002
pair_style eam
pair_coeff * * cu_u3.eam
velocity all create 300 4928459 mom yes rot yes dist uniform
velocity left create 0 4928459 mom yes rot yes dist uniform
velocity right create 0 4928459 mom yes rot yes dist uniform
fix 1 all nvt temp 300 300 0.01
fix 2 left setforce 0 0 0
fix 3 right setforce 0 0 0
fix 4 all nve
thermo 100
run 1000
#####################################
compute 1 middle stress/atom
compute 2 middle reduce sum c_1[1]
dump 1 all custom 100 stress.txt mass x y z c_1[1] c_1[2] c_1[3]
c_1[4] c_1[5] c_1[6]
dump 2 all xyz 100 dump.xyz
#####################################
variable a loop 2
label loopa
fix 8 right move linear 0.2 0 0 units box
fix 9 left move linear 0 0 0 units box
run 1000
#####################################
unfix 8
unfix 9
fix 8 right move linear 0 0 0 units box
fix 9 left move linear 0 0 0 units box
run 40000
#####################################
fix 10 all nve
thermo 100
run 10000
#####################################
variable sigma equal "c_2/(40000)*(10^4)"
variable l2 equal xcm(right,x)
variable l0 equal ${l2}
variable strain equal "(v_l2-v_l0)/(v_l0)*100"
next a
jump in.copper99 loopa
restart 1000 restart.*