Experimental, Computational, and Machine Learning Methods for Prediction of Residual Stresses in Laser Additive Manufacturing: A Critical Review

In recent decades, laser additive manufacturing has seen rapid development and has been applied to various fields, including the aerospace, automotive, and biomedical industries. However, the residual stresses that form during the manufacturing process can lead to defects in the printed parts, such as distortion and cracking. Therefore, accurately predicting residual stresses is crucial for preventing part failure and ensuring product quality. This critical review covers the fundamental aspects and formation mechanisms of residual stresses. It also extensively discusses the prediction of residual stresses utilizing experimental, computational, and machine learning methods. Finally, the review addresses the challenges and future directions in predicting residual stresses in laser additive manufacturing.


Introduction
Laser Additive Manufacturing (AM) is an emerging technology that employs focused laser beams to create complex geometries from a digital model, doing so layer by layer.This process offers unparalleled design freedom, rapid prototyping, and the ability to create internal structures [1].Various techniques exist within additive manufacturing, each with unique applications and material compatibility.Laser Powder Bed Fusion (LPBF) is widely used in producing intricate parts and is ideal for materials like metal and plastic.Wire-Directed Energy Deposition (W-DED) involves the use of wire feedstock, offering benefits in terms of material usage and build rate.Powder-Directed Energy Deposition (P-DED) uses powder feedstock and is better suited for repair applications or multi-material layering [2].
Laser additive manufacturing is also associated with various defects and disadvantages, such as lack of fusion, porosity, low surface finish, and dimensional tolerance.The formation of residual stresses during AM processes raises very critical issues, as it can lead to delamination, cracking, and early failure in AM parts [3,4].Figure 1 shows various instances of part failure due to residual stress formation.Figure 1a-d shows cracking [5], whereas Figure 1e,f show delamination and distortion of AM parts, respectively [6,7].Residual stresses in AM result from uneven cooling rates and thermal gradients during material deposition and solidification [8].Residual stresses and distortion in AM can undermine part quality and integrity, posing significant challenges such as decreased fatigue strength, shrinking, and bending [9][10][11].Potential applications of metal additive manufacturing include the manufacturing of complex free-form part designs and customization in aerospace [12][13][14], automotive [15], and biomedical applications [16].Due to the critical nature of these applications, defects in AM parts could even lead to fatality.Residual stresses, in part, if not accounted for, can cause early failure during service, leading to detrimental effects on various stakeholders.Thus, these issues must be carefully researched and managed in the AM process.Residual stresses naturally reach an equilibrium state, encompassing tensile residual stresses, which are often seen as detrimental, and compressive residual stresses, which are typically considered beneficial [18].In AM, residual stresses manifest in the following three distinct types: Type I, macro-residual stresses, occur at a scale encompassing multiple grains; Type II, micro-residual stresses, develop within a single grain due to microstructural transformations; Type III, sub-micro-residual stresses, emerge within a few atomic units of the grain, influenced by factors like crystalline vacancies and dislocations [19], as shown in Figure 2. Understanding the impact of residual stresses on part quality underscores the significance of both measuring and predicting residual stresses.This article provides an overview of various residual stress measurement methods, encompassing destructive, semi-destructive, and non-destructive techniques.Given the constraints of time and cost associated with experimental measurement, computational methods have gained popularity in recent years for predicting residual stresses prior to manufacturing.To enhance the versatility and control of computational approaches, analytical methods have also become increasingly prevalent.Moreover, statistical methods and machine learning have found applications in this research field, contributing to the efficiency of residual stress prediction.
The aim of this review is to provide readers with a comprehensive overview of current techniques and knowledge related to predicting residual stresses in additive manufacturing (AM) parts.The subsequent sections cover the fundamentals of residual stress and its formation, as well as the measurement and prediction of residual stresses using experimental, computational, analytical, and machine learning methods.Following this discussion, the authors outline several future research trends in this field.

