Numerical Simulation of Friction Stir Welding of Dissimilar Al/Mg Alloys Using Coupled Level Set and Volume of Fluid Method

The coupled level set and volume of fluid (CLSVOF) method is proposed to simulate the material distribution and physical properties during dissimilar aluminum/magnesium friction stir welding (FSW) process more accurately. Combined with a computational fluid dynamics model, the FSW process is numerically simulated and the heat transfer and material flow are analyzed. The results show that heat transfer and material flow have great influence on the Al/Mg bonding. In order to verify the accuracy of the model, the calculated results based on different methods are compared with the experimental results, and the Al/Mg interface simulated by the CLSVOF method is in better agreement with the experimental results. Finally, the material distribution and interface evolution near the tool at different times were studied based on the CLSVOF method.


Introduction
The complex structure composed of different lightweight materials (aluminum alloy and magnesium alloy) has attracted wide attention in the aerospace, automobile, and other sectors [1,2].However, the large differences in the crystal structure and physical properties between the two metals make it difficult to join them together by using fusion welding processes.Friction stir welding (FSW), as a solid-state process, is suitable for joining dissimilar materials, and plentiful experiments have been carried out [3][4][5].To understand the complex underlying physics in FSW process of dissimilar Al/Mg alloys, the combination of numerical simulation and experimental verification is the most economical and effective method.
In previous studies, computational fluid dynamics (CFD) was a common means to simulate the heat transfer and material flow in the dissimilar FSW process, where multiphase flow theory and the volume of fluid (VOF) method were used to describe the mixing and distribution of dissimilar materials [6,7].VOF is a single-fluid algorithm derived from continuous equations with the property of mass conservation [8].However, the discontinuity of the function defined by the VOF method makes it difficult to obtain the exact interface curvature and the physical properties of materials near the interface, which reduces the stability of the calculation process and leads to poor accuracy of interface reproduction.
The level set method proposed by Osher et al. [9] is another way of solving two-phase fluid flow.The method can track the interface changes by calculating the zero-level set at the new time step.Compared with the VOF method, it has higher accuracy in the interface calculation due to its smooth continuity.Tomashchuk et al. [10] took the electron beam welding of copper/steel as an example and used the level set method to solve the motion equation of the interface between two metals.The position of the interface on a two-dimensional plane can be easily obtained and can approximately reproduce the weld morphology of two metals.Kesharwani et al. [11] numerically analyzed the FSW process of Al 6061-T6 with Al 2 O 3 particles and predicted the mixing of the two fluids using the level set method.Sadeghian et al. [12] used the level set method to simulate weld morphology and predicted dissimilar material flow behaviors in the aluminum/steel FSW process.The results proved that the level set method can accurately predict material flow behaviors.However, in the process of solving the level set equation, there is a small amount of mass loss/increase at each time step due to the dissipation effect in the numerical method, and the error accumulation over time leads to the gradual distortion and even ambiguity of the solved moving interface [13].Combining the advantages of mass conservation of the VOF method and the smooth continuity of the level set method, Sussman and Puckett [14] proposed a coupled level set and volume of fluid (CLSVOF) method to calculate two-phase flow.However, the CLSVOF method is mostly used in gas dynamics [15,16] and is rarely used in welding process, especially in the FSW process.
In this work, the CLSVOF method, combined with a three-dimensional multiphase CFD model, is employed to study the dissimilar Al/Mg FSW process.The material distribution on different horizontal planes is predicted by the level set function and the smooth material physical properties are obtained near the Al/Mg interface.The heat transfer and material flow behavior of the FSW process simulated based on the VOF and CLSVOF methods are compared and analyzed.The experimental results are used to verify the accuracy of the model.Finally, the material distribution and interface evolution near the tool at different times are studied based on the CLSVOF method.

Governing Equations
A CFD model is established to predict the heat transfer and material flow behavior of the dissimilar Al/Mg FSW process.The Al and Mg alloys experiencing severe plastic deformation around the FSW tool are treated as an incompressible non-Newtonian viscoplastic flow, where the Al alloy is the primary phase and the Mg alloy is the secondary phase.The heat transfer and fluid flow are governed by the following equations: where ρ m is the fluid density, → V is the flow velocity vector, t is the time, P is the static pressure, → F σ is the interacting force between two phases and is zero except for the cell at the interface, c p,m is the heat capacity, λ m is the thermal conductivity, S v,m is the viscous dissipation heat generated by the plastic deformation material around the tool, which is related to the material viscosity and strain rate.The viscosity, µ s,m , can be obtained as follows: where .
ε is the strain rate, and σ s,m is the flow stress.Other physical properties of base materials, constitutive equation parameters related to flow stress, and boundary condition settings have been comprehensively described in a previous study [17].

VOF Method
The VOF method is commonly used to model the dissimilar FSW process, where the interaction between different fluids is expressed by the volume fraction of different phases in a cell.The sum of the volume fractions of each phase in a cell is equal to 1 [18]: where α is the volume fraction, and the subscripts Al and Mg indicate Al alloy and Mg alloy, respectively.Therefore, we just need to solve for the volume fraction of one phase to obtain the two-phase distribution.The volume fraction of the secondary phase is controlled by the continuity equation [19]: where The physical properties of each cell M m , such as density and viscosity, can be calculated by the volume fraction of the primary phase: The interacting force between two phases is described by the continuous surface tension (CSF) model [20]: where σ Al−Mg is the surface tension coefficient, and the normal vector

