lammps模拟实例详解

lammps模拟实例详解
lammps模拟实例详解

# Big colloid particles and small LJ particles

units lj

This command sets the style of units used for a simulation. It determines the units of all quantities specified in the input script and data file, as well as quantities output to the screen, log file, and dump files. Typically, this command is used at the very beginning of an input script.这个指令设定模拟的格式,它决定了在输入脚本文件和数据文件以及在屏幕上显示的输出物,日志文件和垃圾文件中所有的单元格式。典型的是,它经常用于输入脚本的开头

For style lj, all quantities are unitless. Without loss of generality, LAMMPS sets the fundamental quantities mass, sigma, epsilon, and the Boltzmann constant = 1. The masses, distances, energies you specify are multiples of these fundamental values. The formulas relating the reduced or unitless quantity (with an asterisk) to the same quantity with units is also given. Thus you can use the mass & sigma & epsilon values for a specific material and convert the results from a unitless LJ simulation into physical quantities.

对于lj格式,所有数量都是无量纲的。不失一般性的,lammps设定了基本量质量sigma epsilon 和波尔兹曼常数=1。你定义的质量,距离,能量是这些基本值的倍数。公式把衰减量或者是无量纲量(用*)和单元给出的相同的量关联起来。因此你可以用mass,sigma,epsilon值表示一个具体材料并且改变一个无量纲lj模拟的物理量的结果。

mass = mass or m

distance = sigma, where x* = x / sigma

time = tau, where tau = t* = t (epsilon / m / sigma^2)^1/2

energy = epsilon, where E* = E / epsilon

velocity = sigma/tau, where v* = v tau / sigma

force = epsilon/sigma, where f* = f sigma / epsilon

torque = epsilon, where t* = t / epsilon

temperature = reduced LJ temperature, where T* = T Kb / epsilon

pressure = reduced LJ pressure, where P* = P sigma^3 / epsilon

dynamic viscosity = reduced LJ viscosity, where eta* = eta sigma^3 / epsilon / tau

charge = reduced LJ charge, where q* = q / (4 pi perm0 sigma epsilon)^1/2

dipole = reduced LJ dipole, moment where *mu = mu / (4 pi perm0 sigma^3 epsilon)^1/2

electric field = force/charge, where E* = E (4 pi perm0 sigma epsilon)^1/2 sigma / epsilon density = mass/volume, where rho* = rho sigma^dim

atom_style atomic 原子类型atomic(原子的)

Define what style of atoms to use in a simulation. This determines what attributes are associated with the atoms. This command must be used before a simulation is setup via a read_data, read_restart, or create_box command.

定义在模拟中用到的原子类型,这个决定了与原子有关的属性,这个命令必须用在模拟被设定之前通过read_data, read_restart, or create_box

Atomic only the default values coarse-grain liquids, solids, metals

Atomic 附加属性是只是默认值用于粗粒液体,固体和金属的模拟

dimension 2 二维

lattice sq 0.01 建造一个sq类型的二维晶格,lj折合密度rho*=0.01

Lattice Define a lattice for use by other commands. In LAMMPS, a lattice is simply a set of points in space, determined by a unit cell with basis atoms, that is replicated infinitely in all dimensions. The arguments of the lattice command can be used to define a wide variety of crystallographic lattices.

Lattice 指令定义了一个其他指令可以使用的晶格,在lammps中,一个晶格是一个空间中简单的点集,被基本原子构成的所有维度中无限复制的晶胞在所决定。Lattice指令额参数可以被用来定义各种各样的晶格。

A lattice is used by LAMMPS in two ways. First, the create_atoms command creates atoms on the lattice points inside the simulation box. Note that the create_atoms command allows different atom types to be assigned to different basis atoms of the lattice. Second, the lattice spacing in the x,y,z dimensions implied by the lattice, can be used by other commands as distance units (e.g. create_box, region and velocity), which are often convenient to use when the underlying problem geometry is atoms on a lattice.一个lattice 明令在lammps中有两种实用方式,首先,create_atoms command 在模拟盒子内部的格点上创建原子。注意,e create_atoms command允许不同的原子类型去分配到晶格中不同的基本原子。第二,晶格间距在x,y,z轴分量隐含在晶格中,可以被其他命令应用作为距离单元。这个距离单元当潜在问题的几何构型是在晶格中的原子的时候经常被方便的使用。

A lattice consists of a unit cell, a set of basis atoms within that cell, and a set of transformation parameters (scale, origin, orient) that map the unit cell into the simulation box. The vectors a1,a2,a3 are the edge vectors of the unit cell. This is the nomenclature for "primitive" vectors in solid-state crystallography, but in LAMMPS the unit cell they determine does not have to be a "primitive cell" of minimum volume.一个晶格由晶胞,晶胞内部的基本原子构成的集合,一个将晶胞绘制入模拟盒子的基本参数构成的集合构成。矢量a1,a2,a3是晶胞的棱矢量,在固态物理学里面用术语primitive矢量来表示。但是在lammps中不一定要用最小体积的原胞来定义晶胞

Lattice应用:

lattice style scale keyword values

style = none or sc or bcc or fcc or hcp or diamond or sq or sq2 or hex or custom scale = scale factor between lattice and simulation box

for style none:

scale is not specified (nor any optional arguments)

for all other styles:

scale = reduced density rho* (for LJ units)

scale = lattice constant in distance units (for non-LJ units)

Lattices of style sq and sq2 are 2d lattices that define a square unit cell with edge length = 1.0. This means a1 = 1 0 0 and a2 = 0 1 0. A sq lattice has 1 basis atom at the lower-left corner of the square. A sq2 lattice has 2 basis atoms, one at the corner and one at the center of the square.

sq and sq2格式的晶格是一个2维晶格这个晶格定义了一个棱长为1.0的直角晶胞的2维

晶胞。这意味着a1=1 0 0 ,a2=0 1 0。一个sq晶格在正方形左下角有一个基本的原子。Sq2则有两个基本原子,一个在角落另一个在正方形的中心。

For unit style lj, the scale argument is the Lennard-Jones reduced density, typically written as rho*. LAMMPS converts this value into the multiplicative factor via the formula "factor^dim = rho/rho*", where rho = N/V with V = the volume of the lattice unit cell and N = the number of basis atoms in the unit cell (described below), and dim = 2 or 3 for the dimensionality of the simulation. Effectively, this means that if LJ particles of size sigma = 1.0 are used in the simulation, the lattice of particles will be at the desired reduced density.对于li单元,scale是 Lennard-Jones 折算密度,典型写为 rho*。Lammps通过公式"factor^dim = rho/rho*"将这个值转变为倍增因子。Rho=N/V,v=晶格单元的体积,n=晶胞中基本原子的数量,dim根据模拟的维度等于2或者3。实际上这表明如果在模拟中使用的lj粒子的sigma=1.0,那么晶格中的粒子将会有预期的折算密度。

region box block 0 30 0 30 -0.5 0.5

