On the mechanical, microstructural, and corrosion properties of pulsed gas tungsten arc and friction stir welded RZ5 rare earth grade magnesium alloy

Experimental studies have been conducted on the microstructure, mechanical, and corrosion characteristics of magnesium alloy RZ5 that has been butt welded. Pulsed tungsten inert gas (PTIG) and friction stir welding (FSW) are two distinct welding techniques that have been considered. The weld metal of the PTIG joint exhibited finer grain cast structures of 10 μm with coarser intergranular eutectic τ-Phase particles as compared to the coarse-grained cast base metal microstructure of 104 μm. The FSW joints microstructural investigation revealed that the precipitates with globular morphology had spread out throughout the wrought ultrafine α-Mg grains of 2 μm. X-ray elemental distribution and phase analysis indicated that in base metal and weld joints, the grain boundaries and interior zones were enriched with Zn and Zr elements with corresponding secondary phases. Microhardness measurements showed the softening is reduced in the heat-affected zone of FSW compared to PTIG joints. The stir zone exhibits the highest hardness of 120.4 HV0.2 which is 40% higher than the fusion zone hardness of PTIG welds. Electrochemical polarization scans and immersion testing indicated that the weld zone of the FSW joint exhibits higher corrosion resistance than the RZ5 base alloy and PTIG welds. The corrosion data (i.e., higher corrosion potential, lower current density, and higher breakdown potential) obtained from the polarisation scans are correlated with the microstructural features after immersion testing.


Introduction
Lightweight alloys are mainly used in the aeronautical, automobile, and marine industries to enhance the vehicle's performance and fuel efficiency. Magnesium is one of the light alloys that has attracted industries for its high specific strength, castability, and thermal conductivity [1]. For industrial applications, the joining of one or more alloys is necessary for attaining complex shapes, due to which welding has received attraction. For joining the magnesium alloys, fusion and solid-state welding can be used [2]. Tungsten Inert Gas (TIG) welding is one of the widely used fusion techniques by industries for joining purposes due to cost efficiency and ease of operation. However, the fusion welding process of magnesium alloy suffers from porosity and hot cracking if appropriate welding parameters are not selected [3]. Many researchers have shown interest in the strength enhancement of various magnesium alloys joined using different welding techniques. Munitz et al [4] studied the metallurgical and mechanical properties of TIG-welded AZ91D magnesium alloy and reported that slower cooling rate results in the formation of continuous β phase (i.e., Mg 17 (Al, Zn) 12 ) particles at the grain boundaries. It is further observed that the large size and continuously distributed β phase reduced the strength of the weldment. To overcome this issue, the authors have suggested reducing the size of the HAZ by enforcing a faster cooling rate.
Malik et al [5] investigated the effect of welding speed and current on the tensile properties of TIG-welded AZ91 magnesium alloys. It is reported that the arc efficiency increased with an increase in welding current and decreased with an increase in welding speed. It is also reported that the welding process parameters influence the width, depth, and microstructure of the fusion zone. Liu et al [6] investigated the metallurgical and mechanical properties of TIG-welded Mg-Li alloy. It is reported that the microstructure at the fusion is very fine, and the microstructure at the HAZ is very coarse compared to all other zones. Demir et al [7] demonstrated that the pulsed current produces weld joints with more favourable properties for magnesium alloys than the alternating current, which may result in porosity and micro oxide inclusions.
The fusion welding-related issues, such as grain growth and solidification hot cracks, can be overcome by using the friction stir welding (FSW) technique in the materials being welded in the solid state. Xie et al [8] examined the metallurgical and mechanical properties of friction stir welded ZK60 magnesium alloys. It is reported that the weld nugget zone (WNZ) has fine equiaxed recrystallized grains with the β-precipitates dispersed all over the magnesium matrix. It is also reported that the failure has occurred at the HAZ due to the low hardness value in the point. According to Kulwant Singh et al [9], the metals removed from AS undergo dynamic recrystallization and redeposit on the retreating side, and therefore there are noticeable differences in grain size in the advancing and retreating sides of the thermo-mechanically affected zone (TMAZ).
Carlone et al [10] compared the TIG and FSW welds of ZE41A magnesium alloy and found that the microhardness, residual stress, and tensile strength values are improved in FSW welds as compared to TIG welds. However, limited data is presented on the microstructure of different zones, and the criteria for selecting welding parameters are unknown. From the above studies, it can be seen that much research has been done on the welding of magnesium alloys using fixed welding parameters as the welding parameters play a vital role in mechanical property enhancement of the weldments, and optimization of welding parameters is needed. So, in this research, optimization of welding parameters based on macrostructural analysis and transverse tensile strength values for both PTIG and FSW was carried out. Pulsed Tungsten Inert Gas (PTIG) and FSW of Rare Earth RZ5 grade mg alloy can drastically change the microstructural features in the weld metal zones compared to the base alloy. For weld zones of PTIG and FSW, the effect of microstructure on corrosion is still a divisive subject. Understanding weld zone corrosion behavior and how its microstructure controls it is necessary for widespread industrial production and technical applications. This study aims to elucidate how pulsed current TIG and FSW weld microstructure affects the microhardness, tensile strength, fraction location features, and corrosion resistance.

