Commit 8a7bc16f authored by stah32's avatar stah32
Browse files

Cleaned up code presentation. Updated tables for outer cutoffs of 1.4-2.0

parent 98cc64b4
#AlAl
#Python script to spline the ZBL Potential to the Buckingham-Coulomb potential for Al-Al interactions
# =============================================================================
# Imports
# =============================================================================
import math
from atsim.potentials import Potential
from atsim.potentials import potentialforms
import atsim.potentials
# =============================================================================
# Custom definitions for ZBL Potential
# =============================================================================
a = (0.46850)/((13**.23)+(13**.23))
def o(x):
return 0.18175*math.exp(-3.19980*x)+.50986*math.exp(-.94229*x)+.28022*math.exp(-.40290*x)+.02817*math.exp(-.20162*x)
def hackZBL(rij):
energy = (14.3996*13*13)/(rij)*o(rij/a)+100
return energy
# =============================================================================
# Define Potentials for table output
# =============================================================================
zbl = potentialforms.zbl(13, 13)
bks_buck = potentialforms.buck(5131.179, 0.3040, 248.0)
coul = potentialforms.coul(-2,-2)
buck_coul = atsim.potentials.plus(bks_buck,coul)
buck_coul_zbl = atsim.potentials.plus(buck_coul,zbl)
spline = atsim.potentials.SplinePotential(zbl,buck_coul,0.5,1.7)
spline = atsim.potentials.SplinePotential(zbl,buck_coul,0.239,2.0)
hackspline = atsim.potentials.SplinePotential(hackZBL,buck_coul,0.5,2.0)
# =============================================================================
# Code to output potentials as tables suitable for LAMMPS
# =============================================================================
#No ZBL Shift
#spline_AlAl= atsim.potentials.Potential('Al', 'Al', spline)
#with open('spline_AlAl_2.0.lmptab', 'wb') as outfile:
# atsim.potentials.writePotentials('LAMMPS', [spline_AlAl], 16.0, 5000, out = outfile)
#ZBL Shift + Spline
#hackspline_AlAl= atsim.potentials.Potential('Al', 'Al', hackspline)
#with open('hackspline_AlAl_2.0.lmptab', 'wb') as outfile:
# atsim.potentials.writePotentials('LAMMPS', [hackspline_AlAl], 16.0, 5000, out = outfile)
#No Spline
#with open('buckcoul_AlAl.lmptab', 'wb') as outfile:
# atsim.potentials.writePotentials('LAMMPS', [buckcoul_AlAl], 16.0, 5000, out = outfile)
# =============================================================================
# Output to data files for use with GNUPlot
# =============================================================================
#ZBL + Spline
#atsim.potentials.plot( 'Spline_2.0.dat', 0.1,16, spline, 5000)
#Shifted ZBL + Spline
#atsim.potentials.plot( 'hackSpline_2.0.dat', 0.1,16, hackspline, 5000)
#Buckingham
atsim.potentials.plot( 'buck.dat', 0.1,16,bks_buck,5000)
#atsim.potentials.plot( 'buck.dat', 0.1,16,bks_buck,5000)
#Buckingham + Coulomb
atsim.potentials.plot( 'buck_coul.dat', 0.1, 16.0, buck_coul, 5000)
###########Maximum at ~1.248
#ZBL
atsim.potentials.plot( 'zbl.dat', 0.1, 16.0, zbl, 5000)
#atsim.potentials.plot( 'zbl.dat', 0.1, 16.0, zbl, 5000)
#Buckingham + Coulomb + ZBL
atsim.potentials.plot( 'sum.dat',0.1,16, buck_coul_zbl, 5000)
atsim.potentials.plot( 'spline.dat' ,0.1, 16, spline, 5000)
buckcoul_AlAl=atsim.potentials.Potential('Al', 'Al', buck_coul)
spline_AlAl= atsim.potentials.Potential('Al', 'Al', spline)
with open('spline_AlAl.lmptab', 'wb') as outfile:
atsim.potentials.writePotentials('LAMMPS', [spline_AlAl], 16.0, 5000, out = outfile)
#atsim.potentials.plot( 'sum.dat',0.1,16, buck_coul_zbl, 5000)
with open('buckcoul_AlAl.lmptab', 'wb') as outfile:
atsim.potentials.writePotentials('LAMMPS', [buckcoul_AlAl], 16.0, 5000, out = outfile)
\ No newline at end of file
#atsim.potentials.plot( 'spline.dat' ,0.1, 16, spline, 5000)
#buckcoul_AlAl=atsim.potentials.Potential('Al', 'Al', buck_coul)
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment