24小时热门版块排行榜    

查看: 2527  |  回复: 4

leila3409

捐助贵宾 (正式写手)


[交流] 【讨论】LAMMPS 晶界计算 输入脚本

在一个网站上看到的一个研究晶界的能量随各个自由度变化的LAMMPS输入文件https://ccg.hpc.msstate.edu/medi ... boundary_generation,很强大的样子,可是有一些设置不是太明白,拿出来大家讨论一下。



我有这么几处不明白,为什么overlapinic 要设为86?是怎么得到86这个数的?

overlapdist 为什么要设为0.275+0.005*(v_c-1)?我知道它应该是测试晶界区域中不同的原子数带来的影响,可是这个0.275是怎么得到的?

if $d == 2 then "delete_atoms overlap ${overlapdist} upper lower" 这句看起来比较奇怪,好像d只能是1,为什么还有这个句子?



望高手予以解答!!




# LAMMPS Input File for Grain Boundaries
# Mark Tschopp, Dec2009
# This file will generate numerous input files for LAMMPS
# using a large number of grain boundaries

# ---------- Setup Variables ---------------------
variable etol equal 1.0e-25
variable ftol equal 1.0e-25
variable maxiter equal 5000
variable maxeval equal 10000
variable latparam equal 2.855312
variable minimumenergy equal -4.122435
variable overlapboth equal 1
variable gbname index Fe_100STGB1
variable counter equal 0
variable inc equal "v_latparam / 6"

# Insert x,y,z sizes in LU and calculate in Angstroms
variable xsize1 equal "sqrt(0^2 + 2^2 + 1^2)"
variable zsize1 equal "sqrt(1^2 + 0^2 + 0^2)"
variable xsize2 equal "sqrt(0^2 + 2^2 + -1^2)"
variable zsize2 equal "sqrt(1^2 + 0^2 + 0^2)"
if ${xsize1} <= ${xsize2} then "variable xsize equal ${xsize1}" else "variable xsize equal ${xsize2}"
if ${zsize1} <= ${zsize2} then "variable zsize equal ${zsize1}" else "variable zsize equal ${zsize2}"
variable xlen equal "v_xsize * v_latparam"
variable zlen equal "v_zsize * v_latparam"

# Determine number of increments for displacement grid in the in-plane GB directions
variable xinc equal "floor(v_xlen / v_inc)"
variable zinc equal "floor(v_zlen / v_inc)"

# Implement overlap criterion
variable overlapinc equal 86

# ---------- Define loops for simulation ---------------------  
label loopa
variable a loop ${xinc}
variable tx equal "(v_a-1) / v_xinc * v_xsize"
label loopb
variable b loop ${zinc}
variable tz equal "(v_b-1) / v_zinc * v_zsize"
label loopd
variable d loop ${overlapboth}
label loopc
variable c loop ${overlapinc}
variable overlapdist equal "0.275 + 0.005 * (v_c-1)"

# ---------- Calculate counter and create data directory ---------------------
variable ctemp equal ${counter}+1
variable counter equal ${ctemp}
variable ctemp delete
print "Counter: ${counter}"
shell mkdir ${gbname}

# ---------- Initialize Simulation ---------------------
clear
units metal
dimension 3
boundary p p p
atom_style atomic

# ---------- Create Atomistic Structure ---------------------
lattice bcc ${latparam}
region whole block 0.000000 6.384672 -121.308763 121.308763 0.000000 2.855312 units box
create_box 2 whole
region upper block INF INF 0.000000 121.308763 INF INF units box
lattice bcc ${latparam} orient x  0  2  1 orient y  0 -1  2 orient z  1  0  0
create_atoms 1 region upper
region lower block INF INF -121.308763 0.000000 INF INF units box
lattice bcc ${latparam} orient x  0  2 -1 orient y  0  1  2 orient z  1  0  0
create_atoms 2 region lower
group upper type 1
group lower type 2  

# ---------- Define Interatomic Potential ---------------------
pair_style eam/fs
pair_coeff * * /cavs/cmd/data1/users/mtschopp/LAMMPS/lammps-12Nov09/potentials/Fe_2.eam.fs Fe Fe
neighbor 2.0 bin
neigh_modify delay 10 check yes

# ---------- Displace atoms and delete overlapping atoms ---------------------
displace_atoms upper move ${tx} 0 ${tz} units lattice
if $d == 1 then "delete_atoms overlap ${overlapdist} lower upper"
if $d == 2 then "delete_atoms overlap ${overlapdist} upper lower"
if $c == 1 then "variable atomprev equal 1"
variable natoms equal "count(all)"
print "Previous: ${atomprev}, Present: ${natoms}"
if ${atomprev} == ${natoms} then "jump GB_Fe_100STGB1.in loopend"

# ---------- Define Settings ---------------------
compute csym all centro/atom
compute eng all pe/atom
compute eatoms all reduce sum c_eng

# ---------- Run Minimization ---------------------
reset_timestep 0
thermo 10
thermo_style custom step pe lx ly lz press pxx pyy pzz c_eatoms
min_style cg
minimize ${etol} ${ftol} ${maxiter} ${maxeval}

