Combining synchrotron X-ray diffraction, mechanistic modeling and machine learning for in situ subsurface temperature quantification during laser melting

A new methodology is demonstrated for analyzing spatial temperature distributions using modeling and machine learning. The method is applied to X-ray data gathered during in situ laser melting.

vide quantitative temperature evolution during laser melting.Temperature distribution metrics are determined using Gaussian Process Regression supervised machine learning surrogate models trained with a combination of mechanistic modeling (heat transfer and fluid flow) and X-ray diffraction simulation.Trained surrogate model uncertainties are found to range from 5% to 15% depending on the metric and current temperature.The surrogate models are then applied to experimental data to extract temperature metrics from an Inconel 625 nickel superalloy wall specimen during laser melting.Maximum temperatures of the solid phase in the diffraction volume through melting and cooling are found to reach the solidus temperature as expected, with mean and minimum temperatures found to be several hundred degrees less.The extracted temperature metrics near melting are determined to be more accurate due to the lower relative levels of mechanical elastic strains.How-

Introduction
Primary factors for controlling the microstructure, porosity, and residual stress state during additive manufacture (AM) of engineering alloys include heat input, resulting temperature, and temperature gradients through the component.Heat-treating of components using the heating sources themselves is also of increasing importance.In response, significant efforts have been undertaken to characterize temperature profiles during AM builds in order to guide the build design process.These efforts include both thermal and optical imaging of the specimen surfaces during a build to estimate both surface temperature and melt-pool shape [1,2,3,4,5,6,7], along with predicting defect formation.While valuable, these characterization efforts only provide information about the temperature profile at the sample surface, precluding understanding critical subsurface thermal profiles during initial melting and subsequent reheating events as layers are added above a volume of material of interest.Rather, different measurement modalities are needed to probe an alloy's evolving microstructure during repeated thermal cycling encountered during the build process.
To address these challenges, new synchrotron X-ray imaging and diffraction capabilities have been developed that can characterize structure at rapid time scales (≪ s).These measurements probe subsurface thermomechanical state (thermal and mechanical lattice strain) and microstructure evolution in conditions mimicking a wide range of additive manufacturing processes [8,9,10,11,12,13,14].During these experiments, average temperatures of the crystalline phases within a diffraction volume are estimated from the shifts in diffraction peak centroid positions due to a convolution of microstructure evolution, thermal, and mechanical strains.The effects of stress (elastic strains) and microstructure evolution (such as changes in local composition or precipitation) are often neglected.With knowledge of the coefficient of thermal expansion (CTE) of the material within the applicable range of temperatures, and assuming equilibrium CTEs are valid during rapid cooling, thermal strains are mapped directly to temperatures.While valuable, accuracy of temperatures from this peak centroid analysis can be compromised due to the inherent spatial gradients of tem-perature, mechanical loading, and chemistry during the build process.However, while a complication for data analysis, information regarding the spatial gradients of temperature (along with mechanical strains and chemistry variation) within a diffraction volume is encoded into each diffraction peak.Unfortunately, the single projection of X-rays through the diffraction volume during these experiments prevents the direct inversion or reconstruction of the temperature field in a tomographic fashion.
Here we propose a novel path forward to extracting this temperature data in which a mechanistic heat transfer and fluid flow model and X-ray simulations provide a framework for interpreting and analyzing complex experimental temperature distributions.The simulations are used to create a collection of reference diffraction patterns (a 'dictionary') representing different thermal states.A strategy is then adapted from [15] to use Gaussian Process Regression (GPR) to learn a mapping between spatial temperature distribution metrics within a diffraction volume (generated from mechanistic modeling) and diffraction peak shapes.The GPR approach taken here is a transfer learning process, in which GPR is applied to simulated training datasets and then the 'learned' relationships between spatial temperature distribution metrics within a diffraction volume and diffraction peak shapes are then transferred to experimental datasets of interest.The simulation includes both heat transfer and fluid flow modeling coupled with X-ray diffraction modeling to generate synthetic diffraction datasets.The accuracy of GPR process as used here depends on how well it can predict the temperature field outputs (descriptors of the temperature fields present) given particular diffraction inputs (diffraction data).Note that since training is performed with synthetic datasets, the temperature fields used to create the diffraction datasets are known.As such, the accuracy of the diffraction modeling is more critical than the heat transfer and fluid flow modeling (although if the heat transfer and fluid flow modeling is accurate, uncertainties will be decreased).Fortunately, the physics of X-ray diffraction are well understood.When applying the trained GPR models to experimental data, uncertainties reflect differences between the training and testing data.

