Kinetic Modeling of Grain Boundary Diffusion: Typical, Bi-Modal, and Semi-Lamellar Polycrystalline Coating Morphologies

: Polycrystalline coatings and materials are widely used in engineering applications. There-fore, it is important to know their kinetics and mass transport mechanisms. The effect of grain boundaries (GBs) on diffusion in thin ﬁlms with different morphologies lacks understanding. Numerical studies are necessary to study GB kinetics but are limited to simpliﬁed cases. The present work addresses the lack of diffusion studies in more complex morphologies. Diffusion in two-dimensional polycrystalline coatings of typical, bi-modal, and semi-lamellar morphologies was modeled and the inﬂuence of the microstructure on the diffusion regimes and the overall rate was identiﬁed. Different morphologies with similar diffusion coefﬁcients provided different regimes. The regime depends not only on the total diffusivity and grain/GB diffusivities, but also on the morphological features of the surface. While the fast diffusion pathways of GBs accelerated diffusion, the level of acceleration depends on the morphology since fast pathways and ﬂux areas are limited to GBs. GB distribution is important to the mass transfer process, as GBs accelerate diffusion locally. The overall diffusion rate is generally dependent on the diffusion coefﬁcients ratio. Nevertheless, the level of this dependence relies on the morphology.


Introduction
Polycrystalline coatings and materials have shown great functional and structural potential and outstanding mechanical and physical properties [1]. Alloys, metals, and ceramics with a polycrystalline microstructure are widely used in engineering applications, including but not limited to electronic devices [2], manufacturing [3], solar and fuel cells [4,5], structural materials [6], thin-film transistors [7], future fusion applications [8], scintillators [9], laser media [10], and light-emitting diodes [11]. Hence, it is important for both practical and phenomenological reasons to know and predict the kinetics and mass transport mechanisms in polycrystalline coatings.
Diffusion in polycrystalline coatings plays an important role in many applications. GB diffusion serves as a fast diffusion path, therefore, for example, in IT-SOFC grain boundaries act as a pathway for metallic Ni to diffuse into the thin film [22]. Olyaeefar et al. [23] Diffusion in a two-dimensional polycrystalline morphology thin layer was modeled by employing the finite difference method to numerically solve Fick's second law Equation (1) with location-dependent diffusion coefficient values: ∂c(x, y, t) ∂t = D x (x, y) ∂ 2 c(x, y, t) ∂x 2 + D y (x, y) ∂ 2 c(x, y, t) ∂y 2 (1) Discretizing Equation (1) using the forward time centered space method [73] yields the numerical form of the model: where ∆t denotes time step, i vertical coordinate, j horizontal coordinate, and h atomic layer thickness, which is the same for all directions h i = h j = h.
While solving the numerical equations for this model, certain assumptions were made: • Fick's laws of diffusion are valid both in grain and GB areas; • Volumetric diffusion from surface to deeper layers of the coating; • Diffusion from GB to grain, and vice versa; • Diffusion along and across GB; • Chemical homogeneity at the interfaces, with no element segregation and/or precipitation; • The diffusivity in the grain boundary is much higher than the diffusivity in the bulk; • Diffusion coefficients are independent of time but dependent on position; • Initial zero concentration of diffusing atoms in the whole volume; • The Dirichlet boundary condition for the first layer: c(x, 0) = 1; • The Neumann condition on all other sides: ∂c(x,) ∂y = ∂c(0,y) ∂x = ∂c(l,y) ∂x = 0. In this study, all parameters are non-dimensional. Considering similarity theory, no matter what size domain will be, under prescribed assumptions diffusion will be identical. Presented simulations were performed using grids of 600 × 1000 non-dimensional units with a total number of 600,000 grid nodes.
The polycrystalline microstructure was modeled through the spatial distribution of diffusion coefficient values, which were obtained as follows. A drawing of the polycrystalline microstructure of the coating was created and converted into the matrix of greyscale code numbers (m) as shown in Figure 1. Black color (the greyscale number equal to 0) corresponds to the primary GB, and the white color corresponds to the grain (greyscale number equal to 255), and all shades of gray between black and white correspond to the secondary GBs.
the numerical form of the model: The diffusivity in the grain boundary is much higher than the diffusivity in the bulk; • Diffusion coefficients are independent of time but dependent on position; • Initial zero concentration of diffusing atoms in the whole volume; • The Dirichlet boundary condition for the first layer: The Neumann condition on all other sides: ( ,) = ( , ) = ( , ) = 0.
In this study, all parameters are non-dimensional. Considering similarity theory, no matter what size domain will be, under prescribed assumptions diffusion will be identical. Presented simulations were performed using grids of 600 × 1000 non-dimensional units with a total number of 600,000 grid nodes.
The polycrystalline microstructure was modeled through the spatial distribution of diffusion coefficient values, which were obtained as follows. A drawing of the polycrystalline microstructure of the coating was created and converted into the matrix of greyscale code numbers (m) as shown in Figure 1. Black color (the greyscale number equal to 0) corresponds to the primary GB, and the white color corresponds to the grain (greyscale number equal to 255), and all shades of gray between black and white correspond to the secondary GBs. The described approach allowed us to take into account more complex polycrystalline morphologies with varying diffusivity in the primary and secondary GBs, which in our model are evaluated according to the greyscale number. The spatial distribution of the diffusion coefficients D corresponding to the simulated polycrystalline microstructure The described approach allowed us to take into account more complex polycrystalline morphologies with varying diffusivity in the primary and secondary GBs, which in our model are evaluated according to the greyscale number. The spatial distribution of the diffusion coefficients D corresponding to the simulated polycrystalline microstructure was then obtained by converting the GB morphology greyscale number matrix to a matrix of diffusion coefficients according to the following expression, where D gb is the diffusion coefficient in the primary GB and D g in the grain: Coatings 2022, 12, 992 5 of 17 The developed model implementation was verified for a monocrystal material against the analytical solution of Fick's second law (Equation (1)). Analytical and numerical solutions of vertical diffusant profiles in the semi-infinite slab case were compared. Obtained correspondence between the analytical and numerical results ( Figure 2) demonstrates a correct implementation of the model. was then obtained by converting the GB morphology greyscale number matrix to a matrix of diffusion coefficients according to the following expression, where Dgb is the diffusion coefficient in the primary GB and Dg in the grain: The developed model implementation was verified for a monocrystal material against the analytical solution of Fick's second law (Equation (1)). Analytical and numerical solutions of vertical diffusant profiles in the semi-infinite slab case were compared. Obtained correspondence between the analytical and numerical results ( Figure 2) demonstrates a correct implementation of the model.

