1 Introduction

The determination of residual stress fields is essential for assessing the structural integrity of engineering parts. Both destructive and non-destructive methods, rooted in mechanical elasticity, have been developed for this purpose. These methods correlate destructive processes like hole drilling [1], surface stripping [2], cracking [3] and ring core drilling [4,5,6], as well as measurements of physical properties like lattice spacing [7,8,9,10], elastic wave velocity [7,8,9] and Raman effect [10] with the elastic properties of materials. These correlations allow us to quantify residual stresses.

Residual elastic strains emerge within a body due to permanent plastic strains [11,12,13], resulting from mechanical loads [14], thermo-mechanical effects [15,16,17,18], or phase transitions [19, 20]. To comprehensively understand compatibility conditions that ensure structural integrity when different regions of a body deform in various ways, it is imperative to map residual elastic strains throughout the entire structure. This necessitates repeating destructive or non-destructive residual stress quantification techniques at regular intervals until a complete map is obtained. However, these measurements may differ, making it challenging or impossible to analyse the relationship between strain components from various locations, leading to a lack of integrity.

The contour method [21], relying on a body's elastic response after non-contact cutting, allows us to determine residual stresses based on the planar distribution of out of plane displacements. The spatial resolution of this method depends on the density of profilometry sampling points. Calculations of the numerical model using the inverse of displacements yield a continuous map of residual stresses that satisfy equilibrium conditions. This method excels in ensuring compatibility between experimental data, processed as a continuous function, and the numerical model's equilibrium calculations. However, integrating processed experimental data with linear elastic numerical models poses challenges, hindering its use by researchers and professionals.

Neutron diffraction validations using welds [22,23,24] and railway rails [25] have elevated the contour method's status as a reference experimental technique for mapping residual stress fields. Additional validation can be found in The Net Task Group 4 [26] studies, which encompass a wide range of experimental and numerical examinations along with the contour method. This method has also been employed in stress analysis of welds [27] and for validating eigenstrain theory-based reconstruction methods [28,29,30,31]. Hosseinzadeh et al. [32] have compiled a comprehensive guide detailing the contour method's steps: cutting, data processing, and numerical modelling. pyCM [33] offers an open-source package for experimental data processing and analysis, eliminating the need for separate libraries. However, the influence of errors related to experimentation, profilometry data processing, and manufacturing conditions on numerical calculations' accuracy remains an ongoing challenge.

Eigenstrain theory attributes residual stresses to permanent plastic strains known as eigenstrains [34]. This theory facilitates the reconstruction of eigenstrains [11] by the help of linear optimization methods [30, 35, 36] or principles of artificial intelligence [13, 28, 37] using experimental measurements from destructive [38] and non-destructive sources [39, 40]. After introducing eigenstrains, the predefined finishing conditions of a body can be employed to assess elastic responses, including displacement, residual elastic strain, and residual stress, resulting from subsequent processes such as non-contact cutting [41] while ensuring equilibrium and compatibility across the entire body.

This study introduces the OxCM contour method solver, developed at the MBLEM lab in the Department of Engineering Science, University of Oxford. The presented solver is based on the legacy version of FEniCS, following the principle of superposition [42]. Its objective is to standardize numerical calculations within an estimated error range, utilizing processed experimental data and a tetrahedral mesh of the entire domain, following the static boundary condition rule outlined in this paper.

While the contour method excels in reconstructing residual stresses successfully based on the assumption of continuous processing conditions, engineering parts involve irregularities related to discontinuous processing conditions [43] and geometric features. Accordingly, the error of reconstruction is expected to depend on these irregularities. In this study, numerical experiments were designed to investigate the influence of such irregularities on the contour method residual stress reconstruction. Artificially created continuous and discontinuous processing bodies with regular and irregular geometric features were analysed for validation and error estimation of the OxCM contour method solver calculations.

In a case study involving a nickel-based superalloy finite-length weldment, the knowledge acquired from numerical experiments was utilized to map residual stress states following an exceptionally complex thermal–mechanical manufacturing process. This case study exemplifies the application of the OxCM contour method solver and is compared with solutions from a commercial PDE solver that was validated through neutron diffraction strain scanning measurements [37] for the planar reconstruction of residual stresses in the same discontinuous processing body.