Basics of Residual Stress and Its Formation
Residual stresses in laser additively manufactured parts can be categorized in three forms, as shown in Figure 3 [17,20].The first phenomenon, known as the Thermal Gradient Mechanism (TGM), begins with localized heating and eventually creates a molten pool on the metal, while the remaining part of the metal plate maintains a normal temperature.This molten pool generates an expanding force due to its higher temperature, attempting to bend the plate outward.This localized bending often exceeds the elastic region of the part, causing plastic deformation [21].The second stage, which is the cool-down phase (CDP) mechanism, involves the cooling of the molten pool.As the melted material tries to solidify, it contracts inward, causing the surrounding material to compress along with it, resulting in an inward distortion of the metallic plate.The solid-state phase transition mechanism involves multiple phase transitions during the solidification process [22].Depending on the cooling rate of certain materials, the ultimately solidified material may not have the same phase as it initially started with, resulting in the formation of residual stresses [23].This review exclusively focuses on residual stress formation due to the first two mechanisms, namely TGM and CDP.
Throughout the AM process, no external forces are applied; instead, all the stresses that arise stem from the laser heat source [24].In simpler terms, residual stresses encompass the forces that persist within the deposit and substrate, even after all external operations are finished.These residual stresses can be the reason for the generation of strain and, consequently, deformation [25].To determine whether these residual stresses surpass acceptable limits and could potentially result in distortion or part failure, various failure criteria must be satisfied.In many instances, stress components, maximum principal stress, and von Mises criteria are examined to assess part qualification [26].Envisioning a single point within a 3D cube that is undergoing stresses, we can classify them into normal stresses and shear stresses, known as stress tensors.In Figure 4, certain tensor components are illustrated; these components play a pivotal role in comprehending each stress type on any plane, as expressed in Equations ( 1)-(3).The symbol σ is normal stress, and τ is shear stress, as shown in follow equations.In Figure 5, materials IN718 and Ti64 use similar process parameters, i.e., a scan speed of 15 mm/s and laser power of 250 W. It was observed that for Ti64, the melt pool dimensions were larger as compared to IN718, creating more residual stresses in their respective directions [27].
Newkirk et al. conducted a numerical analysis by depositing 304 L using L-DED with three layers arranged in a zig-zag fashion, utilizing a laser power of 607 W and a scan speed of 250 mm/min.They also predicted the residual stresses [24].Figure 6 illustrates the directional stresses forecasted by Abaqus CAE.It is noticeable that the majority of the tensile stresses occur in the longitudinal direction, possibly due to the cooling phase in the molten layers.During the solidification process, the remelted lower layers solidify, creating tensile stress due to restrictions imposed by the lower materials or previously solidified material.Although the stress tensor explains the evolution of stresses in the respective directions, it is still essential to establish fail-safe criteria.Typically, for brittle materials, the maximum principal stress failure criterion is considered [28].Three different variants of principal stress help understand the fracture location of the final part.The relationship between principal stress and the stress tensors in two dimensions is explained in Equation ( 4) [29].
Li et al.
[26] conducted a numerical analysis using a square substrate with a single layer to compare different scan strategies with the same process parameters.They concluded that a longer scan path would result in more residual stresses.Consequently, the spiral scan, with the longest track length, exhibited the highest principal stresses, while the S-scan type displayed the lowest principal stresses, as depicted in Figure 7 [26].
Having a failure criterion that addresses ductile materials is crucial because relying solely on the Maximum Principal Theory is inadequate for predicting the yield limit.The Maximum Distortion Energy Theory, also known as the von Mises criteria, asserts that yielding occurs when the combination of stress tensors surpasses the material's yield point, as demonstrated in Equation ( 6) [29].Denlinger et al. conducted experiments on Ti64 and Inconel 625, utilizing identical process parameters but varying the interlayer dwell time from 0 to 40 s.They observed that increasing the dwell time led to an upsurge in von Mises stress for Ti64, while the opposite held true for Inconel 625 [30].The variation in residual stresses between these two materials can be attributed to their structural distinctions [31].Inconel maintains a face-centered cubic structure and does not undergo solid-state transformation, whereas Ti64 undergoes a two-phase (alpha-beta) allotropic solid-state transition [32].In a related study, Lan Li et al. conducted experiments and numerical analyses to repair two geometries (V and rectangle-shaped), using powder DED technology with the same process parameters.It was noticed that more energy was transmitted in the rectangle shape, as it had a larger area to be deposited at the bottom, consequently exhibiting higher von Mises stresses, as shown in Figure 8.It was concluded that using a rectangle shape for repairs could lead to delamination as a result of exceeding the yield limit for Ti64 [33].

