A method for constructing a digital twin model of the temperature field in laser welding

CN122572010APending Publication Date: 2026-08-14WUHAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-06
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

然而,现有焊接温度场的仿真技术面临如下问题:高保真三维模型单工况计算耗时过长,多参数优化时计算量呈指数增长;传统高斯热源假设无法准确反映实际激光束能量分布,导致熔池形貌与温度场仿真预测精度不足

Benefits of technology

[0012]本发明基于ANSYS APDL和Python的参数化批处理技术,实现了多工况仿真数据的自动化生成,构建覆盖全工艺参数空间的高质量训练数据集,并在神经网络模型训练过程中引入熔池区域权重系数,以在不增加数据成本的前提下,显著提升数字孪生模型对焊接核心区域的预测可信度,同时大幅降低计算耗时。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122572010A_ABST
    Figure CN122572010A_ABST
Patent Text Reader

Abstract

This invention discloses a method for constructing a digital twin model of a laser welding temperature field, comprising the following steps: generating simulation results of the laser welding temperature field; training a neural network prediction model based on the simulation results of the laser welding temperature field, and using the trained neural network prediction model as the temperature prediction model of the laser welding temperature field; obtaining the data source for client modeling based on a server with a deployed temperature prediction model and an RBF proxy model, and sending the data source to the client; and constructing a digital twin model of the temperature field on the client based on the data source. This invention can automate the generation of multi-condition laser welding temperature simulation data, and can reduce the data transmission load while ensuring the accuracy of the temperature field cloud map display, significantly improving the real-time response capability of the digital twin system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent manufacturing technology, specifically a method for constructing a digital twin model of the temperature field in laser welding. Background Technology

[0002] Laser welding technology, with its high energy density, narrow heat-affected zone, and excellent processing precision, has become a key joining process in aerospace, new energy vehicles, and precision electronics. The spatiotemporal evolution of the transient temperature field during laser welding directly affects the morphology of the molten pool, the distribution of residual stress, and the formation of microstructure, thereby determining the mechanical properties of the weld and the probability of defects (such as porosity and cracks).

[0003] Therefore, existing technologies have developed a technical solution for predicting welding temperature fields using numerical simulation. This is mainly based on the thermo-mechanical coupling simulation of the finite element method (FEM). By solving the heat conduction equation and the elastoplastic constitutive model, the evolution of the welding temperature field can be approximately simulated. However, existing welding temperature field simulation technologies face the following problems: high-fidelity three-dimensional model calculations for single-condition operations are too time-consuming, and the computational load increases exponentially when optimizing multiple parameters; the traditional Gaussian heat source assumption cannot accurately reflect the actual laser beam energy distribution, resulting in insufficient accuracy in the simulation prediction of molten pool morphology and temperature field. Summary of the Invention

[0004] To address the aforementioned issues, this invention proposes a method for constructing a digital twin model of the laser welding temperature field. This method can automatically generate laser welding temperature simulation data under multiple working conditions, and can reduce data transmission load while ensuring the accuracy of temperature field cloud map display, thus significantly improving the real-time response capability of the digital twin system.

[0005] To achieve the above objectives, the present invention provides the following technical solution:

[0006] A method for constructing a digital twin model of the temperature field in laser welding is provided, which includes the following steps:

[0007] Simulation results of generating the temperature field for laser welding;

[0008] The neural network prediction model is trained based on the simulation results of the laser welding temperature field, and the trained neural network prediction model is used as the temperature prediction model of the laser welding temperature field.

[0009] The server, which is equipped with a temperature prediction model and an RBF proxy model, obtains the data source for client modeling and sends the data source to the client.

[0010] Furthermore, based on the aforementioned data source, a digital twin model of the temperature field is constructed on the client side.

[0011] Compared with the prior art, the present invention has the following beneficial effects:

[0012] This invention utilizes parametric batch processing technology based on ANSYS APDL and Python to automate the generation of simulation data under multiple working conditions, construct a high-quality training dataset covering the entire process parameter space, and introduces a weight coefficient for the molten pool region during the training of the neural network model. This significantly improves the prediction reliability of the digital twin model for the welding core region without increasing data costs, while also greatly reducing computation time.

[0013] Furthermore, this invention combines a lightweight proxy model with 3D dynamic rendering technology to achieve real-time visualization and interaction of the laser welding temperature field. By using the Unity3D engine, the temperature field data is transformed into a real-time dynamic cloud map, which solves the pain point of poor visualization interactivity in existing systems and makes the evolution process of the laser welding temperature field intuitive and interactive.

