LAMMPS命令解读系列–fix nve/limit command使用及注意

这个命令是设置初始状态常用命令,经典命令格式【fix 1 all nve/limit 0.1】,我们一般直接用即可【LJ单位下】,注意此命令只能模拟开始使用,真正需要记录模拟信息时不能用。

命令语法


Syntax:

fix ID group-ID nve/limit xmax

  • ID, group-ID are documented in fix command

  • nve = style name of this fix command

  • xmax = maximum distance an atom can move in one timestep (distance units)

Description:

Perform constant NVE updates of position and velocity for atoms in the group each timestep. A limit is imposed on the maximum distance an atom can move in one timestep. This is useful when starting a simulation with a configuration containing highly overlapped atoms. Normally this would generate huge forces which would blow atoms out of the simulation box, causing LAMMPS to stop with an error. 【这段话告诉我们这个命令是干什么的】

Using this fix can overcome that problem. Forces on atoms must still be computable (which typically means 2 atoms must have a separation distance > 0.0). But large velocities generated by large forces are reset to a value that corresponds to a displacement of length xmax in a single timestep.【通过你设定的距离计算速度,并用来标度】

Xmax is specified in distance units; see the units command for details. The value of xmax should be consistent with the neighbor skin distance and the frequency of neighbor list re-building, so that pairwise interactions are not missed on successive timesteps as atoms move. See the neighbor and neigh_modify commands for details.
【如何设定最大限定的距离呢,这句话告诉我们,设置距离要和你的neighbor list的设置有可比性,不能比bin大太多了,个人认为小没有关系,LJ单位下我们设bin一般是0.3】

Note that if a velocity reset occurs the integrator will not conserve energy. On steps where no velocity resets occur, this integrator is exactly like the fix nvecommand. Since forces are unaltered, pressures computed by thermodynamic output will still be very large for overlapped configurations. 【这句告诉我们不要担心出现的异常现象,也警告我们真正模拟时最好不要用】

系统是通过设定的xlimit和时间步长先计算速度的做大限制【限制速度】,然后计算体系原子的速度,如果这个速度大于【限制速度】,那么就对速度进行标度,最后再计算移动位移。主要代码如下
===========================================
vlimitsq = (xlimit/dtv) * (xlimit/dtv); 【计算速度限制】
—————————-
vsq = v[0]*v[0] + v[1]*v[1] + v[2]*v[2];【实际速度】
—————————-
if (vsq > vlimitsq) { 【比较,满足条件就标度】
ncount++;
scale = sqrt(vlimitsq/vsq);
v[0] *= scale;
v[1] *= scale;
v[2] *= scale;
}
—————————-
x[0] += dtv * v[0]; 【计算位移】
x[1] += dtv * v[1];
x[2] += dtv * v[2];
===========================================

注意:此命令只适合在模拟前期使用,在真正数据收集的过程中,请不要使用此命令,而改成需要的系综,如fix nve, fix NVT等

 

本文转载自模拟小窝知乎专栏,转载目的在于知识分享,本文观点不代表V-suan云平台立场。

主讲:兰晶岗,苏黎世大学博士,导师为从头算分子动力学领域世界顶尖学者Hutter教授,长期从事从头算分子动力学,固-气-液界面,电化学,振动光谱模拟相关研究。CP2K开发和应用者。

课程试听:https://ke.qq.com/course/270047

LAMMPS命令解读系列–fix nve/limit command使用及注意

原创文章,作者:菜菜欧尼酱,如若转载,请注明来源华算科技,注明出处:https://www.v-suan.com/index.php/2023/12/01/e2a2243467/

(0)

相关推荐