Experimental Method
Residual stresses in AM parts are often measured using various experimental methods [34].Over the years, numerous researchers have worked on residual stresses measurement of traditionally manufactured parts [35].Residual stress formation in welded joints has been well explored using various experimental methods [36,37].These experimental methods are also utilized for RS measurement of AM parts.Most of these methods have been extensively studied and are well developed for practical applications [38].This section provides a brief overview of the experiment-based RS measurement methods followed by a discussion of their capabilities and comparison for AM parts.
As direct measurement of residual stresses in a manufactured part is not possible, measurement techniques often measure the strain or deformation of the final part and compare it with a non-stressed reference state [39,40].Variation in the strain or material property can be correlated to the residual stress through established formulations such as Hooke's law.These methods can be broadly classified into three categories, namely destructive, semi-destructive, and non-destructive methods.In destructive methods, a specimen completely loses its integrity as it is subjected to irreversible, macro-level alterations and cannot be used for its intended applications [41].Some of the destructive methods include the contour method, hole drilling, the deep hole technique, etc. Non-destructive techniques such as the ultrasonic method and the Barkhausen noise method retain the integrity of the specimen after testing [42].They analyze the variation of the material property in the stressed state to compute the stress values [43].Semi-destructive methods can retain the integrity of the specimen to a certain extent but often lead to surface defects and micro-damage to the part, either during sample preparation or during the testing process [44].X-ray diffraction and nanoindentation are examples of this category.Due to micro defects and damage, specimens are often discarded for critical applications.Figure 9 shows the classification of various experiment-based residual stress measurement methods, including destructive, semi-destructive, and non-destructive methods.

Destructive Methods
Destructive methods are often referred to as mechanical methods because they involve a stress relaxation procedure, and their fundamental principles of operation are similar.The presence of residual stresses in a part results in a distortion from the initial geometry and material removal from the part, which can lead to the relaxation of these stresses, followed by deformation to the initial geometry.Measurement of the magnitude and direction of this deformation can be correlated to the residual stress values of the part [41].The most common examples of these destructive methods are detailed below.

Slitting Method
The slitting method is used to determine the variation of residual stresses along the specimen thickness from the surface.As the name suggests, a thin slit or groove is made on the top surface, and the resulting strain relaxation is measured using strain gauges.The process is repeated with incremental increases in the depth of the slit [45].Recorded strain data are used to map the stress profiles perpendicular to the cut surface using elasticity theory.The cutting method should not induce additional heating of the sample, which could release the stresses.

Contour Method
The contour method also employs material removal for a stress relaxation procedure.In this method, a specimen is cut along the section where the stress has to be measured.Wire EDM is often used to ensure a that flat, ideal plane is obtained after cutting the contour.Relaxation and redistribution of the residual stress cause the contour to deform.The external reverse stress required to reinstate the plain state of the contour before cutting is calculated using simulation models.This external stress is considered equivalent to the residual stresses acting perpendicular to the cut surface [46].The repeatability of this method for RS measurement is the same as or better than that of other methods [47].

Hole-Drilling Method
Hole drilling is a very common and fast method used to obtain a 2D stress distribution.This method involves drilling a hole in the specimen surface and measuring the strain due to stress relaxation using strain gauges.It has excellent repeatability and is backed by the ASTM E837 standard [9].The accuracy of the process depends on the quality of the drilling process.

Ring Core Method
The ring core method can be thought of as a reversal of the hole-drilling method.In hole drilling, a hole is created, and the surrounding material on the outside is allowed to expand.However, in this method, a ring is machined, and the cylindrical specimen inside the hollow ring is allowed to deform, followed by strain measurements and RS calculations.This method offers larger surface strains but degrades the specimen significantly [9].

Deep Hole Method
The deep hole method is a combination of the hole-drilling and ring core methods.The experimental procedure for this method begins with drilling a hole through the height of the sample.The diameter of this hole is accurately measured, followed by drilling a ring around it.This results in the deformation of the core material between the ring and the hole, changing the diameter of hole.This variation is used to calculate the stresses.All these methods are useful in hybrid manufacturing scenarios when there is a requirement to machine a hole in an additively manufactured part [45].

Semi-Destructive Methods
Semi-destructive methods employ either stress relaxation or material property comparison to determine the residual stresses.They do not destroy the specimen completely but often result in surface defects and sub-surface damage, which could potentially affect the performance of the part in critical applications such as the aerospace or biomedical fields.

X-ray Diffraction
XRD is one of the most popular and widely used residual stress measurement methods.It is based on the variation of lattice spacing or inter-planar distance.Crystal lattices have characteristics of inter-planar distance during the unstressed state.An X-ray beam incident on the specimen surface is diffracted and captured by a detector at different reflective angles [48,49].The lattice spacing of the specimen can be calculated using Bragg's law.The change in the inter-planar spacing can be used to calculate the elastic strain, which can be utilized to calculate the magnitude and direction of residual stresses, provided the elastic properties of the material are known [50].Different methods are utilized to extract the stress values from the diffraction readings, such as the sin2 method and the cos method [51,52].
Even though the operating mechanism of the XRD method does not cause any material destruction, the success of the method depends on the surface finish of the specimen.Sample preparation for XRD often involves surface polishing to obtain a micron-level surface finish, which can affect the residual stresses of the sample.Also, X-rays can penetrate to only few microns (<30 µm) [46].Hence, to map the stress state of the material, layer-bylayer material removal is required, which destroys the specimen.High-energy synchrotron X-rays can be used to analyze Type III stress with nanometer-level penetration [53].XRD combined with ion beam milling can be utilized to measure residual stresses [44,54].However, the very high cost and scarcity of research facilities make it almost unavailable for most applications.

Neutron Diffraction
Neutron diffraction is a method similar to XRD, employing the same principle for RS measurement.However, as the source irradiation is a neutron, it can penetrate into deeper sections, ranging from 25 mm for steel to 100 mm for aluminum.However, the availability of neutron diffraction equipment is very limited.Neutron diffraction can also employ the time-of-flight method to find the variation in lattice spacing for poly-crystalline materials.The time taken by the incident beam to be detected can be correlated to the lattice spacing.In this method, the incident angle and rotation angle are kept constant, but pulsed incident beams of different wavelengths are used [9].

Nanoindentation
Nanoindentation utilizes the variation in localized hardness and elastic properties due to the presence of residual stresses.In this method, an indentation is made on the specimen surface at the nano scale.Tensile residual stresses allow for a larger contact area and deeper penetration, whereas compressive RS inversely affects the indentation.This method can be utilized to map the localized variation in AM samples but is limited to surface levels [46].

Non-Destructive Methods
Non-destructive methods maintain the integrity of the specimen or part, thus making it available for the intended use even after measurement.These methods compare a specific material property of the stressed part with a non-stressed reference state.Hence, no material removal is required for these methods.

Ultrasonic Method
The ultrasonic method utilizes the acoustoelastic effect; the presence of applied or residual stresses in a solid varies the propagation characteristics of an acoustic wave.Compared to other non-destructive methods, the ultrasonic method can measure deeper stresses in the sample [55].However, knowledge of acoustoelastic coefficients that define the linear relationship between stress and ultrasonic velocity is required prior to testing.Also, the change in ultrasonic velocities for each MPa of stress is very low (0.001%), which necessitates highly accurate measurement systems [53].

Barkhausen Noise Method
The BNM is a non-destructive method applicable to ferromagnetic materials that can be magnetized.It is based on magneto-elastic interaction, where the elastic properties vary with the domain and magnetic property of the specimen [56].Barkhausen noise, defined as the variation in electrical pulses induced in a coil due to a jump in the magnetic force field of the specimen when small-order magnetic domains are aligned parallel to the applied magnetic field, is analyzed for RS characterization [45].Due to magneto-elastic interaction, for positive magnetic anisotropic materials such as iron, steels, and cobalt, compressive stresses tend to decrease Barkhausen noise intensity, whereas tensile stresses increases it [57].
BNM is also influenced by the microstructure of the specimen.Hence, initial calibration is highly significant in obtaining accurate results using this method [56].This feature limits the the application of the BNM for AM parts, as the microstructure is highly non-homogeneous.

Comparison of Different Methods for AM Parts
Various methods used for measuring residual stresses were discussed previously.This section compares the discussed methods based on their advantages and limitations in measuring residual stresses in AM parts.Non-destructive methods are often preferred for AM parts, as they maintain the integrity of the part.However, RS measurement using non-destructive methods is associated with a lack of accuracy and difficulty in the experimental setup.Semi-destructive methods such as X-ray diffraction are widely utilized and are sometimes considered non-destructive.However, in reality, measurement using these methods depends on sample preparation and the dimensional limitations of the equipment [58].Preparation of samples for XRD or neutron diffraction causes irreversible damage to the specimens, making these methods semi-destructive.Some of the widely used RS measurement methods are destructive or semi-destructive techniques.These are more mature technologies and can provide accurate, repeatable results.Additively manufactured parts lack repeatability compared to their conventional counterparts [59].As a result, the standard testing procedure of randomly selecting a few specimens from a batch and extending the test results to the entire batch does not fit well [60].Moreover, due to the intricate designs and high costs associated with producing AM parts, it is crucial to avoid any testing methods that could damage the parts' structural integrity.This presents a decision-making scenario while choosing a method for measuring residual stresses, with benefits and disadvantages of different methods to be considered.Table 1 provides a summary of this comparison.Figure 10 provides an approximate map of the spatial resolution, penetration depth, and type of stress measured by various methods.

Governing Equations of AM Processes
As discussed earlier, the formation of residual stresses in additive manufacturing (AM) parts is attributed to the laser heat source during both the heating and cooling processes.Therefore, this section can be divided into the following two parts: (1) thermal equations and (2) mechanical Equations.

Thermal Model
The temperature distribution within a body, characterized by density (ρ) and specific heat (C), can be calculated by incorporating Fourier's law of conduction, as shown in Equation ( 7) [24].
In this equation, T represents temperature, t stands for time, k denotes thermal conductivity within the respective frame of reference, and Q represents internal heat generation.To solve this equation, proper initial and boundary conditions are necessary, as discussed below.
Various heat source models have been employed, and they can be essentially categorized into two types based on whether they use surface or body heat flux.Surface heat flux equations involve 2D heat flux that can be applied to the surface.A few examples include uniform heat sources, concentrated heat sources, and 2D Gaussian heat sources.The most commonly used body heat flux is Goldak's double ellipsoidal heat source, as shown in Equation (8) [61].
where P is power in Watts; η is the absorption co-efficient; a, b, and c are the width, depth, and length of the 3D Gaussian curve, respectively; and x, y, and z are the axes of the coordinate system, where the heat source moves in the z direction with respect to time (t) and velocity (V s ) [62].
During the additive manufacturing (AM) process, heat loss occurs through several methods, including convection and radiation.Among these, convection is a significant source of heat loss [63].Convection mechanisms can be categorized as either free/natural or forced.Natural convection, which occurs when fluid or air movement is driven solely by buoyancy forces arising from temperature variations without external mechanical assistance, typically has values ranging from 5 to 15 W/m 2 C [64].The measurement of free convection can be readily accomplished using either the lumped capacitance method or analytical techniques [65].Forced convection happens when air/fluid moves due to external force.This phenomenon can be experienced by the melt pool due to shielding and the carrier gas of powder during deposition.Things get even more complex when deposition arms or fixtures are moving in different directions to perform 3D deposition; hence, this is difficult to measure and requires a wide range of experimentation [62].In various literature reports, the peak of its value ranges from 40 to 120 W/m 2 C [66].In some literature, this value was approximated as 18 W/m 2 C to obtain accurate results for thermal analysis [30].For LPBF, it was observed that a forced convection value in the range of 5-20 W/m 2 C produced accurate models [67].
Heat loss due to radiation can be calculated using the Stephen-Boltzman law, as shown in Equation (9) [62].
where ϵ is emissivity, σ is Stephen Boltzmann's constant, and T s and T ∞ represent the surface and room temperature, respectively.Sometimes, the above-mentioned loss of heat can be considered as a combined heat loss, as shown in Equations ( 10) and (11).
where h f ree , h f orced and h radiation are the coefficients of free, forced, and radiation heat transfer, respectively, and q conv is heat loss due to convection.

Mechanical Model
The one-way or weakly coupled solution involves utilizing thermal data calculated in the preceding section to compute residual stresses in an additively manufactured part.For mechanical calculation, Equation ( 12) [66] serves as the equilibrium equation.

∇ •
where σ is the stress tensor and b is body forces.A relationship is required to obtain information on stress and strain; hence, Equation ( 13) is used for that purpose.
where ϵ e is elastic strain and C is the fourth-order stiffness of the material [66].In this process, residual stress forms due to strain induced by thermal or mechanical factors.When we expand these terms in the form of Equation ( 14), it appears as follows [24]: where ϵ E ij is strain due to elasticity, ϵ P ij is due to plasticity, ϵ T ij is due to thermal strain, ϵ ∆V ij is due to volumetric change because of plastic transformation, and ϵ Trp ij is due to solid-state transition.ϵ Trp ij and ϵ ∆V ij are due to solid-state phase transformation and are not discussed here so can be ignored for the purposes of this study.

Numerical Modeling Using FEA
To conduct numerical analysis, the governing equations are transformed into their weak form through the Galerkin method.The nodal values obtained from this weak formulation can then be employed to extract thermal data.The computation of thermal values first, followed by subsequent derivation of mechanical or stress values based on them is referred to as the one-way or decoupled method or the sequential method.This approach assumes that the mechanical model does not affect the thermal model [68].One of the advantages of employing this method is that it reduces computational time compared to the coupled method.The partial differential equation of thermal analysis is parabolic to solve for thermal history, whereas for mechanical analysis it is of a quasi-static nature and is elliptical [62].
The addition of material can be mimicked using various methods, which include quiet activation, inactive activation, and hybrid activation.
The quiet-element method involves introducing elements representing metal deposition regions initially and assigning properties to minimize their impact.In heat transfer analyses, thermal conductivity (k) is reduced to limit conduction, and specific heat (Cp) is adjusted for energy transfer.This approach is easy to implement, maintaining a constant number of equations without the need for renumbering or solver initialization.However, inappropriate scaling factors can lead to errors from energy conduction or ill-conditioned Jacobians.In modeling additive manufacturing, where most of the domain consists of quiet elements, this method may result in lengthy computations [62].
The inactive-element method removes elements representing metal deposition regions from the analysis, focusing solely on nodal degrees of freedom for active elements.This approach avoids errors or ill-conditioning from scaling factors and results in smaller algebraic systems during Newton-Raphson linearization.However, it is less adaptable to general-purpose commercial codes, requiring repeated equation numbering and solver initialization when elements are activated and potentially introducing artificial energy when shared nodes have different initial temperatures [62].
The hybrid-element activation strategy was introduced as an enhancement over the quiet and inactive methods.Initially, elements are set as inactive, but they are gradually transitioned layer by layer to quiet, then to active, based on heat input.This approach minimizes equation numbering and solver initialization, leading to faster computations with comparable results [69].

Analytical Method
The analytical solution is the one that uses partial differential equations to solve for exact solutions.For example, a 1D governing equation that includes conduction and convection can be written as Equation (15) [62].

−k
After solving the above differential equation for temperature, Equation ( 16) is obtained, where L is the length of the plate, T L is the temperature on that plate, and the remaining variables bear the same meanings as above.This method can not only be used to solve for temperature values of the 1D system but can also be used to verify the FE code to observe the error [62].Ning et al. conducted analytical modeling to solve for thermal stresses, as shown in the equations below [70,71].
where the above-mentioned thermal stresses (σ) are calculated using Green's function (G).Khan et al. [72] conducted analytical modeling and compared their results of residual stress prediction with the numerical method, as shown in Table 2. Numerous studies have employed modeling techniques, utilizing both numerical and analytical methods, to calculate residual stresses in laser additive manufacturing, as presented in Table 3.  * Unspecified in the original source.

