Grain Growth of AZ31 Magnesium Alloy Based on Three-Dimensional Cellular Automata

Based on the thermodynamic conversion mechanism and energy transition principle, a three-dimensional cellular automata model of grain growth is established from the aspects of grain orientation, grain size distribution, grain growth kinetics, and grain topology. Also, the effect of temperature on the three-dimensional grain growth process of AZ31magnesium alloy is analyzed.+e results show that the normal growth of three-dimensional grains satisfies the Aboav-weaire equation, the average number of grain planes is between 12 and 14 at 420°C and 2000 CAS, and the maximum number of grain planes is more than 40. Grains of different sizes are distributed normally at different times, most of which are grains with the ratio of grain diameter to average grain diameter R/Rm≈ 1.0, which meets the minimum energy criterion of grain evolution. +e grain of AZ31 magnesium alloy increases in size with the increase of temperature, and the number of grains decreases with the increase in time. +e angle between the twodimensional slices of three-dimensional grains is approximately 120°, which is consistent with that of the traditional two-dimensional cellular automata.+e relative error of grain size before and after heat preservation is in the range of 0.1–0.6 μm, which indicates that the 3D cellular automata can accurately simulate the heat preservation process of AZ31 magnesium alloy.


Introduction
Since grain growth is closely related to the mechanical properties of polycrystalline materials, such as plasticity, strength, and rigidity, it is important to study the grain growth for controlling and improving the mechanical properties of material [1]. Grain growth is a phenomenon in which the average grain size of the system gradually increases during annealing [2], which is usually difficult to be observed completely through experiments. With the development and progress of computer technology, a large number of simulation methods have been used in the research of the microstructure evolution process, such as the phase field method, Monte Carlo method, and cellular automata method, which have been recognized by the majority of researchers [3].
For the simulation of grain growth, Liu et al. [4] first combined the CA method with the MC method to simulate the two-dimensional grain growth process and analyzed the size, edge number, and growth dynamics during the grain growth process. Geiger et al. [5], based on the principle of grain boundary transition, simulated the growth of twodimensional grains by improving the transformation rule of cellular automata. However, three-dimensional grain growth [6][7][8][9] can reflect the internal structure of materials more intuitively than two-dimensional grain growth. At present, some researchers are gradually exploring threedimensional space [10][11][12][13] on the basis of two-dimensional research. Wang et al. [14] considered the growth mechanism driven by curvature and thermodynamics and used 3D-CA model to simulate the normal austenite grain growth process. Zhao et al. [13] established an improved 3D-CA model to dynamically simulate the equiaxed grain growth process in the annealing process of metal materials. Guoquan et al. [15] used the Monte Carlo method to simulate the grain growth process of two kinds of initial grains (β � 2.96, β � 3.47) with the Weibull distribution. According to the physical mechanism of grain growth, Hao et al. [16] analyzed its growth law with the cross-section method and obtained the three-dimensional grain growth index of 0.3961, which is close to the theoretical value of 0.5. e establishment of the abovementioned three-dimensional model has laid a certain foundation for further research. However, due to the large amount of calculation, the abovementioned model does not establish the relationship between the three-dimensional model and the two-dimensional model and does not study and observe the grain orientation number, so there are still some deficiencies in the microstructure simulation process.
In this paper, the grain growth process of AZ31 magnesium alloy is simulated by using a three-dimensional cellular automata model based on the thermodynamic conversion mechanism and energy conversion principle. e effect of temperature on grain growth of magnesium alloy is analyzed. Also, the grain size distribution at different temperatures is obtained. By extracting and observing the grain growth under different orientations, the growth mode of grains is further revealed. e simulation results are verified by the metallographic structure, which provides an effective method and idea for the study of grain size distribution and orientation transformation in three-dimensional space.

Three-Dimensional Cellular
Automata Model ree-dimensional cellular automata (3D-CA) is an important model to obtain the information of grain size, morphology, grain boundary, and orientation through three-dimensional characterization technology. e model can simulate the process of grain growth by establishing the model parameters of a three-dimensional cell and using the cell transformation rules, which plays an irreplaceable role in promoting the development of microstructure evolution theory.