Polycrystalline Microstructures
Three polycrystalline microstructure types were chosen for this study. No specific materials were designated for the simulation, since the study is performed within the scope of morphologies and all generated morphologies correspond to characteristic microstructures which can be found in a number of different real materials, coatings, and thin films [74]. In this research, already fully formed coatings having specific morphology are investigated.
All generated morphologies contain polycrystal grains separated by the primary GBs. In addition to primary GBs, two of the selected morphologies contain secondary GBs within the grains (Figure 3, black-primary GB, gray-secondary GBs). The primary and secondary GBs differ by the magnitude of the diffusion coefficient. The primary GB diffusion coefficient is a defined property Dgb of the simulated case. Diffusivities of the secondary GBs are expressed through the intensity of their gray color ( Figure 2) and their diffusion coefficients are calculated from the grayscale number according to expression (2).
The typical microstructure is the most commonly found polycrystalline morphology. It is composed of solid grains of similar sizes and shapes separated by primary GBs only [45]. Bi-modal morphology also has the same distribution of grains and primary GBs as

Polycrystalline Microstructures
Three polycrystalline microstructure types were chosen for this study. No specific materials were designated for the simulation, since the study is performed within the scope of morphologies and all generated morphologies correspond to characteristic microstructures which can be found in a number of different real materials, coatings, and thin films [74]. In this research, already fully formed coatings having specific morphology are investigated.
All generated morphologies contain polycrystal grains separated by the primary GBs. In addition to primary GBs, two of the selected morphologies contain secondary GBs within the grains (Figure 3, black-primary GB, gray-secondary GBs).
was then obtained by converting the GB morphology greyscale number matrix to a matri of diffusion coefficients according to the following expression, where Dgb is the diffusion coefficient in the primary GB and Dg in the grain: The developed model implementation was verified for a monocrystal materia against the analytical solution of Fick's second law (Equation (1)). Analytical and numer ical solutions of vertical diffusant profiles in the semi-infinite slab case were compared Obtained correspondence between the analytical and numerical results ( Figure 2) demon strates a correct implementation of the model.

