#文件结构#Initialization#Atom definition#Settings#Run a simulation#注意本程序由于默认的单位体制是LJ# 2d friction simulation#初始化dimension 2#维数boundary p s p#边界条件 boundary x y zx,y,z =porsorform, one or two lettersp is periodicf is non-periodic and fixeds is non-periodic and shrink-wrappedm is non-periodic and shrink-wrapped with a minimum values为收缩边界(自由边界),用于有限尺寸的维度,随原子移动而改变,原子不会跑出边界;f为固定边界,同样用于有限尺寸的维度,模拟时原子可能跑出边界,跑出则程序终止;p为周期边界,原子可以周期穿过盒子边界。
m为柔性边界,允许边界上的粒子有微小移动以反映内层原子的作用力施加到它们身上的情况。
atom_style atomic#atomic原子模式(用于粗粒液体,固体和金属的模拟)。
Define what style of atoms to use in a simulation 定义模拟体系中的原子属性。
用比需要的范围大的类型。
neighbor 0.3 bin#建近邻表参数(r+rc),rc为力的截断距离,缓冲距离r=0.3sigma(σ),bin表示为近邻表类型。
所有截止距离等于它的力的截断距离加上缓冲距离的原子对都被存储在列表里。
其值的选择取决于单位制。
Syntax:neighbor skin styleThis command sets parameters that affect the building of pairwise neighbor lists.skin = extra distance beyond force cutoff (distance units)style =bin or nsq or multineigh_modify delay 5#间隔5载荷步重新形成近邻表# create geometry#创建初始几何构形lattice hex 0.9#定义晶格类型(二维hex)和Lennard-Jones折算密度0.9region box block 0 50 0 22 -0.25 0.25#定义模拟盒子(区域)的大小,在空间x[0,50],y[0,22],z[-0.25,0.25]的范围内创建区域。
create_box 4 box#在上述空间内创建一个具有四种原子类型的模拟盒子(原子位置初始化)mass 1 1.0#第一种原子类型质量为1g/molmass 2 1.0#第二种原子类型质量为1g/molmass 3 1.0#第三种原子类型质量为1g/molmass 4 1.0#第四种原子类型质量为1g/mol# atom regionsregion lo-fixed block INF INF INF 1.1 INF INF#定义了一个叫lo-fixed的区域{x[-inf,+inf],y[-inf,1.1],z[-inf,+inf]}region lo-slab block INF INF INF 7 INF INFregion above-lo block INF INF INF 7 INF INF side out#side out表示与所给坐标相反的一边region hi-fixed block INF INF 20.9 INF INF INFregion hi-slab block INF INF 15 INF INF INFregion below-hi block INF INF 15 INF INF INF side outregion lo-asperity sphere 32 7 0 8#定义了一个叫lo-asperity([æˈspɛrɪti]粗糙)的球形区域,球心(32,7,0),球的半径8region hi-asperity sphere 18 15 0 8region lo-half-sphere intersect 2 lo-asperity above-lo#定义lo-asperity和above-lo两个区域的相交区域为lo-half-sphere区域region hi-half-sphere intersect 2 hi-asperity below-hi# create 2 surfaces with asperities#创建两个粗糙表面create_atoms 1 region lo-slab#在lo-slab区域里创建第1种原子create_atoms 1 region hi-slabcreate_atoms 2 region lo-half-spherecreate_atoms 3 region hi-half-sphere# LJ potentials#LJ势函数pair_style lj/cut 2.5#定义势函数是lj势,截断半径为2.5pair_coeff * * 1.0 1.0 2.5#指定lj势参数ɛσ cutoff# define groups#定义组,便于加载group lo region lo-slab#定义lo-slab区域里的原子组叫lo组group lo type 2#并不能改变原子类型,仅仅是将第2种原子定义入lo组group hi region hi-slabgroup hi type 3group lo-fixed region lo-fixedgroup hi-fixed region hi-fixedgroup boundary union lo-fixed hi-fixed#定义总边界组lo-fixed+hi-fixed= boundarygroup mobile subtract all boundary#定义可动原子组mobile=all-boundaryset group lo-fixed type 4#指定group lo-fixed为第四种原子类型set group hi-fixed type 4#指定group hi-fixed为第四种原子类型# initial velocities#设定初始速度compute new mobile temp/partial 0 1 0#定义温度的计算(可动区域内统计平均), 用户为计算取的名字new(ID),group-ID ,mobile原子组,temp/partiale(style)XYZ的对应位置0或1表示排除或包含这个方向Define a computation that calculates the temperature of a group of atoms, after excluding one or more velocity components. A compute of this style can be used by any command that computes a temperature, e.g.thermo_modify, fix temp/rescale, fix npt, etc.The temperature is calculated by the formula KE = dim/2 N k T, where KE = total kinetic energy of the groupof atoms (sum of 1/2 m v^2), dim = dimensionality of the simulation, N = number of atoms in the group, k =Boltzmann constant, and T = temperature. The calculation of KE excludes the x, y, or z dimensions if xflag,yflag, or zflag = 0. The dim parameter is adjusted to give the correct number of degrees of freedom.velocity mobile create 0.1 482748 temp new#格式:velocity group-ID style args keyword value ...mobile(group ID)按指定的温度(0.1)计算方法,初始化原子的速度。
The create style generates an ensemble of velocities using a random number generator with the specified seed as the specified temperature.create风格使用一个随机数发生器与指定的种子产生一个整体的速度作为指定的温度。
Create args = temp seedtemp = temperature value (temperature units) 0.1seed = random # seed (positive integer) 482748temp value = temperature compute ID temp newvelocity hi set 1.0 0.0 0.0 sum yes#velocity group-ID style args keyword valuehi原子组x方向的速度为1.0,set(style),set args = vx vy vzvx,vy,vz = velocity value or NULL (velocity units)any of vx,vy,vz van be a variable (see below)sum(keyword)其值为yes或者no(The sum keyword is used by all styles, except zero. The new velocities will be added to the existing ones ifsum = yes, or will replace them if sum = no).# fixes#fix指令的用途是对一组原子进行定义,可以用于更新原子的位置、速度、控制温度、加常力、施加边界条件等。