2 Methodology

The OxCM contour method solver is designed to standardize the reconstruction of residual stresses in the plane of non-contact cutting, which can also be referred to as the plane of reconstruction. This is accomplished using a set of processed experimental data and tetrahedral mesh aligned with the experimental data. The reliability of the OxCM contour method solver calculations was tested through numerical experiments aimed at gaining a novel understanding of contour method calculation accuracy depending on the processing condition and geometric irregularity. These experiments also served to validate the OxCM contour method solver calculations. The application of the OxCM contour method solver in the case study of discontinuous processing bodies provided additional validation through a commercial finite element method solver.

2.1 The OxCM contour method solver

The contour method is an advanced technique for mapping residual stresses on planar surfaces. Its cost-effectiveness is grounded in specimen processing, surface profilometry experimentation, and raw data analysis. Previous guides have demonstrated that various parameters in processing, experimentation, and data analysis significantly influence the quality of the experimental data used in linear elastic numerical modelling [32, 44] During the operational steps of the contour method, decisions made by the experimenter inevitably influence errors in the processed experimental data. These errors can lead to deviations from the equilibrium state of stress relief. The OxCM contour method solver adopts a static boundary condition rule that eliminates the need for CAD modelling of complex geometries and prevents errors related to model geometry. In the case of availability of processed experimental data and model domain created by extruding the experimental data plane geometry, the initiation of the numerical model's solution is simplified to a single-line command.

The contour method is founded on the principle of superposition, which posits that the elastic relief of residual stresses results from changes in boundary conditions. Displacements occur on the newly formed boundaries after electric discharge machine non-contact cutting as a consequence of residual stress relief. To quantify residual stresses within the original body, these displacements are imposed on a stress-free domain. However, in the numerical implementation of this calculation, the introduction of boundary conditions is essential to balance the loads that may arise due to the imposed displacements. The imposition of these boundary conditions is a critical aspect of the presented contour method, often achieved through methods such as symmetry.

The OxCM contour method solver enforces static boundary condition rule by setting boundary conditions on two parallel planes of model domain extruded from the geometry of non-contact cutting plane positioned parallel to the \(xy\)-plane. The first plane, situated on the positive side of the \(z\)-axis, accommodates the reversed magnitude of surface contour resulting from the non-contact cutting process. The second plane, located on the negative side of the \(z\)-axis, includes symmetry boundary conditions.

The initiation of the OxCM contour method solver requires a finite element model domain and experimental surface contour data that is processed according to the guidelines provided by Hosseinzadeh et al. [32]. The model domain is generated by extruding the two-dimensional non-contact cutting surface geometry parallel to the \(xy\)-plane along the \(z\)-axis and meshing the resulting three-dimensional body using tetrahedral elements.

To initiate the OxCM contour method solver from the command line, users need two input files: a tetrahedral mesh file in “.xml” format supported by the legacy version of FEniCS and a text file containing surface contour data. Tetrahedral elements are preferred because of their ability to capture deformations accurately due to high connectivity and their ability to mesh domains with complex geometric properties. The surface contour data is presented as out-of-plane displacements distributed on the \(xy\)-plane in three columns: \(x\)-coordinate, \(y\)-coordinate, and \(z\)-displacement, separated by tabs in scattered or ordered form.

After initiating the OxCM contour method solver from the command line, following the up-to-date rules provided in the corresponding repository, the OxCM contour method solver creates a function space with an order determined by the user. The processed surface contour data is then distributed to the degrees of freedom points of the function space located at the plane of reconstruction by bicubic interpolation, and displacement boundary conditions are applied to the corresponding degrees of freedom as reverse of the measured displacements. Subsequent to the application of static boundary conditions to the back plane located at saturation depth, the linear elastic finite element model is solved using Young's modulus and Poisson's ratio defined in the command line. At the end of the solution, the outputs of the model are saved as three-dimensional plots in ParaView Data (PVD) format. Up-to-date rules of the OxCM contour method solver, file formats and flow chart, given in Fig. 1, can be found in the project repository.