Polycrystalline Microstructures
Three polycrystalline microstructure types were chosen for this study. No specifi materials were designated for the simulation, since the study is performed within th scope of morphologies and all generated morphologies correspond to characteristic mi crostructures which can be found in a number of different real materials, coatings, and thin films [74]. In this research, already fully formed coatings having specific morphology are investigated.
All generated morphologies contain polycrystal grains separated by the primary GBs. In addition to primary GBs, two of the selected morphologies contain secondary GB within the grains (Figure 3, black-primary GB, gray-secondary GBs). The primary and secondary GBs differ by the magnitude of the diffusion coefficient The primary GB diffusion coefficient is a defined property Dgb of the simulated case. Dif fusivities of the secondary GBs are expressed through the intensity of their gray colo ( Figure 2) and their diffusion coefficients are calculated from the grayscale number ac cording to expression (2).
The typical microstructure is the most commonly found polycrystalline morphology It is composed of solid grains of similar sizes and shapes separated by primary GBs onl [45]. Bi-modal morphology also has the same distribution of grains and primary GBs a The primary and secondary GBs differ by the magnitude of the diffusion coefficient. The primary GB diffusion coefficient is a defined property D gb of the simulated case. Diffusivities of the secondary GBs are expressed through the intensity of their gray color ( Figure 2) and their diffusion coefficients are calculated from the grayscale number according to expression (2).
The typical microstructure is the most commonly found polycrystalline morphology. It is composed of solid grains of similar sizes and shapes separated by primary GBs only [45]. Bi-modal morphology also has the same distribution of grains and primary GBs as typical, but a fraction of grains also contains secondary GBs, while other grains do not, and some are partially filled [55]. Secondary GBs have no preferred orientation. Semi-lamellar morphologies have the same distribution of grains and primary GBs as typical, but all grains also contain secondary GBs [52]. Table 1 represents a comparison of all generated morphologies according to the occupied total, GB, and grain two-dimensional volume in arbitrary units. GBs occupy the smallest part of the volume in the typical morphology since it does not contain secondary GBs. However, the ratio of GB volume versus total volume does not fully characterize morphologies' diffusive properties, since the ratio of primary and secondary GBs can differ between morphologies, as well as diffusivities of secondary GBs, resulting in different overall diffusivity even with the same ratio of GB and total volume. Therefore, an additional parameter is defined to characterize the diffusivity of generated morphologies, coefficient a gb : where m is the average greyscale number of the whole morphology. This coefficient expresses overall average GB-like diffusivity in the generated morphologies. As expected, the highest value of a gb corresponds to the highest value of V gb /V total ratio (Table 1).
To study the relationship between the bulk and grain boundary diffusion and to identify their influence on the overall mass transfer, two cases of D gb /D g ratios were selected for investigation (see Table 2). The total diffusivity coefficient is calculated as The general tendency can be observed that with the increasing V gb /V total ratio (see Table 1), total diffusion coefficient also increases. Cases 1 and 2 differ by 10 times lower D g coefficients, while 2 and 3 by D gb coefficients ten times lower. Cases 4 and 5 maintain the same constant total diffusivity with different D gb /D g ratios. Cases 4 and 6 maintain the same D gb /D g ratio, but total diffusivity differs by 10 times.

Results
During the performed simulations the diffusion process in the coatings with the selected polycrystalline morphologies was modeled. An example of obtained results is presented in Figure 4 where concentration distributions of diffusant at selected instances of t = 5,000,000 and 10,000,000 are shown for Cases 1 and 2, and typical, bi-modal, and semi-lamellar morphologies (surface at the top). No morphological distribution is shown in Figure 4, which graphically shows whether morphology affects diffusion by preferring a diffusant path to GB or not. Therefore, it creates (or not) a pattern similar to a simulated case of morphology. The same progression of diffusion into the material from the surface was observed in coatings of all morphologies. Since diffusion coefficients were selected with significantly higher values in GBs compared to grain interiors, diffusion mostly progressed through the primary GBs, with slower diffusion occurring at secondary GBs. Diffusion into the grain interiors from the surface and GBs was significantly slower than along the GBs.  This general trend is visually confirmed by the obtained concentration distributions. The locations of higher diffusant concentrations correspond to the GBs in all simulated coatings confirming preferential transport of the diffusant. The relative intensity of diffusion into the grain interiors depends on the ratio of D gb /D g which is 10 times lower in case 1 than in case 2. This difference results in less sharp concentration distributions in case 1 (Figure 4 first column), where the concentration seems to be smeared from GBs into the grain interiors since grain diffusion is more intense, versus case 2, which still exhibits sharp primary GBs at this moment (Figure 4 second column).
It can be seen in Figure 4 that the obtained concentration distributions each exhibit quite a different character. The observed diversity can be explained by different Harrison regimes dominating different morphologies and cases [27].

