#######################################################################
# #
# Example: Calculate the surface energy of a 100 surface in Ni at 0K #
# #
#######################################################################
# #
# #
# METHOD #
# #
# Compare the energy of a lattice with no surface (repeating #
# boundary conditions in three directions) with the energy of a #
# lattice with one surface (repeating boundaries in two #
# direction, a free surface in the other). The difference in #
# energy will be due to the surface energy. Divide the energy #
# difference by the surface area to get the surface energy. #
# #
# #
#######################################################################
#
#
# Read in NiAl potential
#
read ../niai.txt
#
# Set the size of the simulation box
# NX,NY,NZ are the number of unit cells in the X, Y and Z directions
#
calc NX=4
calc NY=4
calc NZ=4
#
#
# Create an FCC lattice with unit cell length of 1 angstrom
#
box NX NY NZ
fill particle 4
1 1/4 1/4 1/4
1 1/4 3/4 3/4
1 3/4 1/4 3/4
1 3/4 3/4 1/4
fill go
#
# Scale lattice to unit cell length of Ni, 3.52 angstroms
# Save scale factor in the variable SCALE for later use.
#
calc SCALE=3.52
scale SCALE
#
#
# Write lattice energy per atom with repeating boundaries in three directions
#
surface off x y z
write energy
#
# Write lattice energy per atom with free surface in x direction
#
surface on x
write energy
#
# Calculate area of free surface (in angstroms)
#
# NX and NZ are the number of unit cells in the Y and Z directions
# 2 is the number of surfaces (one each at X=0 and X=NX*SCALE)
# SCALE is the size of the Ni unit cell in angtroms.
#
calc AREA=2*NY*NZ*SCALE^2
write AREA
#
# From XMD output, take the difference in lattice energy and divide
# the area of the free surface.
#
# Note that the energy reported by the WRITE ENERGY command is the
# lattice energy *per atom*. Multiply by the number of atoms (in
# this case, 256) to obtain the total lattice energy. Then take
# this lattice energy difference and divide by the surface
# energy surface area to obtain the surface energy.
#
#
# JR - 2 Nov 1998
# (Thanks to Hengzhong Zhang )