Microscale investigation of phase transformation and plasticity in multi-crystalline shape memory alloy using discrete dislocation–transformation method

Martensitic phase transformation and plasticity are two primary mechanisms of deformation in shape memory alloys (SMAs) and the interaction between them influences the behaviour of SMA during cyclic loading, specifically the pseudoelasticity behaviour and the shape memory effect. This interaction, which occurs in microscale, affects the reversibility and eventually the actuation capacity of SMAs. In order to capture this interaction in microscale, a discrete dislocation–transformation model was developed in Sakhaei et al. (Mech Mater 97:1–18, 2016) and was applied to simulate the single-crystalline NiTi samples under thermo-mechanical loads. In this study, the microscale coupling between phase transformation and plasticity as well as grain size and orientation effects is investigated in multi-crystalline shape memory alloys under thermal and mechanical loading by using the discrete dislocation–transformation framework through the representative numerical simulations. The results illustrated the dependency of dislocation slip and martensitic transformation to crystalline orientations as well as grain size and grain boundary densities in the multi-crystalline SMAs.


C
Fourth-order stiffness tensor D Fourth-order compliance tensor ρ Mass density λ Transformation latent heat θ Temperature θ T Transformation temperature ν Poisson's ratio t Time

Introduction
Shape memory alloys (SMAs) have the ability to recover the original structure after experiencing a macroscopic inelastic deformation upon applying desirable thermo-mechanical cyclic loading. This performance is called the "shape memory effect" or "pseudoelasticity", depending on the loading type. Furthermore, SMAs could consume and dissipate energy by illustrating hysteric behaviour under cyclic loads. These specific behaviours are due to martensitic phase transformation that makes SMAs an attractive material for actuation scenarios in various industrial applications [2]. The martensitic transformation is a diffusionless and solid-solid phase transformation between two different crystalline structures. The phase with higher symmetry is named austenite, whereas the phase with lower symmetry in atomistic structure is called martensite. Martensitic phase transformation which generates the recoverable strain has the main contribution to the inelastic deformation of a sample made of SMA. However, the plasticity mechanism could also provoke irrecoverable strain in SMAs that influences the reversibility behaviour of this material under thermal and/or mechanical cyclic loadings [3][4][5]. Ezaz et al. [6] illustrated that the slip planes in body-centred cubic structure (BCC) of austenitic NiTi are active, and therefore, the transformation and plasticity mechanisms could interact each other as well as the total thermo-mechanical response of SMA. This phenomenon is explored in several types of metallic alloys and is generally called as transformation-induced plasticity (TRIP) in the literature. These phenomena have been investigated in microscale in various studies in the literature. For example, Xu et al. have developed a three-dimensional phase field model for single-crystalline NiTi shape memory alloys which has integrated the austenite and martensite plasticity mechanisms [7]. They have also observed that during cyclic deformation the reverse transformation is affected by plastic deformation, and therefore, the residual martensitic phase would be remained through cyclic loading. Furthermore, the effect of grain boundaries on shape memory effect and pseudoelasticity of polycrystalline NiTi SMA has been studied using the two-dimensional phase field model in [8], where the grain size dependency of martensitic transformation and plasticity in polycrystalline SMAs have been revealed.
The nature of transformation-induced strains in NITI SMAs during austenite to martensite phase transformation has been also studied in nanoscale level using molecular dynamics (MD) simulations [9][10][11]. For example, Wang et al. have observed that the transformation-induced plasticity and phase transformation have been generated in martensitic phases and near the martensitic variants interfaces in monocrystalline NiTi SMA using MD simulations [10]. Furthermore, they have shown that the transformation ratcheting generated under isothermal pseudoelastic behaviour of NiTi is due to the occurrence of plastic deformation at grain boundaries as well as the accumulation of residual martensitic phases in the microstructure [11].
At the macroscopic level, the effect of transformation-induced plasticity in SMAs has been considered in different phenomenological models (e.g. see [12][13][14][15]). It is assumed that the local stress fields associated with the martensitic transformation may activate the plasticity although the external stresses are lower than the yield stress of the material [16,17]. Therefore, they come up with a phenomenological continuum models that are able to consider the interaction between plasticity and phase transformation in the macroscopic simulations. Furthermore, Yu et al. have developed a constitutive model for anisotropic pseudoelasticity of single-crystalline NiTi shape memory alloys considering experimental studies [18]. Similar to [1], they have also considered the martensitic phases as ellipsoidal inclusion inside austenitic phase to accommodate the effect of internal stresses and transformation-induced plasticity in their model. The model was then used for the investigation of anisotropic behaviour under multi-axial loading scenarios through comparison with experiments.
At the microscopic length scale, plasticity phenomenon is interpreted by kinetic of dislocations along slip planes and the martensitic phase transformation occurs through the creation of plate-like regions. Therefore, the influence of plastic deformation on phase transformation might be studied by looking at the effect of dislocations on the nucleation and growth of the martensitic regions. Similarly, the impact of martensitic inclusions on the generation and movement of dislocations represents the effect of phase transformation on plasticity. Although it is not yet proved whether the dislocation plasticity assists the martensitic phase transformation or resists against the movement of martensite-austenite interface, some studies have attempted to provide an answer based on microscale simulation [1,19,20]. Discrete dislocation dynamic method facilitates to model the microstructure of plastic deformation by considering the nucleation, motion, and annihilation of dislocations [21]. Shi et al. [19] used the discrete dislocation dynamic method for modelling plasticity and combined it with the proposed discrete transformation model to simulate the phase transformation in multi-phase TRIP steel. However, their framework was unable to model the reversible martensitic transformation in SMAs and simulate the response of material under thermal loading. Furthermore, [1,4] presented a modified discrete dislocation-transformation model for SMAs to study the interaction between plasticity and martensitic transformation under cyclic thermal and mechanical loading for single-crystal samples of SMA.
In the current work, we aim to apply the discrete dislocation-transformation framework presented in our earlier work [1] for multi-grain SMA structure. The goal is to study the effect of grain boundaries and Hall-Petch effects in addition to the interaction between plasticity and phase transformation under cyclic mechanical loading in the multi-grain NiTi SMA.
The polycrystalline structure is composed of numerous grains with different sizes and orientations. These grains are connected to each other via grain boundaries across which the orientation of the crystals changes. The material behaviour of single-and polycrystalline SMAs are different with each other as in single crystals, the behaviour is highly dependent on the direction of loading and crystal orientation, whereas the polycrystalline SMA shows less anisotropic behaviour. Furthermore, the grain boundaries have a resistance role on the dislocation slip and the growth of transformation regions. Shi et al. [22] studied the interaction of martensitic phase transformation of dislocation plasticity in polycrystalline multi-phase TRIP steel. They also investigated the Hall-Petch effect and orientation effect in their study. However, they did not model the two-way phase transformation which occurs in SMAs. Moreover, their model was unable to incorporate temperature effects and thermal cycling as important factors that affect the response of SMAs. Therefore, the current study aims to cover these gaps and investigate the interaction between plasticity and martensitic transformation in the presence of grain boundaries by using the authors' earlier proposed discrete dislocation-transformation model in [1].
The structure of this paper is as follows: in Sect. 2, a summary of the discrete dislocation-transformation method as well as the numerical implementations for modelling the microscale behaviour of multi-crystalline shape memory alloys is presented. In Sect. 3, the interaction between plasticity and phase transformation in the presence of grain boundaries is analysed. Moreover, the orientation effect, grain size effects, and the interaction of grain boundaries on dislocation dynamic and martensitic transformation are investigated in this section. Finally, concluding remarks are provided in Sect. 4.