Machine Learning Method
The aforementioned reviews essentially show that the results of residual stresses calculated through computational methods are accurate and reliable.However, computational efficiency remains a significant challenge [86].In order to facilitate the industrialization of additive manufacturing, it is crucial to create process simulation models capable of quickly forecasting the quality of parts.To address this issue, researchers have attempted to reduce the computation time by employing statistical methods and machine learning [87].
Machine learning techniques are basically the data-driven methods for predicting the values that researchers expect.By using machine learning techniques to predict residual stresses and distortions, knowing what factors may affect the prediction is not mandatory but beneficial for collecting datasets and features for the training of machine learning models [88].In the context of additive manufacturing, the intricate interplay of process parameters such as laser power, scanning speed, dwell time, building direction, and scanning strategy plays a pivotal role in influencing the formation of residual stresses within manufactured components [89,90].Higher laser power, for instance, can increase the temperature gradient between melted and solidified layers, leading to significant thermal stresses that cool and contract differently across the part [91][92][93][94].Conversely, scanning speed affects the heat input and cooling rates, where faster speeds may reduce the overall heat input and lead to uneven cooling rates, potentially increasing the likelihood of residual stress formation, as shown in Figure 11 [95,96].Adjusting these parameters is crucial for managing thermal gradients and minimizing the internal stresses that can compromise the structural integrity and dimensional accuracy of 3D-printed parts.
Furthermore, dwell time, the delay between subsequent scans, and the building direction are critical factors affecting residual stress levels [30,58,97].A longer dwell time allows for more heat dissipation into the surrounding material, potentially reducing thermal gradients but also increasing the risk of unwanted thermal effects if not carefully controlled [98,99].The building direction influences the layer-by-layer construction of the part, with vertical or angled building directions affecting how heat accumulates and dissipates through the structure [100][101][102][103][104].
Strategic manipulation of these parameters can help control the cooling rates and thermal gradients, thus mitigating the formation of residual stresses [105].Researchers have developed models and experimental studies to understand and predict the effects of these variables on residual stresses, emphasizing and strengthening the need for a machine learning technique to predict residual stresses and optimize additive manufacturing processes [106].
In this chapter, the article discusses various additive manufacturing processes, including welding, wire-arc additive manufacturing, laser powder-directed energy deposition, and laser powder bed fusion, to categorize and predict residual stresses using machine learning.Considering the correspondence between residual stresses and distortion, the prediction of distortion using machine learning techniques is also included in the following parts [107].In the welding process, incorporating statistical methods to estimate residual stresses values, researchers have included parameters such as the depth of laser penetration and laser bead width into non-linear statistical regression analyses to predict residual stresses [107].To further enhance the potential of obtaining residual stress predictions using machine learning, researchers have developed various algorithms with a wide array of input variables.In electron beam welding (EBW), input process parameters such as accelerating voltage, beam current, welding speed, and natural frequency have been considered [108].Moreover, the heat source, cooling rate, and mechanical properties were considered in a series of research [109].By implementing a variety of machine learning algorithms, M5 algorithm-based (M5P) model regression trees and multi-layer perceptions (MLPs) achieve better prediction performance [110].Evolution fuzzy support vector regression (FSVG) can also achieve the accurate prediction of residual stresses [111].Artificial neural networks (ANNs) and fuzzy neural networks (FNNs) have also been applied and compared to predict residual stresses, and FNNs were found to achieve better prediction accuracy [112].
In wire-arc additive manufacturing (WAAM), standard and enhanced ANNs are implemented to train models to estimate distortion [113].Process parameters such as the number of beads, preheating temperature, welding speed, wire feed, and energy are considered input parameters for the training model, as shown in Figure 12.Random forests (RFs) and ANN algorithms are applied to explore the hierarchy of influential variables, and the substrate preheating temperature is the most critical factor of residual stress [114].Three levels of ANNs, namely the thermal history and field history of the deposition process, the cooling process, and the residual von Mises stress field, were developed to predict RSS, and the predicted time achieved the second level [115].In laser powder-directed energy deposition (LP-DED), three classic geometries, namely a plane wall, L-shaped wall, and rectangular box, are included in finite element analysis with thermal-mechanical modeling to generate training datasets; then, an ANN is applied to build up a model to predict residual stresses [116], as shown in Figure 13.In addition to the ANN model, a convolution neural network is also applied to predict geometric deviation before deposition to avoid defects [117].The gray-box model approach is also included in the shot-peening process.This gray-box-based model acts as the foundation for the machine learning technique by incorporating data from practical residual stress experiments, and the algorithm refines the initial model, steadily enhancing accuracy [118].In laser powder bed fusion (LPBF), distortion and residual stress are always accompanied by deposition and cause unqualified geometry.To mitigate those issues, finding the optimum value of process parameters such as laser power, scanning speed, and hatch spacing is critical [119].Non-linear regression analysis is applied to obtain optimized process parameters to alleviate the residual stresses and distortion [120].An ANN is applied to estimate the stress distribution on the cured layer from selective laser melting, achieving near-real-time results [121].A convolution neural network (CNN) with a 3D U-Net architecture is applied to predict part-scale RSS, and three basic types of geometries are mutually combined by a full-order model (FOM) and included in training datasets [122], as shown in Figure 14.Considering that it is relatively challenging and time-consuming to collect data of residual stress, deep learning is also utilized to predict distortion during the LPBF process [123].Additionally, real-time identification of layer-wise surface deformation of overhang geometries is presented by an imaged-based CNN algorithm [124].A series of research has also utilized long-short term memory (LSTM) to predict real-time thermal history.The result was an acceleration of the efficiency of the finite element model in calculating residual stresses [125].The researcher also compared the computational time between the machine learning and finite element models.One of the results showed that machine learning stress prediction required only about 0.47 s, which significantly less than the 5-10 h needed for finite element (FE) simulation [126].Therefore, machine learning models have significant potential to integrate the existing data from simulations and experiments to predict residual stresses and deformation.The research studies that utilize machine learning methods to predict residual stresses and distortion are listed in Table 4.