Morphology Influence on Diffusion Regimes
The Type-A regime corresponds to long diffusion times, grain diffusion coefficient not much greater than in GBs or smaller grains. However, as is shown below, Type-A regime is also facilitated by a higher density of secondary GBs. From the three presented cases, Type-A regime most clearly can be observed in Case 1 semi-lamellar morphology, which has the highest a gb . This regime is distinguished by the insignificant differences between bulk and GB concentrations ( Figure 4). The presence of Type-A regime is as well confirmed by the averaged concentration profiles (see Figure 5), which are also dependent on the dominant kinetic regime. Case 1 semi-lamellar curves are smooth, indicating no local effect of GBs, while every other case has greater or smaller peaks at depths where the grain boundary density is higher.

Morphology Influence on Diffusion Regimes
The Type-A regime corresponds to long diffusion times, grain diffusion coefficient not much greater than in GBs or smaller grains. However, as is shown below, Type-A regime is also facilitated by a higher density of secondary GBs. From the three presented cases, Type-A regime most clearly can be observed in Case 1 semi-lamellar morphology, which has the highest agb. This regime is distinguished by the insignificant differences between bulk and GB concentrations ( Figure 4). The presence of Type-A regime is as well confirmed by the averaged concentration profiles (see Figure 5), which are also dependent on the dominant kinetic regime. Case 1 semi-lamellar curves are smooth, indicating no local effect of GBs, while every other case has greater or smaller peaks at depths where the grain boundary density is higher. The Type-B regime, which is the most complicated, exhibits larger differences between GBs and grains, however, the distribution of concentrations does not approach any limiting case. GBs tend to be saturated, while grains are shallowly penetrated by diffusant, with substantially lower concentrations in the grains' interiors. Since this regime is intermediate between limiting cases, it can be commonly observed during the transient. Due to a higher Dgb/Dg ratio, this regime dominates in Case 2 semi-lamellar morphology (compared to Type-A in Case 1). The Type-B regime can be clearly seen in Case 1 of other typical and bi-modal morphologies ( Figure 4). However, in all these cases, the Type-B regime does not appear individually, while near the surface the Type-A regime is observed as well. A comparison of concentration distributions at different instances in these cases shows that Type-A regime region is expanding deeper from the surface with time.
In the bi-modal morphology case, additional localization of Type A/B regimes can be distinguished where the diffusion around the grains with secondary GBs behaves as Type-A diffusion, while in the rest of the volume as Type-B. The Type-B regime is indicated by the visible GB-normal gradient of concentration towards the center of the grain. Likewise, the averaged concentration profile shows some bumps, which indicate a mild local effect of GBs (see Figure 5).
Type-C regime corresponds to short diffusion times or significant differences between grain and GB diffusion coefficients, for example, the diffusion length in grain is less  The Type-B regime, which is the most complicated, exhibits larger differences between GBs and grains, however, the distribution of concentrations does not approach any limiting case. GBs tend to be saturated, while grains are shallowly penetrated by diffusant, with substantially lower concentrations in the grains' interiors. Since this regime is intermediate between limiting cases, it can be commonly observed during the transient. Due to a higher D gb /D g ratio, this regime dominates in Case 2 semi-lamellar morphology (compared to Type-A in Case 1). The Type-B regime can be clearly seen in Case 1 of other typical and bi-modal morphologies (Figure 4). However, in all these cases, the Type-B regime does not appear individually, while near the surface the Type-A regime is observed as well. A comparison of concentration distributions at different instances in these cases shows that Type-A regime region is expanding deeper from the surface with time. In the bi-modal morphology case, additional localization of Type A/B regimes can be distinguished where the diffusion around the grains with secondary GBs behaves as Type-A diffusion, while in the rest of the volume as Type-B. The Type-B regime is indicated by the visible GBnormal gradient of concentration towards the center of the grain. Likewise, the averaged concentration profile shows some bumps, which indicate a mild local effect of GBs (see Figure 5).
Type-C regime corresponds to short diffusion times or significant differences between grain and GB diffusion coefficients, for example, the diffusion length in grain is less than the GB width. It can be assumed that in this regime diffusion takes place only in GBs. In this research, a pure Type-C regime is facilitated by the absence of secondary GBs and is observed only in the early instances, when diffusion length is still sufficiently small. Case 2 concentration contours of the typical morphology at the earlier instance ( Figure 4) are quite sharp and mainly correspond to this regime. In this case, diffusion takes place mostly along the GBs, and the leakage from the GBs to the grains is very low or non-existent. After some time, with diffusant leaking to grains, the Type-C regime begins to transition to Type-B (later instance).
If the thin film morphology has a complex distribution of primary and secondary GBs, like, in our case, bi-modal, it can simultaneously experience all three regimes in different locations: Type-A in grains with the secondary GBs nearer the surface, Type-B in grains with secondary GBs deeper in the material, and Type-C around the grains without secondary GBs. With increasing time, regime locations advance deeper into the material.
Type C-B-A transition in the coating is shown in more detail in Figure 6, where local concentration curves become smoother with time. A larger gradient between the grain interior and secondary GBs observed in grains closer to the surface can be attributed to overall higher gradients closer to the surface initially. Regime changes can also be seen in Figure 5, where the most prominent peaks are observed in case 2 typical morphology followed by the same case bi-modal morphology, corresponding to Type-C regime. However, they are slightly smearing out with time, indicating the beginning of a transition to Type-B.
Coatings 2022, 12, x FOR PEER REVIEW 10 of 18 existent. After some time, with diffusant leaking to grains, the Type-C regime begins to transition to Type-B (later instance). If the thin film morphology has a complex distribution of primary and secondary GBs, like, in our case, bi-modal, it can simultaneously experience all three regimes in different locations: Type-A in grains with the secondary GBs nearer the surface, Type-B in grains with secondary GBs deeper in the material, and Type-C around the grains without secondary GBs. With increasing time, regime locations advance deeper into the material.
Type C-B-A transition in the coating is shown in more detail in Figure 6, where local concentration curves become smoother with time. A larger gradient between the grain interior and secondary GBs observed in grains closer to the surface can be attributed to overall higher gradients closer to the surface initially. Regime changes can also be seen in Figure 5, where the most prominent peaks are observed in case 2 typical morphology followed by the same case bi-modal morphology, corresponding to Type-C regime. However, they are slightly smearing out with time, indicating the beginning of a transition to Type-B. Several time moments of averaged concentration profiles are given in Figure 7 for Case 1 typical and Case 2 bi-modal morphology coatings. Curves tend to become smoother over time. It is apparent that the Type-A regime remains, while Type-B tends to switch to Type-A and Type-C shifts to Type-B. However, in Case 2 bi-modal morphology, further peaks, e.g., in between 100 and 200 depths, become greater, which indicates a local Several time moments of averaged concentration profiles are given in Figure 7 for Case 1 typical and Case 2 bi-modal morphology coatings. Curves tend to become smoother over time. It is apparent that the Type-A regime remains, while Type-B tends to switch to Type-A and Type-C shifts to Type-B. However, in Case 2 bi-modal morphology, further peaks, e.g., in between 100 and 200 depths, become greater, which indicates a local reversal and more pronounced Type-B or even Type-C regime. Overall, averaged concentration profiles can indicate a dominant regime not only in simple polycrystal models but also in realistic and complex morphologies, for example, a non-uniform profile indicates Type-C or Type-B regimes, while a smooth curve shows that the regime is Type-A.
More densely located secondary grain boundaries create areas of faster diffusion, and a lower Dgb/Dg ratio leads to greater diffusant leakage from GBs to grains and a more uniform concentration distribution. If leakage to grains is low, the accumulation of diffusant in GBs can result in a non-uniform concentration distribution, and thus in non-uniform material properties, which may be a problem for an appliance that utilizes it. Figure 8 shows the evolution of average concentration in the simulated coating in Case 1 for all polycrystal morphologies and corresponding monocrystal cases. All polycrystal microstructures have the same Dgb and Dg, however, due to variations between morphologies' total diffusivities, Dtotal are different. The introduction of GBs with a high diffusion coefficient has a straightforward effect of speeding up the integral diffusion rate in the material, as a comparison with monocrystal with D = Dg shows. The level of speed up depends on the morphology features and is limited due to the constraint of higher diffusion coefficients to the GBs, and subsequently, limited interface areas for faster diffusion fluxes. If the same total diffusivity, obtained in each polycrystal case, would be distributed homogenously in a corresponding monocrystal material, the overall diffusion rate would be higher, as illustrated in Figure 8. In conclusion, the presence of GBs speeds up the diffusion rate, but less efficiently than a homogenous increase of diffusivity to the same average value. Figure 9a shows the dependency of the average concentration increase rate on the average concentration for all coatings. As could be expected, the average diffusion rate is higher in morphologies with a larger total diffusivity. Ratios of diffusion rates in these morphologies (Figure 9b) are practically constant when the average concentration is in the range of 0.4-0.7. Therefore, it is possible to compare averaged diffusion rates for these morphologies by taking values at the same selected average concentration from this range. Overall, averaged concentration profiles can indicate a dominant regime not only in simple polycrystal models but also in realistic and complex morphologies, for example, a non-uniform profile indicates Type-C or Type-B regimes, while a smooth curve shows that the regime is Type-A.

