查看: 4289  |  回复: 12

zhang_jaj

木虫 (正式写手)

[求助] lammps计算速度自相关函数

想请教一下lammps怎么计算速度自相关函数,好像没有直接计算的命令。那么需要用哪些辅助命令得到哪些数据?
回复此楼

» 收录本帖的淘贴专辑推荐

MD分子动力学 动力学或热力学计算 模拟软件安装精华淘 lammps学习

» 猜你喜欢

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

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
回帖支持 ( 显示支持度最高的前 50 名 )

z654023015

铜虫 (初入文坛)

你可以用dump命令输出,每个原子在不同时刻的速度,然后在对它进行处理获得速度自相关函数,处理的时候可以用直接方法也可以用FFT获得速度自相关函数,用直接方法比较慢
10楼2013-07-07 21:35:13
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通回帖

ddll_slsl

木虫 (正式写手)

【答案】应助回帖


感谢参与,应助指数 +1
zh1987hs: 金币+1, 谢谢 2013-01-13 17:20:21
Variable 或Compute命令, 详细看手册。
2楼2013-01-13 17:08:03
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

zhang_jaj

木虫 (正式写手)

引用回帖:
2楼: Originally posted by ddll_slsl at 2013-01-13 17:08:03
Variable 或Compute命令, 详细看手册。

你好,这两个命令都看过了,没找到直接相关的,麻烦您能给我说下吗?如果不麻烦的话,谢谢
3楼2013-01-13 19:01:17
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

ddll_slsl

木虫 (正式写手)

【答案】应助回帖

★ ★ ★ ★ ★
zhang_jaj: 金币+3, 有帮助, 谢谢 2013-01-13 22:19:58
chaizhm: 金币+2, 谢谢~ 2013-01-15 10:39:56
根据自相关函数的公式,在variable里设置。 或者输出函数的自变量,运算完成后自己另外计算
4楼2013-01-13 20:30:44
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

zhang_jaj

木虫 (正式写手)

自己顶一下,有没有人帮忙,谢谢
5楼2013-01-26 11:12:53
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

Bessel

木虫 (正式写手)

【答案】应助回帖

★ ★ ★ ★ ★ ★ ★
zhang_jaj: 金币+7, ★★★★★最佳答案, 非常感谢! 2013-05-05 10:43:15
lammps的手册里有一部分是讲如何计算粘滞系数的 viscosity,粘滞系数其实就是压强关联函数。能算压强当然就能速度了。

6.21 Calculating viscosity

The shear viscosity eta of a fluid can be measured in at least 3 ways using various options in LAMMPS. (See this section of the manual for an analogous discussion for thermal conductivity). Eta is a measure of the propensity of a fluid to transmit momentum in a direction perpendicular to the direction of velocity or momentum flow. Alternatively it is the resistance the fluid has to being sheared. It is given by

J = -eta grad(Vstream)

where J is the momentum flux in units of momentum per area per time. and grad(Vstream) is the spatial gradient of the velocity of the fluid moving in another direction, normal to the area through which the momentum flows. Viscosity thus has units of pressure-time.

The first method is to perform a non-equlibrium MD (NEMD) simulation by shearing the simulation box via the fix deform command, and using the fix nvt/sllod command to thermostat the fluid via the SLLOD equations of motion. The velocity profile setup in the fluid by this procedure can be monitored by the fix ave/spatial command, which determines grad(Vstream) in the equation above. E.g. the derivative in the y-direction of the Vx component of fluid motion or grad(Vstream) = dVx/dy. In this case, the Pxy off-diagonal component of the pressure or stress tensor, as calculated by the compute pressure command, can also be monitored, which is the J term in the equation above. See this section of the manual for details on NEMD simulations.

The second method is to perform a reverse non-equilibrium MD simulation using the fix viscosity command which implements the rNEMD algorithm of Muller-Plathe. Momentum in one dimension is swapped between atoms in two different layers of the simulation box in a different dimension. This induces a velocity gradient which can be monitored with the fix ave/spatial command. The fix tallies the cummulative momentum transfer that it performs. See the fix viscosity command for details.

The third method is based on the Green-Kubo (GK) formula which relates the ensemble average of the auto-correlation of the stress/pressure tensor to eta. This can be done in a steady-state equilibrated simulation which is in contrast to the two preceding non-equilibrium methods, where momentum flows continuously through the simulation box.

Here is an example input script that calculates the viscosity of liquid Ar via the GK formalism:

# Sample LAMMPS input script for viscosity of liquid Ar

units       real
variable    T equal 86.4956
variable    V equal vol
variable    dt equal 4.0
variable    p equal 400     # correlation length
variable    s equal 5       # sample interval
variable    d equal $p*$s   # dump interval

# convert from LAMMPS real units to SI

variable    kB equal 1.3806504e-23    # [J/K/ Boltzmann
variable    atm2Pa equal 101325.0
variable    A2m equal 1.0e-10
variable    fs2s equal 1.0e-15
variable    convert equal ${atm2Pa}*${atm2Pa}*${fs2s}*${A2m}*${A2m}*${A2m}

# setup problem

dimension    3
boundary     p p p
lattice      fcc 5.376 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1
region       box block 0 4 0 4 0 4
create_box   1 box
create_atoms 1 box
mass             1 39.948
pair_style   lj/cut 13.0
pair_coeff   * * 0.2381 3.405
timestep     ${dt}
thermo             $d