Future Trends
Measurement of residual stresses of AM parts requires significant improvement in terms of accuracy, feasibility, and resolution.As discussed in the previous sections, these methods can be based on experiments, computation, or machine learning algorithms.While each of these categories has its own advantages, they lack in certain aspects.
Experiment-based methods involve measuring the strain or changes in material properties to calculate the residual stresses using elastic mechanics.However, these methods often require certain assumptions that limit the accuracy and applicability of the results.For example, the isotropic nature of the material and the absence of shear force are commonly adopted assumptions in experiment-based methods.As AM parts are largely anisotropic, experiment-based methods need to adopt modified stress-strain conversion.Also, damaging the integrity of AM parts during testing is highly undesirable, as batch-wise testing is not feasible for AM.Hence, pure non-destructive tests like the ultrasonic method or the Barkhausen noise method need to be adopted, and research on non-destructive methods needs to be explored further.
Numerical and analytical models are employed to predict the thermal history and distortion in laser additive manufacturing components.Numerical methods, while accurate, often demand substantial computational time.Researchers have begun implementing layerbased deposition techniques to alleviate this issue.However, this approach sacrifices some level of detail, reducing the accuracy of models.On the other hand, despite their limitation to two dimensions, analytical methods offer a trade-off between computational time and detail.Further exploration of analytical methods is warranted to incorporate all necessary dimensions for comprehensive modeling.
Prediction of residual stresses and distortion using machine learning methods involves a range of algorithms, as discussed previously, demonstrating their effectiveness in achieving accurate predictions.However, certain drawbacks and future research directions in this area are worth mentioning.First, concerning manufacturing processes, the majority of related studies have concentrated on welding, wire-arc additive manufacturing, and laser powder bed fusion.Consequently, it is desirable to expand research efforts into areas such as laser powder-directed energy deposition and electron beam welding.
Secondly, there is a need for finer and more reliable datasets.Most current research relies heavily on data from finite element analysis due to their abundance and the huge cost of collecting data in experiments.However, incorporating datasets from experiments can enhance the practicality of these datasets.Therefore, developing fast and accurate measurement methods is crucial and needed rapidly.Finally, in the realm of algorithms, exploring time-series algorithms like recurrent neural networks (RNNs) and long shortterm memory (LSTM) networks is advisable because the distribution of residual stresses is essentially time-dependent.Moreover, given the complexity and the need for explainable AI models, the investigation of the use of physics-informed neural networks (PINNs) for prediction of residual stresses holds significant promise [128].PINNs integrate physics and governing equations directly into the machine learning model.The loss function in PINNs includes partial differential equations (PDEs), boundary conditions, and initial conditions.Understanding the correspondence between thermal and mechanical models is crucial for the application of PINNs to predict residual stresses.Additionally, knowledge of material properties during additive manufacturing is also significant.Although some researchers have applied PINNs to analyze additive manufacturing processes for prediction of thermal distribution and melt pool characteristics, most research focuses on simple geometries, 2D dimensions, and the lack of residual stress analysis [129].Therefore, there is potential to explore the prediction of residual stresses using PINNs [130].
Additionally, to enhance the versatility of the application, it is beneficial to consider a broader range of geometries in AI models.Improving the accuracy, efficiency, and compatibility of machine learning models is urgently required for further development in AM research, such as digital twins and digital factories, as it will be necessary to qualify AM parts for critical applications.

Conclusions
Residual stress evaluation in additively manufactured parts is critical, as residual stress leads to early failure and damages parts.The mechanism of residual stress formation in AM parts was discussed in this paper.Various methods used for residual stress evaluation were described, leading to the following conclusions: • Experiment-based methods provide accurate results at the expense of the integrity of the part, which is highly undesirable.The development of easily accessible, nondestructive methods based on a matured theory that can measure different stress levels is required.• Numerical modeling enables the prediction of residual stress and part distortion in three dimensions for various laser additive manufacturing processes.This versatility grants users the freedom to work with intricate geometries.However, it is associated with extended computational times and demands a high level of expertise to ensure model stability and prevent divergence.• Machine learning and deep learning techniques have been employed to construct fast, predictive models for prediction of residual stresses in AM parts.They also provide the additional flexibility of in situ prediction of residual stresses.However, model accuracy is based on data developed by other methods, creating a dependency on experiment-based and computational methods.
• Future research directions were identified with respect to the potential development of a comprehensive method that incorporates experiment-based approaches, computational techniques, machine learning, and physics-informed neural networks.The interpretability provided by physics-informed algorithms can significantly enhance accuracy and reduce computation time, enabling better integration with experimental and computational models.

Figure 4 .
Figure 4. Distribution of Stress components in 3D.

Figure 6 .
Figure 6.Directional stresses, in Pascal units, forecasted by Abaqus CAE in the x, y, and z planes on the deposit before sectioning in half (1) and after sectioning in half (2) [24].

Table 2 .
[72]arison of computational time for prediction of residual stresses during LPBF deposition using numerical and analytical methods[72].

Table 3 .
Numerical and analytical models used in laser additive manufacturing for the prediction of residual stresses for Selective Laser Melting (SLM), Powder Bed Fusion (PBF) and Laser Powder Directed Energy Deposition (LPDED).

Table 4 .
Predicting residual stresses and distortion using machine learning.