In this paper, t he effect of pitting corrosion on fatigue life and fretting fatigue of elastic stable intramed ullary nails ( ESINs ) is investigated . To this en d, using a crystal plasticity formulation, the behavio ur of magnesium under large deformation s is investigated by implementing a user defined material subroutine (UMAT) in the Abaqus/Standard finite element solver . Using data provided by SEM images, the ap proximate configurations of grains in the polycrystalline material are obtained. Adopting Mg -RE (73 -2) as one of candidates for implant applic ations, the fatigue analysis is performed , and the results are compared to the experimental fatigue data for vario us strain amplitudes. Furthermore, the effect of pitting corrosion on the fatigue life of the material is investigated. It is shown that the maximum accumulated plastic slip occurs at the tip of a corrosion pit . This suggests a faster crack initiation rate on corroded magnesium specimens compared to non -corroded ones , under cyclic loading . Application of pitting corrosion before cyclic loa ding, causes a significant reduction in the predicted cycles to crack initiation , compared to the uncorro ded case. Howev er, the number of cycles to crack initiation is almost the same irrespective of the amount of mass loss due to corrosion . Next, by modelling the fretting fatigue of ESIN s, it is demonstrated that plastic slip accumulates at both the contact surface and dee per into the grain microstructure. However, the maximum values of stress and accumulated plastic slip occur at the contact surface. While the grain geometry and orientation influence the location and magnitude of accumulated plastic slip. By modelling the fretting fatigue of the material with different amounts of corrosion, it is shown that the maximum accumulated plastic slip occurs at the contact surface for the case without corrosion , and also for different percentages of corrosion. Finally, the results of fretting fatigue simulation of ESINs show that corrosion significantly accelerates crack initiation due to fretting wear . __________________________________________________________________________ _ 1. Introduction The use of magnesium (Mg) alloys, which have bioresorbable properties under physiological loading conditions, will address issues with the long -term invasive nature of the current metallic devices such as the need for secondary surgery, mismatched mechanical properties and potentially toxic meta l particulates (Zhao et al., 2017) . Secondary or revision surgery to remove implants accounts for up to 30% of all elective orthopaedic procedures (Kirchhoff et al., 2008) , therefore the bioresorbable properties of Mg where the resorption bi -products are also biocompatible is an extremely desirable clinical feature. Elemental Mg is inadequate for use in structural application due to its low Young’s modulus, limited cold work formability, toughness, limited high strength and creep resistance at elevated temperature, and its poor corrosion resistance (Mordike and Ebert, 2001) . Most Mg alloy products are fabricated by high pressure die casting, a high production rate technique capable of producing componen ts with highly accurate dimensions and smooth surface finish (Das, 2008; Froes et al., 19 98; Kulekci, 2008; Mordike and Ebert, 2001) . The drawback of high pressure die ca sting and other Mg casting techniques are casting defects and mechanical properties unsuitable for future lightweight applications. Wrought Mg alloys offer better mechanica l properties and fatigue properties than cast Mg alloys due to fine grain refinement achieved during thermo -mechanical processing (Shahzad and Wagner, 2009) . It is also widely known that wrought Mg alloys exhibit strongly anisotropic plastic deformation behavior under cyclic loading , thus restricting their use in current applications. To overcome the anisotropic behavior of wrought Mg alloys, several t echniques have been employed to influence and enrich the properties of Mg -based materials. Improvement in the extrudability and ductili ty can be achieved through the controlling of grain size and texture development/modification (Mishra et al., 2008) . Addition of rare-earth elements ( RE) is known to randomize the texture in Mg and reduce anisotropic cyclic behavior while enhancing both monotonic and cyclic properties (Li et al., 2016; F. Mirza et al., 2013; F. A. Mirza et al., 2013; Mirza et al., 2014; Mirza and Chen, 2014; Wang et al., 2013) . The us e of Mg alloys is expanding into structural and implant domains, where components are subjected to cyclic loading. It is thus crucial to evaluate the fatigue properties of wrought Mg alloys . In the biomedical field, implants are not only exposed to large c yclic stresses and strains, but also to a corrosive environment. The combination of cyclic loading and corrosion generates damaging phenomena such as corrosion -fatigue (Teoh, 2000) . Fretting fatigue can occur whe n two materials in contact under a normal load are subjected to a cyclic tangential force. This is a concern for biomedical implants such as elastic stable intramedullary nails (ESINs). ESINs are implanted into the intramedull ary cavity of the femur or oth er appropriate long bones of the body as a fracture fixation technique for paediatric patients . The technique was originally introduced as it allowed for a shorter period s of bed rest and earlier weight bearing compar ed to traction (Ligier et al., 1988) . More recently , it is preferred by some surgeons over fixation with screws and plate s as the insertion procedure is minimally invasive and does not required stripping of the soft tissue at the fracture site (Narayanan et al., 2004; Nørgaard et al., 2018) . ESINs can be subject to cyclical contact forces due to the dynamic loading conditions which may lead to fretting fatigue and crack formation of the ESI N. Several computational models have been developed to simulate the behavior of biodegradable material s. Using the crystal plasticity framework , the behavior of magnesium stents with HCP crystal structure has been predicted by Grogan et al. (Grogan et al., 2014) . A phenomenological corrosion model was also proposed by Grogan et al. (Grogan et al., 2011) , to predict the behavior of bioresorba ble stents in the presence of corrosion, . The finite element modellin g of crack initiation during fretting of stainless steel with FCC crystal structure is performed by McCarthy et al. (McCarthy et al., 2014a, 201 3, 2011) . Using crystal plasticity formulation, t he fretting fatigue crack nucleation in Ti –6Al–4V, with a combination of BCC and HCP crystal structures, has been further investigated by McCarthy et al (McCarthy et al., 2014b) . It should be noted that the simultaneous effects of pitting corrosion and fretting fatigue on the performance of implants has not been considered by previous models. The objective of this paper is to inve stigate the performance of magnesium ESINs when subj ected to fatigue loading, fretting and corrosion. To this end, the crystal plasticity modelling for magnesium HCP crystal, considering microstructure -sensitive crack initiation formulation and the effect of pitting corrosion, is presented in Section 2. Material parameter identification is explained in Section 3. Different results related to cyclic loading and fretting fatigue of ESINs are outlined in Section 4. Section 5 represents some conclusions based on the computational simulations. 2. Modelling framew ork 2.1. Constitutive m odelling of magnesium alloy in the framework of crystal plasticity The model proposed by Grogan et al. (Grogan et al., 2014) is adopted here to predict the behavio ur of magnesium in finite deformation regimes. Based on multiplicative decomposition , the deformation gradient tensor is divided in to elastic, 𝑭𝑒, and plastic, 𝑭𝑝, parts . The extensive explanations of the relations used for crystal plasticity formulations can be found in (Grogan et al., 2014; McGarry et al ., 2004 , 2007 ). 𝑭 = 𝑭𝑒 ∙ 𝑭𝑝 (1) The elastic part, containing rigid body motions, is described by an elastic strain energy potential. The prescribed linear relation between Cauchy stress tensor and elastic logarithmic strain tensor can be obtained by Young’s modulus E and Poisson’s ratio ν. Considering 𝛼 as the number of slip syste ms in magnesium HCP crystal structure, the plastic velocity gradient tensor can be expressed by: 𝑭̇𝑝 ∙ 𝑭𝑝−1=∑𝛾̇(𝛼) 𝛼𝒔𝛼𝒎𝛼 (2) Where 𝛾̇(𝛼) is the plastic slip rate for the 𝛼th slip system . 𝒔𝛼 and 𝒎𝛼 are uni t vectors describing slip direction and slip plane normal for the 𝛼th slip system, respectively. Schmidt’s law is used to describe the p lastic slip in magnesium. T he rate of plast ic shear strain , 𝛾̇(𝛼), for the 𝛼th slip system is assumed to be dependent on the Schmidt resolved shear stress , 𝜏(𝛼), acting on that syste m. A power -law rate -dependent relationship is used to describe the evolution of plastic shear strain . 𝛾̇(𝛼) = 𝑎̇ sgn(𝜏(𝛼)){|𝜏(𝛼) 𝑔(𝛼)|}𝑛 (3) where 𝑎̇ is the reference strain rate, a nd 𝑛 is a material parameter controlling the rate sensitivity of plastic slip, known as rate sensitivity exponent . The evolution equation for the slip system strain hardness , 𝑔(𝛼), is such that: 𝑔̇(𝛼)= ∑ℎ𝛼𝛽|𝛾̇(𝛽)| 𝛼 (4) where ℎ𝛼𝛽 is the strain hardening modul us; ℎ𝛼𝛼 and ℎ𝛼𝛽 (𝛼 ≠𝛽) are the self and latent hardening moduli , respectively. The hardening moduli are selected such that (Grogan et al., 2014) : ℎ𝛼𝛼 = ℎ(𝛾𝑎) ℎ𝛼𝛽 = 𝑞𝛼𝛽ℎ(𝛾𝑎) (5) where 𝑞𝛼𝛽 is a set of interaction parameters and 𝛾𝑎 is the accumulated plastic slip , described by: 𝛾𝑎=∑∫|𝛾̇(𝛼)|𝑡 0𝛼𝑑𝑡 (6) where 𝑡 denotes time and the summation is over all active slip systems at a given material point. Based on the active slip system s, three different hardening laws are applied for the magnesium crystals (Graff et al., 2007) : ℎ(𝛾𝑎)=ℎ0 (Linear hardening ) (7) ℎ(𝛾𝑎)=ℎ0(1− 𝑔0 𝑔∞)𝑒𝑥𝑝 (−ℎ0𝛾𝑎 𝑔∞) (Voce hardening) (8) ℎ(𝛾𝑎)={ℎ0 for 𝛾𝑎≤ 𝛾𝑟𝑒𝑓 ℎ0(𝛾𝑎 𝛾𝑟𝑒𝑓)𝑚−1 for 𝛾𝑎> 𝛾𝑟𝑒𝑓 (Deformation twinning) (9) where ℎ0 is the initial hardening modulus of slip system, 𝑔0 and 𝑔∞ are initial and maximum strengths of slip system, respectively. 𝛾𝑟𝑒𝑓 and 𝑚 are material parameters to be calibrated. To ensure that activation of twinning is restricted to tensile loading , the following condition is also enforced on the twinning slip systems : 𝑔(𝛼)→∞ for 𝜏(𝛼)≤0 (10) The mater ial behaviour is implemented in a user defined material subroutine (UMAT) in the Abaqus/Standard finite element solver. In order to simulate the behavio ur of HCP crystals considering the effect of twinning, the UMAT subroutine presented by Huang for FCC cr ystals (Huang, 1991) is modified by Grogan et al. (Grogan et al., 2014) . Fig. 1. Demon stration of slip planes and sli p directions for different slip systems in the magnesium HCP lattice. Directions are shown in terms of Miller indices , depicted by ‘ai’ and ‘c’ axes (Grogan et al., 2014) . As shown in Fig. 1, slip in magnesium is considered to take place on basal {0001} and prismatic {11̅00} planes in the <11 2̅0> directions and in the pyramidal planes {11 2̅2} in the <11 2̅3> directions, where Miller -Bravais indices are assumed. Tensile t winning is also represented as slip on the {10 1̅2} planes in the <10 1̅1> directions (Graff et al., 2007) . Hardening on the basal systems is assumed to follow Eq. 7, hardening on the prisma tic and pyrami dal systems is assumed to follow Eq. 8 and hardening on the twinning systems is assumed to follow Eq. 9. Values of latent hardening coefficients, 𝑞𝛼𝛽, are based on previous studies ( Graff et al., 2007; Grogan et al., 2014) . 2.2. Pitting corrosion of magnesium alloy Grogan el al. (Grogan et al., 2011) developed a phenomenological pitting corrosion model for biodegradable magnesium alloy s implemented for use in computational finite element software , such as Abaqus . Detailed descriptions of the pitting corrosion model can be found in Grogan et al. (Grogan et al., 2011) and Boland et al. (Boland et al., 2018, 2016) . Cons idering magnesium corrosion as a surface -based phenomenon, the elements on the exterior surface of the material would be exposed to the corrosive environment and are selected as part of the corrosion surface. The phenomenological pitting corrosion model is based on continuum damage mechanics and adopts a scalar damage parameter D (0≤ D ≤1) to account for the corrosion process. The mechanical properties of the elements on the corrosion surface will be linearly reduced as the damage parameter , D, increases . For a completely damaged element (D ≈ 1), the element is deleted , and the co rrosion surface is then updated to include neighbouring elements via an element connectivity map . The damage evolution law for uniform corrosion , which results in a homogeneous corrosion process , is as follows : U U edDkdt L= (11) where U and eL are the respective material and FE model characteristic lengths and Uk is the corrosion kinetic parameter. For the uniform case and for a given U and eL , the damage evolution law is p roportional to Uk . The pitting corrosion model is obtained by the inclu sion of a dimensionless pitting parameter, e , in the uniform corr osion model (Grogan et al., 2011) : U eU edDkdt L= (12) Using a Weibull distribution -based random number generator, e ach element on the corrosion surface is initially assigned a random pitt ing parameter , e. Elements on the corrosion surface with larger assigned number s are more susceptible to pitting corrosion. By the complete degradation and subsequent deletion of an element on the corrosion surface, a pit growth ra te parameter,  , controls the rate of neighbouring element degradation such that: en = (13) where n is the pitting parameter of the fully degraded element and  is a dimensionless parameter that controls the acceleration/deceleration of pit growth. In order to account for the stochastic nature of pit locations, each corrosion simulation is done five times with different initial pit configurat ions. The reported re sults of this paper are the average d results of the corresponding five simulations. To this end, different initial seed values are entered into the Weibull distribution based random number generator each time to generate five different initial pit configur ations . 2.3. Microstructure -sensitive crack initiation model In order to predict the number of cycles prior to crack initiation, a microstructure -sensitive methodology developed by Manonukul and Dunne (Manonukul and Dunne, 2004) , and used by McCarthy et al. (McCarthy et al., 2014b) is implemented her e. The accumulated plastic slip, 𝑝, is considered as the controlling parameter for crack initiation which is defined such that (McCarthy et al., 2014b) : 𝑝̇= (2 3𝐿𝑝:𝐿𝑝)1/2 ; 𝑝=∫𝑝̇𝑑𝑡𝑡 0 (14) where 𝐿𝑝 denotes the plastic velocity gradient tensor , presented in Eq. (2). Crack initiation is deemed to occur once 𝑝 reaches a critical value, 𝑝𝑐𝑟𝑖𝑡, which is determined expe rimentally from the number of cycles to crack initiation, 𝑁𝑖, and the maximum accumulated plastic slip in one cycle, 𝑝𝑐𝑦𝑐 . Due to the predicted rapid stabilisation of p with respect to the number of fatigue cycles, N, it is possible to determi ne 𝑝𝑐𝑟𝑖𝑡 from the following equation : 𝑝𝑐𝑟𝑖𝑡= 𝑁𝑖𝑝𝑐𝑦𝑐 (15) 3. Material parameter identification 3.1. CP model calibration In order to approximate the microstructure of grains in the material, SEM image of hot extruded Mg-RE (73-2) whic h is shown in Fig. 2(a) has been used (McGhee, 2017) . Addition of RE is known to randomize the texture in Mg and reduce anisotropic cyclic behavior while enhancing both monotonic and cyclic properties (Li et al., 2016; F. Mirza et al., 2013; F. A. Mirza et al., 2013; Mirza et al., 2014; Mirza and Chen, 2014; Wang et al., 2013) . Therefore, random orientations are assigned to different grains in the polycrystalline material . The pitting corrosion model has been calibrated using in -vitro corrosion experiments of Mg WE43 alloy (Boland et al., 2018) . It should be noted that the Mg -RE (73 -2) alloy which is used for simulations in this pap er contains rare earth alloying elements , similar to the Mg WE43 alloy s. Fig. 2. (a) SEM image of microstructure of hot extruded Mg -RE (73-2) (McGhee, 2017) (b) Approximated grain geometry used for the computational simulations. The uniaxial tensile t est data of Mg -RE (73 -2) (McGhee, 2017) , is used to calibrate the hardening parameters of the model by an iterative approa ch. The experimental uniaxial tensile data and the equivalent fitted computational simulation, to ca librate the hardening parameters are shown in Fig. 3. The V on-Mises stress distribution at the end of loading for the simulated material is shown in Fig. 4. The values of the calibrated parameters related to Eqs. (7) -(9), are presented in Table 1 . Fig. 3. Comparison of the experimental (McGhee, 2017) and simulated computational results for uniaxial tensile tests Fig. 4. Von-Mises stress distribution at the end of loading for tensile loading o f the simulated materia l. Table 1. Material hardening parameters calibrated using experimental results of Mg -RE 73 -2. Parameter Basal Prismatic Pyramidal Twinning 𝒈𝟎 130 80 160 48 𝒈∞ 0 90 170 0 𝒉𝟎 1 1 1 1 050100150200250300350400 0.0% 2.5% 5.0% 7.5% 10.0%Stress (MPa) StrainUniaxial Tensile Test Computational Experimental Table 2 represents the magnitudes of interaction coefficients , 𝑞𝛼𝛽, for magnesium single crystals. Table 2. Latent hardening (interaction) coefficient s, 𝑞𝛼𝛽, for magnesium single crystals (Graff et al., 20 07; Grogan et al., 2014) , where the hardening in slip system α depends on slip in slip system β. Basal 𝜷 Prismatic 𝜷 Pyramidal 𝜷 Twinning 𝜷 Basal 𝜶 𝑞𝛼𝛽= 0.2 𝑞𝛼𝛽= 0.5 𝑞𝛼𝛽= 0.5 𝑞𝛼𝛽= 0.5 Prismatic 𝜶 𝑞𝛼𝛽= 0.2 𝑞𝛼𝛽= 0.2 𝑞𝛼𝛽= 0.2 𝑞𝛼𝛽= 0.5 Pyramidal 𝜶 𝑞𝛼𝛽= 1.0 𝑞𝛼𝛽= 1.0 𝑞𝛼𝛽= 0.2 𝑞𝛼𝛽= 0.25 Twinning 𝜶 𝑞𝛼𝛽= 1.0 𝑞𝛼𝛽= 1.0 𝑞𝛼𝛽= 0.2 𝑞𝛼𝛽= 0.25 3.2.The crack initiation model calibration It should be noted that for determining the critical accumulat ed slip, we must know when the crack initiation occurs, which is not always easy to determine. However, in general, it is easy to determine the number of cycles to failure. Consequently, if the number of cycles to crack initiation is much larger than that for propagation, we can equate the critical accumulated slip for crack initiation with the accumulated slip to cause failure. Therefore, by having the number of cycles to failure, 𝑁𝑓, and by calculating the accumulated plastic slip per cycle, 𝑝𝑐𝑦𝑐, the critical accu mulated slip, 𝑝𝑐𝑟𝑖𝑡, can be calculated (Manonukul and Dunne, 2004) . The experimental low cycle fatigue data for Mg -RE (73 -2) which is presented in Fig. 5, represents the relationship between total strain amplitu de, 𝛥𝜀, and number of cycles to failure, 𝑁𝑓 (Mcghee, 2017) . The value of 𝑝𝑐𝑟𝑖𝑡 describing microstructural crack initiation for Mg -RE (73-2), is then identified to be equal to 2.848 using the 𝑁𝑓 value cor responding to one particular value of strain amplitude. Using the obtained value of 𝑝𝑐𝑟𝑖𝑡 and Eq. (15), the low -cycle fatigue response for our simulation is plotted for the range of applied strain amplitudes in Fig. 5. Fig. 5. Experimenta l (Mcghee, 2017) and predicted total strain amplitude vs. number of cycles to failure for Mg - RE (73 -2) 4. Results and discussions 4.1. Fatigue analysis neglecting the effect of corrosion To examine the accuracy of calibrated parameters , the fatigue analysis is performed and the results are compared to the experimental fatigue data of Mg-RE (73-2) (Mcghee, 2017) . The applied loading s and boundary conditions to the material are shown in Fig. 6. The left and bottom edges are prevented from moving in x and y directions, respectively. Using e quation constraints , the top and right faces are forced to remain hori zontal and vertical, respectively. In order to simulate low -cycle fatigue, a cyclic displacement is applied to the right edge. Four - noded plane strain elements are used throughout this work. 00.10.20.30.40.50.60.70.80.91 1 10 100 1000 10000 100000 1000000Δε/ 2 (%) Number of Cycles to Crack Initiation ( Ni/Nf)Experimental Computational Fig. 6. Demonstration of l oading s and boundary conditions used for simulating fatigue failure of material in Abaqus software. The comparison of computational a nd experimental stress -strain curves for ± 1 % and ± 0.75 % strain amplitudes , in the first cycle and mi d-life cycles are shown in Figs. 7 and 8, respectively. Fig. 7. Comparison of computational and experimental (Mcghee , 2017) stress -strain response s of Mg -RE (73 -2) at strain amplitudes of ± 1 % and ± 0.75 % in the 1st cycle. In Fig. 7 we see that the computational model predicts a very good fit with the experimental results for the first cycle of the fatigue test for both strain amplitudes shown. For the m id-life -400-300-200-1000100200300400 -1.0% -0.5% 0.0% 0.5% 1.0%Stress (MPa) StrainFatigue ±1% Computational - 1% Experimental - 1% -400-300-200-1000100200300400 -1.0% -0.5% 0.0% 0.5% 1.0%Stress (MPa) StrainFatigue ±0.75% Computational - 0.75% Experimental - 0.75% cycles shown in Fig. 8, the computational model deviates slightly from the experimental results , however the overall shape of the h ysteresis curves matches the experiments quite well. Fig. 8. Comparison of c omputational and experimental (Mcghee, 2017) stress -strain response s of Mg -RE (73 -2) at strain amplitudes of ± 1 % and ± 0.75 % in the mid -life cycle . The accumulated plastic slip distribution at the end of 1st and 10th cycles for ±1% strain amplitude is shown in Fig. 9. The increase in plastic slip predicted with increasing number of cycles is clearly evident. Fig. 9. distribution of accumulated plastic slip for strain amplitude of ±1% at the end of (a) 1st, and (b) 10 th cycle 4.2. Fatigue analysis by considering the effect of pitting corrosion The grain geometry and material described previously is also used for modelling the pitting corrosion with crystal plasticity formulation . The pitting corrosion model is applied to the top -400-300-200-1000100200300400 -1.0% -0.5% 0.0% 0.5% 1.0%Stress (MPa) Strain10Cycles Computational - 1% Experimental - 1% -400-300-200-1000100200300400 -1.0% -0.5% 0.0% 0.5% 1.0%Stress (MPa) Strain10Cycles Computational - 0.75% Experimental - 0.75% and bottom surfaces in accordance with the experimental fatigue results/observations reported in (McCarthy et al., 2013) . Following corrosion, a cycli c load is applied to the material geometry as shown in Fig. 6, to investigate the effects of mass loss due to corrosion and strain range on the fatigue life of the samples. The contour plots of accumulated plastic slip for different amou nts of mass loss due to c orrosion after 10 cycles is shown in Fig. 10. Fig. 10. Contour plot s showing the accumulated plastic slip ( 𝑝) after 10 cycles with ±1 % strain applied for (a) no corrosion , (b) 1% mass loss due to corrosion , and (c) 5% mass loss due to corrosion . In Fig(a), the maximum accumulated plastic slip of 0.89 with ±1 % appli ed strain occurs in the bottom left of an uncorroded sample . This is the predicted location of crack initiation due to cyclical fatigue . In contrast to the uncorroded sample (Fig. 10(a)), both corroded samples predict the maximum accumulated plastic slip o ccurs at the tip of a corrosion pit, as show n in the con tour plots in Fig(b) andFig(c) for 1% mass loss and 5% mass loss, respectively . In the case of ±1% applied strain, the average maximum accumulated plastic slip s for 1%, 2%, 5% and 10% mass losses are 6.58, 6.57, 7.44 , and 6.74 , respectively. This suggests that when subject ed to cycl ical fatigue loading, cracks initiate at a faster rate on corroded magnesium specimens c ompared to non-corroded /uncorroded samples . The computational curves of applied strain versus number of cycles to crack initiation, for different amounts of mass loss due to corrosion , are plotted in Fig. 11. Fig. 11. Experimental (Mcghee, 2017) and computational curves of applied strain versus number of cycles to crack initiation , for different amounts of mass loss due to corrosion. As previously mentioned, the computational model with no corrosion is calibrated with the experimental data, and a value of 2.848 for 𝑝𝑐𝑟𝑖𝑡 is obtained. As demonstrated by Fig. , the calibrated computational model accurate ly replicates the experimental data at strain ranges of 0.5% to 1%. H owever, the cycles to failure is overpredicted for strain ranges of 0.25% to 0.4%. Applying pitting corrosion to the model before application of cyclical fatigue loading significantly reduces the predicted cycles to crack initiation for all simulated strai n ranges as illustrated in Fig. . However, increasing quantities of mass loss due to corrosion (1%, 2%, 5% and 10%) have minimal effect on the predicted cycles to crack initiation . 4.3.Fretting fatigue analysis Due t o contact between the two implanted ESINs, fretting fatigue is a probable failure /damage mechanism . A FE model of a cylinder -on-flat fretting configuration based on the experimental work of Ding et al. (Ding et al., 2009) , and computational work of McCarthy et al. (McCarthy et al., 2014b, 2011) is implemented to investigate fretting fat igue. The schematic of fretting fatigue model is demonstrated in Fig. 12. Fig. 12. A schematic of the fretting fatigue FE model, highlighting the contact zone The values of normal load, P, and tangential displacement, Q, are obtained from ESIN implantation simulation . The contour plot of contact stress between t wo implanted ESINs is shown in Fig. 13. The contact stress of 35 MPa predicted by the ESIN simulation translates to a normal load of 210 N and displacement of 2 𝜇m in the fretting fatigue model. These values have been implemented in all further fretting f atigue results in this section, unless otherwise stated. Fig. 13. contour plot of contact stress between two implanted ESINs The contour plots of Von -Mises stress and accumulated plastic slip for fretting fatigue of uncorroded magnesium after the 10th cycle are shown in Fig. 14. It is predicted that the maximum values of stress and accumulated plastic slip occur at the contact surface. However, significant values of plastic slip also accumulate deeper into the grain microstructure. It should be noted tha t the grain geometry and orientation influence the location and magnitude of accumulated plastic slip. Fig. 14. Contour plots of (a) Von-Mises stress , and (b) accumulated plastic slip for fretting fatigue of material with no corrosion with normal load of 220 N and tangential displacement of 2 𝜇m at the end of the 1 0th cycle. Fig. 15 demonstrates the distribution of accumulated plastic slip in the magnesium alloy. The results are related to 10th cycle with normal load of 210 N and tangential displacement of 2 𝜇m. As depicted in Fig. 15, plastic slip accumulates at both the contact surface and deeper into the grain microstructure. It should be noted that t he grain geometry and orientation influence the location and magnitude of accumulated plastic slip . Fig. 15. Contour plot of the accumula ted plastic slip parameter in the magnesium alloy : (a) before and (b) after 10 cycles with a normal load of 210 N and tangential displacement of 2 μm. In order to investigate the effect of corrosion on fretting fatigue of the material, the fretting analysis is done for different amounts of mass loss due to corrosion . Fig. 16 (a), (b) and (c) shows the accumulated plastic slip contour plots for samp les with no corrosion, 3.5% corrosion and 8.5% corrosion, respectively . The maximum accumulated plastic slip occurs at the contact surface in all three cases . It can be seen that any increase in mass loss due to corrosion causes an increase in the maximum accumulated plastic slip. By increasing the corrosion, a more localized accumulated plastic slip is observed. Fig. 16. contour plots of accumulated plastic slip in the enlarged are a for different amounts of corrosion : (a) no corrosion, (b) 3.5% corrosio n, (c) 8.5% corrosion , with normal load of 220 N and tangential displacement of 2 𝜇m. Fig. 17. comparison of number of cycles to crack initiation for 3 different simulations with no corrosion, 3.5% corrosion and 8.5% corrosion with normal load of 220 N and tangential displacement of 2 𝜇m. Fig. 17. shows the number of cycles to crack initiation for 3 different simulations : no corrosion, 3.5% corrosion and 8.5% corrosion with normal load of 220 N and tangential displacement of 2 𝜇m. It is clear that corrosion also accelerates crack initiation due to fretting . 5. Conclusions Using the crystal plasticity formulation, the behavio ur of magnesium under large deformation s is investigated by implementing a user defined material subroutine (UMAT) in the Abaqus/S tandard finite element solver. Considering a microstructure -sensitive crack initiation formulation and the effect of pitting corrosion, the cyclic and fretting fatigue behavio ur of a Mg alloy is investigated. Using data provided by SEM images, the approxim ate configuration s of grains in the polycrystalline material are obtained. In order to investigate the effects of pitting corrosion and fretting fatigue on the overall behavio ur of the material, different simulations have been performed. Reasonable agreeme nt is obtained by comparing the results of fatigue analysis with the available experimental data of Mg -RE (73 -2) (Mcghee, 2017) . The effect of different amounts of mass -loss due to pitting corrosion on the response of the material is investigated. It is shown that the tip of corrosion pits would be the critical points and when subjected to cyclical fatigue loading, cracks initiate at a faster rate on corroded magnesium specimens compared to non -corroded ones. Furthermore, i t is shown that applying pitting corrosion to the model before application of cyclical fatigue loading significantly reduces the predicted cycles to crack initiatio n. However, the different quantities of mass loss due to corrosion has minimal effect on the predicted cycles to crack initiation. The results of fretting fatigue simulations show the accumulation of plastic slip at both the contact surface and deeper into the grain microstructure. Considering different percentages of corrosion at the contact surface of ESINs, it is demonstrated that by any increase in corrosion, the number of cycles to crack initiation will decrease.