這個命令是設置初始狀態(tài)常用命令,經典命令格式【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. 【這句告訴我們不要擔心出現(xiàn)的異?,F(xiàn)象,也警告我們真正模擬時最好不要用】
系統(tǒng)是通過設定的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];
===========================================
注意:此命令只適合在模擬前期使用,在真正數(shù)據(jù)收集的過程中,請不要使用此命令,而改成需要的系綜,如fix nve, fix NVT等
?
本文轉載自模擬小窩知乎專欄,轉載目的在于知識分享,本文觀點不代表V-suan云平臺立場。
主講:蘭晶崗,蘇黎世大學博士,導師為從頭算分子動力學領域世界頂尖學者Hutter教授,長期從事從頭算分子動力學,固-氣-液界面,電化學,振動光譜模擬相關研究。CP2K開發(fā)和應用者。
課程試聽:https://ke.qq.com/course/270047
原創(chuàng)文章,作者:菜菜歐尼醬,如若轉載,請注明來源華算科技,注明出處:http://www.xiubac.cn/index.php/2023/12/01/e2a2243467/