在空间xlo=0,xhi=30,ylo=0,yhi=30,zlo=—0.5,zhi=0.5的范围内创建区域。Region This command defines a geometric region of space. Various other commands use regions. For example, the region can be filled with atoms via the create_atoms command. Or a bounding box around the region, can be used to define the simulation box via the create_box command. Or the surface of the region can be used as a boundary wall via the fix wall/region command. Region指令定义了一个几何空间。许多的其他的指令都用这条指令,比如,空间可以被原子充满通过create_atoms command。或者是一个区域周围的边界盒子可以被用来定义迷你盒子通过create_box command.或者空间表面可以作为一个边界框使用通过指令 the fix wall/region .

A box value selects standard distance units as defined by the units command, e.g. Angstroms for units = real or metal. A lattice value means the distance units are in lattice spacings. The lattice command must have been previously used to define the lattice spacings which are used as follows:一个box值选用被units明令定义的距离标准单位。如A对应的units= real or metal.一个lattice值意味着距离单元在晶格间距内。Lattice指令必须已经在之前被用于定义晶格间距如:

For style block, the lattice spacing in dimension x is applied to xlo and xhi, similarly the spacings in dimensions y,z are applied to ylo/yhi and zlo/zhi.

对于block格式,晶格间距在x轴上被应用于xlo and xhi。y,z轴情况相似。

create_box 2 box 在上述空间内建在一个有两种原子类型的模拟箱

This command creates a simulation box based on the specified region. Thus a region command must first be used to define a geometric domain.这条指令在被指定的区域内创建一个模拟盒子,因此一个region指令必须首先被用来定义一个几何区域。

The argument N is the number of atom types that will be used in the simulation.参数n是在模拟中使用到的原子类型。

create_atoms 1 box

This command creates atoms on a lattice, or a single atom, or a random collection

of atoms, as an alternative to reading in their coordinates explicitly via a read_data or read_restart command. A simulation box must already exist, which is typically created via the create_box command. Before using this command, a lattice must also be defined using the lattice command. The only exceptions are for the single style with units = box or the random style这条指令在晶格中创造原子,或者创造一个简单原子,或是创造一个随即收集的原子,作为读取他们明确坐标的替代物,通过read_data or read_restart指令,一个模拟盒子必须已经存在,盒子可以通过create_box 指令创建。在用这条指令之前,一个晶格也必须用lattice指令定义。

For the box style, the create_atoms command fills the entire simulation box with atoms on the lattice. If your simulation box is periodic, you should insure its size is a multiple of the lattice spacings, to avoid unwanted atom overlaps at the box boundaries. If your box is periodic and a multiple of the lattice spacing in a particular dimension, LAMMPS is careful to put exactly one atom at the boundary (on either side of the box), not zero or two.对于box格式, create_atoms 指令将整个模拟盒子用晶格上的原子填充。如果模拟盒子是周期性的,你必须确保它的大小是一个晶格间距的整数倍以避免边界上不必要的原子重叠。若箱在特定的维度是周期性的,并且它的大小是一个晶格间距的整数倍,lammps就会在边界两侧各放一个原子。

set group all type/fraction 2 0.96 2398

set style ID keyword values ...

Set one or more properties of one or more atoms. Since atom properties are initially ass igned by the read_data, read_restart or create_atoms commands, this command changes those assignments. This can be useful for overriding the default values assigned by the create_atoms command (e.g. charge = 0.0). It can be useful for altering pairwise and molecular force interactions, since force-field coefficients are defined in terms of types. It can be used to change the labeling of atoms by atom type or molecule ID when they are output in dump files. It can be useful for debugging purposes; i.e. positioning an atom at a precise location to compute subsequent forces or energy.设定一个或多个原子的一个或多个属性。自从原子属性被read_data, read_restart or create_atoms指令所分配,这个命令改变他们的参数。这个对于通过create_atoms command来重置默认值是很有用处的。当力场参数依据类型被定义后,这条指令对于变更成对的或是分子的相互作用力是有用的。该指令可以被用来改变原子的标识通过在他们在dump files中输出的时候改变原子类型或是分子id来完成。这条指令也对调试目标是有用的。定位一个特定的原子的位置,计算后来的力量或能量。 The style group selects all the atoms in the specified group. The style region selects all the atoms in the specified geometric region.Group格式选择所有的原子在指定的群里。Region格式选择在制定几何区域内德所有原子。

Keyword type/fraction sets the atom type for a fraction of the selected atoms. The actual number of atoms changed is not guaranteed to be exactly the requested fraction, but should be statistically close. Random numbers are used in such a way that a particular atom is changed or not changed, regardless of how many processors are being used.关键词type/fraction设定一部分指定原子的原子类型。真实的原子改变的数量不被保证正是需要的部分,但是应该是统计接近的。随机数在一个特定原子是改变或是不变的时候被使用,不管多少处理器被使用。

type/fraction values = type fraction seed

type = new atom type

fraction = fraction of selected atoms to set to new atom type

seed = random # seed (positive integer)

mass 1 9 第一种原子类型质量为9 g/mol

mass 2 1 第二种原子类型质量为1 g/mol

velocity all create 1.44 87287 loop geom

velocity group-ID style args keyword value ...

Set or change the velocities of a group of atoms in one of several styles. For each style, there are required arguments and optional keyword/value parameters. Not all options are used by each style. Each option has a default as listed below.

设定或是改变在一个或是几个类型里一群原子的速度。对于每个类型,都有需要的参数和可选项keyword/value参数。不是所有的可选项都在每一个类型中使用到,每一个可选项有一个默认值。

The create style generates an ensemble of velocities using a random number generator with the specified seed as the specified temperature.Creat类型引发了全体的速度用一个被指定温度指定的种子的随即数发生器。

group-ID = ID of group of atoms whose velocity will be changed

create args = temp seed

temp = temperature value (temperature units)

seed = random # seed (positive integer)

loop value = all or local or geom

The loop option is used by create in the following ways.

If loop = geom, then each processor loops over only its atoms. For each atom a unique random number seed is created, based on the atom's xyz coordinates. A velocity is generated using that seed. This is a fast loop and the velocity assigned to a particular atom will be the same, independent of how many processors are used.对于每个原子都有基于xyz坐标的独一无二的随机数产生。这是一个快速回路并且分配给特别原子的速度将是一样的,独立于有多少处理器被使用。

Note that the loop geom option will not necessarily assign identical velocities for two simulations run on different machines. This is because the computations based on xyz coordinates are sensitive to tiny differences in the double-precision value for a coordinate as stored on a particular machine.geom选项将不必要对不同机器上运行的两个模拟分配完全相同的速度。这是因为基于xyz坐标的运算指令对储存在一个特定机器的双精度坐标值的微小变化是敏感的。

If units = box, the velocities and coordinates specified in the velocity command are in the standard units described by the units command (e.g. Angstroms/fmsec for real units).如果units = box,被velocity command 指定的速度和坐标是被the units command描述的标准单元

# multi neighbor and comm for efficiency

neighbor 1 multi

neighbor skin style

skin = extra distance beyond force cutoff (distance units)

style = bin or nsq or multi