Thermo-mechanical discrete dislocation-transformation model
The discrete dislocation-transformation framework used in this study for simulation the behaviour of multicrystalline SMAs has been presented completely in the authors' previously published article in [1]. Therefore, we only summarized the important aspect of this model here and the readers should refer to [1] for comprehensive explanation.

Discrete dislocation-transformation model
As it is described in [1], two-dimensional discrete dislocation-transformation model is developed by incorporating the two-dimensional discrete dislocation method presented by [21] and the representation of martensitic transformation in the microstructure. To model the phase transformation, the martensitic regions are speculated to generate and grow as elliptically shaped inclusions during a thermo-mechanical loading process. Therefore, the migration and evolution of dislocation cores and martensitic regions in austenite domain characterize the plastic deformation and martensitic transformation, respectively. In the current model, it is essential to determine the stress, strain, and displacement fields due to the existence of dislocation cores, martensitic regions, and boundary conditions in the domain before updating the configuration of them for the next time step using kinematic relations.
If the material domain is occupied with boundary ∂ , the stress, strain, and displacement field of the configuration under prescribed boundary conditions are determined with the decomposition method presented  [1,19,21] as where all the quantities with d, m, and c superscripts correspond to fields associated with the dislocations, martensitic plates, and the complementary problem, respectively. Figure 1 illustrates the above decomposition schematically. At any time t, we define N d = N d (t) the total number of edge dislocation cores and by N m = N m (t) the total number of martensitic regions inside . Therefore, the terms in Eq. (1) are calculated as a summation of states from each individual dislocation and martensitic region as where the subscripts i and j determine the individual dislocations and martensitic inclusion, respectively. The calculation related to dislocations and martensitic inclusions is performed analytically in an infinite medium, and the complementary field is applied to assure the actual boundary conditions in the original finite domain. and refers to the Poisson's ratio of the medium where the dislocation core is embedded, with p = a, m for the austenitic and martensitic phases, respectively. Regarding the fields due to the martensitic transformation, it is possible to characterize the transformation at the continuum level by a pair of vectors a and n, where a is the transformation strain vector and n is the normal vector to the habit plane. According to experiments conducted in [23] and the assumptions made in [1,19], it is considered here that each martensitic region has an elliptical shape as shown in Fig. 2-b. Furthermore, the nominal habit plane normal m j is considered as the major semi-axis of the elliptical plate and the transformation strain of the jth martensitic inclusion is calculated as where δ = a j · m j and γ = a j · m ⊥ j are dilation and shape strain terms during transformation, respectively. m ⊥ j is a unit vector perpendicular to m j and in the loading plane as presented in Fig. 2b. The stress field σ m j inside and outside of elliptical martensitic plate could be determined based on the Eshelby solution of elliptical region using the eigen-strain of inclusion ε m j [24]. The eigen-strain in our problem is because of the difference between elastic behaviour of martensitic and austenitic phases and the transformation strain. For the points inside of the jth martensitic plate, the strain and stress fields are determined by where S is the fourth-order Eshelby's tensor for interior points [24]. Furthermore, the stress fields of the points outside of martensitic elliptical inclusion are determined by Muskhelishvili decomposition as it is presented in [19]. Finally to satisfy the original boundary condition of the problem as illustrated in Fig. 1, we need to solve and add a complementary field to the decomposition problem presented in Eq. (1). Therefore, assuming the original boundary condition as the boundary conditions for the complementary problem are given by where ∂ u and ∂ t indicate the area that the displacement and traction boundary condition are prescribed, respectively. Furthermore, t c = σ c n, t d = σ d n, and t m = σ m n where n is the outward unit vector normal to ∂ . The elastic boundary value problem is then solved by finite element method at each time step to compute the complementary terms in Eq. (1).

Two-dimensional dislocation dynamics
The discrete dislocation method correlates the plastic deformation in crystalline structures with nucleation, motion and annihilation of dislocations. In this study, we follow the discrete dislocation model which is specified for two-dimensional plane strain problems in [21] and is presented comprehensively in [1]. As indicated in [21], the nucleation of new dislocations and the glide of existing ones are determined by Peach-Koehler force, f d i which is the work conjugate to the dislocation displacement. The Peach-Koehler force is determined as the product of the total stress at the ith dislocation position and the strain tensor due to a glide of the dislocation on the slip system b i , n i as When the magnitude of this force at the ith source point overreaches a critical value ( f cr i ), a pair of dislocations with different signed Burgers vector are set up. This is formulated in [1,19] Furthermore, the kinetic formulation for gliding of the ith dislocation is represented as where B d is a drag constant, v d i is the velocity of ith dislocation on a slip plane i, and v d max is the limit for maximum velocity of dislocations.
It is worth mentioning that the interface between martensite and austenite phases and grain boundaries in the microstructures work as the obstacle against the migration of dislocations in the slip systems and changing the thickness of grain boundaries is not the scope of this study. Furthermore, two dislocations with opposite Burgers vectors will be annihilated from the domain if the distance between them is less than a material-dependent parameter L e which is considered as L e = 6b i based on [21].

Martensitic transformation kinetics
Transformation kinetics means updating the martensitic region configuration from time t to t + t that includes the roles for nucleation and annihilation as well as growth and shrinkage of elliptical martensitic inclusions during forward and backward transformation in SMAs [1].
Similar to Peach-Koehler force in dislocation dynamics, it is possible to determine the local driving force acting on the interface between austenite and martensite domains S m j according to [1,25] as where σ + and σ − are the local stress tensor across the interface, D a = (C a ) −1 and D m = (C m ) −1 are the compliance tensors for austenitic and martensitic phases, n is the habit plane normal vector, and ε tr j is the transformation strain. Moreover, ρ is the mass density, λ is transformation latent heat, θ is temperature, and θ T is called transformation temperature of shape memory alloys which is the average of austenite and martensite start temperatures.
Similar to nucleation rule of dislocations, a new martensitic embryo is generated when the transformation driving force exceeds a critical value ( f cr j ) at jth randomly distributed transformation source point. Due to the fact that there is no austenite/martensite interface at transformation source point, the nucleation transformation driving force could be calculated as f nuc j := σ · ε tr j − ρλ θ T (θ − θ T ) according to Eq. (12). At this point, an elliptical embryo with semi-axes c 0 and d 0 is created and the transformation source j would be deleted.
The kinetic rules for growth and shrinkage of the elliptical martensitic regions are presented in [1] by determining the velocity of ellipse tips as v (q) where v (1) tip and v (2) tip are the velocities of tips 1 and 2 when the opposite one is kept fixed, c is the major semiaxis of elliptical region, B is a viscosity-like constant, and v max is the cut-off value for tip velocity which is physically related to the sound speed in the material. Furthermore,f (q) is the effective driving force at tip (q) where q = 1, 2 and it is determined according to [1] by integrating the local driving force acting on martensitic interface asf where f tr j is the local driving force calculated in Eq. (12) for any points on the austenite/martensite interface, and w (1) and w (2) are weighting functions independent of v (1) tip (please refer to [1] for more details). Finally, during the backward phase transformation, the shrinkage of each elliptical martensitic region is continued until the size of that region goes less than the embryonic dimensions (d 0 and c 0 ). At this point, the martensitic inclusion is eliminated from the microstructure completely.

Thermo-mechanical loading of multi-crystalline SMA
In this section, the mechanical behaviour of un-textured multi-crystalline shape memory alloy samples is investigated under thermo-mechanical loads using the 2D discrete dislocation-transformation model which is described in Sect. 2. To interpret the results, we have defined the dislocation density as ρ d = ρ d (t) := N d | | and the total martensitic volume fraction, ζ m = ζ m (t) := | m | | | at a given time t, where | m | is the total area occupied by the martensitic phase. It is worth mentioning that the un-textured multi-crystalline structure consists of randomly oriented grains.

Problem assumptions and material parameters
The assumptions related to computational framework (i.e. discrete dislocation-transformation method) are same as reported in [1]. The material in all the simulations are considered under plane strain conditions in the (1 0 1) plane which is named as loading plane in Fig. 3. Then, (1 2 1) [11 1], (1 21) [111], and (1 0 1) [0 1 0] are considered as active slip systems for dislocation slips in BCC structure. Furthermore, to study the martensitic phase transformation in two-dimensional state, two groups of transformation systems are chosen in a way that the habit plane normal m and the strain vector a are lied in the loading plane.
In the multi-crystalline model, different grains are attached together across grain boundaries. This leads to another assumption regarding the grain boundaries. It is considered that the dislocations and martensitic areas which are nucleated and grown inside a grain cannot pass the grain boundaries. A multi-crystalline sample including of four grains as well as the pinning of dislocations and martensitic regions in grain boundaries are illustrated schematically in Fig. 4.
In this study, the multi-crystalline specimens are assumed to be initially in the austenitic phase under a stress-free and dislocation-free configuration. Furthermore, the dislocation sources are randomly scattered in the domain on the slip planes. The strength τ cr of each dislocation source is randomly generated from a Gaussian distribution. The locations and strengths f cr of the transformation sources are determined in a similar way, with consideration of habit planes instead of slip planes. Table 1 summarizes the material parameters which are used in the simulations which are collected from [21,26,27]. Moreover, in this study, each multi-crystalline structure is composed of grains of the same size and square shape and the orientation of each grain is assigned randomly. Due to the computational limitations, the maximum number of grains are bounded 16 grains.  The multi-crystalline NiTi specimens in this study is subjected to plane strain uniaxial loading when the temperature is constant and above A f . The boundary conditions according to Fig. 4 are defined as follows: whereε is the applied strain rate. In order to improve computational efficiency, it is suggested to impose a relatively high strain rate. In this study, it is assumed to be equal to 5×10 3 s −1 . Furthermore, the values of dislocation source and transformation sources densities used in the simulations are ρ d source = 30 µm −2 and ρ m source = 8 µm −2 .

Discrete dislocation-transformation method and grain orientation effects
Although the macroscopic behaviour of polycrystalline materials is considered to be isotropic and homogeneous, the microstructure of polycrystalline materials is anisotropic and it is combined from numerous crystals with different orientations. The grain orientations would induce a non-uniform local stress in the microstructures that affects the plastic deformation and strength of metals [28], the direction of crack propagation [29], and the propensity for twinning [30]. Therefore, at this part of the study, we illustrate the potential of our proposed discrete dislocation-transformation framework (as a tool for microscale modelling of the interaction between dislocations and martensitic transformation in the microstructure), in capturing the effect of grain orientations on local stress as well as the martensitic transformation and dislocation plasticity mechanism in the microstructure.
As schematically depicted in Fig. 5, the mechanical responses of four bi-crystal cases are studied under isothermal mechanical loading. Each case is combined from two grains which the orientation of the first grain of each case is kept the same while the orientation of the second grain is defined by rotating the first orientation by zero, 15, 30, and 45 degrees and are named as cases 1 to 4, respectively.
The specimens are loaded at a rateε > 0, as described above, up to an average axial strain ofε = 0.01. The results of these simulations are presented in Fig. 6 in terms of (a) the stress-strain curve (averaged over the whole sample), (b) the evolution of the dislocation density, and (c) the evolution of martensitic volume fraction as a function of the average axial strainε 11 . Furthermore, to demonstrate the contribution of plasticity to the irreversible strain after a complete cycle involving the forward and reverse martensite transformation processes of shape memory alloy, the full pseudoelastic behaviour of the material during loading and unloading condition is provided in Appendix section in Fig. 12 Figure 6a illustrates the pseudo-elastic behaviour of the above-mentioned bi-crystal samples. As it was expected, Fig. 6a shows the different mechanical response for the four cases due to different orientation of grains. However, it is not clear yet that this variation of results is due to the difference of dislocation slip directions or transformation systems or both of them. To find out the answer of this question, the change of dislocation density and martensitic volume fraction along the loading are compared for the above four cases in Fig. 6b and c, respectively.  Fig. 6 Effect of grain orientation on pseudoelasticity behaviour of bi-crystal samples by comparing a the stress-strain response, b the dislocation density, and c the martensitic volume fraction As shown in Fig. 6b, the evolution of dislocations varies from a bi-crystalline sample to another. This is in agreement with the physical fact that the plastic deformation behaviour of a crystalline grain is orientation dependent. Furthermore, the above result confirms that the discrete dislocation-transformation framework proposed in this study is able to capture the effect of slip system orientations in microscale simulations.
To investigate the effect of transformation system orientations on the mechanical response of the SMA, the change of the martensitic volume fraction for specimens 1 to 4 under isothermal mechanical loading is compared in Fig. 6c. The value of martensitic volume fraction (ζ ) for four different bi-crystalline samples explains how much the martensitic regions grow in each of the cases. Therefore, it can be concluded that the grain orientation has clear effect on the nucleation and growth of the martensitic phase and more importantly our discrete dislocation-transformation framework is able to capture the effect of grain orientations on the transformation mechanism in microscale modelling of the structure.

Discrete dislocation-transformation method and grain size effect (Hall-Petch effect)
The grain size is another important factor related to the polycrystalline metals. The effect of grain size on the mechanical behaviour of metals was first proposed by Hall and Petch; therefore, the grain size effect is also called "Hall-Petch effect". There are a lot of studies that investigate the grain size effect in polycrystalline structure experimentally and computationally [31]. Shi et al. [22] studied the effect of grain size on the transformation-induced plasticity in TRIP steels by discrete dislocation-transformation model. It was observed that the grain boundaries play an obstacle role against the dislocation motion. It is clear that the smaller grain size means higher grain boundary density and more resistance against dislocation motions. Therefore, the finer grain size materials exhibit higher strength behaviour in comparison with coarse grain polycrystalline structure.
To investigate microstructurally the effect of grain size on the mechanical behaviour of multi-crystalline domain, three multi-crystalline samples are studied with discrete dislocation-transformation method under isothermal mechanical loading. These specimens are combined from 4, 9, and 16 square-shaped grains, respectively. Furthermore, the orientation of each grain in multi-crystalline structure is assigned randomly. The schematic of the multi-crystalline samples is depicted in Fig. 7.
In Fig. 8, the mechanical responses of the three multi-crystalline domains with different grain sizes under isothermal mechanical loading are compared together. As it is shown in the figure, the specimens with finer grains show more hardening mechanical behaviour. The small grain sample has higher grain boundary densities; therefore, it causes more resistance against dislocation motion and phase transformation. To have a better understanding about the effect of grain boundaries on the dislocation dynamic and transformation growth, the evolution of dislocation density and martensitic volume fraction is compared for simulations with different grain sizes. These are illustrated in Fig. 8b and c, respectively.
Fundamentally, work hardening is quantified by increasing the number of dislocations in microstructure of crystalline metals. As shown in Fig. 8b, the size of the grains affects the dislocation density in the domain. As the smaller grain specimens have more grain boundary densities in their microstructures, the likelihood of dislocations reaching the grains and having pinned to the boundaries would be increased. Therefore, the sample with higher dislocation density in Fig. 8b shows more hardening response in Fig. 8a. Figure 8c shows the particular effect of grain boundaries on the phase transformation in multi-crystalline NiTi. As it is illustrated in the figure, the samples with finer grains show less martensitic transformation. This result is in accordance with the assumption which is considered in the beginning of this section. Based on this assumption, the martensitic regions stop growing by reaching the grain boundaries. Therefore, the resistance against martensitic growth increases in multi-crystalline samples with smaller grains.
To provide more detailed insight into the effect of grain boundaries on mechanical behaviour of samples including plasticity and martensitic transformation, the distribution of the local axial stress σ 11 inside the samples and the corresponding microstructure are shown in Fig. 9 for the three aforementioned cases (four grains, nine grains, and sixteen grains). The figures include a contour plot at the end of the loading step, when the average axial strain isε 11 = 0.01. In Fig. 9, dislocation cores are indicated with the symbol "+" while the martensitic regions are represented through their external (elliptical) shapes and the grain boundaries are highlighted with red colour. Figure 9 presents a typical plastic deformation with dislocation pile-ups at the grain boundaries, which generate the hardening observed in Fig. 8a. It is illustrated that there is more dislocation pinning in the boundaries in Fig. 9c in comparison with Fig. 9a and b due to the higher density of grain boundaries. Therefore, more resistance against dislocation motion in Fig. 9 causes higher dislocation densities and more hardening behaviour that are shown in Fig. 8a and b, respectively. Furthermore, Fig. 9 illustrates the local stress concentration at grain boundaries in the microstructure. As a result, the specimens with smaller grains (higher density of grain boundary) represent more local regions with concentrated local stresses in the microstructure (the light yellow area in Fig. 9). Therefore, predicting the non-uniform stress distribution as illustrated in Fig. 9 is one of the potentials of the current discrete dislocation-transformation framework presented in this study. This could be applied for calculating the local stress concentration in microstructure that affects other deformation mechanisms such as twinning, fracture, and failure. This section studies the mechanical behaviour of multi-crystalline SMA under thermal cyclic loading and constant external stresses. These simulations are performed to observe the shape memory effect in multicrystalline NiTi and the effect of grain sizes on this behaviour. Here, the same samples presented in Fig. 7 are cooled from austenite to martensitic phase and then heated back to the initial temperature when they are under constant uniaxial stress.
The grain size effect on thermal cyclic loading of multi-crystalline NiTi is illustrated in Fig 10a-c. As shown in Fig. 10a, the specimen with larger grain size experiences larger transformation strain than specimens with smaller grain sizes along cooling and heating. Furthermore, to study the grain size effect on both transformation and plasticity mechanisms, the evolution of martensitic volume fraction and dislocation density is compared for different grain sizes in Fig. 10b and c, respectively. Figure 10b presents that the material transformed less in finer grain samples. It is because of the fact that by reducing the size of grains, the density of grain boundaries increased and each grain boundary acts as a   Fig. 10c illustrates that the amount of dislocation density and, as a result, plastic strain is higher in specimens with larger grain size. At a glance, it is against the fact that grain boundaries cause the increase of dislocations and hence work hardening. However, by looking deeply at Fig. 10c it is notable that dislocation generation is induced by phase transformation around the temperature of 70 • C, and before martensitic transformation, there is no dislocation dynamics. It means that the plastic mechanism is activated by the local stress field generated by martensitic regions. Therefore, the sample with higher transformation growth (grain size = 2 µm in Fig. 10b) shows higher dislocation density in Fig. 10c.

Effect of applied stress in thermal cyclic loading of multi-crystal NiTi
Finally, two-way shape memory effect behaviour of a multi-crystalline SMA sample made from nine grains is studied under temperature cycling and two different uniaxial stresses equal to 50 and 300 MPA. The results are presented in Fig. 11. As shown in Fig. 11b and d, for both samples, the martensitic regions transformed back completely by heating to the initial temperature in austenite phase. This means there is no residual strain due to the remaining martensitic phase after thermal cyclic loading. However, Fig. 11a and c illustrates some nonreversible strain after thermal cycling in both sample. This remaining strain is due to the dislocation plasticity which is induced mainly by the martensitic transformation (as the uniaxial applied stress is much lower than yield stress in NiTi material). It is observed that the plastic strain for the sample under 300 MPa external stress is higher than that of the sample under 50 MPa applied stress. It is due to the fact that the Peach-Koehler force (driving force for dislocation generation and motion) is computed by local stress field which is a combination of stress field of martensitic regions (which is similar for both sample) and the external stresses.

Conclusions
In this study, the interaction between dislocation slip plasticity and martensitic phase transformation was investigated. This interaction included the effects of martensitic transformation on dislocation plasticity (i.e. transformation-induced plasticity) and effects of dislocations on the generation and growth of martensitic regions. These phenomena were modelled by a discrete dislocation-transformation method at the sub-micron length scale.
The two-dimensional bi-crystalline samples of NiTi shape memory alloy were simulated by the discrete dislocation-transformation framework. The results illustrated the effect of different structural orientations on the thermo-mechanical response of the SMAs. It was explained that both dislocation slip and martensitic transformation are orientation dependent. Therefore, changing the orientation of one grain in a bi-crystalline sample led the mechanical response of the specimen during loading to change.
Furthermore, the effects of grain size and grain boundary densities on the two-way shape memory effect and pseudoelasticity behaviour were studied. The grain boundaries act as an obstacle against the dislocation motion and martensitic growth. Therefore, the smaller grain specimens caused more dislocation pinning and less martensitic growth, and as a result, it showed more hardening responses. These results also confirm Fig. 10 Grain size effect on the shape memory behaviour of multi-crystalline NiTi under temperature cyclic loading that our discrete dislocation-transformation framework has the ability to simulate the Hall-Petch effect in polycrystalline structures.
Finally, despite the limitations of a two-dimensional discrete dislocation-transformation model, it still provides useful validated information about the interaction between plasticity and martensitic phase transformation. The model could describe the grain orientations and grain size effects in shape memory alloys at the length scales that are somewhat sophisticated to resolve experimentally, particularly when the loading conditions change. This could be therefore a robust computational tool for further investigation on coexistence of plasticity and phase transformation in SMAs and other alloys. Furthermore, the proposed computational method would benefit the data-driven and machine learning modelling approaches by providing further data from the microstructure of SMAs and accelerates the data sampling methodologies.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

A Full pseudoelasticity response
In this appendix, the full stress-strain curve of pseudoelasticity behaviour of polycrystalline NiTi during loading and unloading is provided in Fig. 12. This graph demonstrates the irreversibility in the super-elasticity response and the contribution of plasticity to the irreversible strain after a complete cycle involving the forward and reverse martensite transformation processes of shape memory alloy. Figure 12 is particularly related to the four polycrystalline case with four different grain orientations described in Figs. 5 and 6 in Sect. 3.2.