Material and Experiment Description
The specimens in both experiment and simulations used in this work were AM Inconel 625 (IN625) nickel superalloy made using laser powder bed fusion (LPBF) at the National Institute of Standards and Technology (NIST), designation PBF-LB-IN625.The experimen-tal specimen was a thin wall 3 mm in height along the build direction (z S ) by 0.53 mm in thickness (y S ) and 20 mm in length (x S ).The experimental specimen was extracted using electro discharge machining from a block (50 mm × 15 mm × 6 mm) built in an EOS M290 machine using manufacturer recommended build parameters [16].The IN625 powder used for the build was attained from the machine manufacturer EOS.The build layer thickness was 40 µm, with a 110 µm hatch spacing.The laser power and speed were 285 W and 960 mm/s respectively.The interlayer rotation during the build of the larger block from which the thin wall specimen was extracted was 67.5 • .After build and prior to thin wall specimen extraction, the block was stress-relief heat treated at 800 • C for 2 hr.The IN625 used in this work was built using the same machine, powders, and build parameters of material utilized for the NIST AM Bench 2018 challenge [17].An orientation map measured using electron backscatter diffraction from the thin wall specimen prior to laser remelting is shown in Fig. 1.Crystal directions are colored with respect to the build direction using an inverse pole figure color map.The microstructure primarily consists of large grains with dimensions on the order of 100 µm, interspersed with smaller grains on the order of 10 µm.
The in situ diffraction measurements during laser melting were performed at beamline 1-ID at the Advanced Photon Source (APS).Fig. 2a shows a schematic of the experimental geometry for the measurements including AM IN625 wall specimen, heating laser, and incoming X-ray beam, and the orientations of the sample ('S') and laboratory ('L') coordinate system.In the laboratory coordinate system, the incoming X-ray beam travels in the −z L direction while the heating laser was nominally aligned along y L .During X-ray measurements, the specimen remained fixed in the laboratory coordinate system as the laser traveled in the x L / x S direction.The angle between incoming and diffracted X-rays 2θ is labeled and is related to the spacing of diffracting sets of lattice planes.The incoming X-ray beam was 61.332 keV and was focused vertically by a set of Si sawtooth lenses to dimensions of 50 µm × 30 µm along x L and y L respectively.X-ray diffraction images were measured by a Pilatus3 X CdTe 2M detector sitting 752 mm downstream of the sample.The detector has 1475×1679 pixels and a pixel size of 172×172 µm 2 .Diffraction images were collected with an exposure time of 1 ms and a frequency of 250 Hz throughout the experiment.
Laser melting was performed using an existing in situ LPBF simulator at the APS.A picture of the simulator in Sector 1-ID is shown in Fig. 2b and more complete system details can be found in [18].The LBPF simulator uses a ytterbium fiber laser (IPG YLR-500-AC, USA) and an intelliSCAN de ® 30 for laser motion.Prior to laser melting, the environment chamber was purged and re-filled with high-purity argon gas.During testing, the specimen was placed 2.9 mm away from the laser focal plane to create a spot diameter of 100 µm.
During X-ray diffraction measurements, the laser was rastered over the wall specimen along x L with a laser power of approximately 120 W and speed of 0.05 m/s.We note that this linear power density (2,400 J/m) is relatively high in comparison to standard LPBF parameters for IN625.These parameters were chosen to ensure a relatively large melt-pool and extended temperature gradient through the thickness of the specimen.Figure 3 shows the diffracted intensity integrated azimuthally around the detector (along the diffraction rings) vs time.In the figure, we can see the shifting of the diffracted intensity to lower 2θ at 125 ms.This shift to lower 2θ is due to an increase in lattice plane spacing as the diffraction volume is rapidly heated due to the laser passing over the diffraction volume.

Methods
In this section, an overview of the various methods employed to build the dictionary of reference diffraction patterns linked to underlying thermal distributions is given.A description of the GPR model, training, and hyperparameter selection used to learn the mapping between underlying temperature distribution metrics and diffraction line profiles is also provided.As previously described in the Introduction, as opposed to using X-ray diffraction data to validate a simulation, we are using combinations of heat transfer and fluid flow modeling, X-ray diffraction simulation, and machine learning to interpret and extract information from the experimental data.A schematic of the various components of the effort are shown in Fig. 4 and the components of the modeling and training effort are described in more detail in the following subsections.As a short summary, synthetic X-ray data are generated using thermal fields output from the mechanistic heat transfer and fluid flow model.We adopt an approach outlined in Fig. 4 in which pairs of synthetic X-ray line profiles (input) and underlying temperature metrics (output) are used to train various GPR surrogate models.Then, the surrogate models, trained using synthetic data (the Source Domain), are transferred [19] to analyze experimental data (the Target Domain) to determine temperature metrics through, essentially, comparisons with the previously generated synthetic data.

