Optimizing Experiment Performance by Realistic Sample Simulations

A simulation of realistic samples within a neutron scattering or imaging experiment has been created in order to support the accuracy, feasibility, and analysis of residual stress measurements as well as the development of novel experimental methods and instrument components. Covering the influences of individual neutron instrument parameters, the simulation also assists in optimizing the experimental configuration towards precise measurements and effective usage of neutron beamtime.


Introduction
Residual stress determination with neutrons in the bulk of a material is an attractive tool for investigations in fundamental research as well as for industrial applications. However, the rising interest in neutron measurements is in opposition to the very limited neutron beamtime available to users. Consequently, enormous effort is put into the development and upgrade of new and existing instruments at steady-state research reactors and spallation sources. Recent improvements to increase the accuracy, measurement speed and flexibility for a large range of applications of the Berlin residual stress neutron diffractometer E3 at the Helmholtz Centre Berlin (HZB) have been made and these have been presented elsewhere [1]. The improvement included the development and implementation of new hardware, e.g. improvement of neutron optics and new software to provide easyto-use instrument control and fast data analysis [2].
Furthermore, dedicated Monte Carlo neutron ray-tracing software packages exist which have many modules available to simulate entire neutron beamlines. The complexity of such instruments including the individual components, ranging from neutron sources, optics and samples to detectors, can be covered by a large number of parameters, which can be sampled to study different instrument setups. Therefore, the neutron trajectory through a beamline is investigated and evaluated towards the influences on the measured detector signal. Thus, the simulations are used to assist with the optimization of the instrument's performance. However, the simulation of an experiment can also be utilized to improve speed and accuracy of the measurement.
The present work demonstrates the large range of capabilities of a newly developed virtual module to assist neutron imaging and engineering diffraction measurements for practical applications.

Neutron Ray-Tracing Simulations
With version 2.0 and 2.11 of the neutron simulation frameworks McStas [3] and Vitess [4] respectively, a new general sample module was released, individually adapted to both software packages but based on the same calculations. The components in both frameworks, from neutron source to detector, adjust the state vector (position, flight direction, velocity) of each incident neutron and let it propagate to the subsequent component. The new sample module computes the probabilities for neutron scattering and absorption events, taking into account the crystallographic description of the sample material. For this purpose, the module includes the nxs program library [5] and applies the available routines to calculate neutron cross sections at a given neutron wavelength λ. The com-putation considers the setup of a given unit cell, which builds the crystallographic structure of the material. Hence, the parameters contributing to the unit cell definition (space group, lattice parameters, atom properties) have to be given as an nxs input file. A decision is made, depending on the individual cross section values, whether to absorb (remove from trajectory), transmit (keep flight direction) or scatter the neutron (change flight direction). Further details will be covered by a dedicated future publication. However, the sample module can be used within the simulation of neutron diffraction instruments and imaging beamlines, for example. Example input files and helpful instructions on how to use and customize the individual sample parameters are already provided within the Vitess and McStas repositories and will permanently be updated with upcoming changes and future release versions of the sample module.
Method development. A number of neutron simulations utilizing the sample component have already been performed to-date, attesting the usefulness of such a tool. Taking advantage of the capability to simulate energy-resolved neutron transmission spectra (radiography/tomography), the software has been used for validations of Bragg edge transmission experiments with different types of samples [6].
In one example, a textured aluminum cylinder was measured in radiographic mode at different neutron beamlines. Moreover, the experiments have been simulated, taking the different instrumental parameters into account. For this purpose the virtual sample was extended with the so-called March-Dollase model to correct the neutron cross section calculation for texture parameters. The sample simulation was fed with texture parameters received from standardized diffraction measurements. Thus, perfect agreement with the individual Bragg edge measurements and simulations was achieved. The differences in the measurement results could be reproduced and attributed to the instrumental setups. It was further possible to estimate the instrument performance, in terms of resolution of the resolved texture degree, and to make a statement on the feasibility of future experiments to quantitatively determine texture parameters with such an alternative measurement method. In another example, residual stress samples have been measured with a new technique to check if the received 'through-thickness' strains match the calculated theoretical strains. For that purpose, the sample module was further extended to read strain profiles from an input file and calculate the effective lattice spacing in neutron transmission direction at a local sample position from three perpendicular strain directions (radial, tangential and axial) whenever a neutron intersects the sample. Fig. 1 shows a map of the effective lattice spacings for the VAMAS round-robin aluminum ring and plug (RnP) cylinder [7] for the neutron transmission direction (along x). The computation takes into