This command sets parameters that affect the building of pairwise neighbor lists. All atom pairs within a neighbor cutoff distance equal to the their force cutoff plus the skin distance are stored in the list. Typically, the larger the skin distance, the less often neighbor lists need to be built, but more pairs must be checked for possible force interactions every timestep. The default value for skin depends on the choice of units for the simulation; see the default values below.这个指令设定影响成对建造的邻域列表的参数。所有截止距离等于它的力的截断距离加上缓冲距离的原子对都被储存在列表里。代表性的是,缓冲距离越大所需要构建的临域列表越小,但是每一步的时候必须检查更多的原子对间可能的相互作用。缓冲距离的默认值依靠模拟单元的选择。

The skin distance is also used to determine how often atoms migrate to new processors if the check option of the neigh_modify command is set to yes. Atoms are migrated (communicated) to new processors on the same timestep that neighbor lists are re-built.那种距离也被用来定义如果检查neigh_modify command设定的是yes的情况下,原子迁移至新的处理器一次要多长时间。在neighbor 列表被重新构建的同一步里原子迁移到新的处理器内。

The style value selects what algorithm is used to build the list.

Style值构建列表的算法。

The multi style is a modified binning algorithm that is useful for systems with a wide range of cutoff distances, e.g. due to different size particles. For the bin style, the bin size is set to 1/2 of the largest cutoff distance between any pair of atom types and a single set of bins is defined to search over for all atom types. This can be inefficient if one pair of types has a very long cutoff, but other type pairs have a much shorter cutoff. For style multi the bin size is set to 1/2 of the shortest cutoff distance and multiple sets of bins are defined to search over for different atom types. This imposes some extra setup overhead, but the searches themselves may be much faster for the short-cutoff cases. multi风格是一个改良的bining算法,对于有广泛截止距离的系统有很大作用。举例来说由于不同的粒子大小,对于bin风格,bin大小设定为任意两个原子类型之间最大的截止距离1/2,并且bin的基本设置被定义来搜索所有的原子类型。如果子类型有很长的截至距离这可能是低效的,但是其他的类型可能会有断的截至距离。例如对于multi the bin大小被设置成两个原子类型之间最小的截止距离1/2 ,并且bins在multiple中得设置来定义搜索不同的原子类型。这

个利用其它的设置控制信息,但是搜索本身对于短截止距离的情况可能是很快的。

neigh_modify delay 0

neigh_modify keyword values

delay value = N

N = delay building until this many steps since last build

自上次构建neighbor列表之后无延迟

communicate multi

communicate style keyword value

style = single or multi

This command sets the style of inter-processor communication that occurs each timestep as atom coordinates and other properties are exchanged between neighboring processors and stored as properties of ghost atoms.这条指令设置在在每一步中发生的处理器之间的交流方式,就想原子坐标和其他的属性在相近的处理器之间交换并且作为ghost原子储存。

For many systems this is an efficient algorithm, but for systems with widely varying cutoffs for different type pairs, the multi style can be faster. In this case, each atom type is assigned its own distance cutoff for communication purposes, and fewer atoms will be communicated. 对于很多的系统这会是有效的算法。但是对于有着广泛截止距离的不同类型的原子对,multi格式会更快一些,既然这样,每一个类型的原子为了交流(信息)被分配自己的截至距离,很少的原子会被联系。

# colloid potential

pair_style colloid 12.5

pair_style style args

style = one of the styles from the list below

args = arguments used by a particular style

Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time. See the bond_style command to define potentials between pairs of bonded atoms, which typically remain in place for the duration of a simulation.设置lammps实用的公式来计算成对发生的相互作用力。在lammps中电位对。被定义在两个在截止距离内的原子之间,有活性的相互作用的设置随时间典型变化。

In LAMMPS, pairwise force fields encompass a variety of interactions, some of which include many-body effects, e.g. EAM, Stillinger-Weber, Tersoff, REBO potentials. They are still classified as "pairwise" potentials because the set of interacting atoms changes with time (unlike molecular bonds) and thus a neighbor list is used to find nearby interacting atoms.在lammps中承兑发生的力场包括大量的相互作用,有些包括多体作用。这些依然被分类为 "pairwise" potentials因为原子相互作用的设置随时间变化并且因此neighbor列表被用来发现在相互作用附近的原子。

pair_style colloid - integrated(完全的) colloidal(胶体) potential

pair_style colloid cutoff

cutoff = global cutoff for colloidal interactions (distance units)对于胶体的相互作用球形的截至距离。

pair_coeff 1 1 1.0 1.0 5.0 5.0 12.5

pair_coeff 1 2 5.0 1.0 5.0 0.0 7.0

pair_coeff 2 2 10.0 1.0 0.0 0.0 2.5

pair_coeff I J args

I,J = atom types (see asterisk form below)

args = coefficients for one or more pairs of atom types

Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. Pair coefficients can also be set in the data file read by the read_data command or in a restart file.为一个或更多原子类型制定成对的力场系数。系数的数量和意义取决于pair style 。每一个系数也可以在数据文件中被设定。在read data 指令或是在一个重启文件。

I and J can be specified in one of two ways. Explicit numeric values can be used for each, as in the 1st example above. I <= J is required. LAMMPS sets the coefficients for the symmetric J,I interaction to the same values.I和J可以被定义在通过两种方式。明确的数值可以被用于每个, I <= J 是必须的。Lammps设置对称的i,j相互作用系数是一样的。

The following coefficients must be defined for each pair of atoms types via the pair_coeff command紧跟的系数一定通过pair_coeff command被确定为每一个原子对类型

A (energy units)

sigma (distance units)

d1 (distance units)

d2 (distance units)

cutoff (distance units)

A is the Hamaker energy prefactor A是Hamaker能量速率

Sigma is the size of the solvent particle or the constituent particles integrated over in the colloidal particle sigma是溶剂粒子的大小或是胶体粒子的整体的粒子构

成。fix 1 all npt temp 2.0 2.0 1.0 iso 0.0 1.0 10.0 drag 1.0 &

mtk no pchain 0 tchain 1

fix 2 all enforce2d

fix ID group-ID style args

ID = user-assigned name for the fix

group-ID = ID of the group of atoms to apply the fix to

style = one of a long list of possible style names (see below)

args = arguments used by a particular style

Set a fix that will be applied to a group of atoms. In LAMMPS, a "fix" is any operation that is applied to the system during timestepping or minimization.设置一个fix会应用为一个原子群里。在lammps里面一个"fix"是一个任意的操作在整个时间步伐里应用于系统中。

Temp恒温器的温度iso恒压器的压强

In some cases (e.g. for solids) the pressure (volume) and/or temperature of the system can oscillate undesirably when a Nose/Hoover barostat and thermostat is applied. The optional drag keyword will damp these oscillations,在一些情况里当Nose/Hoover恒温器或是恒压器使用时,系统的温度或是压强会不受人欢迎的震动drag 会抑制这些振动。