# ---------- Run Minimization 2---------------------
# Now allow the box to expand/contract perpendicular to the grain boundary
reset_timestep 0
thermo 10
thermo_style custom step pe lx ly lz press pxx pyy pzz c_eatoms
fix 1 all box/relax aniso NULL 0.0 NULL vmax 0.001
min_style cg
minimize ${etol} ${ftol} ${maxiter} ${maxeval}

# ---------- Calculate GB Energy ---------------------
variable esum equal "v_minimumenergy * count(all)"
variable xseng equal "c_eatoms - (v_minimumenergy * count(all))"
variable gbarea equal "lx * lz * 2"
variable gbe equal "(c_eatoms - (v_minimumenergy * count(all)))/v_gbarea"
variable gbemJm2 equal ${gbe}*16021.7733
variable gbernd equal round(${gbemJm2})
print "After third minimization:"
print "GB energy is ${gbemJm2} mJ/m^2"

# Store number of atoms for overlap criterion, i.e., do not rerun equivalent configurations
variable atomprev equal "v_natoms"

# ---------- Dump data into Data file -------------
shell cd Fe_100STGB1
reset_timestep 0
timestep 0.001
velocity all create 20 95812384
fix 2 all npt 1 1 100 xyz 0 0 100 drag 0.2
dump 1 all custom 1000 dump.${counter}_${gbernd} id type x y z c_csym c_eng
run 0
shell cd ..

# ---------- End of loop structure -------------
label loopend
next c
jump GB_Fe_100STGB1.in loopc
variable c delete
next d
jump GB_Fe_100STGB1.in loopd
variable d delete
next b
jump GB_Fe_100STGB1.in loopb
variable b delete
next a
jump GB_Fe_100STGB1.in loopa
print "All done"
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

» 抢金币啦!回帖就可以得到:

查看全部散金贴

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

jsheng5059

银虫 (小有名气)


准备用lammps研究晶界,虽然不懂!顶一个!
2楼2011-03-29 18:34:29
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

xi007

铜虫 (小有名气)


3楼2012-06-05 21:54:28
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

15845409825

新虫 (初入文坛)



小木虫: 金币+0.5, 给个红包,谢谢回帖
variable minimumenergy equal -4.122435 里面 -4.122435 是怎么取值的?
5楼2015-05-11 10:54:00
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
简单回复
lcl1cxt4楼
2015-01-16 20:52   回复  
顶一下,
相关版块跳转 我要订阅楼主 leila3409 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 材料专硕306英一数二 +7 z1z2z3879 2026-03-16 9/450 2026-03-17 17:31 by ccjequ
[考研] 材料工程专硕调剂 +5 204818@lcx 2026-03-17 5/250 2026-03-17 17:27 by Little-xue
[考研] 274求调剂0856材料化工 +13 z2839474511 2026-03-11 14/700 2026-03-17 16:51 by share_joy
[考研] 302求调剂 +4 小贾同学123 2026-03-15 8/400 2026-03-17 10:33 by 小贾同学123
[考研] 274求调剂 +5 时间点 2026-03-13 5/250 2026-03-17 07:34 by 热情沙漠
[考研] 环境工程调剂 +6 大可digkids 2026-03-16 6/300 2026-03-16 17:16 by barlinike
[考研] 0703一志愿211 285分求调剂 +5 ly3471z 2026-03-13 5/250 2026-03-16 16:16 by 哦哦123
[考研] 085600材料与化工 求调剂 +13 enenenhui 2026-03-13 14/700 2026-03-16 15:19 by 了了了了。。
[考研] 327求调剂 +6 拾光任染 2026-03-15 11/550 2026-03-15 22:47 by 拾光任染
[考研] 080500,材料学硕302分求调剂学校 +4 初识可乐 2026-03-14 5/250 2026-03-14 21:08 by peike
[考研] 中科大材料专硕319求调剂 +3 孟鑫材料 2026-03-13 3/150 2026-03-14 18:10 by houyaoxu
[考研] 331求调剂(0703有机化学 +5 ZY-05 2026-03-13 6/300 2026-03-14 10:51 by Jy?
[考研] 招收0805(材料)调剂 +3 18595523086 2026-03-13 3/150 2026-03-14 00:33 by 123%、
[考研] 复试调剂 +9 Copy267 2026-03-10 9/450 2026-03-13 23:45 by userper
[考研] 0703,333分求调剂 一志愿郑州大学-物理化学 +3 李魔女斗篷 2026-03-11 3/150 2026-03-13 22:24 by JourneyLucky
[考研] (081700)化学工程与技术-298分求调剂 +12 11啦啦啦 2026-03-11 35/1750 2026-03-13 21:25 by JourneyLucky
[考研] 求b区学校调剂 +3 周56 2026-03-11 3/150 2026-03-13 16:20 by JourneyLucky
[考研] 328化工专硕求调剂 +4 。,。,。,。i 2026-03-12 4/200 2026-03-13 14:44 by JourneyLucky
[考研] 277求调剂 +4 anchor17 2026-03-12 4/200 2026-03-13 11:15 by 白夜悠长
[考研] 化工学硕306求调剂 +9 42838695 2026-03-12 9/450 2026-03-13 10:16 by houyaoxu
信息提示
请填处理意见