stefanbringuier / PolyCrysGen

Generate Multiphase Polycrystalline LAMMPS data files using Atomsk and ASE

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PolyCrysGen

Name Badge Email Website build-and-release

Description

⚠️ CAUTION ⚠️: All structures are strictly generated via geometric considerations. No energy minimization/relaxation is being performed!

This is a wrapper-script to generate polycrystalline samples for LAMMPS simulation. It utilizes ASE (Atomic Simulation Environment) and Atomsk to create the base unit cells, then multi-phase polycrystalline structures, and write a LAMMPS data file (atom_style full). The flags you can pass to the script are simulation box size, elemental phases and number of grains. All grains are randomly oriented, constructed under PBC, and unwrapped with image flags in the data file. Assumes bulk structures are available from ASE.build.bulk. You should be able to create as many elemental phases+grains as needed.

📓 NOTE: Only pure elemental structures that are in bulk from ase.build are fully covered at the moment. Some compounds and an experimental amorphous phase creation option are available.

Usage 🔨

If your python setup has ASE and your linux environment path includes the atomsk binary, then the PolyCrysGen.sh file can be ran as is by executing in the command line with: bash PolyCrysGen.sh or chmod +x PolyCrysGen.sh; ./PolyCrysGen.sh.

Optionally, I have put together a portable x86_64 AppImage release which you can download and then in a Linux terminal:

chmod +x PolyCrysGen.AppImage
./PolyCrysGen.AppImage --help

Note: I have only tested the AppImage on Ubuntu and requires you install libfuse2 (apt install libfuse2)

Example:

./PolyCrysGen.AppImage --size "150 150 150" --phases "Fe:6 Mg:2 Cr:2 " --postfix "FeMgCr_Polycrystal"

Options:

  • -s, --size SIZE: Define the box size as "X Y Z". Default is "50 50 50".
  • -p, --phases PHASES: Specify phases and number of grains "Element1:N-Grains Element2:M-Grains". Default is "Si:2 Ge:3".
  • -x, --postfix POSTFIX: Set a postfix for the generated files. Default is "Polycrystal".

Adding Amorphous phases

☣️ This is still very experimental!

Although, as the name suggest, the focus is on multiphase polycrystalline materials. If you would like to specify grains to be amorphous use the following syntax:

./PolyCrysGen.sh --phases "SiC-a:2 Ge:2" --size "100 100 100"

This will use the script genamorph.py and generate a seed cell with stoichiometry infered from the formula (e.g., Si:1 C:1) and then use the generated structure as the seed cell for the grains (two in the example above).

📓 NOTE: This can be very time-consuming because the genmorph.py script uses a min distance criteria to insert atoms via a metropolis like algo and is not parallelized. Also the amorphous structure(s) might be very far from reality.

Notes on running 🏃

The script will prompt you in the beginning to remove any file formats that are used in the workfow, if you don't do anything after 10 seconds it will default to n. This can have unintended consequences and is more of a check so you don't delete anything you wanted to preserve. You usually want to use y.

At the end you will also be prompted if you want to delete any output files, if your wanting to inspect the grain locations and detail you'll want to use y to save these. They are the .txt files.

TODO

  • Add logic for 1 phase.
  • Verify 4+ phases (I believe the logic require alphabetic ordering in --phases arg?)
  • Add support for compound phases (ex. SiC) [Partial List]

📚 References

  1. P. Hirel, Atomsk: A tool for manipulating and converting atomic data files, Computer Physics Communications 197 (2015) 212–219. https://doi.org/10.1016/j.cpc.2015.07.012.
  2. A. Hjorth Larsen, et al., The atomic simulation environment—a Python library for working with atoms, J. Phys.: Condens. Matter 29 (2017) 273002. https://doi.org/10.1088/1361-648X/aa680e.

About

Generate Multiphase Polycrystalline LAMMPS data files using Atomsk and ASE


Languages

Language:Shell 58.6%Language:Python 41.4%