198
Residual Stresses IX account that the strain gradients in the cylinder are radially symmetric over the whole sample. The effective through-thickness strain measured with the Bragg edge transmission method corresponds to the average lattice spacing along the transmission direction. The simulation was utilized to validate the results from the Bragg edge measurements and identify limits of the Bragg edge method. A similar test within a proof-of-concept study [8] was done with dieless-drawn steel rods providing the same strain symmetry. The simulation module turned out to be a perfect tool to check the consistence of the results from such an alternative measurement method. Detector development. Besides the use within McStas and Vitess, the nxs routines have been used for the Geant4 framework for simulations of the passage of particles through matter [9]. An extension to the framework was created to enable thermal and cold neutron scattering from polycrystalline materials for the purpose of the development of novel neutron detectors at the European Spallation Source (ESS) [10]. Details will be described in a more detailed and dedicated publication [11].
Instrument development. The sample module was further utilized with McStas to measure the imaging performance of the upcoming IMAT beamline at the ISIS 2 nd target station (TS-II) and benchmark it based on transmission spectra with the different moderator options available [12].
Surface effect. Neutron measurement data might be affected by the so-called surface effect in two modes, if the gauge volume, e.g. having a size of 2 mm × 2 mm × 2 mm, is not entirely embedded in the sample volume. Firstly, depending on the instrument optics and the sample geometry, artificial peak shifts causing spurious strains can occur. Fig. 2a provides an example of this effect measured with a stress-/ strain-free, 10-mm-thick reference iron sample. The (211) peak position was determined on E3 scanning from the center of the sample (-5 mm) to the surface in both reflection and transmission geometry. Although, constant peak positions are expected, the reflection mode scan exhibits a strong gradient towards smaller 2θ angles, whereas the transmission shows a less prominent behavior. Supported by Simres/Restrax simulations [13], a first analytical model to correct for such effects, also taking the experimental setup into account, has already been developed [14].
Secondly, the center of gravity (COG) of the gauge volume changes if it is only partially filled by the sample. In this case, it is required to determine the 'real' local measurement position, i.e. the COG, by means of the translator position and gauge volume size. The developed sample simulation module is also helpful in this manner. Fig. 2b shows an example of the gauge volume partially leaving the sample and demonstrates the principle used in the simulation: Asterisks (*) indicate that neutrons intersecting the sample volume are tagged, i.e. the local neutron position (x, y, z) inside the sample is stored if a scattering events occurs. The local positions of neutrons propagating to the de- tector (dark asterisks) will then be used to calculate the COG, whereas the other neutrons (bright asterisks) will be ignored. A resulting COG plot from a scan simulation towards the surface of the sample is shown in Fig. 2c and indicates the non-linear relationship of the experiment's translator position and the COG. This approach also provides the capability to simulate such scans beforehand and match preferred measurement positions with the instrument translators during the experiment. On the E3 instrument, for example, it has been shown [15] that determining residual stresses with neutrons is possible from the bulk of a material (cm) up to the near-surface region (µm) with high-precision. Thus, the gap to complementary (soft) X-ray/synchrotron measurements at the surface of a sample can be closed successfully in many cases.
Phase fraction analysis. The above-shown simulation-supported experiment analysis is further useful if neutron attenuation effects in the front and/or the back of the gauge volume must be considered. In the case of determining the distribution of phase fractions inside a sample exhibiting more than one crystallographic phase, such a consideration is of similar importance. Transformation-induced plasticity (TRIP) steel cylinder samples after plastic tensile and torsional deformation have been investigated on E3 to study fcc-to-bcc phase gradients [16]. Since phase fractions are determined by evaluating the peak amplitude, any other impact to the height of the amplitude needs to be eliminated. Such influences could be a varying volume fraction within the gauge volume as shown above, but also a varying neutron path length through the sample, such that the scattered signal undergoes different attenuations. For the correction of these influences, the measured scans along the sample diameter were simulated with two single-phase samples as a reference, by computing both single-phase fcc steel and single-phase bcc measurements. Both simulated scans have been used to normalize the measurements on E3. As an example Fig. 3 demonstrates the importance of such a correction based on the treatment of the bcc measurements. Whereas the measured peak intensities suggest another phase transition towards both sample edges, the corrected gradients show the expected radial-symmetric behavior after torsional deformation [17]. The simulation results (asterisks) clearly indicate that the intensities along the sample diameter are neither constant because of the partially emerging gauge volume at the edges, nor symmetric (especially in radial mode) because of different neutron path lengths through the sample. The corrected intensities exhibit an increasing bcc phase fraction towards both sample edges.

Outlook
The implementation of neutron cross section calculations and their utilization within existing simulation frameworks have enabled a broad field of applications for the development and optimization of instruments and detectors. The implemented extensions, such as strain profiles, texture information and capabilities for phase analyses, will offer more detailed experimental data analysis as well as support in the development of new measurement techniques.
The comparison with the Bragg edge neutron transmission measurements has shown the usefulness of a sample simulation which includes a real strain profile. However, further and more complicated strain profiles (2D, 3D, non-symmetric) are necessary to be implemented for simulation pur- poses in order to extend the range of applications, such as the validation of new experiment methods with more practical samples. Such an extension using the presented input file mechanism is already under development. Another extension would be to implement a larger range of available sample geometries or even arbitrary self-defined shapes. Up to now, the simulation module derives its sample shape from the existing geometries in McStas and Vitess, i.e. only cylinder-and box-shaped geometries are possible. However, arbitrary and more complex shapes are conceivable. Also, individual properties (e.g. phase transitions, cracks, porosity) could be included in neutron experiment simulations. An interface from finite element methods (FEM) to the presented simulation frameworks could fulfil such a task. This can be beneficial, for example, for simulations of neutron imaging experiments to study the instrument's resolution capabilities and, thus, would contribute to the developments of instruments at future neutron sources, such as the ESS.
Simres/Restrax has been proven to be a successful simulation tool, especially for the development of an analytical model to compensate the spurious strain caused by the surface effect presented in [14]. It might be beneficial to also implement the developed sample simulation for this software to provide the presented features for a larger community.