Model Parameter
(1) Cell: cube cell with a side length of 2 μm.
(2) Cell space: a three-dimensional cellular automata is used, and the simulation area is 0.4 mm × 0.4 mm × 0.4 mm, that is, a grid composed of 200 × 200 × 200 three-dimensional cube cells.
(3) Cell state: it includes grain orientation and grain boundary variables. e random integers of 1-180 are used to represent grain orientation, and the same grain orientation represents the same grain. e grain boundary variables are used to judge whether the cell is in the grain boundary, so as to identify all the grain boundaries. e grain boundary variables of the cell in the crystal are 0, and the grain boundary variables of the cell in the grain boundary are 1.
(4) Neighbor type: three-dimensional Moore neighbor type, that is, the state of central cell in the next time step depends on the state of 26 neighbors in this time step, which are, respectively, the state of the last 6 neighbors, the next 12 neighbors, and the next 8 neighbors.
(5) Boundary condition: the three-dimensional periodic boundary condition, connected up and down, left and right, and front and back, approximately simulates the infinite area.

Cellular Transformation Rule.
According to the physical mechanism of grain growth and the principle of energy transition, the transformation rules of three-dimensional normal grain growth cellular automata are established according to the probability transformation rules of thermodynamic energy fluctuation. e details are as follows: (1) traverse all cells and find the cells located at the grain boundary. e grain boundary energy of each cell is represented by the Hamilton function [17]. e Hamilton function is used to express the interaction between atoms and calculate the grain boundary energy E i between the cell and the surrounding cell: In formulas (1) and (2), c is a positive grain boundary energy constant. Suppose that the grain growth is isotropic, where c takes as 1, n is the grain orientation number, M is all the neighbors of cell I, and M takes as 26. S i and S j are the grain orientation numbers of cell i and cell j, respectively. δ s i s j is the Kronecker δ function.
(2) e cell with a different orientation number in the neighbor cell is found, a new orientation number is randomly assigned to the neighbor cell, and the new grain boundary energy E i+1 of the cell in the next time after transformation is calculated. (3) e grains gradually reach a stable state during the growth process. e total energy of the system decreases gradually. e change of the system grain boundary energy is consistent with that of the cell grain boundary energy. It can be expressed as ΔE � E i+1 − E i . e energy difference ΔE is judged after transformation. If ΔE ≤ 0, the cell will change, that is, the probability of change is 1. If ΔE > 0, the cell will be judged by the energy transition principle. (4) According to the energy transition principle, if ΔE > 0, the probability transition rule is made to judge it. Grain growth is actually a process of continuous transition of atoms at grain boundaries. e energy transformation of the atom during the transition process is shown in Figure 1. e energy required for the atom to make a transition from grain 1 to grain 2 is ΔE A . e energy required to make a transition from grain 2 to grain 1 is and E B2 represent the grain boundary energy of grains 1 and 2, respectively [18].
2 Advances in Materials Science and Engineering e probability of the atom to make a transition from grain 1 to grain 2 is as follows: e probability of the atom to make a transition from grain 2 to grain 1 is as follows: In equations (3) and (4), T is the absolute temperature and R is the gas constant. erefore, the final probability of the atom to make a transition from grain 1 to grain 2 can be expressed as In equation (5), P 3 � exp(−ΔE/RT).In every step of the transformation process of cellular automata, each cell is transformed according to the probability P. erefore, the final transformation rule of a cell can be expressed as follows:

Simulation Process.
e flow chart of simulation of the grain growth process at a certain time step is shown in Figure 2.
Step 1: parameters are input to give the cell a certain initial cell space and grain orientation number. e cell space is used to determine the size of the simulated actual space. e grain orientation number is used to describe different grains and distinguish the cells in the crystal and the cells in the grain boundary.
Step 2: the time step tt � 1 is started, the transition probability P of a cell under this time step is calculated, and a random number of cell 0-1 is given.
Step 3: we determine whether it is a grain boundary cell. By comparing the random number Rand and the transition probability P, it can be determined whether the cell is likely to change.
Step 4: the fourth step is to determine the cells that may be transformed and then judge whether the cells meet the requirements of ΔE ≤ 0 or Rand < P.
Step 5: all cells are traversed. After all the judgments in the third and fourth steps, each cell will change the cell that meets the transformation rules. At this time, tt � tt + 1. We go to the next step and judge all cells. is process needs to be repeated again and again to make the grains grow gradually.

