||
Al 拉伸lammps输入脚本:
# ------------------------ INITIALIZATION ---------------------------- | |
units metal | |
dimension 3 | |
boundary p p p | |
atom_style atomic | |
variable latparam equal 4.0320 | |
# ----------------------- ATOM DEFINITION---------------------------- | |
lattice fcc ${latparam} | |
region whole block 0 10 0 10 0 10 | |
create_box 1 whole | |
lattice fcc ${latparam} orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 | |
create_atoms 1 region whole | |
# ------------------------ FORCE FIELDS------------------------------ | |
pair_style eam/alloy | |
pair_coeff * * Al_EA.eam.alloy Al | |
# ------------------------EQUILIBRATION--------------------------------- | |
variable tstp equal 0.001 | |
timestep ${tstp} | |
variable tdamp equal "v_tstp * 100" | |
variable pdamp equal "v_tstp * 1000" | |
fix 1 all nve | |
fix 2 all langevin 300.0 300.0 ${pdamp} 904297 | |
thermo 500 | |
run 10000 | |
unfix 1 | |
unfix 2 | |
fix 1 all npt temp 300 300 1 iso 0 0 1 drag 1 | |
thermo 200 | |
thermo_style custom step lx ly lz press pxx pyy pzz pe temp | |
run 10000 | |
unfix 1 | |
variable tmp equal "lx" | |
variable L0 equal ${tmp} | |
# ------------------------DEFORMATION--------------------------------- | |
reset_timestep 0 | |
fix 1 all npt temp 300 300 ${tdamp} y 1 1 ${pdamp} z 1 1 ${pdamp} drag 1 | |
variable srate equal 1.0e10 | |
variable srate1 equal "v_srate / 1.0e12" | |
fix 2 all deform 1 x erate ${srate1} units box remap x | |
# ------------------------OUTPUTS--------------------------------- | |
# for units metal, pressure is in [bars] = 100 [kPa] = 1/10000 [GPa] | |
# for units real, pressure is in [atm] = 101.325 [kPa] = 1.01325/10000 [GPa] | |
variable strain equal "(lx - v_L0)/v_L0" | |
variable p1 equal "-pxx/10000" | |
variable p2 equal "-pyy/10000" | |
variable p3 equal "-pzz/10000" | |
fix print all print 10 "${strain} ${p1} ${p2} ${p3}" file stress-strain.txt screen no | |
dump 2 all atom 200 tensile_test_movie.lammpstrj | |
thermo 100 | |
thermo_style custom step temp v_strain v_p1 v_p2 v_p3 ke pe press | |
run 20000 |
应力应变后处理MATLAB脚本:
%% 2020/12/12 | |
%% This code extracts data from the LAMMPS output file stress-strain.dump and plot the stress-strain curve. | |
clear all | |
close all | |
clc | |
%% Extracting stress-strain data from the log.lammps file | |
[fid] = fopen('stress-srain.txt'); | |
headings = fscanf(fid,'%s ',7); | |
[Stress,count] = fscanf(fid, '%f %f %f %f',[4,inf]); | |
Stress = Stress'; % | |
%% Plotting | |
figure | |
plot(Stress(:,1), Stress(:,2),'-or','MarkerSize',2) | |
hold on | |
plot(Stress(:,1), Stress(:,3),'-ob','MarkerSize',2) | |
hold on | |
plot(Stress(:,1), Stress(:,4),'-og','MarkerSize',2) | |
xlabel('Strain','fontsize',12) | |
ylabel('Stress (GPa)','fontsize',12) | |
grid on | |
set(gca,'LineWidth',1,'Fontsize',12) | |
axis square | |
%axis([0 0.3 0 120]) | |
legend({ '\sigma_{xx}', '\sigma_{yy}', '\sigma_{zz}'},'Location','northwest','FontSize',14) | |
legend boxoff |
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-24 13:44
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社