[0014] Meanwhile, the communication link between the server and client of this invention adopts a standardized data protocol and lightweight RBF interpolation technology, which opens up a two-way data channel between the finite element data body and the digital twin. It can realize millisecond-level synchronization of temperature field data, process parameters and spatial coordinates through TCP local loopback, and combine the RBF proxy model for real-time interpolation transformation of finite element mesh, which reduces data transmission load while ensuring the accuracy of cloud map display, and significantly improves the real-time response capability of the digital twin system. Attached Figure Description

[0015] Figure 1 This is a flowchart illustrating the steps of the method for constructing a digital twin model of the laser welding temperature field in this invention.

[0016] Figure 2 This is a three-dimensional geometric model of the workpiece in this invention;

[0017] Figure 3 This is a simulation cloud map of the laser welding temperature field in the simulation results of this invention;

[0018] Figure 4 This is the storage format for the laser welding process parameter combinations, time steps, and temperature data in the simulation results of this invention.

[0019] Figure 5 This is the MLP neural network model architecture in this invention;

[0020] Figure 6 This is a scatter plot of the training loss, validation loss, predicted temperature, and actual temperature during the training process of the MLP neural network model in this invention.

[0021] Figure 7 This is a schematic diagram of the client and server structures in this invention;

[0022] Figure 8 This is the client's operating interface in this invention. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of this technical solution clearer, the following detailed description, in conjunction with specific embodiments, further illustrates this technical solution. It should be understood that these descriptions are merely exemplary and not intended to limit the scope of this technical solution.

[0024] Example 1:

[0025] like Figure 1 As shown in the figure, this embodiment provides a method for constructing a digital twin model of the temperature field in laser welding, which includes the following steps:

[0026] S1. Generating simulation results of the laser welding temperature field based on simulation software such as ANSYS, which specifically includes the following steps:

[0027] S11. Create a three-dimensional geometric model P corresponding to the real laser-welded workpiece, and set simulation parameters in ANSYS based on the material properties of the real laser-welded workpiece. The simulation parameters include: material properties, heat source model of laser welding, boundary conditions, initial temperature value, finite element mesh node generation scheme of the three-dimensional geometric model, and laser welding process parameters such as laser power, laser scanning speed, and defocusing amount used for simulating laser welding, etc., one or more of these. The material properties include parameters that can change with temperature, which may specifically include one or more of these, such as density, thermal conductivity, and specific heat capacity. The initial temperature value refers to the initial temperature of the entire geometric model at the initial moment, which can usually be determined as room temperature. The boundary conditions refer to the heat exchange conditions between the surface of the geometric model and the external environment, which may specifically include convective heat transfer boundaries simulating natural heat dissipation from the workpiece surface and moving heat source boundaries simulating dynamic heat input from the heat source model, etc.

[0028] S12. Calculate the simulation temperature data of each grid node in each time step based on ANSYS. After completing all ANSYS calculations, iterate through all time steps and use the *VGET and *GET commands to extract the coordinates of all grid nodes and the simulation temperature data of all grid nodes in each time step. Save the coordinates and simulation temperature data of all grid nodes to a structured text file (such as a CSV file).

[0029] S13. Use APDL (ANSYS Parametric Design Language) to parameterize the simulation process to obtain the basic APDL script;

[0030] The simulation process includes one or more of the following: creation of the three-dimensional geometric model, setting of simulation parameters, ANSYS calculation, and extraction of the coordinates of all mesh nodes and the simulation temperature data of all mesh nodes within each time step. The basic APDL script can be a command stream file including .inp and .mac files. The .inp file is a command stream script that can execute the complete simulation process, and the .mac file is a parameterized and reusable macro module that can encapsulate common operations (such as loading the heat source model, loading the finite element mesh generation scheme, etc.) into functions, which can be directly called through macro names to achieve modular programming.

[0031] S14. Build a batch simulation platform based on basic APDL scripts and Python to obtain simulation results of the laser welding temperature field. This includes the following steps:

[0032] S141. Complete the ANSYS APDL calculation environment configuration, which specifically includes: determining the ANSYS APDL executable program path; creating a temporary file storage directory and a simulation result storage directory, wherein the temporary file storage directory is used to store APDL scripts, and the simulation result storage directory is used to store the simulation results of the laser welding temperature field.

[0033] S142. Read the basic APDL script and modify the basic APDL script by means of string replacement (e.g., modify the laser welding process parameters in the basic APDL script), and save the modified APDL script as a temporary file temp_apdl_{parameter combination}.inp and store it in the temporary file storage directory.

[0034] S143. Start the ANSYS process using Python's subprocess.run, and run the modified APDL script by calling ANSYS to perform finite element simulation calculations according to the modified APDL script, and output the simulation results of the laser welding temperature field.

[0035] For example, in this embodiment, after the ANSYS process starts, the following command line parameters can be passed:

[0036] -b: Enable batch processing mode and suppress the graphical interface display;

[0037] -i: Specifies the path to the input APDL script temp_apdl_{parameter combination}.inp;