Experimental procedure
The base metal RZ5 is used for this study and is cut into the required dimension of 100 × 50 × 5 mm. The chemical and mechanical properties of the base materials are analyzed and are given in table 1. The chemical composition of the base metal is analyzed using an optical emission spectrometer (Make-Spectro; Model-LDW-50). The mechanical property of the base metal is analyzed using a universal testing machine (UTM) (Make -Bluestar; Model-LDW-50). The welding process parameters and the limits chosen for PTIG welding are peak current (PC) ranging between 180 to 220 A, pulse frequency (PF) ranging between 2 to 10 Hz, and welding speed (WS) ranging between 120 to 160 mm min −1 based on initial fusion welding trials and macro defect (i.e., porosity, cracks, penetration depth) finding analysis. The welding process parameter and limits chosen for friction stir welding are tool rotational speed (TRS) ranging between 800 to 1200 rpm, tool traverse speed (TTS) ranging between 100 to 140 mm min −1 , and the axial load (AL) ranging between 1 to 5 kN based on initial solid state welding trials and macro defect (i.e., surface grooves, tunnel, pinholes) finding analysis. The upper and lower levels (i.e., values) of the welding parameters have been coded as + 1.682 and −1.682, respectively, to make it easier to record and analyze experimental data. The following relationship (equation (1)) can be used to calculate the coded values of any intermediate values (−1, 0, and 1): where X min is the variable's lowest level, Xmax is its highest level, and Xi is the required coded value of the variable [11]. In table 2, the actual values for the process parameters for PTIG and FSW are shown in comparison to the coded values. The design of experiments is formulated using response surface methodology (RSM). The base plates are cleaned using acetone before welding. The welding is conducted as per the experiment matrix composed using RSM. The tensile samples are extracted from the weldment using the Wire Electrical Discharge Machining (WEDM) machine as per ASTM-E8 standards. The extracted samples are tested on the UTM to determine the transverse ultimate tensile strength (UTS). The best welding parameters to join the RZ5 magnesium alloy using PTIG and FSW are found using the empirical relationship statistically verified with analysis of variance (ANOVA). The microstructural properties of the samples joined using the optimized welding parameters are studied. The samples for microstructural analysis are extracted along the transverse direction of the weld and are mounted with black phenolic powder using the hot mounting press. The mounted samples are polished using silicon carbide abrasive sheets of 80 to 400 grits by hand polishing. The samples are further polished using a double disc polishing machine (Make-BS Pyromatic; Model-DD-8) using abrasive sheets of 600 to 2000 grits. The microstructural analysis is done using an optical microscope (OM) and scanning electron microscope (SEM). The elemental analysis is carried out along a line on the optimized welded sample using SEM-EDAX analysis to find the present elements. The microhardness survey is taken along different zones at the transverse direction of the weldment by using a Vickers microhardness tester by applying a 0.2 kg load for a dwell time of 20 s. The hardness values are taken at five rows at distances of 0.5, 1.5, 2.5, 3.5, and 4.5 mm from the top. Hardness values are taken at 49 spots at each row by keeping the weld at the center. The polarization scan experiments were conducted utilizing a Gill AC Potentiostat and software, a three-electrode cell, a 3.5% NaCl solution, and the as-cast/weld zones of PTIG and FSW RZ5 specimen as a working electrode. The saturated calomel electrode (SCE) served as the reference electrode.