Experimental Materials.
In order to verify the effect of temperature on the three-dimensional grain growth process, with AZ31 magnesium alloy bar as the raw material, the microstructure and grain at different temperatures are simulated with the CA method, and the simulation results are visualized by using Matlab tool and FORTRAN language.
e chemical elements of magnesium alloys are shown in Table 1.

Experimental Methods.
e AZ31 magnesium alloy round bar blank is processed into a V 8 mm × 12 mm cylindrical sample. e samples are heated to 300°C, 380°C, and 420°C at the speed of 10° /min and then kept for 12 h. After being kept warm, they are immediately cooled with water, then ground and polished, and then, corroded with corrosive solution. Finally, the metallographic structure of the samples is observed under the optical microscope. e grain size is calculated with the cross-section method.

Grain Morphology.
e three-dimensional grain growth process of AZ31 magnesium alloy at different temperatures is shown in Figure 3. It can be seen from Figure 3 that, with the increase of time steps, the grains grow gradually at different temperatures, the number of large grains decreases continuously, and the average grain size increases and that the larger grains devour the smaller grains and the smaller grains gradually decrease until they disappear. During the whole process, the grains are more uniform and conform to the normal growth law of grains. In the temperature range studied, the higher the temperature is, the better the grain boundary migration is; that is, the higher the temperature is, the more easily the grain grows. e two-dimensional section of grain growth of AZ31 magnesium alloy at different temperatures is shown in Figure 4. It can be seen from Figure 4 that the grain growth process still satisfies the law of two-dimensional grain boundary flatness. In order to reduce the local free energy, the region of grain boundary is gradually flat, and the grains finally form a stable state with an included angle of 120°.

Crystal Orientation.
e grain growth process at 420°C with different grain orientation numbers is shown in Figure 5. For polycrystalline materials, different grains have different orientations. Under the premise of selecting the maximum orientation number of 180, in order to observe the change in the grain orientation more clearly, the grains with orientation numbers of 20, 70, and 110 are extracted separately. It can be clearly seen from Figure 5 that the grains with different orientations change continuously. For the grains with the same orientation, some change into other orientations and some grow gradually without any change in the orientations. At the same time, for the grains with the same orientation number, some grains with the same orientation number are transformed into grains with other orientation numbers during the grain growth process. is is the phenomenon of "gradual disappearance of grains" observed in the single extraction of grains with a certain number of orientations. On the contrary, the phenomenon of "grain growing up" is   Advances in Materials Science and Engineering caused by the transformation of grains with other grain orientations. erefore, the grain orientation will change continuously during the grain growth, and there is a "preferred orientation" between the grains.

Grain Growth Dynamics.
e change of grain size with simulation time at different temperatures is shown in Figure 6. At the same temperature and different time steps, the grain size increases with the increase in simulation time.

Advances in Materials Science and Engineering
For example, at 420°C, the grain size increases from the initial 5.6 μm to 21.2 μm of 2000CAS. With the simulation time, the grain growth rate decreases gradually and the grain tends to be stable, and the slope is smaller and smaller in Figure 6. At the same time and different temperature range, the degree of grain growth increases with the increase in temperature. is is because the higher the temperature is, the more the energy provided for grain growth, and the smaller the driving force required for the grain to overcome grain boundary migration is, the higher the degree of grain growth is. In order to observe the change of grain size more clearly, the grain with an orientation number of 5 can be found to grow gradually at 420°C. e change of grain number with simulation time at different temperatures is shown in Figure 7. At the same temperature, the number of grains decreases with the Q = 20  Advances in Materials Science and Engineering increase in simulation time. For example, at 420°C, the number of grains decreases from the initial 2716 to the 876 of 2000 CAS, and the rate of grain reduction decreases with the increase of time step, which further shows that the grain growth tends to be stable, and the slope is increasing in Figure 7. At the same time and different temperature range, the decrease degree of grain number is also different and increases with the increase in temperature, which shows that temperature can promote grain growth.