[0038] -o: Specifies the output path for the log file output_{parameter combination}.log, which records the status of the calculation process.

[0039] Therefore, finite element simulation calculations can be completed in batches to obtain simulation results of the laser welding temperature field, and these results can be stored in a target location, such as a simulation results storage directory. In this embodiment, the simulation results include: a simulation cloud map of the laser welding temperature field (e.g.,...). Figure 3 (as shown) and during simulated laser welding under different combinations of laser welding process parameters, the temperature data corresponding to all grid nodes at each time step (e.g.) Figure 4 (as shown)

[0040] S2. Construct a neural network prediction model, and train the neural network prediction model based on the simulation results of the laser welding temperature field. The trained neural network prediction model is then used as the temperature prediction model for the laser welding temperature field. This process includes the following steps:

[0041] S21. Extract all simulation data from the simulation results of the laser welding temperature field. The simulation data includes: all laser welding process parameters, all time steps, all grid node coordinates and all temperature data. Construct a NumPy array based on all extracted simulation data. The NumPy array includes an m-row × n-column feature array and an m-row × 1-column label array.

[0042] Specifically, each row of the feature array includes the coordinates of a grid node, laser welding process parameters from a set of simulation data, and a time step from the simulation data. For example, the feature array (6 rows × 7 columns) is as follows:

[0043]

[0044] Where (x_k1, y_k1, z_k1) and (x_k2, y_k2, z_k2) are the three-dimensional coordinates of mesh nodes k1 and k2, respectively; power_A, speed_A, and defocus_A are the laser power, laser scanning speed, and defocus amount of laser welding process parameter A, respectively; power_B, speed_B, and defocus_B are the laser power, laser scanning speed, and defocus amount of laser welding process parameter B, respectively; and time_t10 and time_t15 are the 10th and 15th time steps, respectively.

[0045] Each row of the label array contains the temperature data for the corresponding row of the feature array. For example, if the feature array is a 6-row × 7-column array, then the label array is a 6-row × 1-column array, and is as follows:

[0046]

[0047] Then temp__A1_t10, temp__A2_t10, temp__A1_t15, temp__A2_t15, temp__B1_t10, and temp__B2_t10 are the temperature data that correspond one-to-one with the data in rows 1-6 of the feature array;

[0048] Furthermore, the NumPy arrays of the same type are normalized according to the following formula:

[0049]

[0050] Where, x norm The normalized simulation data is any one of the following: laser welding process parameters, time steps, grid node coordinates, and temperature data. Preferably, each type of simulation data in the feature array and label array is normalized. x represents the simulation data. mean(x) and std(x) are the mean and standard deviation of the simulation data of the same type, respectively.

[0051] Specifically, in this embodiment, we first traverse all temp_apdl_* subfolders in the simulation result storage directory, extract the temperature data corresponding to all grid nodes in each time step when simulating laser welding under each combination of laser welding process parameters, and then concatenate all the extracted simulation data into a NumPy array containing feature arrays and label arrays, and then perform global normalization processing according to the above formula.

[0052] S22. A PyTorch framework is used to construct an MLP (Multi-Layer Perceptron) neural network model for predicting the temperature field of laser welding, and the MLP neural network model is trained based on the loss function to obtain a temperature prediction model for the laser welding temperature field.

[0053] Specifically, such as Figure 5 As shown, in this embodiment, the dimension of the input layer is first determined based on the input parameters (i.e., the laser welding process parameters, time steps, and mesh node coordinates of the simulation results). The hidden layer is a fully connected layer with ReLU activation, and the output of the fully connected layer is processed through the Dropout mechanism to suppress overfitting. At the same time, the output layer is set as a 1-dimensional linear layer to output the predicted temperature data, thereby constructing an MLP neural network model.

[0054] After the MLP neural network model is built, the normalized feature array data is used as the training dataset, and it is divided into training set, validation set and test set according to the proportion, and the initial learning rate is set.

[0055] Furthermore, the feature array data used as the training set is converted into a PyTorch tensor and input into the MLP neural network model to output predicted temperature data through the MLP neural network model. GPU acceleration is enabled for computation, and the Adam optimizer and loss function Loss are used for model training. After the training results meet the predetermined conditions, an MLP neural network model for predicting the laser welding temperature field is output as a temperature prediction model for the laser welding temperature field.

[0056] Furthermore, in this embodiment, the loss function Loss used for training the MLP neural network model is as follows:

[0057]

[0058] Among them, W bath This is a weighting coefficient for the molten pool region formed during laser welding, with a value ranging from 2 to 10. The molten pool region is the area on the workpiece where the temperature is greater than or equal to the melting point of the workpiece material during laser welding. It can be defined by first setting a temperature threshold based on the melting point of the workpiece material (thresholds), and then further marking the mesh nodes in the simulation results whose temperature data is greater than or equal to this temperature threshold using a Boolean mask (pool_mask) to represent the molten pool region. i The i-th row of the label array contains the temperature data (i.e., the actual temperature value). This refers to the predicted temperature data (i.e., predicted temperature value) output by the MLP neural network model after the i-th row of the feature array used as the training set is input into the model.