Results and discussion
3.1. Establishing and validating the empirical relationship using RSM and ANOVA RSM method is employed to frame the design matrix and the empirical relationship between UTS and input parameters and developed and validated using ANOVA. Also, RSM seeks to identify the location where the response is at its best or approaches its best value, in addition to examining the response throughout the entire space of parameters. Analyzing the response surface model allows for the identification of the factors which together provide the optimal response [12]. Table 3 gives the design matrix obtained from RSM, and tensile values achieved by PTIG and FSW weldments joined by each welding parameter combination as per the DOE matrix. Equations 2 and 3 provide the empirical connection developed to predict the transverse UTS values of welded samples using PTIG and FSW, respectively.
Analysis of variance (ANOVA) is applied to assess how well the established relationship works. Table 4 displays the results of the ANOVA analysis. According to table 4, the factor affecting the UTS largely for PTIGwelded samples is the PF, whereas the effects of PC and WS are almost identical. In the case of FSW, the factor that affects the UTS largely is TRS, followed by TTS, whereas the AL has the lowest impact on the UTS. The empirical relationship relating the UTS with the input parameters is given below  Strength TS  TRS  TTS  AL  TRS TTS  TRS AL  TTS AL  TRS  TTS  The grain size and its orientation, precipitate size and distribution, and volume fraction of the precipitates at different zones are the main factors that affect the weldment's mechanical characteristics. It can be seen from  [13], when the pulse frequency value increases, the molten weld pool is aggressively stirred, producing finer grains. This is because the high-frequency current's electromagnetic force causes the molten material in the weld pool to stir, breaking new grains and producing locations for heterogeneous nucleation. Another main factor that affects grain size is the heat supply. The heat supply to the welding can be increased by increasing the welding current and reducing the welding speed. According to Carlone et al [14], grain refinement is based on rapid cooling brought on by heat transfer from the liquid to the solid zones of the weld. Similarly, when the peak current is extremely high, the heat supply rises, prolonging the time it takes for the grain to solidify and enabling it to expand. From the numerical optimization results for the developed empirical relations, the optimal PTIG welding parameters to join the RZ5 magnesium alloy are a peak current of 195 A, pulse frequency of 6.6 Hz, and welding speed of 140 mm/min. In the case of the FSW joint, the TRS has the maximum impact on the UTS, and the AL has the lowest impact on the UTS. The UTS of FSWed weldments are lower than that of the BM for two main reasons. Firstly, according to Chowdhury et al [15], the UTS of the weldment is directly proportional to its hardness. During FSW, the heat flow during the welding process causes the grains in the HAZ to grow, leading to the softening of HAZ, resulting in a decrease in the UTS value of the weldments. Secondly, according to Raza Moshwan et al [16], the heat flow during the welding process results in the dissolution of the strengthening β-intermetallic phase resulting in a considerable decrease in the UTS of the weldments. From the above observations, it can be inferred that the heat input plays a vital role in the strength of the weldments. Optimal heat input is required as high and low heat inputs result in various defects. The heat input can be controlled by varying the welding process parameters. The increase in tool rotational speed and axial load increases heat input, but the increase in tool traverse speed decreases the heat input. From the numerical optimization results for the developed empirical relations, the optimal FSW welding parameters for joining the RZ5 magnesium alloy are a tool rotational speed of 1030 rpm, tool traverse speed of 118 mm min −1 , and axial load of 3 kN.

Microstructural features, elemental and volume fractions of the precipitates
The microstructural images taken at 2000X using a scanning electron microscope at the base metal zone and weld zones of PTIG and FSW samples welded at optimized welding conditions are given in figures 1(a)-(c), respectively. From figure 1(a), it can be seen that the base metal has the α-Mg matrix in all areas with an average grain size of 128 μm, and the intergranular eutectic τ-Mg 7 Zn 3 RE phase particles with an average size of 15.29 ± 4.34 μm are seen to be accumulated on the grain boundaries. The zirconium (Zr) elements are found in the center of the grains. On comparing figures 1(a) and (b), it can be seen that the microstructures of the base metal and PTIG weld zone look similar, but the FZ of the PTIG joint has very finer grains of 10.6 μm that has occurred due to the prolific nature of the Zr elements. According to Cao et al [17], small sphere-shaped grains begin to develop around Zr elements. Because of their prolific nature, the Zr elements facilitate the nucleation of many grains at once. The melted materials during the gas tungsten welding process solidified at a much faster cooling rate than the casting process used to manufacture the base metal. As multiple grains form at once, the boundaries impinge as the grain grows, limiting its size. The intergranular eutectic phases with an average size of 4.71 ± 1.75 μm were reprecipitated in the weld zone of the PTIG joint. On comparing figures 1(b) and (c) and the measured precipitate size in the weld metal zones, it can be seen that the FZ of the PTIG joint (figure 1(c)) has α-Mg matrix all over the zone, which is surrounded by the relatively coarser and blocky τ-Mg 7 Zn 3 RE phase precipitates at the grain boundaries, but on the WNZ of the FSW joint ( figure 1(c)), it can be seen that the fine globular precipitates with an average size of 1.99 ± 0.83 μm have scattered all around the ultrafine α-Mg grains of 2.9 μm due to the action of the tool pin. According to the Arbegast model [18] used in equation (4), the peak welding temperature was around 488 o C, which is closer to the solution temperature of precipitates. Where TRS is the tool rotation speed, TTS is the tool traversing speed, α and K are the relevant constants, T wp is the peak temperature of WNZ, and T melting is the melting temperature of RZ5 alloy, and so on. The constants, K, and melting temperature for the RZ5 alloy are 0.0442, 0.8052, and 610°C, respectively [19]. As a result, the estimated temperature in SZ for the suitable welding conditions, TRS of 1030 rpm and TTS of 118 mm min −1 , would be about 488°C, which is near the secondary phase solution temperature of 500°C. The second phase of the WNZ did, however, partially dissolve and redistribute when exposed to the predicted weld temperature. However, the second phase in the WNZ underwent fractional dissolution and redistribution exposed to the predicted weld temperature. However, faster precipitation kinetics associated with finer grain resulted in reprecipitation of τ-phase present along with the fragmented second phase particles by mechanical mixing. It is clear from the binary Mg-Zn phase diagram that Zn exhibits diminishing solubility in solid Mg at room temperature [20]. Zn is most soluble in Mg at 310°C, where its solubility is 2.4 weight percent; at ambient temperature, it is one weight percent. Consequently, the τ-phase compound develops in the RZ5 alloy at room temperature. According to Feng et al [21], during the friction stir welding process, the stirring action causes dynamic recrystallization on the WNZ, resulting in smaller grains. The stirring action also breaks the precipitates into smaller sizes and spreads them throughout the WNZ due to the intense plastic deformation and mechanical mixing. The volume fraction of the precipitates (PVF) for the base metal and weld zones of PTIG and FSW joints are calculated using ImageJ software. The volume fraction of the precipitate in the base metal calculated by using figure 1(a) is 3.895 ± 1.13%. The volume fraction of the precipitates at the FZ of PTIG samples calculated using figure 1(b) is 12.6 ± 2.21%. The volume fraction of the precipitates at the WNZ of FSW samples calculated using figure 1(c) are 11.9% ± 2.11%. It can be seen that the volume fraction of the precipitate is high on the FZ and WNZ compared to the BMZ. The increase in the percentage of PVF in the FZ is because of the reduction of the volume of Mg due to evaporation. A similar observation has been made by Vasu et al [22] during the fusion welding of magnesium-containing aluminium AA5059 Al alloy. It has been reported that about 39% of loss in Mg alloy occurred during the fusion welding process. The reduction of Mg alloy also leads to a decrease in ductility. Arora et al [23] observed an increase in the volume of the second phase during friction stir processing of AE42 grade magnesium alloy due to the fragmentation of secondary phases and the formation of fresh insitu secondary particles due to severe mechanical stirring.
The results of the elemental bulk analysis ( figure 2) show that the amounts of magnesium (Mg), zinc (Zn), zirconium (Zr), lanthanum (La), and cerium (Ce) present in the WNZ of the FSW joint and the FZ of the PTIG joint are comparable, indicating that these elements were retained after the welding. The elemental line scan analysis of the weldment is carried out using SEM-EDAX analysis for PTIG and FSW joined samples and is given in figures 2(a) and (b), respectively. The yellow, red, and green reference lines in the graph denote the Mg, Zr, and Zn elements present across the different zones of welded joints. It can be seen that the magnesium elements are high when the reference line passes through the α-matrix interior regions, but there is a drop in the Mg elements when the reference line crosses the grain boundaries. It can also be seen that when the reference line crosses the grain boundaries, there is a rise in the Zn peak. This shows that the Zn elements accumulate at the grain boundaries. The red peak in the EDAX graph indicates the presence of Zr elements. In figure 2(a), when the reference line crosses the particle in the center of the grain, a rise in the Zr peak is observed. This shows that the Zr elements are present in the center of the grains. A higher number of Zr/Zn elemental peaks are observed in weld zones of both joints as compared to the RZ5 base metal, which reflects the distribution and size of the secondary phases and grains, respectively. Much closer peaks are observed in the FSW joint due to ultrafine grains with uniformly distributed secondary phases as compared to relatively bigger α-Mg in the PTIG joint. The X-ray phase scans (figure 3) also confirmed the presence of primary α-Mg and secondary τ-Mg 7 Zn 3 RE phases in the base metal, PTIG, and FSW joints without forming new phases. However, there is a substantial difference in the peak heights (e.g., intensity @ 2θ οf 37°, 57°, 70°) in FSW joints compared to PTIG and BM. This is mainly due to the modified size and texture of the primary α-Mg phases in the FSW joint. Kiran Babu et al [24] observed a similar reduction in the intensity during FSP of ZE41 mg alloy and related this drop to the texture formation and preferred orientation of grains after FSP. Similar behaviour, in which shear deformation altered the texture, was seen in equal channel angular pressed magnesium alloy [25,26]. However, there is little difference in the peaks in PTIG and base metal due to the similarity in the melting and solidification behaviour though PTIG welds cooled much faster than the base metal.

Microhardness at different zones of the optimized weldments
The contour plot generated using the hardness values measured at various zones of the weldment for PTIG, and FSW joined specimens are shown in figures 4(a) and (b), respectively. Table 5 shows the grain sizes at each zone and the respective hardness values at the particular zones. For the PTIG welded sample ( figure 4(a)), the highest hardness values are observed at the FZ, and the lowest hardness values are observed at the HAZ. The hardness value is inversely proportional to the heat input. According to Nakata et al [27], the hardness of the welded joints is inversely proportional to the square root of the grain size. This is because when the heat input is less, it will cause the molten metal in the FZ to cool down rapidly, forming smaller grains and resulting in higher hardness values. In the case of HAZ, the grain size increases more than the BM. Similar observations have been reported by Xin Tong et al [28]. In addition, it has been reported that the eutectic phases in the HAZ have become continuous with coarsened morphologies. The coarsening of the grains and the eutectic phase particles are the main reasons for the decrease in the hardness values at the HAZ.
For the FSW joined sample ( figure 4(b)), it can be seen that the highest hardness values are observed on the WNZ, and the lowest hardness values are observed at the HAZ. There are two main reasons for the increase in hardness at the WNZ: (a) due to the finer grains in the WNZ and (b) due to the Orowan hardening mechanism because of the presence of the precipitates. Xunhong et al [29] reported that grain size considerably impacts hardness. According to the Hall-Petch relation, the decrease in grain size increases the hardness values, which is one of the main reasons behind the increase in the hardness values at the WNZ. Similar observations have been made by Kulwant Singh [30]; they have reported that the hardness variations at different weldment zones have been mainly due to the difference in grain size at the different zones. The lowest hardness values are observed at the HAZ of the welded joints; this is because of the biggest grains at this zone. The biggest grains are found in the HAZ, and this is due to the grain growth that occurs in this zone as the result of heat flow during the welding process. It can be seen from the hardness distribution that WNZ has the highest hardness values at the bottom surface, which is the pin-influenced zone (PIZ). The top surface of the WNZ is the shoulder-influenced zone (SIZ) which has a slightly lesser hardness than the PIZ. This is mainly due to the presence of finer grains on the PIZ compared to the SIZ of the WNZ. Similar observations have been made by Chang et al [31] during friction stir processing on AZ31 magnesium alloys. It has been reported that the friction stir processed AZ31 magnesium alloy showed very fine grains at the bottom than on the top surface. It is considered that the heat generated by the tool shoulder causes the growth of bigger grains near the top surface.

Fracture location and fractured surfaces of the optimized weldments
The tested tensile samples indicated that the PTIG and FSW joints failed in the HAZ (figure 5a), which is clearly due to the lowest hardness distribution in HAZ compared to other zones. The fractured surface of the tensile samples is analyzed using a scanning electron microscope and is presented in figures 5b-c. The fractured morphology of the base metal RZ5 is displayed in figure 5(b), and the fractured morphology of the samples welded using PTIG and FSW processes are given in figures 5(c) and (d) respectively. Table 6 shows the quantitative measurements of the dimples on the fractured surfaces. The fractured surface morphology of the base metal ( figure 5(a)) shows a lot of fine and large dimples, which denotes that the RZ5 base metal undergoes a ductile mode of failure. It can also be seen from table 6 that the dimple sizes varied between 1.2 to 18.3 μm with the average dimple size of about 8.8 μm. The percentage of dimple distributions on the fractured surface is 76.95% which is higher than the percentage of dimple distributions in both PTIG and FSW joined samples. This shows the base metal has higher ductility than the welded joints. The fractured surface of the PTIG and FSW samples shows the combined morphologies of shallow dimples, quasi-cleavage, and facets. This shows a mixed failure mode. Similar features were observed by Liu et al [32]. It has been reported that the load-withstanding capacity and morphology of the fracture are mainly influenced by the change in microstructural features like  grain growth, distribution of precipitates, and texture evolution. The presence of facets in the fractured surface shows that the failure has occurred in brittle mode. The presence of a quasi-cleavage structure on the surface shows the reduction of ductility in the material. The shallow dimples (figure 5c) show some ductility in the PTIG joints. The combined features (figure 5c and d) of all the zones show the reduction of ductility in the PTIG and FSW samples. Comparing the percentage of dimple distributions on the TIG and FSW samples from table 5 shows that the FSW weldments showed better ductile nature than PTIG weldments.

Comparison of corrosion resistance of RZ5 base metal with optimized weldments
The polarization curves for the weld zones of PTIG and FSW joints are compared in figure 6, and the corrosion parameters extracted from the plot are presented in table 7. It is clear that the corrosion potential (E Corr ) is increased, and corrosion current density (I Corr ) is decreased for FSW joints compared to the base metal. On the other hand, E Corr and I Corr values are reduced for the PTIG joint compared to the base metal. This implies that the PTIG and FSW joints exhibited lower and higher corrosion resistance when compared with the RZ5 cast material. Long et al [33] found that the degradation resistance of Mg-5Zn alloy was enhanced after FSP, and it was confirmed by the increase in E corr and decrease in I corr values of the FSP zone due to the reduced cathodic activity and hydrogen evolution. Liu et al [34] indicated that the fusion welded joint of AZ31 magnesium alloy exhibited lower degradation resistance than the rolled base metal with negative E corr and higher I Corr values. It is also essential to note that the pitting or breakdown potential (E pit ) of the FSW joint is 6% and 16% higher when compared with the RZ5 cast alloy and PTIG joint, respectively. Moreover, the difference between the E corr and  E pit values for the FSW joint is 1.00 V which is 22% and 92% higher than the RZ5 base alloy and PTIG joint, respectively. This indicates that the protective magnesium oxide or hydroxide film formed on the FSW joint is steadier and stronger than its counterparts. Kish et al [35] observed that the time taken for the breakdown of surface magnesium oxide films in the FSW AZ31 magnesium joint doubled that of the time taken for the breakdown of the base alloy and claimed that grain refinement is the major cause for this change.
The microstructure of RZ5 base alloy, PTIG, and FSW weld zones subjected to immersion testing are analyzed to clarify the trend and data obtained from polarization curves. The RZ5 base alloy microstructure after 36 h of immersion is shown in figure 7. As mentioned already, RZ5 base alloy prepared via sand casting under equilibrium cooling conditions has primary α-Mg phase, intergranular eutectic τ-Mg 7 Zn 3 RE Phase and intragranular Zr rich particles. α-Mg phase is anodic in nature during the corrosion process. However, τ -Mg 7 Zn 3 RE and Zr rich are cathodic related to the α-Mg phase. Coy et al [36] measured the Volta potential difference (V pd ) and found that V pd for τ phase and Zr-rich phase is +0.1 V and +0.18 V, respectively, with the α-Mg phase. Hence, intragranular and intergranular secondary τ and Zr-rich phases are the desired locations for hydrogen evolution.
The dissolution was initiated around the intragranular and intergranular secondary cathodic phases due to a galvanic reaction with the anodic α-matrix. As time progressed, the dissolution spread over the surface as a crater around Zr-rich and the continuous cavity around τ phase (figure 7). These outcomes are reliable with observations by Neil et al [37] and Zhao et al [38]. To differentiate the effect of dispersion, dimensions and profile of secondary cathodic phases and α-anodic matrix grain size on the corrosion resistance of RZ5 base alloy with the weld zones of PTIG and FSW joints, the samples consist of different zones are immersed for 24 h, and the results are analyzed. Figure 8 shows the zone-wise microstructure of the PTIG joint after 36 h of immersion in the NaCl environment and found that the weld metal suffered from severe metal loss compared to the other regions. The fine-grained zone around a larger volume fraction of coarser secondary cathodic phases is selected corroded compared to the coarser grains with less volume of secondary cathodic phases. Although the weld metal zone of the PTIG joint experienced a similar melting and solidification route to the sand-casting process used to prepare RZ5 base alloy, the solidification happened much faster in the welding process than in the casting route. It is hypothetical that faster cooling during solidification after welding can lead to finer grain and homogeneous dispersion of alloying elements and subsequently improve degradation resistance [39]. However, the  polarization curves indicate the protective magnesium oxide layer breakdown for both base alloy and weld zones. Hence, the anodic matrix grain size alone is not the factor to assess the degradation resistance. The overall degradation resistance of precipitation-hardened Mg-Zn-Zr-RE alloys depends on the size and dispersion of secondary cathodic phases and anodic matrix grain size. The microstructural features (i.e., rare rich secondary cathodic phases) formed in RZ5 base alloy and weld zones are significantly different due to refined weld metal grains. Song et al [40] reported that a larger precipitate volume in aluminum containing Mg alloy could act as a barricade to the corrosion progress and delay the corrosion process. Ben-Hamu et al [41] reported that the TIG weld metal suffered due to a severe degradation rate which is 110% higher as compared to  the base AZ31 alloy, and in contrast to other studies, grain coarsening in the FZ with new secondary phases. Bland et al [42] reported that the TIG weld metal showed superior resistance against corrosion compared to rolled base AZ31 Mg plate, and the authors claimed that the finer grains with a uniform dispersion of secondary cathodic phases and alloy homogenization caused this improvement. However, the base alloy used in this research is a sand-cast alloy free from aluminum. The secondary cathodic phases may lead to accelerating the dissolution by acting as a galvanic pair with anodic matrix grains, or it can act as a barricade to reduce the progression of corrosion progress depending on the relative proportion of anodic matrix and cathodic secondary precipitates, dimensions, size, and dispersion the RE-rich phases.
However, in the weld zone of the PTIG joint, similar to the base alloy, the corrosion initiated around the secondary cathodic phases and spread towards the center of anodic matrix grains ( figure 8). However, the time taken for the corrosion to spread on the entire surface is less as compared to the base metal due to reduced matrix grain dimensions, early breakdown of a passive protective layer, the higher volume fraction of secondary cathodic phases. This resulted in a honeycomb structure with a deeper cavity and heavier material loss in the weld metal of PTIG welds. Heavy material loss was also observed in fine grains around the necklace structure in the partially melted zone. Nowak et al [43] confirmed that RE-rich precipitates increased the ratio of the cathode to anode and resulted in the preferential dissolution of TIG weld metal as compared to the HAZ and the base alloys with rare Earth elements. Birbilis et al [44] observed the negative influence of a higher volume fraction of secondary cathodic phases on the degradation resistance of Mg-Zn-Zr-RE alloy, which is in good agreement with the behaviour of the weld zone of the PTIG joint. Figure 9 shows the zone-wise microstructure of the FSW joint after 36 h of immersion in the NaCl environment and found that the HAZ and the base alloy suffered from severe metal loss compared to the weld nugget (i.e., stir zone) regions. The wider and deeper pits with α-grain dropping are observed in the base alloy zone and HAZ due to the galvanic pair between the anodic mg matrix and secondary cathodic phases present in these zones. The WNZ of FSW joints exhibited ultrafine grains of around 2 μm with a homogeneously dispersed globular secondary phase. The ultrafine grains and fine secondary phases are beneficial in generating stable and strongly adhered magnesium oxide layers, thereby lessening the tendency of passive film cracking, as evidenced by the E pit values of the FSW joint weld metal. The delay in the protective layer breakdown and supersaturated matrix due to friction stirring resulted in reduced anodic dissolution with shallow and smaller pits in the weld metal and enhanced degradation resistance compared with the base alloy and PTIG welds.
Baradarani et al [45] observed a significant reduction in current density due to ultrafine grains and uniformly dispersed Al elements formed due to hybrid ultrasonic-friction stir processing of AZ91 grade alloy. Eivani et al [46] reported that the second phase particle breakup and redispersion resulted in a stronger protective layer and enhanced corrosion resistance of multipass FS-treated WE43 magnesium alloy. Kish et al [47] reported that the resident potentials are imperative in determining overall anodic and cathodic regions and the corrosion propagation (i.e., spreading of corrosion) depends on the breakdown voltage. In FSW joint, the resident potential balanced the cathodic and anodic activity by producing ultrafine grains. The spread of corrosion is reduced due to the fine dispersion of globular secondary precipitates, making it a more vital and stable passive surface covering.