Fig. 1
figure 1

Flowchart of the OxCM contour method solver

2.2 Numerical experiments

According to Saint–Venant's principle, when dealing with statistically equivalent local distributions of external loads, the difference between them becomes negligible at positions sufficiently far away from these loads. In the context of the contour method, tractions develop on the plane of reconstruction due to the applied displacement boundary conditions within a stress-free model domain. These tractions must maintain static equilibrium, meaning a zero resultant force and moment. As a result, the internal stresses induced by these displacements diminish at distances roughly proportional to the cross-sectional size of the body. To minimize their influence, additional rigid boundary conditions were applied at a distance chosen carefully in relation to the length of the continuous processing body. In the OxCM contour method solver, the loads introduced by the applied displacements on the surface were balanced with corresponding points on the rigid boundary surface, ensuring equilibrium and minimizing numerical errors in quantifying residual stresses.

The tetrahedral mesh domain of the OxCM contour method solver remains independent of the geometric properties of the specimen. However, the processing conditions of the specimen and the saturation depth of the domain defined as the distance between the plane of reconstruction and the parallel back surface of the domain influence the reliability of the OxCM contour method solver calculations, aligning with Saint–Venant's principle and the conditions of static equilibrium. To comprehend the collective impact of processing conditions and domain depth, numerical experiments were designed.

The domain that mimics geometric features of a finite length weldment was created as illustrated in Fig. 2 for numerical experiments by extruding the non-contact cutting plane and by meshing using tetrahedral elements. The reference state of residual stresses determined in this domain based on eigenstrain theory were reconstructed at varying extrusion depths created using the artificial non-contact cutting plane measuring 12 \(\times\) 150 mm. The edge size of the tetrahedral elements in this domain was determined to be 2 mm, and they were distributed homogeneously throughout the rectangular domain.

Fig. 2
figure 2

a Illustration of the discontinuous processing body of finite length weldment and non-contact cutting plane and b the representation of model domain with boundary conditions

Although the illustrations in Fig. 2 represent the discontinuous processing conditions of finite length weldments, numerical experiments encompass both continuous and discontinuous processing scenarios. The analysis of the domain extrusion depth allowed the determination of the saturation depth of the tetrahedral mesh domain for each processing condition. This was achieved by adjusting the domain depth as 2 mm thick layers of tetrahedral elements. For instance, when the domain depth was set to 10 mm, it accommodated 5 layers of tetrahedral elements, and the number of layers varied linearly as the tested domain depths became multiples of 10 mm.

Numerical experiments were designed based on the eigenstrain theory, involving the incorporation of a predetermined eigenstrain field to establish reference conditions. This approach follows the principle that subsequent non-contact cutting does not alter the distribution and magnitude of permanent plastic strains, but they do change the resulting residual stresses due to new boundary conditions. According to the eigenstrain theory, permanent plastic strains, responsible for residual stress formation, are defined as eigenstrains. After implementing an eigenstrain field into the numerical model's domain, resulting residual stresses were calculated by solving linear elastic equations, which depend on the specified boundary conditions. For detailed formulation information, please refer to previous studies [28, 41]. In this study, the impact of the non-contact cutting process is addressed by removing the symmetry boundary condition on the cut plane. Calculations of the linear elastic model were performed to determine the elastic responses of the domain in both before and after non-contact cutting stages. These calculated elastic responses encompass residual stresses and displacements respectively. The obtained displacements, after eliminating the symmetry boundary condition on the cut plane, are then used in the calculations performed by the OxCM contour method solver.

The condition of continuous processing was achieved by importing the \(z\)-component of eigenstrains using Eq. 1. In this equation, \(a\) represents an arbitrary constant that allows the adjustment of the eigenstrain field's magnitude. \(k\) and \(l\) represent the dimensions of the domain along the \(x\)- and \(y\)-axes, respectively. \(x\) and \(y\) denote the coordinates along the \(x\)- and \(y\)-axes, respectively. This results in a continuous eigenstrain field that varies exclusively along the \(x\)- and \(y\)-axes only.