[0059] In laser welding temperature field prediction, although the molten pool region accounts for a small proportion of the mesh nodes of the entire workpiece, the accuracy of its temperature distribution directly determines the weld formation quality and the reliability of defect assessment. If the conventional mean square error loss function is used, the model will tend to fit the low-temperature samples that account for the vast majority, resulting in insufficient prediction accuracy of the peak temperature and morphology of the molten pool region. Therefore, this embodiment introduces a molten pool region weight coefficient in the loss function Loss to give the molten pool region a higher weight. This forces the model to prioritize the allocation of its limited fitting ability to the high-temperature molten pool region nodes during training, thereby significantly improving the prediction credibility of the digital twin model for the welding core region without increasing data costs.

[0060] like Figure 6 As shown, when the number of training epochs is 1200, compared with the actual temperature value, the root mean square error (RMSE) of the predicted temperature value output by the MLP neural network model in this embodiment is 10.33℃ (RMSE = sqrt(MSE)), and the coefficient of determination R0 is 10.33℃. 2=0.9911, which proves that the model has good predictive performance and high accuracy (R² = 0.9911). 2 The closer a value is to 1, the better the model's predictive performance. , This is the average value of all temperature data in the label array;

[0061] S3. Obtain the data source for client modeling based on the server-side (such as Python server-side) that has deployed temperature prediction model and RBF proxy model, and send the data source to the client (such as Unity client).

[0062] Specifically, such as Figure 7 As shown, the server side includes a server-side Socket communication module, a TCP server, a message protocol processor, and a temperature prediction module deployed with an MLP neural network model and an RBF (Radial Basis Function) surrogate model; the client side includes a client-side Socket communication module and a control parameter generation module.

[0063] The server and client communicate based on the TCP protocol and establish a Socket connection through the server-side Socket communication module and the client-side Socket communication module. The TCP server listens for connection requests from clients and creates an independent Thread for each client to achieve asynchronous communication, supporting multiple clients concurrently without blocking the main program.

[0064] The control parameter generation module is used to generate control parameters for the simulated laser welding process. These control parameters include the time step corresponding to the spatial position of the virtual laser welding gun used for simulated laser welding on the three-dimensional geometric model P, and the laser welding process parameters for simulated laser welding (the laser welding process parameters include one or more of the following: laser power, laser scanning speed, defocusing amount, etc.). Furthermore, the time step and the time step value of the feature array in the control parameters are the same. In this embodiment, the user can set the virtual laser welding gun used for simulated laser welding, the welding path during simulated laser welding, and the welding gun movement speed in the Unity virtual environment of the client. Based on the welding path length and welding gun movement speed corresponding to the current position of the virtual laser welding gun, the spatial position information of the virtual laser welding gun is mapped to a time step, thereby realizing the mapping from the spatial position of the virtual laser welding gun to the time dimension. Finally, the time step characterizes the temporal information in the welding process.

[0065] For example, a user sets a straight welding path with a length of 100 mm in the Unity virtual environment and sets the moving speed of the virtual laser welding gun to 10 mm / s. When the virtual laser welding gun moves along the welding path to a position 30 mm away from the starting point, the elapsed time t = 30 mm ÷ 10 mm / s = 3 s. Assuming that the simulation data is saved at 0.5-second intervals (i.e., the time step is 0.5 seconds / step), it means that this position corresponds to the 6th time step (3 s ÷ 0.5 s = 6). Thus, any spatial position of the virtual laser welding gun is mapped to a unique time step.

[0066] The control parameter generation module sends the control parameters to the server through the established Socket connection, and the message protocol processor parses the received control parameters to extract the corresponding control parameter information, which is then sent to the temperature prediction module for subsequent processing. In this embodiment, the control parameters generated and sent by the control parameter generation module can be text lines in string format, where the string format is "X + parameter value", where X is a preset character identifier used to represent the data category of the control parameter, and the parameter value is the numerical value of the control parameter. For example, the preset character identifier X can be: T represents the time step, such as "T+6" representing the 6th time step; P represents the laser power, such as "P+4000" representing a laser power of 4000W; S represents the laser scanning speed, such as "S+6.9" representing a laser scanning speed of 6.9 m / min; and D represents the defocus amount, such as "D+0" representing a defocus amount of 0 mm.