Conclusions
This investigation's key findings include the following ones.
• With a welding current of 194 A, a pulse frequency of 6.6 Hz, and a welding speed of 13 mm/min, PTIG welds achieved the maximum transverse tensile strength of 185 MPa. The FSW welds, which were fabricated using a tool that rotated at 1030 rpm, traversed at 118 mm min −1 , and with an axial load of 3 kN, yielded the maximum transverse tensile strength of 225 MPa.
• Invariably during transverse tensile testing, the joint failed in the heat-affected zone due to weld thermal softening. Due to the solid state and low heat input nature of the process, the degree of the loss in the FSW joint (i.e., around 10 Hv 0.2 ) is, however, less severe as compared to PTIG joint (i.e., approximately 20 Hv 0.2 ).
• The FZ of PTIG resembles the microstructure of the RZ5 base metal. However, the grains in FZ are much more refined (i.e., 10.6 μm) than the base metal, with an average grain size of 128 μm. This is mainly due to the rapid cooling rate after PTIG welding.
• Due to the mechanical action of the tool pin and dynamic recrystallization, the ultrafine 2.9 μm diameter α-Mg grains were dispersed throughout the microstructure of the FSW joint.
• The base metal, PTIG, and FSW joints contained primary α-Mg and secondary τ-Mg 7 Zn 3 RE Phases without creating new phases, according to the x-ray phase scans.
• In contrast to the base metal and WNZ of the FSW joint, the FZ of the PTIG joint suffered significant metal loss, as shown by the polarisation corrosion curves and the results of the immersion testing.
• The ultrafine grain, uniformly scattered spherical secondary phase, and stable and firmly adherent magnesium oxide layer in the WNZ of the FSW joint caused improved resistance in a corrosive medium as compared to the FZ of the PTIG joint and the RZ5 base metal.

Data availability statement
The data that support the findings of this study are available upon reasonable request from the authors.