$${C}_{eig}\left(x,y\right)=a {\text{exp}}\left(\frac{-{x}^{2}}{{\left(k/8\right)}^{2}}\right){\left(y+0.5l+1\right)}^{2}$$
(1)

The discontinuous processing condition was satisfied using Eq. 2 where \({C}_{eig}\) is defined by Eq. 1 while \(b\) and \(n\) are arbitrary constants and \(z\) represents the position along the \(z\)-axis. This equation defines an eigenstrain field that varies in the \(x\)-, \(y\)-, and \(z\)-axes. Similar to the conditions of continuous processing, only the \(z\)-component of eigenstrains were imported into the model domain.

$${D}_{eig}\left(x,y,z\right)={C}_{eig}\left(x,y\right) \left(\frac{{z}^{n}}{{b}^{n}+{z}^{n}}\right)$$
(2)

A challenging alternative of discontinuous processing was also analysed in the domain that mimics geometric features of a finite length weldment by including \(x\)- and \(y\)-components of eigenstrain, assigning the same eigenstrain field defined with a magnitude proportional to the dimensions of the domain illustrated in Fig. 1.

In addition to the irregularities arising from discontinuous processing conditions, geometric irregularities are expected to impact the calculations of the OxCM contour method solver. Consequently, an investigation into the static boundary condition rule of the OxCM contour method solver was conducted using an artificial body with irregular geometric properties as illustrated in Fig. 3a. This body accommodates eigenstrains distributed only parallel to the \(xy\)-plane and remains constant along the \(z\)-axis using the formulation given in Eq. 3 where c represents an arbitrary constant.

Fig. 3
figure 3

Illustration of a the domain of artificial body with irregular geometric properties and b the domain created according to static boundary condition rule of the OxCM contour method solver along with tetrahedral elements and the plane of reconstruction bounded by dashed lines

The reference irregular domain was designed to exhibit symmetry at the depth end, and the eigenstrain model was solved to determine displacements on the front end resulting from changes in the boundary conditions due to non-contact cutting. The OxCM contour method solver calculations were performed using both the domain with irregular geometric features and an additional domain, as illustrated in Fig. 3b, created according to the static boundary condition rule. The depth of the second domain is determined to be double the depth of the irregular domain. Tetrahedral meshes of both domains were created with a seed size of 1 mm.

$${G}_{eig}\left(x,y\right)= {\text{sin}}\left(\frac{c\left|x\right|}{k}\right){\text{sin}}\left(\frac{c\left|y\right|}{l}\right)\sqrt{2/kl}$$
(3)

2.3 Case study

The distribution of residual stresses in Inconel 740H finite length weldment illustrated in Fig. 2 was reconstructed on the plane of non-contact cut. This reconstruction was accomplished by utilizing an externally generated tetrahedral mesh representing the domain, in conjunction with processed profilometry data collected using a laboratory-based coordinate measuring machine. Notably, this marks the inaugural application of the OxCM contour method solver for quantifying residual stresses within a discontinuous processing body.

3 Results

Numerical experiments have yielded insights into the saturation depths of the tetrahedral mesh in domains representing both continuous and discontinuous processing bodies, all created based on the eigenstrain theory. The numerical experiment conducted using an idealized continuous processing body has also allowed us to assess the reliability of the OxCM contour method solver calculations. Similarly, the numerical experiment involving a discontinuous processing body has provided an estimate of the expected error range in the calculated residual stresses. The numerical experiment involving geometric irregularities presented the influence of static boundary condition rule on the calculation of the OxCM contour method solver. These insights, gleaned from the outcomes of the numerical experiments, have enhanced the understanding of the case study. All numerical experiments and the case study were carried out with Young's modulus set at 200 GPa and Poisson's ratio at 0.29.

3.1 Numerical experiments

Numerical experiments were conducted to reconstruct residual stresses within the plane of the non-contact cutting. This was achieved by utilizing displacement information, which represents the elastic response of the material when boundary conditions within this plane are altered. Reference bodies were generated based on the eigenstrain theory, using the functions defined in Eqs. 1 and 2. These equations were applied to simulate continuous and discontinuous processing conditions. For each scenario, the arbitrary constants, \(a\), \(b\), \(c\) and \(n\), were systematically adjusted to 0.5, 50, 6.283 and 10, respectively. Additionally, the long-transversal span of the domain, denoted as \(k\), was set to 150, and the short-transversal span, \(l\), to 12.