The mtk keyword controls whether or not the correction terms due to Martyna, Tuckerman, and Klein are included in the equations of motion (Martyna). Specifying no reproduces the original Hoover barostat, whose volume probability distribution function differs from the true NPT and NPH ensembles by a factor of 1/V. Hence using yes is more correct, but in many cases the difference is negligible.Mtk控制是否修正包括Martyna, Tuckerman, and Klein在内的方程的移动。指定原始的hoover恒温器(其体积分布系数与真实的npt或是nph的体积分布系数有1/V的不同)没有再现。使用yes是更精确的但多数时候不同时可以忽略的。

the number and meaning of the vector values depends on which fix is used and the settings for keywords tchain and pchain, which specify the number of Nose/Hoover chains for the thermostat and barostat.矢量值的数量和意义取决于那个fix被使用以及tchain and pchain的设定。tchain and pchain 指定恒温器和恒压器的Nose/Hoover 链条的数目。If no thermostatting is done, then tchain is 0. .its value is 1 if couple xyz is used or couple xy for a 2d simulation,

包括enforce2d

Zero out the z-dimension velocity and force on each atom in the group.将每个群里的原子z轴的力和速率清零。

dump 1 all atom 200 dump.colloid

dump ID group-ID style N file args

ID = user-assigned name for the dump

group-ID = ID of the group of atoms to be dumped

style = atom or cfg or dcd or xtc or xyz or image or local or custom

N = dump every this many timesteps

file = name of file to write dump info to

args = list of arguments for a particular style

Dump a snapshot of atom quantities to one or more files every N timesteps in one of several styles.每n步里在一个或是多个格式里面倾倒一段数量的原子至一个或是多个文件里

thermo_style custom step temp epair etotal press vol

Set the style and content for printing thermodynamic data to the screen and log file.设定屏幕或是长文件中热力学数据得格式和内容。

Style custom is the most general setting and allows you to specify which of the keywords listed above you want printed on each thermodynamic timestep. Thus the custom style provides a flexible means of outputting essentially any desired quantity as a simulation proceeds.custom格式是最一般的设置并且允许你在你想打印出的每一个热力学时间步伐中设定关键字列表。因此custom格式提供一个灵活的方式输出所有原来渴望的值作为模拟的数据。

step = timestep时间步伐

temp = temperature温度

epair = pairwise energy (evdwl + ecoul + elong + etail)相互作用能量

etotal = total energy (pe + ke)总能量

press = pressure压力

vol = volume体积

thermo 1000N = output thermodynamics every N timesteps 每N步输出一次热动力学量的结果

timestep 0.005时间步长0.005

run 50000

走50000下

lammps实例(3)

Project #1 硅的晶格常数和体弹模量的计算 一、平衡晶格常数和内聚能 自然条件下硅为金刚石结构(dc )。计算模拟时,我们可以假定它为各种结构,f cc, bcc, sc, dc. 可以预测,模拟的dc 结构的硅的体系能量最低,也即最稳定。下面我们将运用LAMMPS 来对硅的各种结构进行模拟。 定义晶格能量为Φ, 数密度为 ρ: pot E N Φ= N V ρ= 其中E pot 为势能, N 为体系总原子数,V 为体系的体积。选取 Stillinger-Weber (SW),以下面命令执行 lammps 运算: 其中,lmp_serial 为 lammps 命令;”<” 符号为读取符;in.Silicon 为输入文件,里面包含运算所需要的各种数据和命令;-log 指定输出文件的名称。 可以看到屏幕上显示出lammps 运行的信息。这个计算量很小,所以很快就结束。接下来以如下命令来查看计算得到的数据: grep 是linux 中一个很重要的命令,用来搜索文本,读取匹配的行并打印出来。这里是搜索 dc.log 文件,将 @ 开头的行打印出来。如下: 晶格参数为5.4305埃,数密度为0.0499540303,每个原子的能量为-4.336599609eV.

下面具体来看刚才给的输入文件,in.Silicon . dc.log 文件中有原子总数的信息, 每个金刚石晶胞中有8个原子,383216?=,所以是216个原子。如下给出各种结构下的体系的原子数:

晶体结构类型 晶胞中的原子数 总原子数 简单立方SC 1 27 体心立方BCC 2 54 面心立方FCC 4 108 金刚石DC 8 216 表1. 不同晶体结构中的原子数 下图是计算模拟得出的各种结构下的数密度与每个原子能量的关系图。 横坐标为数密度, 以金刚石为例,ρ= 8/5.4315^3=0.049926,也即我们直接通过 grep 命令得到的第二项值;纵坐标为每个原子的能量,为第三项值。 金刚石之外,还需计算其他结构。只需对 in.Silicon 做稍微改动: 首先,将in.Silicon 复制成in.fcc : 然后编辑 in. fcc 改动如下几项: 然后如下命令执行: 相应的,如下命令查看log 文件中的数据:

ubuntu下并行安装lammps教程(需联网)超简单 亲测成功,适合小白

ubuntu下并行安装lammps教程(需联网)超简单亲测成功,适合小白 写在前面的话:手册很重要,一定要看手册!!!本人小白一个,没用过任何linux系统,前天才安装了ubuntu,linux系统和win系统有很大的区别,很多操作需要在终端中进行,因此想要安装lammps,最好先熟悉一下linux的基本操作,然后根据手册进行编译安装。安装过程中我走了很多弯路,下载lammps以后就先看了看手册,关于安装那一部分写的很详细,但由于对linux基本操作都不熟悉,以至于根本看不懂,没办法,只能按照网上的教程安装,但装了一天也没成功,最后舍弃所有教程,还是自己根据手册安装成功的。熟悉了linux的基本操作以后就能发现,如何安装lammps手册上其实说的很清楚了,很多教程都走了弯路,进行了很多不必要的步骤,特别是对ubuntu系统的用户来说。这个教程意在帮助ubuntu和lammps小白少走弯路,我尽可能详细地列出了安装过程中的每一个步骤,并对步骤进行了说明,希望能帮助小白们在了解linux基本操作的同时完成lammps的安装。但最好还是根据手册自行安装,因为手册上说的真的很详细。由于我也是小白,加上写作水平有限,难免有纰漏,有不足之处,还请见谅。 lqjunzi 2016.6.2 首先安装ubuntu系统,不会的自行查看相关教程 1.进入安装好的ubuntu系统,先打开software updater(桌面左下角有个类似Windows开始菜单的图表,点击,搜索updater)更新系统,不