Influence of Polycrystal Morphology on the Overall Rate
More densely located secondary grain boundaries create areas of faster diffusion, and a lower D gb /D g ratio leads to greater diffusant leakage from GBs to grains and a more uniform concentration distribution. If leakage to grains is low, the accumulation of diffusant in GBs can result in a non-uniform concentration distribution, and thus in non-uniform material properties, which may be a problem for an appliance that utilizes it. Figure 8 shows the evolution of average concentration in the simulated coating in Case 1 for all polycrystal morphologies and corresponding monocrystal cases. All polycrystal microstructures have the same D gb and D g , however, due to variations between morphologies' total diffusivities, D total are different. The introduction of GBs with a high diffusion coefficient has a straightforward effect of speeding up the integral diffusion rate in the material, as a comparison with monocrystal with D = D g shows. The level of speed up depends on the morphology features and is limited due to the constraint of higher diffusion coefficients to the GBs, and subsequently, limited interface areas for faster diffusion fluxes. If the same total diffusivity, obtained in each polycrystal case, would be distributed homogenously in a corresponding monocrystal material, the overall diffusion rate would be higher, as illustrated in Figure 8. In conclusion, the presence of GBs speeds up the diffusion rate, but less efficiently than a homogenous increase of diffusivity to the same average value. Figure 9a shows the dependency of the average concentration increase rate on the average concentration for all coatings. As could be expected, the average diffusion rate is higher in morphologies with a larger total diffusivity. Ratios of diffusion rates in these morphologies (Figure 9b) are practically constant when the average concentration is in the range of 0.4-0.7. Therefore, it is possible to compare averaged diffusion rates for these morphologies by taking values at the same selected average concentration from this range.   Figure 10 shows dependencies of the integral diffusion rate on Dtotal and Dgb at an average concentration of 0.5 for all morphologies (Dgb/Dg = 1000) and monocrystal cases. Linear dependencies are obtained, with proportionality coefficients depending on the morphology and the selected average concentration. As expected, in dependency on Dgb case, bi-modal morphology is between the typical and semi-lamellar morphologies, since it is the intermediate microstructure. However, when dependency against the Dtotal is examined, typical morphology seems to be more efficient than bi-modal. This result shows that the overall diffusion rate is not solely determined by the total diffusivity Dtotal, but results from a complex relationship between the Dtotal, Dgb, and distribution of primary and secondary GBs. To obtain higher total diffusivities in typical morphology, which does not contain secondary GBs, significantly higher Dgb values are needed. Moreover, it is these high Dgb values which then make overall diffusion faster in typical morphology than in the bi-modal morphology at the same Dtotal. However, diffusion is the fastest in semi-lamellar morphology, regardless of the lowest Dgb values required for the same Dtotal, showing that the relative importance of Dtotal or Dgb depends greatly on the morphology features and density of secondary GBs.   Figure 10 shows dependencies of the integral diffusion rate on Dtotal and Dgb at an average concentration of 0.5 for all morphologies (Dgb/Dg = 1000) and monocrystal cases. Linear dependencies are obtained, with proportionality coefficients depending on the morphology and the selected average concentration. As expected, in dependency on Dgb case, bi-modal morphology is between the typical and semi-lamellar morphologies, since it is the intermediate microstructure. However, when dependency against the Dtotal is examined, typical morphology seems to be more efficient than bi-modal. This result shows that the overall diffusion rate is not solely determined by the total diffusivity Dtotal, but results from a complex relationship between the Dtotal, Dgb, and distribution of primary and secondary GBs. To obtain higher total diffusivities in typical morphology, which does not contain secondary GBs, significantly higher Dgb values are needed. Moreover, it is these high Dgb values which then make overall diffusion faster in typical morphology than in the bi-modal morphology at the same Dtotal. However, diffusion is the fastest in semi-lamellar morphology, regardless of the lowest Dgb values required for the same Dtotal, showing that the relative importance of Dtotal or Dgb depends greatly on the morphology features and density of secondary GBs.  Figure 10 shows dependencies of the integral diffusion rate on D total and D gb at an average concentration of 0.5 for all morphologies (D gb /D g = 1000) and monocrystal cases. Linear dependencies are obtained, with proportionality coefficients depending on the morphology and the selected average concentration. As expected, in dependency on D gb case, bi-modal morphology is between the typical and semi-lamellar morphologies, since it is the intermediate microstructure. However, when dependency against the D total is examined, typical morphology seems to be more efficient than bi-modal. This result shows that the overall diffusion rate is not solely determined by the total diffusivity D total , but results from a complex relationship between the D total , D gb, and distribution of primary and secondary GBs. To obtain higher total diffusivities in typical morphology, which does not contain secondary GBs, significantly higher D gb values are needed. Moreover, it is these high D gb values which then make overall diffusion faster in typical morphology than in the bi-modal morphology at the same D total . However, diffusion is the fastest in semi-lamellar morphology, regardless of the lowest D gb values required for the same D total , showing that the relative importance of D total or D gb depends greatly on the morphology features and density of secondary GBs.  Figure 11 shows the dependence of overall concentration change rate on average concentration separately in grains and GBs in all three materials as an absolute value ( Figure  11a,c) and as the fraction of total rate (Figure 11b,d) at the beginning of the transient (Figure 11a,b) and during the whole duration (Figure 11c,d). All three coatings differ only by the presence of secondary GBs: typical has none, semi-lamellar has secondary GBs in all grains, and bi-modal in approximately half of the grains. Figure 11 shows that diffusion is initially dominated by the GB transport in all morphologies. However, very soon, it is overcome by grain diffusion due to a larger volume of the material taken up by grains. The concentration at which grain diffusion starts to dominate increases with the increasing volume of secondary GBs. Moreover, with the increasing volume of secondary GBs, the dominance of grain diffusion decreases from about 0.9 (typical) to 0.78 (semi-lamellar). It is interesting to note that this ratio does not change for most of the duration of the transient, confirming the self-similar character of diffusion deeper in the material even if its microstructure is not idealized.   Figure 11 shows the dependence of overall concentration change rate on average concentration separately in grains and GBs in all three materials as an absolute value (Figure 11a,c) and as the fraction of total rate (Figure 11b,d) at the beginning of the transient (Figure 11a,b) and during the whole duration (Figure 11c,d). All three coatings differ only by the presence of secondary GBs: typical has none, semi-lamellar has secondary GBs in all grains, and bi-modal in approximately half of the grains. Figure 11 shows that diffusion is initially dominated by the GB transport in all morphologies. However, very soon, it is overcome by grain diffusion due to a larger volume of the material taken up by grains. The concentration at which grain diffusion starts to dominate increases with the increasing volume of secondary GBs. Moreover, with the increasing volume of secondary GBs, the dominance of grain diffusion decreases from about 0.9 (typical) to 0.78 (semi-lamellar). It is interesting to note that this ratio does not change for most of the duration of the transient, confirming the self-similar character of diffusion deeper in the material even if its microstructure is not idealized.  Figure 11 shows the dependence of overall concentration change rate on average concentration separately in grains and GBs in all three materials as an absolute value ( Figure  11a,c) and as the fraction of total rate (Figure 11b,d) at the beginning of the transient (Figure 11a,b) and during the whole duration (Figure 11c,d). All three coatings differ only by the presence of secondary GBs: typical has none, semi-lamellar has secondary GBs in all grains, and bi-modal in approximately half of the grains. Figure 11 shows that diffusion is initially dominated by the GB transport in all morphologies. However, very soon, it is overcome by grain diffusion due to a larger volume of the material taken up by grains. The concentration at which grain diffusion starts to dominate increases with the increasing volume of secondary GBs. Moreover, with the increasing volume of secondary GBs, the dominance of grain diffusion decreases from about 0.9 (typical) to 0.78 (semi-lamellar). It is interesting to note that this ratio does not change for most of the duration of the transient, confirming the self-similar character of diffusion deeper in the material even if its microstructure is not idealized.  The higher ratio D gb /D g (with constant D gb ) of Case 2 affects the overall transient in two ways. First, the overall uptake of diffusant is slower in Case 2, as shown by Figure 12, since grain interiors, which comprise the majority of the material by volume, are filled slower, and second, the depth profile of layer-average concentrations ( Figure 5) is shallower, since less diffusant is leaked from the GBs into the grain interiors, resulting in more intense diffusion into the deeper layers along the GBs. The higher ratio Dgb/Dg (with constant Dgb) of Case 2 affects the overall transient in two ways. First, the overall uptake of diffusant is slower in Case 2, as shown by Figure 12, since grain interiors, which comprise the majority of the material by volume, are filled slower, and second, the depth profile of layer-average concentrations ( Figure 5) is shallower, since less diffusant is leaked from the GBs into the grain interiors, resulting in more intense diffusion into the deeper layers along the GBs. However, the average concentration in semi-lamellar morphology is very similar in both cases, even though the Dgb/Dg ratio differs by an order of magnitude. This result shows that when the network of secondary GBs is sufficiently dense, the relative importance of grain diffusivity decreases. Coatings containing less or no secondary GBs show bigger differences between the cases. However, the relative difference is also decreasing with time.