Varying domain depths using data from both continuous and discontinuous processing conditions were tested. The ratio of the root mean squared average of the \(z\)-component of residual stresses on the cut plane, as calculated by the OxCM contour method solver, to the same average in the reference state, reveals that the saturation of model calculations occurs when the domain depth reaches 100 mm as illustrated in Fig. 4. Based on this result, it can be concluded that increasing the domain depth beyond saturation does not significantly impact the quantification of residual stress. Further investigation into the percent error, which defines the percent deviation of the root mean squared \(z\)-component of residual stresses calculated by the OxCM contour method solver from the reference state, shows that the percent error for continuous processing conditions is less than 0.2% at this depth. This represents the minimum error observed among all tests under continuous processing conditions. This error contradicts the well-established superposition principle. However, differences in the model structure between the two calculations (the reference based on the eigenstrain theory and the contour method relying on displacements transferred from the reference solution), along with the effect of rounding during the transfer of displacement data to the contour method solutions, make this negligible error inevitable.

Fig. 4
figure 4

Ratio of the root mean squared \(z\)-component of residual stresses on the cut plane, calculated by the OxCM contour method solver, to the reference state, and the corresponding percent error in terms of deviation from the reference state

The results presented in Fig. 4 indicate that, unlike continuous processing conditions, discontinuous processing conditions do not reach a minimum error state. Instead, the percent error continues to decrease at an insignificant rate as the domain size increases beyond 100 mm. The percent error is 10.13% at a domain depth of 100 mm, gradually reducing to 6.3% with increasing domain depth. When dealing with discontinuous processing bodies, it is advisable to maintain the domain depth at the point of saturation and increase it only if a lower error is desired. However, it's important to consider that increasing the domain depth will also increase the computational power required. The decision regarding domain depth should be made based on the available computational resources. Consequently, in this study, the saturation depth was determined to be 100 mm for the analysis of numerical experiments involving continuous and discontinuous processing.

The distributions of displacements for both continuous and discontinuous processing artificial bodies are presented in Fig. 5, alongside the applied displacements used in the solutions obtained from the OxCM contour method solver. These results also demonstrate the applied displacements for reconstructing residual stresses on the non-contact cutting plane that are opposite to the displacements observed in the reference bodies after non-contact cutting. Residual stresses in the reference bodies are displayed in Fig. 6, following the reconstruction of residual stresses in the non-contact cutting planes using the OxCM contour method solver. The results indicate a perfect match of residual stresses in the case of continuous processing. However, a slight deviation from the reference state is observed in the case of discontinuous processing. As mentioned earlier, the accuracy of this solver's calculations depends on the depth of the domain of the extruded cut plane. It is possible to achieve a negligible error state by setting a saturation depth beyond the specified limit. Line plots in Fig. 7 demonstrate the excellent match between reconstructed residual stresses and the reference state under continuous processing conditions. This finding validates the precision of the contour method and the OxCM contour method solver in accurately reconstructing residual stresses within a planar region.

Fig. 5
figure 5

Illustrations of the \(z\)-component of displacements (\(u\_z\)) in the reference (ref) state of artificial continuous (CPB) and discontinuous (DPB) processing bodies and their implementation to the OxCM contour method solver domain as reverse of displacements of reference state when the domain depth is 100 mm

Fig. 6
figure 6

Illustrations of the \(z\)-component of residual stresses (\(s\_zz\)) in the reference (ref) state of artificial continuous (CPB) and discontinuous (DPB) processing bodies and their reconstructions by the OxCM contour method solver when the domain depth is 100 mm

Fig. 7
figure 7

Distribution of the \(z\)-component of residual stresses on the cut plane, averaged along the \(y\)-axis in the reference state of an artificial continuous processing body, and their reconstruction by the OxCM contour method solver when the domain depth is 100 mm