CLSVOF Method
Since the volume fraction is a step function, it is difficult to obtain the exact physical properties near the interface, so the level set method is introduced to trace the two-phase moving interface.The level set function ϕ(x, y, z, t) is always the symbolic distance function from the point (x, y, z) to the interface, and the interface is the zero-level set [21]: At any time t, the point on the interface satisfies: By solving the above equation to determine the zero-level set, the interface tracking is realized.Equation (10) is the fundamental equation of the level set method.
However, the level set function no longer remains the defined symbolic distance function after several solving time steps, which will lose the meaning that the zero-level set is the moving interface.Consequently, the level set function needs to be reinitialized at each time step.The reinitialization equation can be expressed as [22,23]: where τ is the virtual iteration time, which is not equal to the actual time t; S(ϕ 0 ) is a symbolic function; and ϕ 0 is the initial value of the level set function.
During the process of reinitialization, the initial value is obtained from the volume fraction [20,24]: where ∆h is the mesh size, and m is taken to correct the initial ϕ so that the value is close to the correct distance to the interface.In order to avoid the instability of the calculation process, the symbolic function can be smooth [24,25]: A smooth function H(ϕ) related to level set function is defined to represent the material distribution; the value ranges from 0 (Mg alloy) to 1 (Al alloy), which can be expressed as [26]: where γ is an adjustable parameter used to indicate the thickness of the Al/Mg interface.Therefore, in the CLSVOF method, physical property parameters can be expressed as: In addition, the normal vector in Equation ( 8) is recalculated by the level set function → n = ∇ϕ/|∇ϕ|, which provides a more accurate interface curvature κ = −∇ • → n than the VOF-based value.δ Γ is redefined as in [27]:

Implementation of CLSVOF
ANSYS FLUENT 16.0 software has a perfect and powerful calculation function for flow field and can add some conditions with user defined functions so that it has great flexibility.Therefore, the VOF model provided by the software is selected in this study, and the model is modified on this basis to realize the application of the CLSVOF method in the numerical simulation of the Al/Mg dissimilar FSW so as to improve the reliability and accuracy of the calculation.
Based on the two-phase incompressibility assumption, the non-conserved level set equation can be conserved: Set the diffusion coefficient and source term of the standard user defined scalar (UDS) equation in FLUENT to zero, and the UDS equation can be expressed as: As can be seen from the above, by returning the unsteady term and convection term without density by the Fluent user-defined function, Equation (18) can be converted to Equation (17) so that the solution of the UDS equation is the value of the level set function.
In the reinitialization equation, Equation (11), the steady-state solution of the equation, converges to |∇ϕ| = 1.The Godunov-Hamiltonian function is adopted to represent the gradient in the equation [28]: where a + = max(ϕ − x , 0), a − = min(ϕ − x , 0), b + = max(ϕ + x , 0) and b − = min(ϕ + x , 0), ϕ − x , and ϕ + x are the left and right derivatives in the X direction, respectively.The same method can be used to obtain c + − f − in the Y and Z directions.
At present, the fifth-order weighted essentially non-oscillatory (WENO) scheme is the most efficient and accurate computing scheme for solving spatial derivatives [29].The main idea of the fifth-order WENO scheme is that for a cell i, to calculate ϕ − x , six left-sided nodes in the X direction {ϕ i−3 , ϕ i−2 , ϕ i−1 , ϕ i , ϕ i+1 , ϕ i+2 } are selected to build the interpolation.Similarly, six right-sided nodes {ϕ i−2 , ϕ i−1 , ϕ i , ϕ i+1 , ϕ i+2 , ϕ i+3 } are selected to calculate ϕ − x .To find a neighbor cell in a given direction of a cell in FLUENT, we need to write a function to perform this manually.As shown in Figure 1, if we want to obtain the adjacent cell C i+1,j,k in the positive X direction of the cell C i,j,k , we need to connect the current cell center to all neighboring cell centers as vectors and then find the smallest angle between these vectors and the direction (1,0,0).The smallest angle-corresponding cell is the adjacent cell we need (Figure 1a).If the angle corresponds to the boundary surface, there is no adjacent cell (Figure 1b).By specifying different directions, adjacent cells in different directions can be obtained., , i j k C , we need to connect the current cell center to all neighboring cell centers as vectors and then find the smallest angle between these vectors and the direction (1,0,0).The smallest angle-corresponding cell is the adjacent cell we need (Figure 1a).If the angle corresponds to the boundary surface, there is no adjacent cell (Figure 1b).By specifying different directions, adjacent cells in different directions can be obtained., we set: When calculating ϕ − x , we set: Materials 2024, 17, 3014 6 of 21 When calculating ϕ + x , we set: The left and right spatial derivatives can be calculated from the following general formula: The weighted values w 1 , w 2 , and w 3 can be expressed as: where ϖ is a minimal empirical constant (ϖ = 10 −6 ), and S 1 , S 2 and S 3 are defined as: In a similar way, ϕ − y , ϕ + y , ϕ − z , and ϕ + z can be calculated.The first-order Euler method or the third-order Runge-Kutta method are usually used to solve the time derivative.Some researchers have shown that the results obtained by the first-order method are basically consistent with those obtained by the third-order method [20].Therefore, in order to save calculation time, the time term is calculated by the first-order Euler form: where n is the maximum iterations.The stable solution ϕ x, y, z, τ steady of the reinitialization equation will be used for the calculation at the next time.

Geometric Model
The base metals are 6061 Al alloy and AZ31B Mg alloy sheets, with sizes of 200 mm (length) × 65 mm (width) × 3 mm (height).The chemical composition of the base materials is listed in Table 1.The FSW tool is made of H13 steel, and the diameters of the shoulder, the pin root, and pin tip are 12 mm, 4.2 mm, and 3.2 mm, respectively.The Mg alloy is placed on the advancing side (AS) and the Al alloy on the retreating side (RS), and the welding process parameters are set as the rotating speed of 800 rpm and the welding speed of 50 mm/min.The geometric features of the tool, such as pin thread, tilt angle, and shoulder plunge depth, are ignored and the CFD model of the Al/Mg dissimilar alloy FSW process is established, as shown in Figure 2a.The ICEM CFD 16.0 software is used to generate grids on the workpiece, regardless of the tool that is considered to be a rigid body.Considering the complex interaction between the tool and the workpiece, a large mesh refinement is performed near the tool and the original Al/Mg interface (Figure 2b).The mesh size is defined as the average distance between the current cell center and all adjacent cell centers: where N f is the number of faces of the cell P, A f is the area vector of the face f, d f is the distance between the cell center and its adjacent cell center, and → n p is the normal vector at P, as shown in Figure 2c. is listed in Table 1.The FSW tool is made of H13 steel, and the diameters of the shoulder, the pin root, and pin tip are 12 mm, 4.2 mm, and 3.2 mm, respectively.The Mg alloy is placed on the advancing side (AS) and the Al alloy on the retreating side (RS), and the welding process parameters are set as the rotating speed of 800 rpm and the welding speed of 50 mm/min.The geometric features of the tool, such as pin thread, tilt angle, and shoulder plunge depth, are ignored and the CFD model of the Al/Mg dissimilar alloy FSW process is established, as shown in Figure 2a.The ICEM CFD 16.0 software is used to generate grids on the workpiece, regardless of the tool that is considered to be a rigid body.Considering the complex interaction between the tool and the workpiece, a large mesh refinement is performed near the tool and the original Al/Mg interface (Figure 2b).The mesh size is defined as the average distance between the current cell center and all adjacent cell centers:

Solution Algorithm
Figure 3 shows the calculation flow chart of the CFD model based on the CLSVOF method, and the detailed instructions are as follows: 1.
Open and initialize the UDS equation to solve the level set function; 2.
On the basis of the initial conditions or the value of the previous time step, initialize the physical quantities required to be solved, such as velocity, density, and level set function; 3.
Calculate relevant physical properties and store normal vector components, interface curvature, and other intermediate values; 6.
Add the interacting force between two phases in the form of the source term to the momentum equation, solve the governing equations, Equations ( 14)-( 16), and obtain an updated velocity field; 7.
Assign the initial value to the level set function according to the VOF function, and use Equation ( 11) to reinitialize the level set function; 8.
Go to the next time and repeat step 2-7.
2. On the basis of the initial conditions or the value of the previous time step, initialize the physical quantities required to be solved, such as velocity, density, and level set function; 3. Solve the VOF equation, Equation (6); 4. Solve the level set equation, Equation (10); 5. Calculate relevant physical properties and store normal vector components, interface curvature, and other intermediate values; 6. Add the interacting force between two phases in the form of the source term to the momentum equation, solve the governing equations, Equations ( 14)-( 16), and obtain an updated velocity field; 7. Assign the initial value to the level set function according to the VOF function, and use Equation ( 11) to reinitialize the level set function; 8. Go to the next time and repeat step 2-7.

Results and Discussion
Based on the CLSVOF method, the Al/Mg dissimilar alloy FSW process is numerically simulated, and the level set equation is solved by the transient model.Since the transient calculation takes a long time, a method combining steady state and transient state is proposed to save computing resources.Firstly, the multiphase steady-state laminar flow simulation based on the VOF method (VOF model) is carried out, and then the steadystate calculation results (velocity field, etc.) are used as the initial solution condition of level set equation to calculate the transient multiphysics field (CLSVOF model) during the dissimilar welding.When the calculation procedure is converged, the material flow and heat generation in the FSW process are extracted and analyzed.In the calculation, it is found that the level set function can reach the stable state quickly, and the transient simulation time is set to 8 s.
In the CLSVOF model, H(ϕ) in Equation ( 14) is used to represent the distribution of two materials.Figure 4 shows the material distribution calculated on different horizontal planes, where the dashed white line represents the shoulder edge and the solid white line represents the original Al/Mg abutting interface.It can be clearly seen that the Mg alloy at the AS flows to the Al at the RS and deposits at the trailing side (TS) of the tool.The maximum flow area is located near the shoulder and the flow area gradually decreases with the z-coordinate decreases.On the upper horizontal plane of the workpiece in Figure 4a, the Al alloy flows across the original abutting interface to the AS under the combined action of the shoulder and the pin, and the degree of Al/Mg bonding is better.On the lower horizontal planes of the workpiece in Figure 4b,c, the shoulder action is weakened and the pin's action is not enough to allow more Mg alloy to flow to the RS, so the flow range is narrowed.At the same time, the distance of Al alloy moving across the original abutting interface is also reduced, and it is difficult to form a good combination between the Al and Mg alloys, which is consistent with the fact that the defects often observed in the pin's affected zone.According to Equations ( 7) and ( 15), the distribution of materials will affect the physical properties of materials and then affect the heat generation and material flow in the welding process.The line Z = 2.5 mm is selected on the cross section in Figure 5, and the physical properties calculated by different models on the path are extracted, as shown in Figure 6.As can be seen from the figure, the calculated results of the VOF model vary greatly in the whole extraction region and the oscillations of the interface curvature are also obvious, which may adversely affect the stability of the calculation process, while the physical property curves calculated by the CLSVOF model are relatively smooth and vary greatly only near the interface.Figure 7 shows the temperature field on the workpiece predicted by different models.The results show that the temperature distribution is obviously asymmetrical due to the different materials on both sides of the tool.In general, the distribution of the two models is basically the same.The temperature at the AS is higher than that at the RS.Taking the tool axis as the center line, the temperature calculated by the CLSVOF model is slightly higher than that in the VOF model at the same radial position, especially at the RS.
Materials 2024, 17, x FOR PEER REVIEW 13 of 23 Figure 7 shows the temperature field on the workpiece predicted by different models.The results show that the temperature distribution is obviously asymmetrical due to the different materials on both sides of the tool.In general, the distribution of the two models is basically the same.The temperature at the AS is higher than that at the RS.Taking the tool axis as the center line, the temperature calculated by the CLSVOF model is slightly higher than that in the VOF model at the same radial position, especially at the RS.The variation in temperature has a significant effect on the material strain rate near the tool.Figure 8 shows the strain rate on the cross-section X = 0 mm.The closer to the pin root, the lower the strain rate of the materials.The strain rate increases gradually from the pin root to the pin bo om and the shoulder edge, reaching the maximum at the edge of the shoulder.This is because in the upper part of the workpiece, the material is subject to the combined action of the shoulder and the pin, and the material flow is more intense than that in the middle and lower part of the workpiece.At the same time, the higher The variation in temperature has a significant effect on the material strain rate near the tool.Figure 8 shows the strain rate on the cross-section X = 0 mm.The closer to the pin root, the lower the strain rate of the materials.The strain rate increases gradually from the pin root to the pin bottom and the shoulder edge, reaching the maximum at the edge of the shoulder.This is because in the upper part of the workpiece, the material is subject to the combined action of the shoulder and the pin, and the material flow is more intense than that in the middle and lower part of the workpiece.At the same time, the higher temperature promoting the material softening results in a smaller strain rate at the pin root, and the lower temperature and the larger material plastic deformation make the strain rate larger near the edge of the shoulder.With the decrease in the z-coordinate, the action of the shoulder is weakened, and the temperature and plastic deformation of the material are reduced, which affects the strain rate in the thickness direction.In order to be er describe the relationship between temperature and strain rate, three paths, L1, L2, and L3, are selected at the shoulder bo om and the pin side, where α is the included angle between the point of the tool axis and X positive direction, as shown in Figure 9a.And the temperature and strain rate on these three paths were extracted.In the shoulder affected zone in Figure 9b,c, the higher temperature near the pin causes the material to be sufficiently softened so that the strain rate of the material there is lower.With the distance away from the tool axis increasing, the temperature gradually decreases, while the strain rate changes in the opposite trend, and the material temperature and strain rate at the AS are greater than those at the RS.The thermal conductivity of the Mg alloy is lower than that of the Al alloy, and the material temperature flowing from the lead side (LS) of the tool to the RS is lower, so the material temperature at the AS is higher.The material is stretched from the AS to the RS by the shoulder action, and the material flow is stronger at the AS, so that the strain rate is also greater.Compared with the VOF model, the Al/Mg interface in the CLSVOF model is more concentrated, resulting in more Al alloy at the RS and more Mg alloy at the AS.Thus, the material temperature is higher at the RS and lower at the AS in the CLSVOF model.In the pin's affected zone in Figure 9d, the shear effect of the pin on the material is not as obvious as that of the shoulder, and the In order to better describe the relationship between temperature and strain rate, three paths, L1, L2, and L3, are selected at the shoulder bottom and the pin side, where α is the included angle between the point of the tool axis and X positive direction, as shown in Figure 9a.And the temperature and strain rate on these three paths were extracted.In the shoulder affected zone in Figure 9b,c, the higher temperature near the pin causes the material to be sufficiently softened so that the strain rate of the material there is lower.With the distance away from the tool axis increasing, the temperature gradually decreases, while the strain rate changes in the opposite trend, and the material temperature and strain rate at the AS are greater than those at the RS.The thermal conductivity of the Mg alloy is lower than that of the Al alloy, and the material temperature flowing from the lead side (LS) of the tool to the RS is lower, so the material temperature at the AS is higher.The material is stretched from the AS to the RS by the shoulder action, and the material flow is stronger at the AS, so that the strain rate is also greater.Compared with the VOF model, the Al/Mg interface in the CLSVOF model is more concentrated, resulting in more Al alloy at the RS and more Mg alloy at the AS.Thus, the material temperature is higher at the RS and lower at the AS in the CLSVOF model.In the pin's affected zone in Figure 9d, the shear effect of the pin on the material is not as obvious as that of the shoulder, and the temperature is not as high as that of the pin root, so the strain rate on the pin side is between that on the shoulder edge and that on the pin root.Material viscosity is closely related to temperature and strain rate, and temperatu plays a major role.Figure 10 shows the material viscosity distribution calculated different models.The temperature difference between the two models is mainly in high temperature region near the tool, while the higher temperature makes the mater viscosity near the tool the lowest in the whole region, so it is difficult to observe difference in the low viscosity region.A similar result for different models is that higher temperature and strain rate at the AS results in a larger low-viscosity region th that at the RS.
Figure 11 shows the material flow velocity on the Z = 2.7 mm and Z = 1.0 m horizontal planes.It is obvious that the velocity at the RS is greater than that at the A This is because the friction direction of the tool on the material at the AS is opposite to welding direction.When the tool moves forward, the friction impedes the material flo making the material flow slower, and the material flow at the RS is exactly opposite that at the AS.In the CLSVOF model, the higher temperature at the RS makes the mater flow velocity larger than the result of the VOF model.On the plane near the shoulder = 2.7 mm), due to the combined action of the shoulder and the pin, the flow range of material is larger.On the plane near the pin bo om (Z = 1.0 mm), the action of the should Material viscosity is closely related to temperature and strain rate, and temperature plays a major role.Figure 10 shows the material viscosity distribution calculated by different models.The temperature difference between the two models is mainly in the high temperature region near the tool, while the higher temperature makes the material viscosity near the tool the lowest in the whole region, so it is difficult to observe the difference in the low viscosity region.A similar result for different models is that the higher temperature and strain rate at the AS results in a larger low-viscosity region than that at the RS.  Figure 11 shows the material flow velocity on the Z = 2.7 mm and Z = 1.0 mm horizontal planes.It is obvious that the velocity at the RS is greater than that at the AS.This is because the friction direction of the tool on the material at the AS is opposite to the welding direction.When the tool moves forward, the friction impedes the material flow, making the material flow slower, and the material flow at the RS is exactly opposite to that at the AS.In the CLSVOF model, the higher temperature at the RS makes the material flow velocity larger than the result of the VOF model.On the plane near the shoulder (Z = 2.7 mm), due to the combined action of the shoulder and the pin, the flow range of the material is larger.On the plane near the pin bottom (Z = 1.0 mm), the action of the shoulder is weakened, and the flow range of the material only appears in a thin layer near the pin.The material flow velocity determines the material distribution in the welding process, which provides effective information on the formation of internal defects.The higher material velocity makes more Al alloy transfer into the Mg alloy, which contributes to the formation of an interlocking structure between Al and Mg and plays a positive role in the final weld performance.On the lower plane, the smaller material flow speed has a weak tensile/compression effect on the Al alloy, resulting in insufficient material flow, and defects are easily formed at these locations.Then the material flow streamlines are drawn on two horizontal planes and colored according to the strain rate, as shown in Figure 12.The plastic deformation region in the shear layer is determined by the isoline with strain rate of 2 s −1 and marked by the red dashed line.It can be clearly seen that the plastic deformation degree of the material in the shoulder's affected zone is much larger than that in the pin affected zone.In the CLSVOF model, the material at the LS has a larger strain rate.Under the action of the shoulder, the material is stretched at the AS and squeezed at the RS, the flow lines deflect, and the strain rate gradually decreases.When the strain rate reduces to a certain extent, the streamlines no longer deviate, and the material flows to the TS and deposits in the same transverse position.Then the material flow streamlines are drawn on two horizontal planes and colored according to the strain rate, as shown in Figure 12.The plastic deformation region in the shear layer is determined by the isoline with strain rate of 2 s −1 and marked by the red dashed line.It can be clearly seen that the plastic deformation degree of the material in the shoulder's affected zone is much larger than that in the pin affected zone.In the CLSVOF model, the material at the LS has a larger strain rate.Under the action of the shoulder, the material is stretched at the AS and squeezed at the RS, the flow lines deflect, and the strain rate gradually decreases.When the strain rate reduces to a certain extent, the streamlines no longer deviate, and the material flows to the TS and deposits in the same transverse position.

 
H  vary between 0 and 1 is taken as the Al/Mg interface calculated by the VOF and CLSVOF models, respectively.They are marked by blue and red dashed lines.Previous research [30] shows that on the horizontal section around the exit hole, the material is deposited behind the pin, but as long as it is still within the contour range of the shoulder, it will still be subjected to the thermal action from the shoulder, and the material will continue to flow.Only outside the contour range of the shoulder can the material stop flowing and complete the deposition process.Therefore, the calculation results outside the shoulder profile (Al/Mg bonding interface is basically stable) are compared with the experimental results.The CLSVOF model calculates more concentrated interface zone and could be er describe the Al/Mg bonding interface of the stable region.Although the Figure 13 shows macrographs of welds on different horizontal planes.The area around and behind the exit hole is selected for observation.It can be seen that from the top to the bottom of the workpiece, the degree of Al/Mg bonding interface is decreasing, and the distance Al alloy penetrates into the Mg alloy across the original abutting interface is smaller.There are a large number of Al/Mg interpenetration structures near the Al/Mg bonding interface, most of which are Al alloy strips in Mg alloy, and the bonding interface is zigzag.Therefore, the region where the volume fraction α Al and smoothing function H(ϕ) vary between 0 and 1 is taken as the Al/Mg interface calculated by the VOF and CLSVOF models, respectively.They are marked by blue and red dashed lines.Previous research [30] shows that on the horizontal section around the exit hole, the material is deposited behind the pin, but as long as it is still within the contour range of the shoulder, it will still be subjected to the thermal action from the shoulder, and the material will continue to flow.Only outside the contour range of the shoulder can the material stop flowing and complete the deposition process.Therefore, the calculation results outside the shoulder profile (Al/Mg bonding interface is basically stable) are compared with the experimental results.The CLSVOF model calculates more concentrated interface zone and could better describe the Al/Mg bonding interface of the stable region.Although the interface near the exit hole is not consistent with the experimental results, with the decrease in height of the horizontal plane, the Al/Mg interface is closer and closer to the exit hole, which is consistent with the change trend of the actual interface and can qualitatively describe the interface change around the exit hole to a certain extent.Similarly, the calculated results of the two models are compared with the metallographic structure of the joint in cross-section, as shown in Figure 14.It can also be seen that the more concentrated interface calculated by the CLSVOF model can be er describe the stable region of the Al/Mg bonding interface.In order to be er understand the material distribution near the tool, taking the material at a point M (−7, 0, 2.5) in the LS of the shoulder as an example, the material flow path is extracted.Different positions on the path represent different moments, and the initial position represents time t0.Six special times, t1-t6, were also selected, as shown in Figure 15a.Figure 15b shows the curve of material strain rate and temperature with time At time t1, the material does not deform, and from time t2, the material begins to deform plastically under the action of the shoulder ( ).With the increase in time, the temperature and strain rate increase, and the strain rate reaches the maximum at time t3 Subsequently, the strain rate began to decrease, and the temperature continued to rise and reached a peak at time t4.Then, the strain rate and temperature both decrease and the material plastic deformation ends at time t5 (  Figure 16 shows the material distribution on the horizontal plane Z = 2.5 mm a different times in Figure 15.In the initial stage of FSW, the Al alloy and Mg alloy are violently mixed under the action of high-speed rotation of the tool.And then the too moves along the welding direction, the material at the LS begins to deform at time t2, and the Mg alloy at the AS flows to the material at the RS under the shearing action of the tool Between time t3 and time t4, the higher strain rate and temperature make the plastic deformation of the material reach the maximum, and the Al alloy easily loses continuity a part of the material is migrated to the TS of the tool, and the other part of the material i In order to better understand the material distribution near the tool, taking the material at a point M (−7, 0, 2.5) in the LS of the shoulder as an example, the material flow path is extracted.Different positions on the path represent different moments, and the initial position represents time t 0 .Six special times, t 1 -t 6 , were also selected, as shown in Figure 15a.Figure 15b shows the curve of material strain rate and temperature with time.At time t 1 , the material does not deform, and from time t 2 , the material begins to deform plastically under the action of the shoulder ( .ε ≥ 2s −1 ).With the increase in time, the temperature and strain rate increase, and the strain rate reaches the maximum at time t 3 .Subsequently, the strain rate began to decrease, and the temperature continued to rise and reached a peak at time t 4 .Then, the strain rate and temperature both decrease and the material plastic deformation ends at time t 5 ( .ε < 2s −1 ).Afterwards, the material keeps flowing under the action of the shoulder and is deposited outside the profile of the shoulder at time t 6 .In order to be er understand the material distribution near the tool, taking the material at a point M (−7, 0, 2.5) in the LS of the shoulder as an example, the material flow path is extracted.Different positions on the path represent different moments, and the initial position represents time t0.Six special times, t1-t6, were also selected, as shown in Figure 15a.Figure 15b shows the curve of material strain rate and temperature with time.At time t1, the material does not deform, and from time t2, the material begins to deform plastically under the action of the shoulder ( ).With the increase in time, the temperature and strain rate increase, and the strain rate reaches the maximum at time t3.Subsequently, the strain rate began to decrease, and the temperature continued to rise and reached a peak at time t4.Then, the strain rate and temperature both decrease and the material plastic deformation ends at time t5 (  Figure 16 shows the material distribution on the horizontal plane Z = 2.5 mm at different times in Figure 15.In the initial stage of FSW, the Al alloy and Mg alloy are violently mixed under the action of high-speed rotation of the tool.And then the tool moves along the welding direction, the material at the LS begins to deform at time t2, and the Mg alloy at the AS flows to the material at the RS under the shearing action of the tool.Between time t3 and time t4, the higher strain rate and temperature make the plastic deformation of the material reach the maximum, and the Al alloy easily loses continuity, a part of the material is migrated to the TS of the tool, and the other part of the material is migrated near the pin and makes a downward spiral movement under the shear and extrusion of the pin.At the time t5, the material ends its deformation, but under the Figure 16 shows the material distribution on the horizontal plane Z = 2.5 mm at different times in Figure 15.In the initial stage of FSW, the Al alloy and Mg alloy are violently mixed under the action of high-speed rotation of the tool.And then the tool moves along the welding direction, the material at the LS begins to deform at time t 2 , and the Mg alloy at the AS flows to the material at the RS under the shearing action of the tool.Between time t 3 and time t 4 , the higher strain rate and temperature make the plastic deformation of the material reach the maximum, and the Al alloy easily loses continuity, a part of the material is migrated to the TS of the tool, and the other part of the material is migrated near the pin and makes a downward spiral movement under the shear and extrusion of the pin.At the time t 5 , the material ends its deformation, but under the thermal action of the tool, the material will still flow to a certain extent.Some materials flow to the TS with other materials and are deposited, and some plastic materials continue to move downward until the tool bottom, gradually forming a stable and continuous two-phase interface.
aterials 2024, 17, x FOR PEER REVIEW 21 of 23 thermal action of the tool, the material will still flow to a certain extent.Some materials flow to the TS with other materials and are deposited, and some plastic materials continue to move downward until the tool bo om, gradually forming a stable and continuous twophase interface.

Conclusions
1.The coupled level set and volume of fluid (CLSVOF) method is proposed and the method can not only maintain the conservation of mass but also accurately calculate the material physical properties near the interface.The material mixing and distribution in the Al/Mg dissimilar FSW are studied by using the CLSVOF method.
In the upper part of the workpiece, the distance of the Al alloy moving across the original abu ing surface is larger than that in the middle and lower part of the workpiece, and the degree of Al/Mg bonding is be er.
The coupled level set and volume of fluid (CLSVOF) method is proposed and the method can not only maintain the conservation of mass but also accurately calculate the material physical properties near the interface.The material mixing and distribution in the Al/Mg dissimilar FSW are studied by using the CLSVOF method.In the upper part of the workpiece, the distance of the Al alloy moving across the original abutting surface is larger than that in the middle and lower part of the workpiece, and the degree of Al/Mg bonding is better.2.
A comparative analysis is conducted on the heat transfer and material flow in the Al/Mg dissimilar FSW process by using the VOF model and CLSVOF model.The heat transfer and material flow play important roles on the mechanical locking between Al and Mg alloys.At the lower part of the workpiece, low heat and poor material fluidity result in weak bonding, making it easy for defects to occur there.

3.
In order to verify the accuracy of the model, the predicted weld morphologies are compared with the experimental results.The CLSVOF model calculates a more concentrated interface zone and could better describe the Al/Mg bonding interface in the stable region.4.
The transient change process of the material near the tool is predicted.Under the severe action of the tool, the Al alloy easily loses continuity.A part of the material is deposited behind the tool and the other part is migrated near the pin and makes a downward spiral movement until the tool bottom under the shear and extrusion of the pin.Finally, a stable continuous two-phase interface is formed.

m
the flow velocity of Mg alloy, ρ Mg is the density of Mg alloy, and .m AlMg and .MgAl are the mass transfer from Al to Mg and from Mg to Al in unit volume and in unit time, respectively.
the positive X direction of the cell

Figure 1 .
Figure 1.Diagram of the current cell and its adjacent cell, where the yellow cell represents the current cell, the red cell represents its adjacent cell and the blue cell represents the other cell.(a) Internal cell and (b) boundary cell.

Figure 1 .
Figure 1.Diagram of the current cell and its adjacent cell, where the yellow cell represents the current cell, the red cell represents its adjacent cell and the blue cell represents the other cell.(a) Internal cell and (b) boundary cell.

N
where f is the number of faces of the cell P, f A  is the area vector of the face f, f d is the distance between the cell center and its adjacent cell center, and p n  is the normal vector at P, as shown in Figure 2c.

Figure 2 .
Figure 2. Geometric model and mesh generation.(a) Geometric model, (b) mesh near the tool, and (c) parameters related to mesh size.

Figure 2 .
Figure 2. Geometric model and mesh generation.(a) Geometric model, (b) mesh near the tool, and (c) parameters related to mesh size.

Figure 3 .
Figure 3.The calculation flow of CFD model based on CLSVOF method.Figure 3. The calculation flow of CFD model based on CLSVOF method.

Figure 3 .
Figure 3.The calculation flow of CFD model based on CLSVOF method.Figure 3. The calculation flow of CFD model based on CLSVOF method.

Figure 5 .
Figure 5.The material distribution calculated by different models on the cross-section of workpiece.X = 0 mm.(a) VOF and (b) CLSVOF.

Figure 5 .
The material distribution calculated by different models on the cross-section of workpiece.X = 0 mm.(a) VOF and (b) CLSVOF.

Figure 6 .
Figure 6.Physical property curves near the interface calculated by different models.(a) Density, (b) thermal conductivity, (c) heat capacity, and (d) interface curvature.

Figure 6 .
Figure 6.Physical property curves near the interface calculated by different models.(a) Density, (b) thermal conductivity, (c) heat capacity, and (d) interface curvature.

Figure 7 .
Figure 7.The calculated temperature field at the cross-section X = 0 mm and tool/workpiece interface for different models.(a) VOF and (b) CLSVOF.

Figure 7 .
Figure 7.The calculated temperature field at the cross-section X = 0 mm and tool/workpiece interface for different models.(a) VOF and (b) CLSVOF.

Figure 8 .
Figure 8.The material strain rate at cross-section of workpiece X = 0 mm.(a) VOF and (b) CLSVOF.

Figure 10 .
Figure 10.Material viscosity distribution on the transverse cross-section X = 0 mm and longitudinal cross-section Y = 0 mm.(a) VOF and (b) CLSVOF.

Figure 12 .
Figure 12.Material flow streamlines on the Z = 2.7 mm and Z = 1.0 mm horizontal planes, where blue arrows represent the material flow direction and red dashed lines represent the plastic deformation regions.(a) VOF, (b) CLSVOF, (c) VOF, and (d) CLSVOF.

Figure 13
Figure 13 shows macrographs of welds on different horizontal planes.The area around and behind the exit hole is selected for observation.It can be seen that from the top to the bo om of the workpiece, the degree of Al/Mg bonding interface is decreasing, and the distance Al alloy penetrates into the Mg alloy across the original abu ing interface is smaller.There are a large number of Al/Mg interpenetration structures near the Al/Mg bonding interface, most of which are Al alloy strips in Mg alloy, and the bonding interface is zigzag.Therefore, the region where the volume fraction Al  and smoothing function

Figure 12 .
Figure 12.Material flow streamlines on the Z = 2.7 mm and Z = 1.0 mm horizontal planes, where blue arrows represent the material flow direction and red dashed lines represent the plastic deformation regions.(a) VOF, (b) CLSVOF, (c) VOF, and (d) CLSVOF.

Materials 2024 ,
17, x FOR PEER REVIEW 19 of 23 decrease in height of the horizontal plane, the Al/Mg interface is closer and closer to the exit hole, which is consistent with the change trend of the actual interface and can qualitatively describe the interface change around the exit hole to a certain extent.

Figure 13 .
Figure 13.Macroscopic metallographic diagrams of weld on different horizontal planes, where the blue and red dashed lines are used to mark the Al/Mg interface calculated by the VOF and CLSVOF models, respectively.(a) Z = 2.7 mm, (b) Z = 2.0 mm, and (c) Z = 1.0 mm.

Figure 13 .
Figure 13.Macroscopic metallographic diagrams of weld on different horizontal planes, where the blue and red dashed lines are used to mark the Al/Mg interface calculated by the VOF and CLSVOF models, respectively.(a) Z = 2.7 mm, (b) Z = 2.0 mm, and (c) Z = 1.0 mm.Similarly, the calculated results of the two models are compared with the metallographic structure of the joint in cross-section, as shown in Figure14.It can also be seen that the more concentrated interface calculated by the CLSVOF model can better describe the stable region of the Al/Mg bonding interface.

Figure 14 .
Figure 14.Metallographic structure of the joint in cross section (X = 30 mm).
, the material keeps flowing under the action of the shoulder and is deposited outside the profile of the shoulder at time t6.

Figure 15 .
Figure 15.Material flow path (a) and its temperature and strain rate changes at point M (b), where the green line is the flow path and the blue dashed line is the shoulder edge.

Figure 14 .
Figure 14.Metallographic structure of the joint in cross section (X = 30 mm).

Figure 14 .
Figure 14.Metallographic structure of the joint in cross section (X = 30 mm).
, the material keeps flowing under the action of the shoulder and is deposited outside the profile of the shoulder at time t6.

Figure 15 .
Figure 15.Material flow path (a) and its temperature and strain rate changes at point M (b), where the green line is the flow path and the blue dashed line is the shoulder edge.

Figure 15 .
Figure 15.Material flow path (a) and its temperature and strain rate changes at point M (b), where the green line is the flow path and the blue dashed line is the shoulder edge.
2. A comparative analysis is conducted on the heat transfer and material flow in the Al/Mg dissimilar FSW process by using the VOF model and CLSVOF model.The heat transfer and material flow play important roles on the mechanical locking between Al and Mg alloys.At the lower part of the workpiece, low heat and poor material fluidity result in weak bonding, making it easy for defects to occur there.3.In order to verify the accuracy of the model, the predicted weld morphologies are compared with the experimental results.The CLSVOF model calculates a more concentrated interface zone and could be er describe the Al/Mg bonding interface in the stable region.4. The transient change process of the material near the tool is predicted.Under the severe action of the tool, the Al alloy easily loses continuity.A part of the material is deposited behind the tool and the other part is migrated near the pin and makes a downward spiral movement until the tool bo om under the shear and extrusion of the pin.Finally, a stable continuous two-phase interface is formed.