Conclusions
The paper presents a model of diffusion in the polycrystalline coatings of different morphologies. Three different polycrystal morphologies were selected with or without secondary GBs. Two cases with constant Dgb and Dg values were modeled. The effect of polycrystalline coating morphology on the diffusion phenomena was studied.
The study has found the following effects of morphology on the diffusion process in the thin film: In realistic complex morphology, all three regimes occur simultaneously in different places of the material depending on the local features of the microstructure.
Average concentration Figure 12. Average concentration evolution.
However, the average concentration in semi-lamellar morphology is very similar in both cases, even though the D gb /D g ratio differs by an order of magnitude. This result shows that when the network of secondary GBs is sufficiently dense, the relative importance of grain diffusivity decreases. Coatings containing less or no secondary GBs show bigger differences between the cases. However, the relative difference is also decreasing with time.

Conclusions
The paper presents a model of diffusion in the polycrystalline coatings of different morphologies. Three different polycrystal morphologies were selected with or without secondary GBs. Two cases with constant D gb and D g values were modeled. The effect of polycrystalline coating morphology on the diffusion phenomena was studied.
The study has found the following effects of morphology on the diffusion process in the thin film: • Different morphologies having the same values of diffusion coefficients D g and D gb can provide a variety of different diffusion regimes. The diffusion regime depends not only on the total diffusivity and ratio D gb /D g , but also on the morphological features of the coating: A dense network of primary and secondary GBs facilitates diffusion, and the Type-A regime is favored. Type-B regime in realistic morphologies was not observed individually in the simulated coatings. It was complemented by Type-A regime in the region by the surface, the depth of which increased with time. Additionally, if coating includes grains of significantly different average diffusivity (bi-modal in our case, containing grains both with and without secondary GBs), Type-A regime might replace Type-B in grains with higher diffusivity (presence of secondary GBs). Type-C regime could only be observed in coatings without secondary GBs in the simulated cases, showing that secondary GBs are effective diffusion and grain saturation pathways. In realistic complex morphology, all three regimes occur simultaneously in different places of the material depending on the local features of the microstructure.
• While the introduction of fast GBs accelerates diffusion, the level of acceleration depends on the morphological features, and ultimately, on the deposition method and conditions, since fast pathways and diffusion flux areas are limited to GBs, which reduces the effectiveness of total diffusivity compared to monocrystal diffusion. GB distribution and connections are important to the mass transfer process, as they accelerate diffusant transport locally.
Speed-up of diffusion due to GBs does not straightforwardly depend on the total or GB diffusivities D total and D gb , but on the features of the coating morphology, which can provide more or less weight to the influence of one or another. Even in polycrystal coatings, the overall process is dominated by grain diffusion for most of the transient. Only initially is GB diffusion responsible for the larger part of the overall uptake of the diffusant. However, the denser network of GBs is present, the longer GB diffusion can dominate, and the larger fraction of the overall rate it takes than grain diffusion is dominating. The ratio of average grain and GB diffusion rates in the coating is constant for most of the transient and is dependent on the morphology. However, it corresponds directly neither to the ratio of grain and GB volumes, nor to the average GB-like diffusivity, expressed through the coefficient a gb . If the coatings differ only by the presence of secondary GBs, developed diffusion in them maintains the same ratio of average rates at the same average concentrations, regardless of the irregular nature of the microstructures. The overall diffusion rate is generally dependent on the D gb /D g ratio (constant D gb ). However, the level of this dependence depends on the morphology. In the coatings with a high number of GBs, e.g., semi-lamellar, the relative influence of Dg is marginal. More densely located secondary grain boundaries create areas of faster diffusion (or accumulation areas), and a lower D gb /D g ratio leads to greater diffusant leakage from GBs to grains and a more uniform concentration distribution in the coating.
Finally, our modeling results may serve as a reference for experimental works which are designated for coatings having studied morphologies, for the initial estimation of morphological features influencing diffusion.