The success of the contour method hinges on the fulfilment of compatibility conditions within the experimental data, which occurs due to the continuous distribution of elastic response following changes in boundary conditions resulting from non-contact cutting. However, it's important to note that the concept of infinitely continuous processing conditions is a theoretical construct, achievable only through numerical methods based on continuum mechanics assumptions. In the case of a discontinuous processing body, the elastic response to boundary condition changes caused by non-contact cutting can still be collected. However, results indicate that errors emerge when reconstructing residual stresses in such bodies. This occurs because the experimental data does not encompass information about compatibility conditions across the entire body, as is the case in continuous processing. Furthermore, the findings of this study demonstrate that error reduction is continuous as the domain depth increases, but achieving an exact match with the reference state requires high computational costs. Thus, the satisfaction of compatibility conditions solely within the region of the non-contact cutting is not the only determinant of the contour method's success. This method inherently relies on compatibility conditions spanning the entire body, delivering excellent reconstruction results only when displacement data from the non-contact cutting plane incorporates information about compatibility conditions present in continuous processing conditions.

Detailed investigation of the thickness-averaged line plots presented in Fig. 8 reveals that the distribution of residual stresses remains consistent. However, the symmetry along the \(x\)-axis is disrupted in the calculations produced by the OxCM contour method solver, accompanied by a shift in magnitudes. The contour method blindly assumes that the displacement data inherently contains information about the compatibility conditions of the entire body and subsequently provides a solution that satisfies equilibrium conditions based on that assumption. In reality, this is not the case, and the magnitude shift and loss of symmetry cannot be rectified through this approach. Instead, improving results necessitates leveraging the intrinsic properties of a numerical solution. Enhancing symmetry conditions may be achievable through mesh adjustments, but this approach is discouraged because mesh refinements rely on presumptions about the state of residual stress. Conversely, employing a higher mesh density is recommended as it allows for better alignment with the reference state. Furthermore, increasing the domain depth also reduces reconstruction errors. Consequently, it can be asserted that utilizing higher mesh density and domain depth beyond the onset of saturation yields improved reconstruction results, albeit at the expense of increased computational demands for linear elastic calculations. The deviation of reconstructed residual stresses from the reference state is contingent upon the factors elucidated above. The displacement data acquired from the non-contact cutting plane of this body lacks information about the compatibility conditions within the body's interior, and there is no feasible method for rectifying this error within an approach that solely aims to reconstruct residual stresses within the same plane as the experimental data.

Fig. 8
figure 8

Distribution of the \(z\)-component of residual stresses on the cut plane, averaged along the \(y\)-axis in the reference state of an artificial discontinuous processing body, and their reconstruction by the OxCM contour method solver when the domain depth is 100 mm

An additional challenging mixed eigenstrain state is created in the discontinuous processing body by assigning \(x\)-, \(y\)-, and \(z\)-components of eigenstrain using Eq. 2. In order to achieve a complex residual stress state, each component is multiplied by dimensionless constants of 0.75, 0.06, and 1.0, respectively. The domain depth is set equal to the saturation depth that was determined to be 100 mm for the analysis of both continuous and discontinuous processing conditions. Figure 9 displays the resulting residual stresses before and displacements after non-contact cutting from the symmetry plane, along with the displacements assigned in the contour method and the corresponding residual stresses. Three-dimensional illustrations emphasize that the contour method's reconstruction is reliable only on the plane of experimental data.

Fig. 9
figure 9

Illustrations of the distribution of \(z\)-component of displacements and residual stresses in discontinuous processing artificial body with mixed state of eigenstrain distribution and their reconstructions by the OxCM contour method solver