Grain Size Distribution.
Grain size distribution is an important index to reflect the uniformity of grain distribution in the process of microstructure growth and the most important quantitative parameter to describe the internal structure characteristics in the process of grain growth [19]. e distribution of grain size is usually represented by the ratio of grain diameter to average grain diameter, i.e., R/R m . e three-dimensional grain size distribution at different times at 420°C is shown in Figure 8. rough the GaussAmp nonlinear fitting of the grain size, it can be found from Figure 8 that the average grain size increases with the increase in time step, and the grain size distribution basically conforms to the normal distribution, in which the grain distribution of R/R m ≈ 1.0 is the most, and the grain proportion of 0.5 < R/R m < 2.5 is very small, which shows that the simulated grains cannot be too large or small. is conforms to the growth rule of normal grains. is result satisfies the minimum energy criterion of grain evolution [20] and further verifies the correctness of the three-dimensional cellular automata model.  e normal growth of three-dimensional grains satisfies the Aboav-Weaire equation [21][22][23], which describes the relationship between the number of grain planes F and the average number of adjacent grains m f : In formula (7), μ 2 is the variance of the distribution of the grain number and 〈f〉 is the average value of the threedimensional grain number.
Distribution of the grain plane number at 420°C is shown in Figure 9.
ese results show that the average grain number is between 12 and 14, and the maximum grain number is more than 40.    Figure 10 shows the metallographic structure of the cross section of the sample. e original microstructure before solution treatment is shown in Figure 10(a). e metallographic diagram of AZ31 magnesium alloy at 300°C, 380°C, and 420°C for 12 h is shown in Figures 10(b)-10(d). It can be seen from Figure 10 that AZ31 magnesium alloy is mainly composed of grains and a large number of small secondphase particles, and the precipitated phase presents an irregular distribution in the alloy. In the process of heat preservation, the number of grains decreases and the average grain size increases with the increase of solution treatment temperature, which results in grain growth. When the temperature is high, more heat is absorbed, which leads to the storage of a large amount of energy in the grains. e grain boundary mobility increases, and the small second phase particles blend into the larger grains, which makes the grain distribution uniform and the grains grow further. Figure 11 shows the metallographic structure of the longitudinal section of the sample. It can be seen from this figure that the metallographic diagram of the longitudinal section and the metallographic diagram of the cross section of the sample show that the same rule of size change is followed. e sizes of grains were measured at room temperature, 300°C, 380°C, and 420°C with the cross-section method. With the comparison of these results and the simulation results, Table 2 shows that the error between them is only 0.1-0.6 μm, and the established three-dimensional cellular automata model can simulate the grain growth process of AZ31 magnesium alloy.

Conclusions
(1) In the process of three-dimensional growth, the grain size increases with the increase in temperature, and the number of grains decreases with the increase in time. e angle between the two-dimensional cross section of grains is approximately 120֩, which is consistent with that of the traditional two-dimensional cellular automata.
(2) With the GaussAmp nonlinear fitting, the grain size satisfies the normal distribution, and the grains of R/R m ≈ 1.0 are distributed in the largest number which conforms to the normal grain growth rule and the minimum energy criterion of grain evolution. (3) With the topological structure of grain growth analyzed, the average number of grain planes is between 12 and 14 at 420°C and 2000 CAS, the maximum number of grain planes is more than 40, and the normal growth of three-dimensional grains meets the Aboav-Weaire equation. (4) With the simulation results verified by the metallographic structure of cross and longitudinal sections, the relative error of grain size before and after heat preservation is 0.1-0.6 μm and the model is of great accuracy.

Data Availability
All data generated or analyzed during this study are included within the article.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.