# equilibration and thermalization

velocity     all create $T 102486 mom yes rot yes dist gaussian
fix          NVT all nvt temp $T $T 10 drag 0.2
run          8000

# viscosity calculation, switch to NVE if desired

#unfix       NVT
#fix         NVE all nve

reset_timestep 0
variable     pxy equal pxy
variable     pxz equal pxz
variable     pyz equal pyz
fix          SS all ave/correlate $s $p $d &
             v_pxy v_pxz v_pyz type auto file S0St.dat ave running
variable     scale equal ${convert}/(${kB}*$T)*$V*$s*${dt}
variable     v11 equal trap(f_SS[3/)*${scale}
variable     v22 equal trap(f_SS[4/)*${scale}
variable     v33 equal trap(f_SS[5/)*${scale}
thermo_style custom step temp press v_pxy v_pxz v_pyz v_v11 v_v22 v_v33
run          100000
variable     v equal (v_v11+v_v22+v_v33)/3.0
variable     ndens equal count(all)/vol
print        "average viscosity: $v [Pa.s/ @ $T K, ${ndens} /A^3"
6楼2013-01-28 04:18:06
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

邪恶少年

新虫 (初入文坛)

【答案】应助回帖

获取速度,然后fix ave/correlate
7楼2013-05-02 12:41:45
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

邪恶少年

新虫 (初入文坛)

LZ求速度自相关干嘛?是不是态密度?将来还要FFF………………
8楼2013-05-02 12:42:40
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

WJ-MS

新虫 (小有名气)

引用回帖:
6楼: Originally posted by Bessel at 2013-01-28 04:18:06
lammps的手册里有一部分是讲如何计算粘滞系数的 viscosity,粘滞系数其实就是压强关联函数。能算压强当然就能速度了。

6.21 Calculating viscosity

The shear viscosity eta of a fluid can be measured in a ...

这个in文件讲了三个压强分量,如果我想添加xx-yy和2zz-xx-yy方向的压强分量,应该怎么处理啊?望指教~~~
加油!
9楼2013-05-28 16:30:25
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 zhang_jaj 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[硕博家园] 难道我真的要放弃吗? +6 133456 2024-06-20 6/300 2024-06-21 01:15 by shuirong
[考博] 有机化学迷茫学生 +4 佛系摸鱼5 2024-06-18 7/350 2024-06-20 23:56 by 佛系摸鱼5
[论文投稿] Pattern Recognition期刊,二审审稿邀请发出一个月了,但有一个审稿人一直未接受审稿 5+3 PLVS_VLTRA 2024-06-19 5/250 2024-06-20 22:54 by holypower
[找工作] 初始合伙人来啦!(生物试剂耗材标准品) +16 欢快的小科研人 2024-06-15 27/1350 2024-06-20 22:19 by zzw1992127
[找工作] 药学硕士找不到工作,打算去做科研助理了 +11 pom戴墨镜 2024-06-14 24/1200 2024-06-20 21:59 by 海阔天空4924
[基金申请] 工材口青年基金大概什么样能上会? +12 今晚推荐22 2024-06-20 17/850 2024-06-20 21:50 by 今晚推荐22
[博后之家] 在国内某高校做全职博士后2年,现在找到新的单位,出站或退站对新工作有什么影响? +3 nxplfcc 2024-06-20 3/150 2024-06-20 19:50 by zhangysbad
[论文投稿] 投稿求助 6+3 小短腿安琪拉 2024-06-19 4/200 2024-06-20 17:40 by 不一样烟火12345
[有机交流] 怎么萃取出锡盐内包裹的化合物 +3 硕六过 2024-06-19 4/200 2024-06-20 15:45 by 2461777831
[考博] 2025年博士申请,可先做科研助理 +4 limit888 2024-06-18 7/350 2024-06-20 10:23 by 安塔瓦拉多
[催化] 镍负载氧化铝的保存问题 8+3 lwn0130 2024-06-15 6/300 2024-06-20 09:00 by lwn0130
[海外博后] 墨尔本大学博后offer要不要接 +3 kyxblmm 2024-06-18 3/150 2024-06-19 22:39 by blake1111
[基金申请] 面上博士后 +3 jsqy 2024-06-19 3/150 2024-06-19 17:58 by bxwisdom_886
[公派出国] 去英国的小伙伴儿都在哪儿租的房子呀? +7 65syn 2024-06-14 11/550 2024-06-19 10:19 by 65syn
[基金申请] 博后基金刷到的BUG,图片来的更直观 +15 carolloo 2024-06-17 16/800 2024-06-19 09:42 by msjy
[公派出国] CSC德国博后每个月资助多少呀?够用吗 +4 326lhpqk 2024-06-16 7/350 2024-06-19 02:03 by PLHOU
[基金申请] 有人中过人文社科类的博后特助吗? +3 outsider1986 2024-06-16 5/250 2024-06-18 11:10 by 袁天未然
[有机交流] 求教最后一步问题出在哪 20+3 苏州浩恒 2024-06-15 4/200 2024-06-18 08:33 by like_2005
[论文投稿] 论文已接收,但发现修改稿传的是旧版该怎么办? +3 zsq54321 2024-06-15 6/300 2024-06-17 19:45 by wjykycg
[基金申请] 关于博后基金的bug问题 +6 lxr1991 2024-06-14 9/450 2024-06-15 21:17 by since—2010
信息提示
请填处理意见