[0067] Based on this, after receiving the control parameters, the message protocol processor can extract the data category and corresponding numerical value of the control parameters by parsing the string format, and send it to the temperature prediction module. The temperature prediction module calls the trained temperature prediction model according to the time step in the control parameters, so as to output discrete predicted temperature data through the temperature prediction model. Furthermore, it performs interpolation operation on the discrete predicted temperature data based on the RBF proxy model to obtain continuous predicted temperature data, so as to return the temperature distribution of all grid nodes on the three-dimensional geometric model P at the current time, thereby realizing an accurate mapping from the spatial motion state to the simulation time dimension.

[0068] After the continuously predicted temperature data is returned to the message protocol processor, the message protocol processor performs JSON serialization on the predicted temperature data and encodes it into a byte stream in UTF-8 format, and then sends it to the client through the established Socket connection;

[0069] Because when there are too many time steps, the temperature prediction model takes a long time to output temperature data, which leads to low real-time performance of the temperature data and discrete temperature data. Therefore, it cannot meet the requirement of displaying the continuous change of temperature data over time in the visualization interface. Therefore, in this embodiment, the temperature data under discrete time steps is supplemented by the interpolation operation of the RBF proxy model to improve the real-time performance and response speed of the digital twin, while making the temperature change continuously over time.

[0070] Furthermore, the temperature prediction module obtains continuous predicted temperature data through the following steps:

[0071] S311. Construct an m-row × n-column input matrix features based on the control parameter information. Each row of the input matrix features includes the mesh node coordinates of a three-dimensional geometric model P, a time step of a control parameter, and a set of laser welding process parameters of the control parameters. Thus, the node coordinates and time steps of the input matrix features and the feature array are the same. The only difference is that the values ​​of the laser welding process parameters in the input matrix features are different from those in the feature array.

[0072] The input matrix features are input into the temperature prediction model to output discrete predicted temperature data. The discrete predicted temperature data includes the discrete predicted temperature value of each grid node in each time step when simulating laser welding under different combinations of laser welding process parameters of the control parameters.

[0073] S312. Filter out duplicate mesh nodes in the 3D geometric model P and create a list of non-duplicate mesh nodes containing the remaining mesh nodes. This includes the following steps:

[0074] Export the 3D geometric model P of the welded workpiece from ANSYS, convert it to ASCII-encoded .stl format in 3ds Max software, open it with Notepad, identify the vertex keyword to extract all mesh nodes of the 3D geometric model P, create an original mesh node list containing all mesh nodes, and save it to a CSV file.

[0075] Read CSV data containing grid nodes using tools such as pandas, filter duplicate grid nodes using methods such as drop_duplicates(), and create a list of unique grid nodes containing the remaining grid nodes.

[0076] S313. Based on the discrete predicted temperature data, interpolation calculation is performed to obtain the predicted temperature value of each grid node on the three-dimensional geometric model P at each time step, so as to interpolate and complete the temperature at each grid node on the three-dimensional geometric model P in the spatial dimension. This specifically includes the following steps:

[0077] The discrete predicted temperature data generated in step S311 is used as the source node data, and the grid nodes in the list of non-repeating target grid nodes are recorded as target nodes.

[0078] Based on the KNN (K-Nearest Neighbors) algorithm and other methods, at the current time step, the K grid nodes (K = 1,2,...,M, where M is the total number of grid nodes in the list of non-repeating target grid nodes) that are spatially closest to the current target node k (K = 1,2,...,M, where M is the total number of grid nodes in the list of non-repeating target grid nodes) in the source node data are denoted as the neighbor nodes of the current target node k, and the spatial coordinates of the K neighbor nodes and the discrete predicted temperature value of each neighbor node are recorded.

[0079] The first RBF (Radial Basis Function) interpolator for spatial interpolation is trained based on the spatial coordinates of K neighbor nodes and their discrete predicted temperature values. Then, the following interpolation operation is performed based on the trained first RBF interpolator:

[0080]

[0081] Among them, T k (x i ,y i ,z i (x) represents the spatial coordinates of the current target node k at the current time step. i ,y i ,z i Predicted temperature value at (x) j ,y j ,z j Let be the spatial coordinates of the j-th neighbor node of the current target node k (j = 1,2,…,K), where K is the number of neighbor nodes; 1(·) represents the first radial basis function, and in this embodiment, a Gaussian function can be selected as the radial basis function; ω1 j The spatial interpolation weighting coefficients can be determined by solving the following system of linear equations:

[0082]

[0083] Repeat the above steps of determining neighbor nodes and interpolating with the RBF interpolator to obtain the spatial coordinates (x, y) of the current target node k at each time step. i ,y i ,z i Predicted temperature value at location )

[0084] Repeating the above steps, the current target node k in spatial coordinates (x...) i ,y i ,z i The steps of obtaining the temperature prediction value at point P are repeated until all grid nodes in the list of non-repeating target grid nodes are traversed, and finally the temperature prediction value of each target node on the three-dimensional geometric model P at each time step is obtained.