The capability of the contour method in reconstructing residual stress components other than those parallel to the experimental data component was also investigated using a reference body subjected to discontinuous processing. To assess the reliability of all reconstructed residual stress components distributed on the plane of the experimental data, through-thickness averaged line plots of the reference and reconstructed states are presented in Fig. 10. Additionally, the percent errors for the \(x\)-, \(y\)-, and \(z\)-components of residual stresses are quantified as 273.17%, 377.64%, and 10.03%, respectively. While the literature contains previous reports focusing on the determination of multiaxial distribution residual stresses on the cut plane after non-contact cutting [45], the determination of residual stresses parallel to the plane of reconstruction falls outside the scope of this study. Based on the line plots and the quantified percent errors, it can be concluded that the contour method provides reliable results only for the residual stress component parallel to the experimental data component, in other words, the residual stress component normal to the cut plane. Furthermore, a 10.03% error shows consistency with the analyses conducted on the discontinuous processing body. Therefore, it can be concluded that the inclusion of other components of eigenstrains, or in other words, the presence of permanent plastic strains other than those distributed normal to the non-contact cutting plane, does not influence the percent error. As the availability of additional components of eigenstrain results in significant changes in the distribution of resulting residual stresses in the reference state, the distribution of residual stresses calculated by the OxCM contour method solver exhibits a non-symmetric variation specific to the mixed eigenstrain state. Similar to the previously tested discontinuous processing condition, improvements in the OxCM contour method solver calculations can be achieved by increasing the domain depth beyond the saturation depth, leading to negligible errors.

Fig. 10
figure 10

Distribution of the \(x\)-, \(y\)- and \(z\)-components of residual stresses on the cut plane averaged through the y-axis in the reference state of the discontinuous processing artificial body of the mixed state of eigenstrain and their reconstructions calculated by the OxCM contour method solver

The OxCM contour method solver aims to provide a standardized solution within a body that corresponds to the extrusion of the non-contact cutting plane. Given that equilibrium and compatibility conditions dictate that stresses are interconnected throughout the body, the placement of static boundary conditions should be carefully adjusted. To achieve a state of negligible error, the domain depth should be set beyond the saturation depth. Users should also consider that real bodies can have complex shapes.

Investigations into the influence of geometric irregularities reveal that when eigenstrains are available and distribute solely along the \(x\)- and \(y\)-axes, geometric irregularities have an insignificant impact on the calculations of the OxCM contour method solver, as illustrated in Fig. 11. The results indicate that displacements at the front end of the irregular domain, caused by implemented eigenstrains, enable the successful calculation of residual stresses on the plane of reconstruction by the OxCM contour method solver, using the model domain created according to the static boundary rule. Residual stresses reconstructed by the OxCM contour method solver using the irregular reference domain and the rectangular domain created by extrusion show excellent agreement with the distribution and magnitude of residual stresses determined by the eigenstrain model calculations in the reference domain before non-contact cutting.

Fig. 11
figure 11

Illustration of the distribution of residual stresses in the reference (ref) domain before non-contact cutting, displacements in the reference (ref) domain after non-contact cutting and residual stresses reconstructed by the OxCM contour method solver using two domains with different geometric features

The percent errors of reconstruction in the irregular and regular domains are quantified as 10.29% and 5.85%, respectively. This result demonstrates that extending the extrusion depth improves the error of reconstruction by achieving a lower error in a domain created according to the static boundary condition rule with a depth that is double the depth of the irregular domain. It should also be mentioned that this error analysis pertains to this specific irregular domain only. Different domains with various geometric irregularities can affect the error of reconstruction in a different way.

3.2 Case study

The first application of the OxCM contour method solver involved a case study to quantify residual stresses in the finite length weldment of Inconel 740H superalloy. To ensure the reliability of the OxCM contour method solver, an investigation into the saturation depth was conducted, guided by insights gained from numerical experiments. The distribution of the root mean squared average of residual stresses with respect to domain depth is presented in Fig. 12. These results indicate that saturation occurs at a domain depth of 100 mm. Based on the findings of this analysis, the saturation depth was determined to be 100 mm in the rectangular domain, which replicated the same conditions as those in numerical experiments.

Fig. 12
figure 12

Root mean squared of \(z\)-component of residual stresses on the cut plane of finite length nickel alloy weldment calculated by the OxCM contour method solver

The results of numerical experiments revealed that only the residual stress component normal to the non-contact cutting surface, located on the same surface, can be considered reliable. The distributions of \(z\)-component of displacements and the corresponding reconstructed residual in the plane of reconstruction can be seen in Fig. 13. Results demonstrate that the OxCM contour method solver successfully reconstructed the expected transversal distribution of longitudinal residual stresses within the metallic body of the finite length weldment. Specifically, it shows tensile stresses around the weld bead and compressive stresses away from the weld beam.