Heat Transfer and Fluid Flow Modeling
A heat transfer and fluid flow model is utilized to calculate the 3D transient temperature and velocity fields during the laser melting of IN625 specimens.The model is discussed in detail in Mukherjee et al. [20,21] and only the important features are described here.
The model was developed using an in-house Fortran code and compiled with an Intel Compiler.The model calculates the melt-pool size, temperature fields, and velocity fields during the LPBF process taking the laser parameters, alloy, and environmental gas properties as inputs.The model considers temperature-dependent thermophysical properties for both powder and fully dense material.The thermophysical properties of IN625 required in the model are calculated using the commercial package JMatPro, while the uncertain parameters such as absorptivity and the power distribution of the laser beam can be adjusted to match the experimental data on thermal cycles and deposit geometry.The material parameters used for the heat transfer and fluid flow modeling are provided in Table 1.The model iteratively solves the equations of conservation of energy, mass, and momentum in a 3D computational domain consisting of the substrate, power bed, deposited layers and hatches, and the shielding gas.The equations are discretized in the computational domain using a finite difference scheme and a traveling grid approach is used to increase computational efficiency.The model provides accurate results on melt-pool geometry and temperature fields by considering the effects of the convective flow of molten metals.We mention that while laser melting and resulting temperature distributions within solid specimens are modeled in this work, the same model is capable of modeling temperature distributions within loose powder layers [21].
Using this model, a series of single laser trace simulations were performed around conditions similar to the previously performed in situ synchrotron experiments ( §4.2).For all simulations, a unidirectional scan along x S of the laser beam is used, with the laser beam direction being −z S .Positive y S is perpendicular to the laser scanning direction and represents the direction along the width of the wall specimen.The laser power and velocity were varied around the nominal experimental parameters (120 W laser power and 50 mm/s laser speed).In total, nine laser melting simulations were performed according to the simulation test matrix in Table 2.Each simulation captured the laser traveling over a 200 ms interval with 200 µs time steps while temperature fields were output every 2 ms.The heat transfer and fluid flow simulations were performed on the ROAR supercomputer at Penn State us-ing 40 cores (2.13 GHz) for each simulation, with each thermal simulation taking one hr to complete.

Synthetic X-ray Data Generation
Each of the nine laser trace simulations was used to generate a series of time-dependent area detector X-ray diffraction patterns using the framework developed in Pagan et al. [22].This simulator uses diffraction calculation and projection algorithms contained in the Python-based HEXRD software package [23].In the diffraction simulation framework, X-ray diffraction is simulated within a polychromatic (Laue) diffraction framework that employs a finite-energy bandwidth to capture realistic beam conditions.This method provides benefits over angular based diffraction solution methods in conditions where the specimen is not rotating, such as the single laser trace experiments described above.Here the average X-ray energy and bandwidth (|∆E|/E) were chosen to match the experiment, 61.332 keV and of 5×10 −4 respectively.
In this framework, diffraction events are simulated from discretized volumes in space, with the spatial positions of each volume being incorporated into diffracted ray tracing calculations.For clarity, we will refer to these discretized volumes as scattering volumes, while the total volume illuminated by the X-ray beam is the diffraction volume.Inside each scattering volume, individual grains (lattice orientations) are inserted from which diffraction events are calculated.In these diffraction simulations, the grains have no morphological features and their orientations are randomly generated.The thermomechanical state of each scattering volume, and the accompanying changes in lattice state, can vary spatially.
Here, temperature fields produce spatially varying thermal strain within the diffraction volume.Matching the experiment, the simulated diffraction volume is 50 × 30 × 530 µm 3 , while each scattering volume was 20 × 20 × 20 µm 3 .Each scattering volume contained two randomly oriented grains simulating grains with approximately 25 µm equivalent diameter.
Each grain contains 1 • of lattice misorientation to provide some amount of diffraction peak broadening.
To model the thermal strain's effects on the measured diffraction data, the lattice structure of an embedded grain is altered by stretching the reciprocal lattice vectors, g, of each grain isotropically (valid for a cubic crystal): where g 0 is the unstrained reciprocal lattice vector in a crystal, I is the second order identity tensor, and the thermal strain ε T is given by The temperature-dependent coefficient of thermal expansion α(T ) used in this work was measured independently using bulk dilatometry measurements at the Penn State Center for Innovative Sintered Products.Bear in mind, these measurements describe equilibrium thermal expansion behavior which may not exactly capture thermal expansion during rapid heating and cooling.The sample used for dilatometry measurements was extracted via EDM from an identically built AM bulk sample used for the in situ diffraction experiments.
Thermal strain ε T as a function of temperature determined from these measurements and used for diffraction simulations are provided in Fig. 5.The reference lattice parameter from which g 0 were generated was 3.5981 Å.As only crystalline material will diffract, if the temperature in a scattering volume exceeds the solidus temperature (1563 K [24]), no diffraction events are recorded.For the high-energy transmission geometry used in the experiment, all diffracting X-rays have nearly the same path length regardless of whether they diffract from the upstream or downstream side of the specimen.As such, absorption is not considered since it will only scale the total integrated intensity of the diffraction peak and not change the peak shape.220), (311), ( 222), (400).After integration, background noise corresponding to scattering in the experimental station was added to the synthetic data.A comparison of example experimental (blue) and synthetic (dashed red) diffraction line profiles in the unheated conditions is given in Fig. 6a and soon after laser heating in Fig. 6b.Differences in relative peak heights are likely due to local texture in the thin wall sample.Figure 6c and Fig. 6d show enlarged views of the (220) diffraction peak in the unheated and heated conditions respectively.Relatively extreme peak broadening and splitting due the temperature gradient present can be observed in both the experimental and synthetic diffraction images.However, we note here that the goal of the diffraction simulations is not to exactly match the experimental diffraction line profiles, but to provide a reference dictionary which a trained GPR surrogate model can utilize to predict a temperature metric based on similar features found in the data of interest.Each diffraction simulation of a heating time series at a single beam position took approximately 4 hr to complete, with diffraction calculations from each scattering volume parallelized over 40 cores.

