This repository holds all of the code and LAMMPS inputs to compute vacancy concentration, formation energy, and formation volume in equiatomic FeNiCrMnCo and FeAl as outlined in our paper on arXiv. To see a stand-alone repository that's better for computing vacancy concentration and formation energy in an arbitrary alloy, see our other repository here.
Here, we assume the LAMMPS executable is named lmp
.
The crucial parts of the code are the files in the inputs/
directory and some variables that need to be specified when calling lmp
.
Here we need a tag
variable, which specifies the name of the subdirectory in inputs/
. Here, I use the name of the system of interest.
In each subdirectory in inputs/*
, we have specified a composition, lattice, masses, and a potential. Note that these are just LAMMPS commands that are directly inputted into LAMMPS input files, so they can be any commands as long as those commands are placed in the proper order corresponding to when inputs/${tag}/*.in
is called. The intended purpose of each file is:
composition.in
defines the composition of the solutionlattice.in
defines the latticemasses.in
defines the mass of each typepotential.in
defines the interatomic potential
Any reference to other files in these *.in
files must take into account that the *.in
files are referenced in the parent directory of inputs/
, not inputs/
itself.
First, to run the MC-NPT equilibration, run the command lmp -in mc.in -var tag ${tag}
, where tag
is defined as above. Then, the MC-NPT analysis scripts need to be run:
mc_md_visualization.py
order_parameter_plots.py
This will generate a file time.txt
which contains all recorded timesteps, sampled at a logarithmic frequency, as well as the MC-NPT visualization and order parameter plots.
Then, LAMMPS must be invoked again to perform the vacancy insertions. This is performed by the input file insertions.in
. To run them for all timesteps, loop through all integers in time.txt
:
for t in $(cat time.txt)
do
lmp -in insertions.in -var tag ${tag} -var t ${t} -log logs/${tag}/insertions${t}.log
done
These runs are quite slow, especially for a pair-style without a GPU/Kokkos accelerator variant. For calculations on an HPC system, consider writing a short script to perform parallel job submissions for each timestep.
Once these runs are finished, the insertions analysis scripts need to be run:
histograms.py
formation_plots.py
order_thermo.py
fluctuation.py
This will generate text files with chemical potentials, the histograms with distributions of local formation enthalpies and volumes, plots of global formation enthalpies and volumes, plots of vacancy thermodynamics and order, and a plot of occupation fluctuations using the calculated chemical potentials.
For your own usage, modify config.json
accordingly. Run python validate_config.py config.json
to validate any created config file.