是必要的,但不更新可能会出现问题,更新比较慢,要联网下载很多东西 2.打开终端(以下在终端中所需输入指令均高亮标出),系统默认是没有root密码的,但安装lammps时需要在root账户下进行,创建初始root密码的命令如下: lqjunzi@lqjunzi:~$ sudo passwd root #输入sudo passwd root按回车,可以鼠标复制粘贴,但ctrl+c不管用 [sudo] lqjunzi 的密码: #输入密码,回车(输完指令按回车执行,后面省略),输入过程不显示 输入新的 UNIX 密码: #再次输入密码,输入过程不显示 重新输入新的 UNIX 密码: #再次输入密码,输入过程不显示passwd:已成功更新密码 #提示root密码更新成功 lqjunzi@lqjunzi:~$ su #输入su,回车 Password: #输入密码,回车 root@lqjunzi:/home/lqjunzi# #可以看到最前面的用户名已经由lqjunzi变成啦root,而后面的~$也变成了#,#是在root下操作的标志 3.下载lammps安装包,下载后的安装包默认 在/home/lqjunzi/Downloads目录下,这里的lqjunzi是安装系统时的用户名,习惯的将下载后的lammps-stable.tar.gz复制至/home/lqjunzi/sw 目录下(完全可以不复制,就在Downloads下操作,只是个人习惯,如不移动则后面操作目录相应改变) root@lqjunzi:/home/lqjunzi# mkdir sw #在/home/lqjunzi目录下建立sw文件夹 root@lqjunzi:/home/lqjunzi# cd Downloads #进入 Downloads文件夹

lammps实例(4)

Project #2 金属中的点缺陷:空位和间隙原子 一、空位 从晶体中移去一个原子,即可形成空位。本例将运用 LAMMPS 计算空位形成能, E v. LAMMPS 输入文件为in.vacancy 1) 在 fcc 结构的完整Cu晶体中引入一个空位 沿<100>方向构造一个 4 ×N×N×N 的晶体。N为input 文件中lattice命令指定的个方向上的晶胞重复单元数。 2) 弛豫 当一个原子从晶体中移走之后,周围的原子将相应地调整位置以降低体系势能。为得到稳定的构型,需要对体系进行弛豫,relaxation. LAMMPS提供两种能量最小化方式,cg 和 sd。本例中选用 sd 方式进行能量最小化。 如下是输入文件,in.vacancy:

3) 运行lammps 4) 计算空位形成能 空位浓度由下式给出: [n ] = exp( ? F v / k B T ). 其中 F v = E v ? TS v 为形成一个空位所需要的Helmholtz 自由能. 忽略熵S v , 空位浓度公式简化为 [n ] = exp( ?E v / k B T ). 设 E 1 为完整晶体能量,含N 个原子;E 2 为弛豫后的晶体能量,含N – 1个原子。空位形成能 E v 为: 211v N E E E N -≡- 或 ()21v coh E E N E ≡--, 其中 E coh = E 1 / N , 为完整晶体的内聚能。 本例中以EAM 模型计算4×(20×20×20)=32000个原子的体系,得到空位形成能E v ~ 1.26 eV ,文献中的实验值为~1.28 eV ,符合较好。 另由上式计算得到,300K 温度下的空位浓度为~ 7.59×10-22 ,1350 K (T m ) 时的空位浓度~ 2.2×10-5(文献中的实验值为~2×10-4 )。换算时注意(1 eV/k B = 1.1604×10?4 K) 图1. 空位处于4×(6×6×6) 的 FCC 晶体中心,106c a =,206c a =,306c a =. 颜色依据原子势能标注。

lammps实例(2)

Project #4 表面与界面能 铜的表面能 当物体形成表面时,表面上的原子键发生断裂,接近表面的几层原子不再如之前处于平衡状态,从而导致能量的升高,升高的温度便是物体的表面能。 利用LAMMPS 做出 20*20*40 fcc 的盒子,删去边缘的原子制造出一段真空层;算出此时体系的总能量0E ,然后从中间把盒子切成两半并移至足够远的距离,此时的体系总能量为E final , 从而表面能: 02final surface E E A γ=? A 为表面的面积 (100) 面与 (111) 面 如下是输入文件in.surface_Cu_100 # LAMMPS Cu _Surface_100 units metal boundary p p p atom_style atomic lattice fcc 3.61 region box block 0 20 0 20 0 40 create_box 1 box create_atoms 1 box timestep 0.005 thermo 5 pair_style eam/alloy pair_coeff * * jin_copper_lammps.setfl Cu region boundary1 block INF INF INF INF 29.9 INF region boundary2 block INF INF INF INF INF 9.9 group boundary1 region boundary1 group boundary2 region boundary2 group boundary union boundary1 boundary2

vasp与lammps学习资料2020年

LAMMPS分子动力学模拟技术与应用课程内容 一、LAMMPS基础1分子动力学模拟入门理论——掌握lammps的in文件中各命令的意义1.1系综理论 1.2主要算法介绍 1.3积分步长的选取 1.4温度和压力控制 1.5周期性边界条件 1.6分子动力学模拟流程 二、LAMMPS入门学习2LAMMPS入门操作基础 2.1Linux命令入门基础——熟练掌握LAMMPS所用的Linux命令 2.2LAMMPS中一些安装包的介绍——为以后创建自己体系进行选择性安装 2.3LAMMPS的linux版串行和并行及GPU版编译安装——掌握LAMMPS的编译方法,针对自己体系编译可执行文件。 2.4LAMMPS的in文件结构格式、基本语法及常用命令讲解、data文件格式。2.5LAMMPS实例讲解。 实例操作:在linux系统编译安装自己的LAMMPS可执行程序。 三、LAMMPS进阶学习https://www.360docs.net/doc/c06802197.html,MMPS各种参数计算 3.1颗粒模拟 3.2可视化快照 3.3弹性常数模拟 3.4计算热导率 3.5计算粘度 3.6计算均方位移 3.7计算径向分布函数 3.8计算扩散系数 3.9计算能量数据 3.10Lammps常见错误及解决途径 实例操作:学员结合自己的科研方向,选择运行契合自己研究方向的例子 四、Lammps的建模4LAMMPS建模——掌握基本操作流程 4.1掌握lattice命令建立晶体模型 4.2Packmol建模语法学习及实操 4.3Material Studio建模学习及实操 4.4VMD建模学习及实操 实例操作:把上述实操模型转换成lammps的data文件 五、从examples的简单例子,到完成自己的科研课题5通过examples中的例子,理解要模拟对象的物理意义 5.1运行examples\flow到建立水分子在石墨烯片层(碳纳米管)内的流动模拟5.2运行examples\shear到石墨烯力学性质模拟 5.3运行examples\friction到金属/合金的摩擦模拟 5.4特殊结构的模拟建模(C60系列模型) 实例操作:学员探索由简单例子到自己科研课题的模拟过程 六、环氧树脂在二氧化硅表面吸附建模 (CVFF力场)6环氧树脂在二氧化硅表面吸附吸能的影响模拟过程 6.1创建构型文件 6.2建立输入脚本 6.3运行能量最小化及体系的预松弛

lammps计算例子过程说明

[lizhao@c0106 src]$ cd [lizhao@c0106 ~]$ ls examples fftw-2.1.5 fftw-2.1.5.tar.gz hosts lammps-21Oct10 lammps.tar.gz mpich-1.2.7p1 mpich.tar.gz [lizhao@c0106 ~]$ cd examples/ [lizhao@c0106 examples]$ ls colloid crack eim ellipse friction meam micelle msst nemd peptide pour README rigid srd comb dipole ELASTIC flow indent melt min neb obstacle peri prd reax shear USER [lizhao@c0106 examples]$ cd crack [lizhao@c0106 crack]$ ls in.crack log.crack.10Sep10.linux.1 log.crack.10Sep10.linux.4 [lizhao@c0106 crack]$ [lizhao@c0106 crack]$ vi hostfile [lizhao@c0106 crack]$ ls dump.crack hostfile in.crack log.crack.10Sep10.linux.1 log.crack.10Sep10.linux.4 https://www.360docs.net/doc/c06802197.html,mmps [lizhao@c0106 crack]$ ll total 2544 -rw-rw-r-- 1 lizhao lizhao 2564431 Dec 16 17:48 dump.crack -rw-rw-r-- 1 lizhao lizhao 12 Dec 16 2010 hostfile -rw-rw-r-- 1 lizhao lizhao 1212 Dec 16 17:40 in.crack -rw-rw-r-- 1 lizhao lizhao 4608 Dec 16 17:40 log.crack.10Sep10.linux.1 -rw-rw-r-- 1 lizhao lizhao 4613 Dec 16 17:40 log.crack.10Sep10.linux.4 -rw-rw-r-- 1 lizhao lizhao 4677 Dec 16 17:48 https://www.360docs.net/doc/c06802197.html,mmps [lizhao@c0106 crack]$ cat hostfile c0105 c0106 [lizhao@c0106 crack]$ mpdallexit [lizhao@c0106 crack]$ ls dump.crack hostfile in.crack log.crack.10Sep10.linux.1 log.crack.10Sep10.linux.4 https://www.360docs.net/doc/c06802197.html,mmps [lizhao@c0106 crack]$ mpdboot -n 2 -f hostfile -r rsh [lizhao@c0106 crack]$ mpdtrace c0106 c0105 [lizhao@c0106 crack]$ mpiexec -genv I_MPI_DEVICE ssm -perhost 2 -np 4 /export/home/lizhao/lammps-21Oct10/src/lmp_mkl < in.crack . . . . . . ——生成的代码 [lizhao@c0106 crack]$ cat in.crack

LAMMPS手册-中文版讲解