Gaussian Process Regression Surrogate Model Description
Here we utilize the supervised machine learning technique, Gaussian Process Regression [25] implemented via scikit-learn [26], to learn a mapping between diffraction line profiles and various temperature metrics in the diffraction volume.Figure 7 shows example synthetic diffraction patterns generated using the mechanistic AM and X-ray diffraction modeling colored by a temperature metric of interest in the diffraction volume (maximum temperature, T Max ).The goal of using GPR is to learn these mappings between line profiles and underlying thermal distributions such that with a diffraction line profile, a temperature metric of interest can be extracted.Again, this places emphasis on the accuracy of the X-ray diffraction simulation, rather than the mechanistic heat transfer and fluid flow modeling.The method was recently applied to developing a mapping between diffraction line profiles and dislocation configurations within diffraction volumes [15].In addition, the GPR approach approach shares commonalities with the Bayesian Rietveld approach introduced by Ida and Izumi [27].
GPR takes a Bayesian statistical approach to surrogate model prediction.The most common kernel function, k, in GPR is the Gaussian kernel (also often referred to as the squared exponential kernel, exponentiated quadratic, or radial basis function kernel).The kernel dictates the weights used to make predictions from training data points.
The Gaussian kernel takes the form Here, we employ the related rational quadratic kernel which is equivalent to the summation of many exponentiated quadratic kernels of different length scales: where α is the relative weighting between large and small length scales.Accordingly, increasing α reduces the amount of local variation (slows the weighting decay rate), and when α → ∞, the rational quadratic kernel converges to the exponentiated quadratic kernel.A range of L and α values were tested for model training, but the closest fits to the training data (without overfitting) corresponded to L = 1 and α = 1.

GPR Model Training and Temperature Metric Extraction
Prior to application of the GPR models to the experimental synchrotron data, the accuracy of GPR predictions were evaluated using a set of reserved simulations.GPR models were trained using 26 of the 27 synthetic diffraction data sets, comprising 2600 images, (again nine laser parameter sets given in Table 2 with three beam positions each) using a single processor.The reserved synthetic diffraction time series data corresponds to conditions best matching the experiment: 120 W laser power, 0.05 m/s laser speed, and placing the X-ray beam 20 µm below the top of the sample.After GPR surrogate model training and testing of the models against reserved simulated data, the trained GPR models were applied to the X-ray diffraction data collected during the synchrotron experiment.In this process, the diffraction data collected at each time step is treated as an independent data point and used as input for the various GPR models.At the end of the process, various temperature metric histories for the diffraction volume probed during the experiment are generated.

Surrogate Model Training
Figure 8 shows predictions of four temperature metrics within the diffraction volume using trained GPR models (each metric has its own trained GPR model) that use diffraction line profiles as input compared with the same temperature metrics extracted directly from the reserved thermal simulations.The four temperature metrics are mean T Mean (Fig. 8a), maximum T Max (Fig. 8b), minimum T Min (Fig. 8c), and median T Median (Fig. 8d) temperatures.As previously described, for each GPR surrogate model prediction, the variance of the prediction associated with the normal distribution of the mapping functions can also be calculated and employed as an uncertainty.In Fig. 8, the uncertainty (square root of the variance, standard deviation) of the GPR prediction is shown by the red error bars.
For each temperature metric, a linear regression line was fit to the GPR predictions and is plotted with a black line.A blue dashed line corresponding to perfect correlation between the GPR model predictions and the reserved testing data is provided for comparison.The R 2 coefficient of determination of the GPR predictions is also provided.
As a whole, there is very good agreement between the reserved testing data and the GPR model predictions.No aphysical predictions are found across the metrics such as predictions of temperature significantly below room temperature or above the solidus temperature.It is noted that there is generally more training and testing data in the lower temperature regions due to the laser passing rapidly over the specimen, leading to generally increased uncertainty at higher temperatures (see larger red error bars).This feature is most notable for the maximum temperature predictions near the solidus temperature which has the largest uncertainties (on the order of 200 K or 15%).Conversely, the mean temperature predictions have the smallest uncertainty (on the order of 20 K to 40 K or 6% to 12%) which is not surprising.The mean temperature is strongly correlated to the point of highest intensity on the diffraction peak.This can be contrasted to the minimum and maximum temperatures which will generally correspond to small volumes of material contributing to the tails of the diffraction peaks.Again, we emphasize here that these temperature metric predictions take into account contributions to peak broadening from the spatial distribution of temperature within the diffraction volume.In other words, the hottest and coldest regions may not necessarily correspond to the most extreme tail positions on the diffraction peak depending on the spatial location of the diffraction event.