[0085] Therefore, this embodiment can calculate the predicted temperature value of the target node k by substituting its own spatial coordinates into the RBF interpolator, thereby completely mapping the discrete temperature information in the source node data to each grid node of the three-dimensional geometric model P, and completing the temperature completion of each target node on the three-dimensional geometric model P at each time step.

[0086] S314. Based on the temperature prediction value of each grid node on the 3D geometric model P at each time step, interpolation calculation is performed to obtain the temperature prediction value of each grid node on the 3D geometric model P at different times, so as to interpolate and complete the temperature at each grid node on the 3D geometric model P in the time dimension. The specific steps include the following:

[0087] Based on the temperature prediction value of each grid node on the 3D geometric model P at each time step, a two-dimensional matrix with dimensions of M rows × N columns is constructed. Each row of the two-dimensional matrix includes the coordinates of a grid node on the 3D geometric model P and the temperature prediction value of that grid node at N time steps. The grid nodes in different rows are all different. M is the total number of grid nodes in the list of non-repeating target grid nodes, and N is the number of time steps.

[0088] The second RBF (Radial Basis Function) interpolator for time interpolation is trained based on the aforementioned two-dimensional matrix, and the following interpolation operation is performed based on the trained second RBF interpolator:

[0089] Among them, T k (x i Let be the k-th mesh node on the 3D geometric model P at time x. j Temperature prediction, x i For the i-th time step, x j For the j-th time; 2(·) represents the second radial basis function. In this embodiment, a cubic function (function='cubic') can be selected as the radial basis function; ω2 j The time interpolation weighting coefficients are represented and can be determined by solving the following system of linear equations:

[0090]

[0091] Repeat the interpolation calculation steps of the RBF interpolator to obtain the temperature prediction value of each target node on the three-dimensional geometric model P at different times, which serves as the continuous predicted temperature data. This continuous predicted temperature data is the data source for client modeling.

[0092] This embodiment middle, The first RBF interpolator and the second RBF interpolator are RBF proxy models, and the interpolation calculations of the first RBF interpolator and the second RBF interpolator can be implemented using tools such as the scipy.interpolate.Rbf class;

[0093] Therefore, in this embodiment, the discrete predicted temperature values ​​of each grid node on the three-dimensional geometric model P are interpolated using the RBF proxy model in both spatial and temporal dimensions to transform the discrete predicted temperature values ​​into continuous predicted temperature values, thereby meeting the real-time requirements of the digital twin system.

[0094] S4. Based on the data source, construct a digital twin model of the temperature field on the client side to generate a simulated temperature field during laser welding. This specifically includes the following steps:

[0095] S41. Export the three-dimensional geometric model P of the welded workpiece from ANSYS, convert the format and import it into the client so that the three-dimensional geometric model P can be displayed in the Unity3D engine of the client as the static geometric basis of the digital twin.

[0096] In addition, configure a virtual camera, a virtual laser welding gun, and a virtual laser light source in the Unity3D engine of the client, and set up the DOTween plugin for subsequent motion control;

[0097] S42. Write a motion control script for the virtual laser welding gun based on the DOTween plugin, and define the moving speed and laser welding path of the virtual laser welding gun; and receive laser welding process parameters input by the user based on the input box of the client UI interface, wherein the laser welding process parameters include one or more of the following: laser power, laser scanning speed, defocusing amount, etc.

[0098] S43. Control the virtual laser welding gun to move along the laser welding path according to the motion control script, so as to simulate laser welding on the three-dimensional geometric model P. During the movement of the virtual laser welding gun, the spatial position of the virtual welding gun can be mapped to a time step in the manner described in step S3. The time step and the laser welding process parameters input by the user are sent to the server through the real-time communication link between the server and the client.

[0099] The server extracts the continuous predicted temperature data of each grid node on the three-dimensional geometric model P at the current time step from the data source based on the received time step and laser welding process parameters, and transmits the continuous predicted temperature data back to the client in real time.

[0100] S44. On the client side, the continuously predicted temperature data received in real time is converted into temperature color information (such as using HSV color wheel to map temperature values), and the temperature color is assigned to the corresponding mesh node of the three-dimensional geometric model P in real time through the Unity3D engine, so as to realize the dynamic display of the simulated temperature field cloud map synchronized with the virtual laser welding process, so as to finally form the construction of a digital twin model of laser welding temperature field driven by the server-side data source in real time.

[0101] In summary, this invention, based on ANSYS APDL and Python's parametric batch processing technology, achieves automated generation of simulation data under multiple working conditions, constructs a high-quality training dataset covering the entire process parameter space, and further combines deep neural networks to establish a nonlinear mapping relationship between process parameters, spatiotemporal coordinates, and temperature data. Furthermore, by introducing a molten pool region weight coefficient during the neural network model training process, the invention significantly improves the prediction reliability of the digital twin model for the welding core region without increasing data costs. Compared with traditional finite element calculations, this invention greatly reduces computation time while ensuring prediction accuracy, breaking through the real-time limitations of traditional simulation methods.

[0102] Furthermore, this invention combines a lightweight proxy model with 3D dynamic rendering technology to achieve real-time visualization and interaction of the laser welding temperature field. By using the Unity3D engine, the temperature field data is transformed into a real-time dynamic cloud map, supporting viewpoint switching, parameter adjustment, welding torch motion control, and key information chart display. This solves the pain point of poor visualization interactivity in existing systems, making the evolution process of the laser welding temperature field intuitive and interactive.

[0103] Meanwhile, the communication link between the server and client of this invention adopts a standardized data protocol and lightweight RBF interpolation technology, which opens up a two-way data channel between the finite element data body and the digital twin. It can realize millisecond-level synchronization of temperature field data, process parameters and spatial coordinates through TCP local loopback, and combine the RBF proxy model for real-time interpolation transformation of finite element mesh, which reduces data transmission load while ensuring the accuracy of cloud map display, and significantly improves the real-time response capability of the digital twin system.

[0104] The above content is only a preferred embodiment of the present invention. For those skilled in the art, many changes can be made in the specific implementation and application scope based on the ideas of the present invention. As long as these changes do not depart from the concept of the present invention, they all fall within the protection scope of this patent.

Claims

1. A method for constructing a digital twin model of the temperature field in laser welding, characterized in that, Includes the following steps: Simulation results of generating the temperature field for laser welding; The neural network prediction model is trained based on the simulation results of the laser welding temperature field, and the trained neural network prediction model is used as the temperature prediction model of the laser welding temperature field. The server, which is equipped with a temperature prediction model and an RBF proxy model, obtains the data source for client modeling and sends the data source to the client. Furthermore, based on the aforementioned data source, a digital twin model of the temperature field is constructed on the client side.

2. The digital twin model construction method as described in claim 1, characterized in that, The simulation results for generating the laser welding temperature field include the following steps: A three-dimensional geometric model corresponding to a real laser-welded workpiece is created, and simulation parameters are set in ANSYS based on the material properties of the real laser-welded workpiece. The simulation parameters include the finite element mesh node division scheme of the three-dimensional geometric model and the laser welding process parameters used for simulating laser welding. The simulation temperature data of each grid node in each time step is calculated based on ANSYS. The simulation process is parameterized using APDL to obtain a basic APDL script, and the simulation process includes extracting the coordinates of all grid nodes and the simulation temperature data of all grid nodes within each time step. Furthermore, a batch simulation platform was built based on basic APDL scripts and Python to obtain simulation results of the laser welding temperature field.

3. The digital twin model construction method as described in claim 2, characterized in that, The process of building a batch simulation platform based on basic APDL scripts and Python to obtain simulation results of the laser welding temperature field includes the following steps: Complete the configuration of the ANSYS APDL computing environment; Read the basic APDL script and modify the basic APDL script; Additionally, the ANSYS process is started, and the modified APDL script is run by calling ANSYS to perform finite element simulation calculations according to the modified APDL script, and output the simulation results of the laser welding temperature field.

4. The digital twin model construction method as described in claim 1, characterized in that, The neural network prediction model is an MLP neural network model, and the neural network prediction model is trained using a feature array that has undergone normalization. The feature array is constructed based on the laser welding process parameters, time steps, and grid node coordinates extracted from the simulation results of the laser welding temperature field. Each row of the feature array includes a grid node coordinate, a set of laser welding process parameters from the simulation data, and a time step from the simulation data.

5. The digital twin model construction method as described in claim 4, characterized in that, The neural network prediction model is trained based on the loss function Loss, which is as follows: Among them, W bath y represents the weighting coefficient of the molten pool region formed during laser welding, with a value ranging from 2 to 10. thresholds is the temperature threshold, and the molten pool region refers to the mesh nodes in the simulation results whose temperature data is greater than or equal to this temperature threshold. i The i-th row of the label array contains temperature data, and each row of the label array contains temperature data corresponding to the row of the feature array. This refers to the predicted temperature data output by the MLP neural network model after the i-th row of the feature array is input into it.

6. The digital twin model construction method as described in claim 1, characterized in that, The server includes a server-side Socket communication module and a temperature prediction module deployed with an MLP neural network model and an RBF proxy model; the client includes a client-side Socket communication module and a control parameter generation module. The server and client establish a Socket connection through the server-side Socket communication module and the client-side Socket communication module. The control parameter generation module is used to generate control parameters in the simulated laser welding process. The control parameters include the time step corresponding to the spatial position of the virtual laser welding gun used to simulate laser welding when performing simulated laser welding on a three-dimensional geometric model, as well as the laser welding process parameters for performing simulated laser welding. The control parameter generation module sends the control parameters to the server through the established Socket connection; The temperature prediction module calls the temperature prediction model according to the time step in the control parameter, so as to output discrete predicted temperature data through the temperature prediction model. Furthermore, based on the RBF proxy model, interpolation is performed on the discrete predicted temperature data to obtain continuous predicted temperature data, and the continuous predicted temperature data is sent to the client through the established Socket connection.

7. The digital twin model construction method as described in claim 6, wherein the discrete predicted temperature data is obtained through the following steps: An input matrix is ​​constructed based on the control parameters, wherein, Each row of the input matrix includes the coordinates of a mesh node of a three-dimensional geometric model, a time step of a control parameter, and a set of laser welding process parameters for the control parameters. The input matrix is ​​input into the temperature prediction model to output discrete predicted temperature data through the temperature prediction model; Interpolation calculations are performed based on the discrete predicted temperature data to obtain the predicted temperature value of each grid node on the three-dimensional geometric model at each time step, so as to interpolate and complete the temperature at each grid node on the three-dimensional geometric model in the spatial dimension. Furthermore, based on the temperature prediction value of each grid node on the three-dimensional geometric model at each time step, interpolation calculation is performed to obtain the temperature prediction value of each grid node on the three-dimensional geometric model at different times, so as to interpolate and complete the temperature at each grid node on the three-dimensional geometric model in the time dimension, so as to serve as continuous predicted temperature data.

8. The digital twin model construction method as described in claim 7, wherein interpolation calculation is performed based on the discrete predicted temperature data to obtain the predicted temperature value of each grid node on the three-dimensional geometric model at each time step, comprising the following steps: Filter out duplicate mesh nodes in the 3D geometry model and create a list of non-duplicate mesh nodes containing the remaining mesh nodes; Discrete predicted temperature data are used as source node data, and grid nodes in the list of non-repeating target grid nodes are recorded as target nodes; Based on the KNN algorithm, at the current time step, the K grid nodes in the source node data that are spatially closest to the current target node k are denoted as the neighbor nodes of the current target node k, and the spatial coordinates of the K neighbor nodes and the discrete predicted temperature value of each neighbor node are recorded. And, the following interpolation operation is performed using the first RBF interpolator: in, T k (x i ,y i ,z i (x) represents the spatial coordinates of the current target node k at the current time step. i ,y i ,z i Predicted temperature value at (x) j ,y j ,z j Let be the spatial coordinates of the j-th neighbor node of the current target node k, where j = 1,2,…,K, and K is the number of neighbor nodes; 1(·) is the first radial basis function; ω1 j Indicates the spatial interpolation weighting coefficients; Repeat the above steps until all grid nodes in the list of non-repeating target grid nodes are traversed, and finally obtain the temperature prediction value of each target node on the 3D geometric model at each time step.

9. The digital twin model construction method as described in claim 8, wherein interpolation calculation is performed based on the temperature prediction value of each grid node on the three-dimensional geometric model at each time step to obtain the temperature prediction value of each grid node on the three-dimensional geometric model at different times, comprising the following steps: The following interpolation operation is performed based on the second RBF interpolator: in, T k (x i () represents the k-th mesh node in the 3D geometric model at time x. j Temperature prediction, x i For the i-th time step, x j For the j-th time; 2(·) is the second radial basis function; ω2 j Indicates the time interpolation weighting coefficients; Repeat the above steps to obtain the temperature prediction value of each target node on the three-dimensional geometric model at different times, as continuous temperature prediction data.

10. The digital twin model construction method as described in claim 1, wherein a temperature field digital twin model is constructed on the client side based on the data source, comprising the following steps: Display the 3D geometric model in the Unity3D engine on the client side, and configure the virtual camera, virtual laser welding gun, and virtual laser light source in the Unity3D engine on the client side; Define the movement speed and laser welding path of the virtual laser welding gun, and receive laser welding process parameters input by the user through the input box of the client UI interface; The virtual laser welding gun is controlled to move along the laser welding path according to the motion control script in order to simulate laser welding on the three-dimensional geometric model. During the movement of the virtual laser welding gun, the spatial position of the virtual welding gun is mapped to a time step, and the time step and the laser welding process parameters input by the user are sent to the server through the real-time communication link between the server and the client. The server extracts the continuous predicted temperature data of each grid node on the three-dimensional geometric model at the current time step from the data source based on the received time step and laser welding process parameters, and transmits the continuous predicted temperature data back to the client in real time. Additionally, the client converts the continuously predicted temperature data received in real time into temperature color information and assigns the temperature color to the corresponding mesh node of the three-dimensional geometric model in real time, so as to realize the dynamic display of the simulated temperature field cloud map synchronized with the virtual laser welding process.