LAMMPS手册-中文解析一、简介 本部分大至介绍了LAMMPS的一些功能和缺陷。 1.什么是LAMMPS? LAMMPS是一个经典的分子动力学代码,他可以模拟液体中的粒子,固体和汽体的系综。他可以采用不同的力场和边界条件来模拟全原子,聚合物,生物,金属,粒状和粗料化体系。LAMMPS可以计算的体系小至几个粒子,大到上百万甚至是上亿个粒子。 LAMMPS可以在单个处理器的台式机和笔记本本上运行且有较高的计算效率,但是它是专门为并行计算机设计的。他可以在任何一个按装了C++编译器和MPI 的平台上运算,这其中当然包括分布式和共享式并行机和Beowulf型的集群机。LAMMPS是一可以修改和扩展的计算程序,比如,可以加上一些新的力场,原子模型,边界条件和诊断功能等。 通常意义上来讲,LAMMPS是根据不同的边界条件和初始条件对通过短程和长程力相互作用的分子,原子和宏观粒子集合对它们的牛顿运动方程进行积分。高效率计算的LAMMPS通过采用相邻清单来跟踪他们邻近的粒子。这些清单是根据粒子间的短程互拆力的大小进行优化过的,目的是防止局部粒子密度过高。在并行机上,LAMMPS采用的是空间分解技术来分配模拟的区域,把整个模拟空间分成较小的三维小空间,其中每一个小空间可以分配在一个处理器上。各个处理器之间相互通信并且存储每一个小空间边界上的”ghost”原子的信息。LAMMPS(并行情况)在模拟3维矩行盒子并且具有近均一密度的体系时效率最高。 2.LAMMPS的功能 总体功能: 可以串行和并行计算 分布式MPI策略 模拟空间的分解并行机制 开源 高移植性C++语言编写 MPI和单处理器串行FFT的可选性(自定义) 可以方便的为之扩展上新特征和功能 只需一个输入脚本就可运行 有定义和使用变量和方程完备语法规则 在运行过程中循环的控制都有严格的规则 只要一个输入脚本试就可以同时实现一个或多个模拟任务 粒子和模拟的类型: (atom style命令)原子粗粒化粒子DNA 全原子聚合物,有机分子,蛋白质,联合原子聚合物或有机分子金属粒子材料粗粒化介观模型延伸球形与椭圆形粒子点偶极粒子刚性粒子所有上面的杂化类型力场:)(命令:pair style, bond style, angle style, dihedral style, improper style, kspace style, tabulated.

Lammps 石墨烯实例

一、简介 1.SiC热分解制备石墨烯 自2004年Novoselov、Geim和合作者们从石墨上剥离出世界上第一种二维材料——单层石墨:石墨烯(Graphene)以来,石墨烯就受到了科技界的广泛重视[1]。Novoselov 和Geim两人因此在2010年获得了诺贝尔物理学奖。因为石墨烯的独特特性,在许多技术领域例如光电子学上它都被寄予厚望。研究石墨烯这种材料相关的物理化学特性和发展大面积、高质量生长石墨烯的技术,同时将其与器件物理学联系起来是我们研究和应用石墨烯的必由途径。 石墨烯是由碳元素组成的二维六边形材料,其在光学、电学、热学、力学等性质十分优异。它有可能在后摩尔定律时代成为硅(Silicon)的继任者,在单分子气体传感器[2]、自旋电子学[3]、量子计算[4]、太赫兹振荡器[5]等等领域发挥重要作用。如今,从石墨上剥离出石墨烯仍然是一种重要的石墨烯制备方方法。然而,这种方法产生的石墨烯大小通常不超过1000 μm2,只适合实验室研究,尚不能在工业上大规模应用。科学家发展了其他的石墨烯制备方法,包括将石墨烯视作一种薄膜来生长的化学气相沉积(Chemical Vapor Deposition, CVD)法、热分解碳化硅法(SiC thermal decomposition)、氧化石墨烯还原法(Graphene oxide reduction)等。 CVD法通过使含碳气源在有催化作用的金属表面分解或者使溶入到这些有催化作用的金属中的碳(C)发生表面偏析,使得在金属表面生成石墨烯或者多层石墨烯(Few-Layer Graphene, FLG)。能否直接在半导体/绝缘体上生长石墨烯呢?碳化硅热分解成功的解决了这一问题。最早试图使六方晶系的SiC晶体石墨化的研究报告见于1961年,Badami在高温和真空环境下得到了发生了一定石墨化的SiC[6]。在一定的退火条件下,SiC晶体表面发生热分解,Si原子发生解吸附,而C原子留下来重新排列和组合可以生长成外延型的石墨烯层[7]。更细致的研究发现用热退火的方法在六方SiC的Si面上生长的石墨烯比C面有更好的可控性,例如:可以更好的控制石墨烯的层数。Si面上生长的石墨烯生长方向与基底晶体结构有密切关系,这样提供了在基底上均匀覆盖和特定方向生长石墨烯的可能性。特别地,石墨烯直接生长在半导体SiC上使得我们无

[转载]关于LAMMPS输出【Output】的问题

无论任何模拟,我们都是想从模拟中得到我们想要的数据【data】,然后分析这些数据,从而提取出相关的信息【MAYBE新的发现】,那么数据的输出是 必然的一道程序,下面谈谈LAMMPS软件是如何输出data。 LAMMPS中处理的输出数据主要分一下三个大的部分: 1.断点数据,这个主要是为了防止模拟过程中出现意外,比如实验室或机房突然断电,程序部分阶段有错误等等。 2.系统热力学量的输出,这些量一般是体系中各个原子的集体行为量,比如温度,压强等 3.单原子详细信息的输出,如我们想得到的轨迹文件 对应于上面的三大部分,LAMMPS设置了不同的命令,有些命令结合在一起实现相关的功能。 1.对于断点数据,原始数据,LAMMPS主要有一下命令进行数据的输入输出。read_data,read_restart【读入】,restart,write_restart【输出】,如果能灵活运用这几个命令,会让你的模拟在突发事件下得到经济上的收获。其中命令里有两类通配 符,* 表示时间步,% 表示CPU编号。 2.全局热力学数据,也就是所谓的thermodynamic output,这些量是面向于系统的,而不是面向于某一类,某一组,原子的。一般是系统 宏观信息的数据。处理这些数据的命令主要有如下几个 thermo, thermo_modify, thermo_style[这个命令对于初学者要认真研究和调试],还有相关的把单原子信息转换为【global quantities】的辅助命令:fix ave/time,fix ave/ spatial, compute reduce 这些命令可以自己设定输出的频率,文件名等等。thermo_style 和 compute/ fix/variable命令结合进行数据的处理和输出是个大学问,这个需要不断的调试才能熟练掌握。其实研究variable compute 和少数 关于数据处理的fix可以节约你大量后期数据处理的时间。 3.单原子数据。相关命令主要有dump, dump_modify,undump.时刻牢记这些命令用于处理atom的数据对于你出现的错误就有敏感 性了,呵呵。 4。echo,print,fix print结合variable可以用于调试你的脚本,纠错。 5.秀个例子,用于输出setforce, group原子于其他相互作用力 #------------------------------------------------------------------------------------ fix 3 tetras setforce 0.0 0.0 0.0 variable fx equal f_3[1] variable fy equal f_3[2] variable fz equal f_3[3] fix 4 tetras print 1 "-- ${fx} ${fy} ${fz} --" #------------------------------------------------------------------------------------ thermo 2 thermo_style custom step f_3[1] f_3[1] f_3[1] #------------------------------------------------------------------------------------ 以上由redream/一下是fc所写 关于output,手册4.15,曾粗略翻译过 除了restart文件,LAMMPS还有两种基本的输出。第一种是热力学输出,每隔一定的时间步就打印到屏幕和log文件的一列数。第二种是dump 文件,包括按照一定的频率写入文件的原子位置快照和各种per-atom数值。每个模拟打印一组热力学输出;可能生成任意数目的dump文件。如下所讨

lammps的in文件详解

例一 units metal # 单位为lammps 中的metel 类型 boundary p p p # 周期性边界条件 atom_style atomic # 原子模式 lattice fcc 3.61 # Cu 的晶格常数3.61 region box block 0 4 0 4 0 4 # x,y,z 各方向上的晶胞重复单元数,也即区域大小 create_box 1 box # 将上述区域指定为模拟的盒子 create_atoms 1 box # 将原子按晶格填满盒子 pair_style eam # 选取Cu 的EAM 势作为模型 pair_coeff * * Cu_u3.eam # EAM 势文件名称 run 0 # 运行0 步,仅为启动lammps 的热力学数据计算 variable E equal pe # 定义变量E 为系统总势能 variable N equal atoms # 定义变量N 为系统总原子数 print "the number of atoms & system energy now are $N $E" # 打印信息 create_atoms 1 single 2.45 2.05 2.05 # 在该位置插入一个原子 min_style sd # 能量最小化模式,sd minimize 1.0e-12 1.0e-12 1000 1000 # 能量最小化参数,指数越大最小化程度越深 print "interstitial introduced, minimized: $N atoms, energy is $E" fix 1 all nvt 100 100 100 drag 0.2 # nvt 系综,原子数、体积和温度保持不变;T=100K timestep 0.005 # 步长0.005fs run 1000 # 运行1000 步 print "nvt performed, temperature up: $N atoms, total energy is $E" fix 1 all nvt 100 0.0001 100 drag 0.2 # nvt 系综,温度由100K 到0.0001K run 1000 # 运行1000 步 print "nvt performed, temperature down: $N atoms, total energy is $E" compute 3 all pe/atom # 计算每个原子的势能 compute 4 all ke/atom # 计算每个原子的动能 compute 5 all coord/atom 3.0 # 计算每个原子的近邻原子数 dump 1 all custom 1 dump.atom id xs ys zs c_3 c_4 c_5 # 将信息写入dump.atom min_style sd minimize 1.0e-12 1.0e-12 10000 10000 # 再次能量最小化 print "the final state: $N atoms, total energy is $E" # 打印信息 ~ 例二 boundary p s s # 边界条件,拉伸方向是周期性,其余是自由边界;如果是薄膜拉伸则是两个周期性,块体则是三个周期性 units metal #单位制定义为metal atom_style atomic #原子类型自动 neighbor 2.0 bin #截断半径相关的东西 neigh_modifydelay 1 check yes # 邻近原子列表更新速度

lammps模拟实例详解

# Big colloid particles and small LJ particles units lj This command sets the style of units used for a simulation. It determines the units of all quantities specified in the input script and data file, as well as quantities output to the screen, log file, and dump files. Typically, this command is used at the very beginning of an input script.这个指令设定模拟的格式,它决定了在输入脚本文件和数据文件以及在屏幕上显示的输出物,日志文件和垃圾文件中所有的单元格式。典型的是,它经常用于输入脚本的开头 For style lj, all quantities are unitless. Without loss of generality, LAMMPS sets the fundamental quantities mass, sigma, epsilon, and the Boltzmann constant = 1. The masses, distances, energies you specify are multiples of these fundamental values. The formulas relating the reduced or unitless quantity (with an asterisk) to the same quantity with units is also given. Thus you can use the mass & sigma & epsilon values for a specific material and convert the results from a unitless LJ simulation into physical quantities. 对于lj格式,所有数量都是无量纲的。不失一般性的,lammps设定了基本量质量sigma epsilon 和波尔兹曼常数=1。你定义的质量,距离,能量是这些基本值的倍数。公式把衰减量或者是无量纲量(用*)和单元给出的相同的量关联起来。因此你可以用mass,sigma,epsilon值表示一个具体材料并且改变一个无量纲lj模拟的物理量的结果。 mass = mass or m distance = sigma, where x* = x / sigma time = tau, where tau = t* = t (epsilon / m / sigma^2)^1/2 energy = epsilon, where E* = E / epsilon velocity = sigma/tau, where v* = v tau / sigma force = epsilon/sigma, where f* = f sigma / epsilon torque = epsilon, where t* = t / epsilon temperature = reduced LJ temperature, where T* = T Kb / epsilon pressure = reduced LJ pressure, where P* = P sigma^3 / epsilon dynamic viscosity = reduced LJ viscosity, where eta* = eta sigma^3 / epsilon / tau charge = reduced LJ charge, where q* = q / (4 pi perm0 sigma epsilon)^1/2 dipole = reduced LJ dipole, moment where *mu = mu / (4 pi perm0 sigma^3 epsilon)^1/2 electric field = force/charge, where E* = E (4 pi perm0 sigma epsilon)^1/2 sigma / epsilon density = mass/volume, where rho* = rho sigma^dim atom_style atomic 原子类型atomic(原子的) Define what style of atoms to use in a simulation. This determines what attributes are associated with the atoms. This command must be used before a simulation is setup via a read_data, read_restart, or create_box command. 定义在模拟中用到的原子类型,这个决定了与原子有关的属性,这个命令必须用在模拟被设定之前通过read_data, read_restart, or create_box Atomic only the default values coarse-grain liquids, solids, metals Atomic 附加属性是只是默认值用于粗粒液体,固体和金属的模拟

LAMMPS实例 单层石墨烯拉伸运行脚本

单层石墨烯拉伸脚本文件 #Initialization units metal dimension2 boundary s s p newton on atom_style atomic neighbor1.0bin neigh_modify every1delay0check yes #Atom Definition #creat geometry variable latp equal1.43*sqrt(3)#C-C键长1.43 lattice custom2.4768a11.00.00.0a20.01.7320.0a30.00.01.3727& basis0.00.333330.0& basis0.00.666670.0& basis0.50.166670.0& basis0.50.833330.0 region graphene block020020-0.10.1 create_box3graphene create_atoms1box mass112 mass212 mass312 #Setting pair_style airebo3.011 pair_coeff**CH.airebo C C C region1block INF INF INF5.0INF INF units box group left region1 region2block INF INF80.0INF INF INF units box group right region2 group boundary union left right group mobile subtract all boundary region medium block INF INF5.080.0INF INF units box group medium region medium set group left type1 set group right type2 set group medium type3 #initial velocity compute1medium stress/atom NULL

lammps实例(5)

Project #5 熔化与凝固:氩,铜,铝 铜和铝的熔化转变: 对于铜和铝,LAMMPS建立8×8×5的FCC晶格体系;充分弛豫后利用Nose-Hover方法,保持压强为零,使体系从T=2.5K开始加热,直至发生熔化转变。 下面是铜熔化的输入文件: # LAMMPS Melt_Cu or Al units metal # 单位,指定为lammps里的金属类的单位,长度为?,能量为eV。boundary p p p # 周期性边界条件 atom_style atomic # 原子模式 variable x equal 2.5 # 定义变量 x为初始温度 lattice fcc 3.61 # Cu 的晶格常数3.61 #lattice fcc 4.05 region box block 0 8 0 8 0 5 # x,y,z各方向上的晶胞重复单元数,也即区域大小 create_box 1 box # 将上述区域指定为模拟的盒子 create_atoms 1 box # 将原子按晶格填满盒子 timestep 0.01 # 步长 0.005fs thermo 1000 #每隔1000步输出热力学结果 pair_style eam/alloy # 选取 Cu 的EAM势作为模型 pair_coeff * * jin_copper_lammps.setfl Cu # EAM 势文件名称 #pair_style eam/fs #pair_coeff * * Al_FM.eam.fs Al neighbor 0.5 bin neigh_modify every 5 delay 0 check yes #velocity all create $x 825577 dist gaussian fix 1 all nvt $x $x 1.0 drag 0.2 #保持初始温度,在NVT下弛豫 #compute 3 all pe/atom

lammps初学者in文件中文解析

Lammps初学者——in文件中文解析 (1)初始化 Units: Units命令是用来设定模拟的原子类型。 Units style(lammps现在提供的有style=LJ、real、metal、si、cgs、electron)LJ是硬球模型 Real是真实的原子模型 Metal是金属原子模型 Si是硅(半导体)原子模型 Cgs Electron是电子模型 Dimension: Dimension命令是用来定义模拟的维度,默认情况为三维。 Dimension N (N=2,3) Boundary: Boundary命令是用来设定模拟的边界条件。 Boundary x y z (x,y,z=p,s,f,m四种类型中的一种或者两种) P是周期性边界条件

S是自由边界条件(但是具有收缩性) F是固定边界条件 M是具有最小值的自由边界条件(但是具有收缩性) Atom-style: Atom-style定义了模拟体系中的原子属性。 Delete-atoms: Pair-style: Pair-style定义了相互作用力场类型,即势函数。 (2)原子定义 1、 Read-data/read-restart: Read-data或read-restart为从data或restart文件中读取内容来定义原子。2、 Lattice: lattice是用来原子类型构建模型晶格结构。 Lattice style scale keyword values... Style表示点阵类型,点阵类型有none、sc、bcc、fcc、hcp、diamond、sq、sq2、hex、custom。 Scale表示构建的点阵类型的单位长度 Keyword表示后面可以追加0个或者多个关键字,关键字有origin、orient、

LAMMPS案例分析—石墨烯拉伸和热传导

第一行一般是一些说明性的文字,例如解释一下这个输入文件的作用,模拟的是什么系统,作者是谁,什么时候完成的。这样做为了方便以后查阅起来方便。在LAMMPS 里用符号#来注释掉不需要执行的指令。 一、Initialization # 2d LJ crack simulation 使用L-J势能模拟裂纹的扩展 Units lj 设置整个模拟系统的单位;物理量均采用无量纲化的约化单位dimension 2 boundary s s p 设置a三个方向上的边界条件 atom_style atomic 基本物质单元所具备属性,参数atomic所有单元都是粗粒化小球neighbor 0.3 bin 成对势能的截至距离 neigh_modify delay 5 间隔多少载荷步从新形成近邻表 二、Atom Definition # create geometry lattice hex 0.93 指定晶格类型和晶格常数(二维六方密堆积) region box block 0 100 0 40 -0.25 0.25 三个方向上模拟的空间区域 create_box 5 box 按照空间区域创造5个模拟盒子 create_atoms 1 box 使模拟盒子里布满原子,原子种类记为1 mass 1 1.0 mass 2 1.0 mass 3 1.0 与5个模拟盒子对应,设置原子的质量 mass 4 1.0 mass 5 1.0 三、Setting # LJ potentials pair_style lj/cut 2.5 相互作用为LJ12-势,截断半径为2.5 pair_coeff * * 1.0 1.0 2.5 LJ 12-6 中的ε 和σ 分别为1.0 和1.0,截断半径为2.5 # define groups region 1 block INF INF INF 1.25 INF INF group lower region 1 定义lower组,便于施加外加速度region 2 block INF INF 38.75 INF INF INF group upper region 2 定义upper组,便于施加外加速度group boundary union lower upper 定义总边界组 group mobile subtract all boundary 定义可动原子组,便于统计温度 region leftupper block INF 20 20 INF INF INF region leftlower block INF 20 INF 20 INF INF

相关文档
最新文档