Application of GPR Surrogate Models to Experimental Data
We have trained a series of GPR surrogate models for predicting temperature metrics from synthetic diffraction line profiles.Here we apply the trained models to analyzing experimental data captured during the synchrotron experiment described in §2. Figure 9 shows the evolution of mean T Mean (Fig. 9a), maximum T Max (Fig. 9b), minimum T Min (Fig. 9c), and median T Median (Fig. 9d) temperatures within the diffraction volume versus time.
Again, the red error bars associated with each temperature metric measurement correspond to the uncertainty in the extracted quantity as given by the square root of variance of the GPR prediction.
The point where the moving laser passes over the diffraction volume is the clear peak in all four metrics.At its highest point, the prediction for T Max is close to the solidus temperature for IN625 as expected, since melted material will not contribute to the diffraction peaks.
Similar to the cross-validation with the simulated data, T Max has the highest uncertainty (largest error bars).We also observe across all four metrics, that the temperature remains relatively high well after the laser has passed over the diffraction volume (on the order of 200 K above room temperature.As will be discussed, this may be due to thermomechanical stress developing within the specimen upon rapid cooling, as a positive mean stress in the volume probed will 'appear' as an elevated temperature.As previously described, the uncertainty in the temperature predictions is related to how close input diffraction line profiles are to data used for GPR model training.With the transfer learning approach, if the simulations in the Source Domain used to generate the training data are missing physics, such as the development of stress due to thermal gradients, the accuracy in the Target Domain will decrease.Taking this into account, temperature metric values closer to the solidus temperature are likely the most accurate since at this point thermal expansion is largest and the mechanical stresses are lowest.This will be further discussed in §5.2.

Discussion
Here, we have described and demonstrated a novel approach for quantifying temperature distributions within alloys during extreme heating processes that utilizes in situ synchrotron X-ray diffraction, mechanistic modeling and X-ray simulation, and supervised machine learning.The approach was applied to quantifying temperature metrics in the bulk of an IN625 specimen during high-speed laser melting mimicking AM.The development of approaches such as that presented in this paper are important for quantifying and controlling temperature distributions during the AM build process.In turn, this information can be used to accelerate process certification and optimization of build routines to control microstructure and minimize defects.The presented method is a significant advance from current X-ray diffraction based approaches in the literature that are only capable of estimating the average temperature in an illuminated volume [11,12,13].Usually analytical functions (e.g., Gaussian or Lorentzian) are fit to the diffraction line profiles and temperature is calculated from shifts of diffraction peaks.Often, to improve temperature extraction from peak fittings, experiments are conducted such that melt pools are much larger and scanning conditions are unrealistic.During this process numerous assumptions are made regarding the temperature distribution present and X-ray interaction with the sample increase the uncertainty of the estimation, most notably that all X-rays are emitted from a point source and the shape of the function used to fit the diffraction peak.In addition to decreasing accuracy with these assumptions, all information about the temperature distribution in the illuminated volume is lost.
Our effort addresses these shortcomings by directly accounting for realistic spatial thermal gradients.With these gradients accounted for, temperature metrics determined from experimental data will have increased accuracy, and we can access information about thermal gradients, a major driver of microstructure formation.Now we will examine the temperature distribution that was probed during the in situ measurements.While the method presented is a major advance forward for bulk temperature quantification during AM, we will also discuss means to further increase accuracy and to extend the method to other quantities, such as melt-pool volume.

Temperature Distribution Evolution
A primary benefit of the approach presented is the ability to explore the evolving distributions of temperature present within the diffraction volume.As an example, we can analyze the distribution of temperature within the diffraction volume during the in situ synchrotron experiment.Figure 10 shows the evolution of the mean, maximum, minimum, and median temperature metrics extracted using the various GPR surrogate models together.With regards to the temperature distribution, of most interest is the range (difference of maximum and minimum) of temperatures in the crystalline phase throughout the diffraction volume.
From the figure, we can see that there is nearly a 600 K difference between the maximum and minimum temperatures in the solid phase as the laser passes over the diffraction volume.We can also see the temperature difference remains throughout cooling and is still over 100 K at the end of measurement.As the mean and median temperatures are closer to the minimum temperature than the maximum, we can infer that the bulk of the diffraction volume remains cooler through thickness, matching intuition regarding localized melting.
Using these data, we can also begin to establish lower bounds for the temperature gradient present.As the dimension of the diffraction volume corresponding to the specimen thickness (530 µm) is significantly larger than those defined by the incoming beam (50 µm and 30 µm), we can assume that spread of temperature is primarily along the thickness of the specimen.With this being the case, and the hottest portion of the specimen being in the center of the specimen, the lower bound of the temperature gradient can be estimated to be approximately 2250 K/mm (600K / 0.265 mm).With any liquid phase present being significantly hotter, the gradient will be larger, but a lower bound is of value for process design.

Effects of Mechanical Elastic Strain and Stress
In §4.2, we observed that in Fig. 9, all temperature metrics appear to be converging towards predicted temperatures greater than room temperature at the end of data collection.
As mentioned, this may be due to accumulation of thermomechanical stress within the specimen.Due to large thermal gradients in the material during laser melting, mechanical elastic strain and accompanying stress distributions in the material are formed to maintain deformation compatibility.These stresses can become large enough to drive plastic flow and set-up residual elastic strain and stress fields that remain in the material even upon cooling [28,29,30].In a cubic alloy such as IN625, tensile hydrostatic stresses and volumetric elastic strains distort the crystal lattice, and subsequently diffraction patterns, in the same fashion as increased temperature does.However, elastic strains during most mechanical deformation modes have large deviatoric components while thermal strains in cubic materials are solely volumetric.With regards to the diffraction data, heating in the absence of thermal gradients in cubic materials will cause uniform contraction or expansion of the diffraction rings.However, temperature gradients and distributions of thermal strains give rise to elastic strains and mechanical stresses to maintain deformation compatibility that, in turn, will distort diffraction rings into ellipses.
To explore the role of mechanical elastic strain's effects on the temperature predictions, which are not currently included in the laser melting and diffraction simulations, the anisotropy of lattice strain around diffraction rings during the experiment were probed.
Figure 11a shows the evolution of average lattice strains from the first three sets of lattice planes from four different azimuthal regions around the detector.These regions are illustrated on a detector image in the inset of Fig. 11a.Average lattice strains ε were first found by fitting Psuedo-Voigt peaks to the first three sets of lattice planes in each bin (noting that fits are relatively poor in the high temperature region due to peak splitting, Fig. 6d).
Lattice strains from each peak ε hkl were then determined from fit peak centers 2θ hkl and Bragg angles calculated from the reference lattice parameter 2θ hkl0 Average lattice strains ε from each region were calculated as an intensity weighted average of the lattice strains from each peak, calculated as ε = ε hkl I hkl I hkl (6) where I hkl is the fit maximum intensity of each peak.This averaging of lattice strains from the four different azimuthal regions assumes that the principal strain directions are nominally aligned with the sample edges and the sample coordinate system.The relatively large azimuthal regions were chosen to increase the number of grains contributing to each lattice stain measurement.In Fig. 11a, we see that as the sample cools, there is a marked deviation in the lattice strains around the detector, reflecting the development of thermomechanical stresses in the specimen containing a tensile stress in the x S direction.None of the lattice strains in any of the regions become negative, indicating still elevated temperature or a compressive stress along the beam direction z L (y S ).We also mention that there is a spread of lattice strains prior to heating that is most likely due to stresses imposed during sample mounting.
To examine an approximate measure of the ratio of volumetric to deviatoric strains caused by thermal expansion and mechanical stresses respectively, the time evolution of the ratio of the mean and standard deviation of the lattice strains from the four regions are shown in Fig. 11b.In regions where the ratio is high (>5), the strains are dominated by volumetric (thermal) expansion and the GPR model temperature predictions are more accurate, but as the ratio gets smaller (during cooling), deviatoric (mechanical elastic) strains influence the results to produce inaccurate temperature predictions.This is reflected in the still relatively high temperature metrics determined from the GPR surrogate models in Fig. 10.
A recent experimental effort [31] has demonstrated that with a large panel area detector and capturing full diffraction rings, the effects of mechanical stresses could largely be decoupled from the effects of heating.Keeping this in mind, the method presented in this work could be extended to train GPR surrogate models with diffraction patterns including thermomechanical effects rather than just thermal effects.The GPR surrogate models would also need to be provided with independent diffraction line profiles from different azimuthal angles around the detector, but this should be readily possible.If successful, low temperature measurement accuracy will be significantly enhanced.

Melt-Pool Volume Estimation
For the extraction of temperature distribution metrics, the GPR surrogate models that have been presented are primarily learning connections between diffraction peak shape and position with the temperature distributions present in the illuminated diffraction volume.As has been mentioned, when a volume of material melts, that volume will no longer contribute intensity to the measured diffraction peaks.The total integrated intensity will therefore reflect the volume of unmelted alloy and as well as the converse, the relative volume of the melt-pool.To test this idea, a final GPR surrogate model was trained in the same fashion as described above, but trained to connect diffraction line profiles to the volume fraction of the melt-pool present.This surrogate model was then provided the experimental X-ray data similarly to §4.2. Figure 12 shows the evolution of the melt-pool volume fraction during the experiment.We can see that the melt-pool volume fraction has a maximum of 0.3 when the laser passes over the diffraction volume.With the relatively large laser beam size (100 µm) and high power density laser conditions, a melt pool volume extending through approximately 30% of the diffraction volume (150 µm) appears reasonable.While highspeed X-ray radiography has been used extensively in the literature to image melt-pool size, diffraction and the approach presented may provide a complimentary means to characterize sub-surface melt-pool dynamics in alloys in addition to samples with relatively little density difference between liquid and solid phases and their minimal radiographic imaging contrast.

Summary and Conclusions
For the first time, bulk maximum and minimum temperatures of the solid phase in an engineering alloy (along with temperature distribution information) are extracted from in situ AM measurements.This was made possible by using high-fidelity mechanistic and supervised machine learning modeling to determine quantities from the experimental data, as opposed to taking a traditional approach of using experimental data to calibrate the models.The approach consists of training Gaussian Process Regression surrogate models using a combination of heat transfer and fluid flow modeling and X-ray diffraction modeling.
Each surrogate model links diffraction line profiles to metrics describing the temperature distribution present within the diffraction volumes including maximum, minimum, mean, and median temperature.The smallest uncertainties determined from the GPR models are approximately 5% for the minimum, median, and mean temperatures.In contrast, the largest for the maximum temperature (approximately 15%), near the solidus temperature.
The trained surrogate models were successfully applied to extracting these metrics from in situ high-energy synchrotron diffraction data collected during additive manufacturing (laser melting) of a thin wall of Inconel 625.Despite the larger uncertainties from the GPR surrogate model output, temperature metric accuracy is believed to be greatest in the high temperature regime and decreases in the low temperature regime when applied to experimental data, as stress develops and distorts the material present.The discussion described future efforts to account for thermomechanical stress formation to increase model accuracy and extend the approach to extract other information about the volume probed including the volume of the melt-pool in the diffraction volume.Table 1: Properties of Inconel 625 used in the heat transfer and fluid modeling.These properties represent the thermo-physical behavior of the alloy and affect the thermal cycles.Here, thermal conductivity and specific heat are taken as temperature dependent and the temperature in K is represented by T .The properties were calculated using the commercial software, JMatPro.

Physical Property Value
The laser-trace simulations described in §3.1 are used as input for generating synthetic diffraction images.As the thermal simulations use a traveling grid formulation for calculation, thermal fields at each time step were mapped to a regular grid of scattering volumes with 20 µm spacing in all three directions.Each thermal simulation was used to generate three sets of synthetic diffraction data capturing the evolution of different temperature gradients by placing the X-ray beam at different portions of the sample.For each thermal simulation time series, the center of the X-ray beam was placed 20, 40, and 60 µm below the top of the specimen and separate 2D X-ray diffraction image sets were generated.In total, 27 sets of X-ray simulations and 2700 diffraction images total were generated for surrogate model training.Once the 2D diffraction patterns were simulated for the entire time series, each pattern was integrated azimuthally around the diffraction rings to create 1D diffraction line profiles (intensity vs. 2θ).The integrated diffraction line profile data covers 2θ angles ranging from 5 • to 13 • and encompasses the first six sets of lattice planes (111), (200), ( The GPR method creates a normal distribution of mapping functions, informed by training data, with the mean of function distribution serving as a model prediction.The variance of the function distribution can serve as a confidence bound or to inform where more training data may be necessary (i.e., where there is high variance).In GPR, model output predictions (i.e., temperature metrics) are constructed from linear combinations of transformations of the input data (i.e., diffraction line profile data).The transformation and linear weights are fit according to the input training data and a chosen covariance (kernel) function.In general, the variance for a given prediction reflects the difference between the GPR model input and training data used to build the model.For example, GPR input (i.e., a diffraction line profile) that exactly matches training data will have a variance of zero, while input that is very different from the training data (e.g., a new phase is present) will produce a prediction (i.e., temperature metric) with a very high variance.As training data becomes more accurate (or at least is closer to the model input of interest), variance or uncertainty is reduced.

where x a and x b are input data vectors and σ 2
is the amplitude.For this work, input data vectors are intensity values in diffraction line profiles.This kernel includes a length scale, L, which controls the extent of influence of a data point, affecting the variance of the function distribution.The Gaussian kernel is referenced because of its representative behavior and familiarity with the shape of Gaussian functions.As the distance between an input vector (x a ) and a data point (x b ) is decreased, the weight increases.Conversely, as the distance increases the weights decay in an exponential fashion.

Figure 1 :
Figure 1: A representative orientation map measured using electron backscatter diffraction from the thin wall specimen tested in this work.Crystal directions are colored with respect to the build direction in the provided inverse pole figure color map.

Figure 2 :
Figure 2: a) Schematic of the experimental setup with 'S' superscripts for the sample reference frame associated with the heat transfer and fluid flow modeling and 'L' superscripts for the laboratory reference frame associated with the laser heating and with the X-ray diffraction simulations.b) Photo of the experimental measurement set-up used to collect X-ray diffraction data for developing the temperature extraction framework.Marked are (1) the sample holder and sample, (2) the laser test system, (3) X-ray area detector, and (4) incoming beam direction.