Fig. 13
figure 13

Illustrations of (top) distribution of \(z\)-component of displacements and (bottom) residual stresses on the cut plane of finite length nickel alloy weldment calculated by the OxCM contour method solver

Figure 14 additionally includes the results from previous studies involving the same specimen [28]. These solutions were performed using the Abaqus FEA by applying the contour method and the eigenstrain reconstruction method and validated using neutron diffraction technique in the past study of authors [37]. The Abaqus FEA solutions presented in Fig. 14 were obtained in a domain with the same geometry as the OxCM contour method solver solution but with a different mesh arrangement. The Abaqus FEA solutions used point-wise boundary conditions, which differ significantly from the static boundary condition defined in the OxCM contour method solver solutions, that leave the back surface of the model domain completely free to move in the direction normal to the cut plane. The comparison between different solvers validates the use of the static boundary condition in the OxCM contour method solver and demonstrates that it does not have a negative impact on the accuracy of the OxCM contour method solver calculations while eliminating rigid body motions and providing robustness of solutions. Based on the numerical experiments, it can be estimated that the percent error of this reconstruction is approximately 10%. Increasing the domain depth is expected to yield more reliable results with lower error as a return of higher computation cost according to the results of numerical experiments.

Fig. 14
figure 14

Distribution of \(z\)-component of residual stresses calculated by the OxCM contour method solver along with Abaqus FEA contour method (CM) and eigenstrain reconstruction (Eig) solutions on the cut plane of finite length nickel alloy weldment averaged thought the \(y\)-axis

4 Conclusions

The contour method is the only direct method for calculating residual stresses within the region of experimental data that satisfies compatibility conditions in the plane of reconstruction. It pertains to the elastic response of a metallic body, corresponding to changes in boundary conditions. The OxCM contour method solver offers a standardized approach for solving the numerical model, providing accurate quantification of residual stresses when high-quality experimental data and sufficient computational resources are available. Users can initiate the solver with a single command line, given the presence of processed experimental data and a tetrahedral mesh of the model domain.

The OxCM contour method solver has been rigorously tested through highly reliable numerical experiments designed based on the eigenstrain theory. The primary decision required when using this solver is determining the saturation depth. Real-world problems seldom adhere to idealized, infinitely continuous processing conditions. Therefore, numerical experiments involving discontinuous processing conditions serve as a guide for error estimation. It's important to note that while the error in a case study depends on various parameters related to processing, experimentation, and data analysis in the contour method, errors associated with non-contact cutting, as well as the collection and processing of experimental data, are not considered in these numerical experiments. A negligible level error of reconstruction of residual stresses can be expected at the initiation of the saturation depth by the application of static boundary condition rule and further improvements can be attained by increasing mesh density and domain depth. The analysis of the static boundary rule presented in this study proves instrumental in applying the contour method to irregular geometries, thereby enhancing its practical utility. Potential scenarios like laser powder bed fusion additive manufacturing parts with irregular geometries exemplify intricate geometries. The proposed extrusion approach for the application of this rule effectively addresses this challenge and eliminates the need for modelling of complex CAD geometries.

Numerical experiments conducted on regular geometries subjected to both continuous and discontinuous processing conditions show that the contour method provides excellent results with negligible error in the case of continuous processing. However, engineering parts with regular geometries are rare, and irregularities in geometric features negatively affect the calculations of the contour method. In addition, it is not possible to provide a generalized error estimation related to geometric features, so the influence of geometric irregularities should be assessed individually.

Reconstructions performed using the original geometry of irregularly shaped bodies achieved an error level similar to that of regularly shaped bodies with discontinuous processing features, providing an accurate estimation of residual stress distribution. On the other hand, the static boundary condition rule introduced by the OxCM contour method solver improved the error in reconstructing residual stresses in irregularly shaped bodies. Therefore, it can be concluded that different processing conditions and geometric features influence the calculations of the OxCM contour method solver but do not impose limitations.