0%

LAMMPS | Create a Polycrystal

This tutorial explains how to generate 3-D or 2-D polycrystals, containing grains of random or specific positions and orientations.

The mode --polycrystal, as its name suggests, aims at creating a polycrystal.

In the following examples, a unit cell of aluminium will be used as a seed. Such a unit cell can be generated with:

atomsk --create fcc 4.046 Al aluminium.xsf

Basics of Voronoi tessellation

Atomsk uses a Voronoi tesselation to construct polycrystals, as illustrated in the figure below.

  1. Nodes (black dots) are introduced at given positions inside the simulation box.

  2. Nodes are linked with their neighbors (red lines). Periodic boundary conditions are used.

  3. The normal to the red lines are found (blue lines). These blue lines define the contours of the future grains, i.e. the grain boundaries.

  4. Atomic “seeds” (for instance unit cells) are placed at the positions of the nodes, with the given crystal orientation.

  5. A seed is expanded in the three directions of space. Atoms that are outside of the grain are removed.

  6. After all seeds have been expanded and cut inside their respective grains, one obtains the final polycrystal.

This illustrates the generation of Voronoi polycrystal in 2-D, but can be generalized to the 3-D case.

Polycrystal with grains at random positions and orientations

Let us start with a random polycrystal. Only two informations are needed: the dimensions of the final box, and the number of grains that it must contain. With this information, Atomsk will generate random positions for the nodes, and random crystal orientations for each grain.

First, the parameters must be written into a text file. For instance, to generate a polycrystal with 12 grains inside a box of size 200x200x200 Å3, create a file named as polycrystal.txt like this:

1
2
box 200 200 200
random 12

Then, run Atomsk in mode “–polycrystal”, using “aluminium.xsf” as a seed and the text file created above:

1
atomsk --polycrystal aluminium.xsf polycrystal.txt final.cfg

The final system is written into “final.cfg”, in Atomeye CFG format. Atomsk creates a new auxiliary property named “grainID”. This property indicates, for each atom, the grain index (here from 1 to 12). The generated polycrystal can then be visualized, e.g. with Atomeye (use Alt+0 to visualize the grainID):

PBC?

Note that many visualization software (like Atomeye) automatically wrap atoms, i.e. they always display atoms as if they were inside the box. But, if you open the file (“final.cfg”) and look at the atom positions, you will find that some atoms are actually outside of the box. It is also recommended to read the tutorial about boundary conditions.

If you wish to apply periodic boundary conditions, so that all atoms are really inside of the box, then use the option “-wrap” when constructing the polycrystal, for instance:

1
atomsk --polycrystal aluminium.xsf polycrystal.txt final.cfg -wrap

Control the position and/or orientation of each grain

Sometimes it is preferrable to control the positions and/or the orientations of the grains. Again the size of the final box must be given. Then, each grain must be defined with a line starting with the keyword “node”, followed by the position of the grain (three real numbers) and its crystal orientation. For example:

1
2
3
4
5
6
7
8
#polycrystal.txt
box 200 180 210
node 0 0 0 [100] [010] [001]
node 40 80 60 56° -83° 45°
node 0.8*box 0.6*box 0.9*box [11-1] [112] [1-10]
node 50 5 60 [110] [1-10] [001]
node 0.75*box 0.3*box 0.45*box -31.4° 28.7° 90.0°
node 60 100 80 random

Such a parameter file is interpreted as follows:

(1) The box will have dimensions 200 Å x 180 Å x 210 Å.

(2) The first grain will be positionned at the origin (0,0,0), and will be oriented X=[100], Y=[010], Z=[001].

(3) The second grain will be positionned at (40,80,60) (in Å), and the crystal will be rotated by 56° around the X axis, then -83° around Y, and then 45° around Z.

(4) The third grain will be positionned at the reduced coordinate (0.8,0.6,0.9). Note how the keyword “box” is used to specify reduced coordinates. This grain will be oriented X=[111], Y=[112], Z=[110].

(5) The last grain will be positionned at (60,100,80) (in Å), and will have a random orientation.

And so on. The various possible notations can be mixed up as in this example, but you may find it easier to use the same notation throughout your file. For instance specify all coordinates in Å (or all in reduced coordinates), and specify all orientations in degrees.

After generating your text file, run Atomsk with the same command as before:

atomsk –polycrystal aluminium.xsf polycrystal.txt final.xsf cfg
This time Atomsk will use the positions and orientations that you have specified, and the final polycrystal will look as follows: