Lattice Parameter Calculation
This simple example, the molecular dynamics simulation calculates the equilibrium lattice constant and corresponding cohesive energy for aluminum.
# Find minimum energy fcc configuration # Mark Tschopp, 2010 # ---------- Initialize Simulation --------------------- clear units metal dimension 3 boundary p p p atom_style atomic atom_modify map array # ---------- Create Atoms --------------------- lattice fcc 4 region box block 0 1 0 1 0 1 units lattice create_box 1 box lattice fcc 4 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 create_atoms 1 box replicate 1 1 1 # ---------- Define Interatomic Potential --------------------- pair_style eam/alloy pair_coeff * * Al99.eam.alloy Al neighbor 2.0 bin neigh_modify delay 10 check yes # ---------- Define Settings --------------------- compute eng all pe/atom compute eatoms all reduce sum c_eng # ---------- Run Minimization --------------------- reset_timestep 0 fix 1 all box/relax iso 0.0 vmax 0.001 thermo 10 thermo_style custom step pe lx ly lz press pxx pyy pzz c_eatoms min_style cg minimize 1e-25 1e-25 5000 10000 variable natoms equal "count(all)" variable teng equal "c_eatoms" variable length equal "lx" variable ecoh equal "v_teng/v_natoms" print "Total energy (eV) = ${teng};" print "Number of atoms = ${natoms};" print "Lattice constant (Angstoms) = ${length};" print "Cohesive energy (eV) = ${ecoh};" print "All done!"
1. In this input file, “Initialize Simulation” section initializes the simulations. The ‘clear’ command clears all memory. The ‘units’ command specifies the units that will be used for the remainder of the simulation. ‘metal’ uses Angstroms and eV, among other units. The ‘dimension 3’ command specifies a 3D simulation cell will be used. The ‘boundary p p p’ specifies periodic boundaries in the x-, y-, and z-direction.
2. In “Create Atoms” section, ‘lattice’ command specifies what type of lattice is used and the number following this specifies the lattice constant. The ‘region’ command specifies the simulation cell. Here, we have used lattice units and specified that the simulation cell box is to be 1 lattice unit in each direction. The ‘create_box’ command following this will use the parameters outlined in the ‘region’ command to actually create the box. The ‘replicate’ command can be used to replicate the periodic cell in each direction.
3. In “Define Interatomic Potential” section, The ‘pair_style’ command specifies what kind of interatomic potential will be used, while the ‘pair_coeff’ specifies the file that the pair potential coefficients are stored in.
4. In “Define Settings” section, two computes are defined. In the first ‘compute’ command, a variable named ‘eng’ is defined to store the potential energy for each atom. In the second ‘compute’ command, a variable named ‘eatoms’ is defined to store the sum of all ‘eng’ values.
5. In “Run Minimization” section, the ‘reset_timestep’ does just that. The ‘fix’ command uses the ‘box/relax’ setting, whereby all directions (‘iso’) are relaxed to 0.0 Pa pressure for all atoms. The ‘thermo’ specifies the output during minimization. The ‘thermo_style’ specifies what type of output is shown to screen. The ‘min_style’ specifies that conjugate gradient will be used for minimization and the ‘minimize’ starts the minimization, i.e., the simulation cell boundaries are relaxed from the specified lattice constant to the actual lattice constant. This section defines some variables, such as ‘natoms’ for the number of atoms, ‘teng’ for the total potential energy, ‘length’ for the length of the simulation cell, and ‘ecoh’ for the cohesive energy of Al. Finally, this section prints these values to screen and to the logfile. The ‘${}’ is used to insert the variables defined earlier.
Reference
https://lammps.sandia.gov