Figure 3 :
Figure 3: Evolution of azimuthally integrated diffracted intensity I with time t during laser melting of the IN625 wall specimen.Each row corresponds to the diffraction line profile (intensity vs 2θ) for a given time step with the color signifying the magnitude of diffracted intensity.

Figure 4 :
Figure 4: Flow chart showing the steps included in this work to extract temperature metrics from X-ray diffraction data.Within the Source Domain, heat transfer and fluid flow modeling is used to inform X-ray diffraction simulations which are then used to train GPR models.The trained GPR models are transferred to the Target Domain and used to predict temperature metrics from the X-ray experimental data.

Figure 5 :
Figure 5: Measured thermal strain εt versus temperature T of IN625 used for the diffraction simulations.Measurements were made using dilatometry on the same material as tested in the synchrotron experiment.

Figure 6 :Figure 7 :
Figure 6: Comparison between experimental (blue) and synthetic (dashed red) diffraction line profiles (intensity I versus Bragg Angle 2θ) from the AM IN625 wall specimens in representative a) unheated and b) heated conditions.Enlarged views of the (220) diffraction peak in the c) unheated and d) heated condition.The (220) peak provides an example of relatively extreme peak splitting due to the temperature gradient presented.

Figure 8 :Figure 9 :
Figure 8: Comparison of prediction of temperature metrics from trained GPR surrogate models using simulated diffraction data input reserved from model training.The metrics are the a) mean T Mean , b) maximum T Max , c) minimum T Min , and d) median T Median of the temperature distribution present in the diffraction volume.The red error bars correspond to the square root of the variance (standard deviation) of the GPR predictions.A linear regression line has been fit to the testing data and GPR predictions and is shown with a black line.The dashed blue line corresponds to perfect correlation between reserved testing data and GPR model predictions.

Figure 10 :
Figure 10: Comparison of the evolution of temperature T metrics with time t extracted from the experimental diffraction data using the GPR surrogate models.

Figure 11 :
Figure 11: a) Evolution of average lattice strains ε measured from four different regions on the detector (shown in inset) through time t.b) Evolution of the ratio of the mean and standard deviation (STD) of the lattice strains from the four different regions.

Figure 12 :
Figure 12: Estimated experimental melt-pool volume fraction (VF) versus time t determined from the experimental diffraction data using a trained GPR surrogate model.