Computer Vision-Based Numerical Simulation Method for Optimizing Heat Sources in Welding

By optimizing the heat source parameters in welding numerical simulation using computer vision and genetic algorithms, the problems of cumbersome adjustment of heat source parameters and reliance on experience in traditional methods are solved, and efficient and accurate welding temperature field simulation is achieved.

CN120509265BActive Publication Date: 2025-10-28SHANDONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511000700.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-21
Publication Date
2025-10-28
Estimated Expiration
2045-07-21

AI Technical Summary

Technical Problem

The process of adjusting heat source parameters in traditional welding numerical simulation is cumbersome, relies on the experience of researchers, and has limited simulation efficiency and accuracy, as well as high modeling costs.

Method used

A computer vision-based numerical simulation method for welding was adopted, combining OpenCV and Abaqus software. The heat source parameters were optimized using a double ellipsoidal heat source model and an improved genetic algorithm. The weld was activated by the field variable correlation method, thus achieving automated parameter solving.

Benefits of technology

It significantly reduces computation time, improves simulation efficiency and accuracy, reduces reliance on researchers' experience, reduces modeling costs, and achieves unified optimization of multi-layer, multi-pass welding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120509265B_ABST
    Figure CN120509265B_ABST
Patent Text Reader

Abstract

This invention provides a computer vision-based efficient calculation method for heat source optimization in welding numerical simulation, belonging to the technical field of welding numerical simulation heat source modeling. The method includes: S1: establishing a heat source model; S2: establishing a simplified finite element model and loading the heat source model for simulation; S3: extracting and processing the maximum molten pool cross-section; S4: extracting the molten pool region and boundary; S5: obtaining the weld width and depth of the simulated weld and the actual weld, determining whether convergence is satisfied or the iteration limit is reached. If not, an improved genetic algorithm is used to optimize the heat source optimization parameters and continue iteration; S6: after stopping iteration, determining whether it is a multi-layer, multi-pass weld and deciding whether to continue optimization. This method uses multi-software collaborative calculation to provide real-time molten pool images during the optimization process, achieving unified optimization of multi-layer, multi-pass welds. It also employs simplified geometry techniques and an improved genetic algorithm, specifying the weld activation method as the field variable correlation method, reducing computation time and improving efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of welding numerical simulation heat source model technology, specifically a welding numerical simulation heat source optimization calculation method based on computer vision. Background Technology

[0002] Welding technology, as a key technology in modern industrial manufacturing, is crucial for ensuring the quality of equipment connections and long-term safe operation. With the advancement of computer technology, the finite element method has largely replaced on-site welding tests, using finite element modeling to study the temperature field during the welding process. The temperature field during welding is influenced by the heat source model, heat dissipation conditions, and material properties. Among these, the heat source model describes the distribution of welding heat energy in the workpiece and is the foundation of temperature field analysis.

[0003] In traditional analysis methods, heat source parameters need to be determined through trial and error. Researchers set initial heat source parameters, conduct simulation analysis, compare them with the actual molten pool boundary, and then make adjustments until the simulation results match the actual molten pool boundary. This process is cumbersome, with a large workload for manual adjustments and post-processing of results, increasing modeling costs. Furthermore, the efficiency and accuracy of the simulation are greatly affected by the researcher's experience.

[0004] Therefore, we propose a computer vision-based numerical simulation method for optimizing the heat source in welding. Summary of the Invention

[0005] The purpose of this invention is to provide a computer vision-based numerical simulation method for optimizing the heat source in welding, so as to solve the problems mentioned in the background art.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] This invention provides a computer vision-based numerical simulation method for optimizing heat sources in welding, comprising the following steps:

[0008] S1: Confirm the heat source model and heat source optimization parameters, set the value range of the weight coefficients and heat source optimization parameters, establish the heat source model and set the initial values ​​of the heat source model parameters;

[0009] S2: Use Abaqus software to build a simplified finite element model and set initial and boundary conditions. Load the heat source model into the simplified finite element model to calculate the welding temperature field.

[0010] S3: Use OpenCV to extract the maximum molten pool cross-section and preprocess the extracted image;

[0011] S4: Use OpenCV to extract the molten pool region and boundary shape from the preprocessed image;

[0012] S5: Use OpenCV to obtain the weld width and depth of the simulated weld. Combine this with the actual weld width and depth obtained from the experiment to determine whether the weld width and depth of the simulated weld meet the convergence requirements or reach the maximum number of iterations. If they do, stop the iterative calculation. If they do not meet the requirements, use an improved genetic algorithm to optimize the heat source optimization parameters and continue the iterative calculation until the convergence requirements are met or the maximum number of iterations is reached.

[0013] S6: After stopping the iterative calculation, determine whether the weld is a multi-layer, multi-pass weld. If not, obtain the optimal heat source optimization parameters; if so, use the heat source parameter temperature field calculation results after the optimization of the previous weld layer as the initial conditions for the optimization of the next weld layer.

[0014] Furthermore, in step S1, the heat source model adopts a double-ellipsoidal heat source model. The double-ellipsoidal heat source model is established using the DFLUX heat source subroutine edited in Fortran. The heat flux density distribution function within the ellipsoid of the first half of the double-ellipsoidal heat source model is:

[0015]

[0016] The heat flux density distribution function within the ellipsoid of the latter half of the double-ellipsoidal heat source model is:

[0017]

[0018] in, For the effective power of the electric arc, take... ; For welding voltage, For welding current, For welding thermal efficiency; , and The coordinates of the heat source center; , , and For ellipsoid shape parameters; For welding speed, mm / s ; This refers to the time required for the welding process. and These are the heat distribution parameters of the front and rear ellipsoids, respectively. .

[0019] Furthermore, in step S2, the specific process of establishing the simplified finite element model is as follows: after establishing the finite element model in Abaqus, the finite element model is then simplified using simplified geometry techniques.

[0020] Furthermore, in step S2, the weld activation method adopts the field variable correlation method in the welding temperature field calculation.

[0021] Furthermore, the specific process of the field variable correlation method is as follows:

[0022] Step 1: Define field variables: In the model definition, set field variables to represent different material states.

[0023] Step 2: Write USDFLD subroutine: Write USDFLD subroutine based on Fortran language to dynamically adjust material parameters according to the value of field variable and add field variable values ​​to material properties.

[0024] Step 3: Associate material properties with field variables: In the material definition, associate the relevant material properties with the field variables.

[0025] Furthermore, in step S3, the specific process of image preprocessing is as follows: the RGB value range of the molten pool shape in the image is set according to the welding simulation results of step S2.

[0026] Furthermore, in step S5, the optimization model for optimizing the heat source parameters is as follows:

[0027]

[0028] in, For plate thickness, mm ; , and These are the error weighting coefficients; , , and For ellipsoid shape parameters; For welding thermal efficiency, different welding methods have different ranges of thermal efficiency values; The ratio of the semi-axis of the rear half to the semi-axis of the front half of the ellipsoid shape is generally greater than 1 to simulate the different energy distributions in the front and rear halves during the movement of the heat source; subscript Indicates the results of finite element simulation; subscript This indicates the actual dimensions of the weld.

[0029] Furthermore, in the optimization model, the objective function R The method is to use the shape of the weld pool as the basis for error calculation, and to simulate the penetration depth of the weld cross-section. , Weld width at the point , Weld width at the point Penetration depth of the actual weld cross-section , Weld width at the point , Weld width at the point The sum of squared errors is used as the objective function.

[0030] Furthermore, in step S5, the specific process of optimizing the heat source optimization parameters using the improved genetic algorithm includes:

[0031] Step 1: Initialize the population and set parameters: Randomly generate an initial population, each individual is encoded by chromosome to represent a potential solution, and set key parameters, including population size, crossover probability, and mutation probability. Then, introduce a chaotic sequence as a tool for generating subsequent crossover points and mutation values.

[0032] Step 2: Fitness Assessment and Ranking: Calculate the fitness value of each individual based on the objective function, and sort all individuals in ascending / descending order according to the objective function value;

[0033] Step 3: Matching Parents Based on Social Status: Breaking the traditional random pairing rules, targeted pairing of individuals with similar fitness is performed based on the ranking results;

[0034] Step 4: Chaos-guided single-point crossover: Perform crossover on each pair of parent individuals;

[0035] Step 5: Multigene Chaotic Mutation: Independent of the crossover operation, perform directional mutation;

[0036] Step Six: Elite Preservation and Population Update: Merge the offspring generated by crossover and mutation into a new generation of population, while forcibly preserving the current best individual;

[0037] Step 7: Termination condition judgment: Check whether the preset termination condition is met. If it is met, output the optimal solution; otherwise, return to step 2 to continue iterative optimization.

[0038] Compared with the prior art, the present invention has the following technical effects:

[0039] In this invention, the method utilizes multi-software collaborative computation to provide real-time images of the molten pool during the optimization process and enables unified optimization of multi-layer, multi-pass welding. Employing a simplified finite element model and an improved genetic algorithm, and specifying the weld activation method as the field variable correlation method, it significantly reduces computation time with negligible accuracy loss, demonstrating great application value in practical engineering. Compared to traditional trial-and-error methods, it achieves automatic parameter solving, eliminating the need for manual operation in the entire process of heat source parameter verification and optimization. This reduces the workload of adjusting heat source parameters in trial-and-error methods, lowers modeling costs, and improves simulation efficiency and accuracy. Simultaneously, it reduces the dependence of welding temperature field simulation efficiency and accuracy on researchers' experience. Attached Figure Description

[0040] Figure 1 This is a flowchart of the welding numerical simulation heat source optimization calculation method according to an embodiment of the present invention;

[0041] Figure 2 This is a schematic diagram of molten pool image processing according to an embodiment of the present invention;

[0042] Figure 3 This is a schematic diagram of a double ellipsoidal heat source model according to an embodiment of the present invention;

[0043] Figure 4 The finite element model and mesh diagram of the single-sided V-groove butt weld before and after simplification in an embodiment of the present invention are shown.

[0044] Figure 5 This is a flowchart of the field variable correlation method according to an embodiment of the present invention;

[0045] Figure 6 This is a schematic diagram of the cross-section of the weld pool according to an embodiment of the present invention;

[0046] Figure 7 This is a flowchart of the improved genetic algorithm according to an embodiment of the present invention;

[0047] Figure 8 This is a comparison diagram of the actual molten pool shape and the simulated molten pool shape calculated after verification of heat source parameters in an embodiment of the present invention. Detailed Implementation

[0048] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.

[0049] In this article, terms such as "left," "right," "up," "down," "front," and "back" are established based on the positional relationships shown in the attached drawings. Depending on the attached drawings, the corresponding positional relationships may also change. Therefore, they should not be interpreted as an absolute limitation on the scope of protection.

[0050] Please see Figures 1 to 8 This embodiment provides a computer vision-based numerical simulation method for optimizing the heat source in welding, comprising the following steps:

[0051] S1: Confirm the heat source model and heat source optimization parameters, set the value range of the weight coefficients and heat source optimization parameters, establish the heat source model and set the initial values ​​of the heat source model parameters.

[0052] Specifically, before establishing the heat source model, the heat source model is confirmed, and a double-ellipsoidal heat source model is adopted. Compared with the Gaussian heat source model and the conical heat source model, the double-ellipsoidal heat source model has more parameters to optimize and is the most difficult to optimize, so it is chosen. After selecting the heat source model, the heat source optimization parameters are confirmed, and the weighting coefficients and the value range of the heat source optimization parameters are set.

[0053] Specifically, the DFLUX heat source subroutine, written in Fortran, is used to establish a double ellipsoidal heat source model. The heat flux density described by the double ellipsoidal heat source model is distributed within the ellipsoidal volume, which can reflect the characteristics of heating the weldment along the depth direction during welding. Therefore, the welding temperature field can be accurately simulated.

[0054] Specifically, in the double-ellipsoidal heat source model, both the first and second halves are 1 / 2 ellipsoids. The heat flux density distribution is typically described using a Gaussian function. The heat flux density distribution equations within the first and second ellipsoids are as follows:

[0055]

[0056]

[0057] in, For the effective power of the electric arc, take... ; This refers to the welding voltage; This refers to the welding current. For welding thermal efficiency; , and The coordinates of the heat source center; , , and For ellipsoid shape parameters; For welding speed, mm / s ; This refers to the time required for the welding process. and These are the heat distribution parameters of the front and rear ellipsoids, respectively. .

[0058] S2: Use Abaqus software to establish a simplified finite element model and set initial and boundary conditions. Load the heat source model into the simplified finite element model to calculate the welding temperature field.

[0059] Specifically, a three-dimensional welding finite element model of the weldment is established using Abaqus software. Material property parameters such as thermal conductivity, specific heat capacity, coefficient of thermal expansion, latent heat of fusion, and latent heat of vaporization are then defined for the weldment model. Convection heat and radiation heat of vaporization boundary conditions are set according to actual working conditions, with different boundary conditions corresponding to different scenarios. After establishing the finite element model in Abaqus, a simplified geometry technique is used to simplify it. This technique assumes that the fusion zone is a local phenomenon, and that significant spatiotemporal variations in the temperature field are limited to the fusion zone. Simplifying the finite element model can shorten computation time. The simplification process is existing technology and will not be detailed here. Then, the heat source model with the initial parameters set in step S1 is applied as a load to the simplified finite element model for welding temperature field calculation.

[0060] Specifically, in Abaqus, a Job file is created, converting the existing numerical simulation model into a Job file. The Job file is the core input file used to define and control the analysis job; it contains all the model's information, including geometry, material properties, load conditions, boundary conditions, and analysis type. Then, Python is used to submit the Job files in batches to the Abaqus solver. The solver will perform calculations on the Job files. During this process, the `read_sta_file` function can be defined in Python to automatically detect the completion status of the Job files. After the calculation is complete, the results are output, yielding a temperature contour map of the weld layer.

[0061] Specifically, the weld activation method in the welding temperature field calculation adopts the field variable correlation method. This method is based on the dependence of material properties on temperature during the welding simulation process. It dynamically adjusts the elastic modulus, coefficient of thermal expansion, etc., according to the temperature change at the integration point, and simulates the weld filling process by controlling the change in thermal conductivity through the integrated temperature. The specific process is as follows:

[0062] Step 1: Define field variables: In the model definition, set field variables to represent different material states.

[0063] Step 2: Write USDFLD subroutine: Write USDFLD subroutine based on Fortran language to dynamically adjust material parameters according to the value of field variable and add field variable values ​​to material properties.

[0064] Step 3: Associate material properties with field variables: In the material definition, associate the relevant material properties with the field variables.

[0065] S3: After connecting to the OpenCV computer vision library and setting the peak temperature of the component as a custom output variable in the Abaqus subroutine UVARM, the maximum molten pool cross-section is captured using OpenCV and the captured image is preprocessed.

[0066] Specifically, the image preprocessing process is as follows: based on the welding simulation results in step S2, the RGB value range of the molten pool shape in the image is set so that OpenCV can extract the molten pool area and boundary shape.

[0067] S4: Use OpenCV to extract the molten pool region and boundary shape from the preprocessed image.

[0068] S5: Use OpenCV to obtain the weld width and depth of the simulated weld. Combine this with the weld width and depth of the actual weld obtained from the experiment to determine whether the weld width and depth of this generation of simulated welds meet the convergence requirements or reach the maximum number of iterations. If they do, stop the iterative calculation. If they do not meet the requirements, use an improved genetic algorithm in Python to optimize the heat source optimization parameters and pass the next generation of heat source optimization parameters to the DFLUX heat source subroutine. Apply these parameters to Abaqus for temperature field calculation and continue iterative calculation until the convergence requirements are met or the maximum number of iterations is reached.

[0069] Specifically, the convergence requirement and the maximum number of iterations are set limits for artificial termination. During the optimization of heat source optimization parameters, if accuracy is required, the weld width and depth of the simulated weld are controlled to be within the set error range compared with the actual weld width and depth. This satisfies the convergence requirement, and the maximum number of iterations is not required. If time is required, the calculation is stopped when the number of iterations reaches the set maximum number of iterations. This satisfies the maximum number of iterations, and the convergence requirement (i.e., accuracy) is not required.

[0070] Specifically, in step S5, the optimization model for optimizing the heat source parameters is as follows:

[0071]

[0072] in, For plate thickness, mm ; , and These are the error weighting coefficients; , , and For ellipsoid shape parameters; For welding thermal efficiency, different welding methods have different ranges of thermal efficiency values; The ratio of the semi-axis of the rear half to the semi-axis of the front half of the ellipsoid shape is generally greater than 1 to simulate the different energy distributions in the front and rear halves during the movement of the heat source; subscript Indicates the results of finite element simulation; subscript This indicates the actual dimensions of the weld.

[0073] In the optimization model, the objective function R The method is to use the shape of the weld pool as the basis for error calculation, and to simulate the penetration depth of the weld cross-section. , Weld width at the point , Weld width at the point Penetration depth of the actual weld cross-section , Weld width at the point , Weld width at the point The sum of squared errors is used as the objective function.

[0074] Specifically, the process of optimizing the heat source parameters using the improved genetic algorithm includes:

[0075] Step 1: Initialize the population and set parameters: Randomly generate an initial population, each individual is encoded by a chromosome to represent a potential solution, and set key parameters, including population size, crossover probability, and mutation probability. Then, introduce a chaotic sequence as a tool for generating subsequent crossover points and mutation values ​​to ensure that randomness is controllable.

[0076] Step 2: Fitness Assessment and Ranking: Calculate the fitness value of each individual based on the objective function (smaller or larger function values ​​correspond to different optimization directions), and sort all individuals in ascending / descending order according to the objective function value to lay the foundation for subsequent "matching" cross-pairing.

[0077] Step 3: Matching Parents Based on Fitness: Breaking away from traditional random pairing rules, targeted pairing of individuals with similar fitness is performed based on the ranking results. Individuals with smaller (better) objective function values ​​are paired with each other to focus on discovering high-quality solution regions; individuals with larger (worse) objective function values ​​are paired with each other to avoid inferior genes interfering with the superior population.

[0078] Step 4: Chaos-guided single-point crossover: For each pair of parent individuals, perform crossover according to the following procedure.

[0079] (1) Crossover decision: The crossover probability determines whether to crossover. If not, the parent generation is directly copied.

[0080] (2) Chaotic intersection point determination: The single-point intersection position is dynamically determined by using a pre-generated chaotic sequence (such as Logistic mapping).

[0081] (3) Weak crossover: Only the gene fragments after the crossover point are exchanged, which reduces the optimization perturbation intensity, suppresses the optimization chattering in the iteration process, and improves the convergence accuracy.

[0082] Step 5: Multigene chaotic mutation: Independent of the crossover operation, perform directional mutation according to the following rules.

[0083] (1) Mutation decision: The mutation probability determines whether to mutate.

[0084] (2) Multi-gene selection: Randomly generate chaotic integers in the range [2, 101] to locate the gene loci to be mutated in the chromosome.

[0085] (3) Chaotic value replacement: Generate new gene values ​​based on chaotic sequences to replace the original genes, enhance population diversity, and prevent premature convergence of the algorithm.

[0086] Step Six: Elite Preservation and Population Update: Merge the offspring generated by crossover and mutation into a new generation of population, while forcibly retaining the current best individual (elite preservation strategy) to ensure the convergence stability of the algorithm.

[0087] Step 7: Termination condition judgment: Check whether the preset termination condition (whether the objective function is satisfied) is met. If it is satisfied, output the optimal solution; otherwise, return to step 2 to continue iterative optimization.

[0088] Specifically, to speed up the solution process, the original code of the improved genetic algorithm should be optimized in parallel within Python.

[0089] Specifically, the improved genetic algorithm separates the mutation operation from the crossover operation, enabling parallel computation and improving efficiency. Employing the weakest single-point crossover ensures convergence accuracy and mitigates / avoids the chattering problem caused by strong crossover. Meanwhile, using a stronger multi-gene chaotic mutation can address the premature convergence issue that might arise from single-point crossover.

[0090] S6: After stopping the iterative calculation, determine whether the weld is a multi-layer, multi-pass weld. If not, obtain the optimal heat source optimization parameters; if so, use the heat source parameter temperature field calculation results after the optimization of the previous weld layer as the initial conditions for the optimization of the next weld layer.

[0091] Specifically, in this invention, the method utilizes multi-software collaborative computation to provide real-time images of the molten pool during the optimization process and enables unified optimization of multi-layer, multi-pass welding. Employing a simplified finite element model and an improved genetic algorithm, and specifying the weld activation method as the field variable correlation method, it significantly reduces computation time with negligible accuracy loss, demonstrating great application value in practical engineering. Compared to traditional trial-and-error methods, it achieves automatic parameter solving, eliminating the need for manual operation in the entire process of heat source parameter verification and optimization. This reduces the workload of adjusting heat source parameters in trial-and-error methods, lowers modeling costs, and improves simulation efficiency and accuracy. Simultaneously, it reduces the dependence of welding temperature field simulation efficiency and accuracy on researchers' experience.

[0092] Example 1

[0093] The following analysis uses Q355B steel plate as an example, and the welding process adopts... In gas shielded welding, a double ellipsoidal heat source model is used to simulate the moving heat source during welding. While the double ellipsoidal heat source model has many heat source parameters, determining its shape requires defining four parameters. , , and , This represents the semi-axial length of the first half of the ellipsoid along the weld length direction. Let be the semi-axis length of the latter half of the ellipsoid along the weld length direction. The length of the semi-axis of the ellipsoid in the weld width direction is used to control the energy distribution area in the weld width direction; The length of the semi-axis of the ellipsoid along the weld depth direction is used to control the energy distribution area along the weld depth direction. The magnitude of these four parameters directly affects the temperature field distribution during welding. The smaller the heat source shape parameter, the more concentrated the energy distribution in this direction; the larger the heat source shape parameter, the more gradual the energy distribution. Values ​​that are too small or too large will increase the error between the simulation results and the actual dimensions. Therefore, determining these four parameters is crucial, with the heat source shape parameter used as the optimization design variable. The shape parameter determines the energy distribution inside the heat source and the welding thermal efficiency. The total energy of the heat source is determined. If the calculation model has corresponding temperature experiments, the actual thermal efficiency is obtained by calibration using thermocouples located far from the weld. This embodiment uses welding thermal efficiency... It is also considered as an optimization variable. The range of values ​​for the optimization variable is shown in Table 1, with weighting coefficients... , and All are set to 1.

[0094] Table 1. Range of values ​​for optimization variables

[0095]

[0096] In this embodiment, the welding process consists of four weld passes from top to bottom: one ceramic backing root pass, two filler passes, and one capping pass. The specific welding process is as follows: before the root pass, a ceramic backing is placed at the bottom of the bevel gap, and the entire welding specimen is raised to maintain a horizontal position. Then, through… Gas shielded welding is performed using a straight-line electrode motion for the root pass. After the root pass is completed, interpass cooling is performed to lower the interpass temperature to below 100°C before continuing with the fill and cap pass welding processes. The welding process parameters for each layer are shown in Table 2.

[0097] Table 2 Welding process parameters

[0098]

[0099] S1: Before establishing the heat source model, the heat source model and optimization parameters were determined, and the weighting coefficients and the value ranges of the heat source optimization parameters were set. The DFLUX heat source subroutine was written using Fortran to establish the double-ellipsoidal heat source model, and the parameters were set, such as... Figure 3 As shown, the heat flux density distribution equations within the first half and the second half of the ellipsoid in the double ellipsoid heat source model are as follows:

[0100]

[0101]

[0102] in, The effective power of the electric arc. W ,Pick ; For welding voltage, V ; For welding current, A ; For welding thermal efficiency; , and The coordinates of the heat source center; , , and For ellipsoid shape parameters; For welding speed, mm / s ; This refers to the time required for the welding process. and These are the heat distribution parameters of the front and rear ellipsoids, respectively. ,Pick =0.6, =1.4.

[0103] S2: A three-dimensional welding finite element model was established using Abaqus finite element software, and initial and boundary conditions were set. The model dimensions were set to 600mm × 400mm × 14mm, the welding type was a full penetration butt weld, the bevel type was a single-sided V-groove without a blunt edge, the bevel angle was 65°, the bevel gap was 3mm, and three-point constrained rigid body displacement was used as the boundary condition. The welding process was as follows: Gas shielded welding was performed using Q355B as the base metal. Based on the principle of equal strength matching, ER50-6 welding wire with a diameter of 1.2mm was selected as the filler material. Since the chemical composition of the deposited metals of Q355B and ER50-6 welding wire is similar, their thermophysical properties can be considered identical. The room temperature was set to 20℃. The weldment model was meshed using a 4:2 transition ratio, with a finer mesh near the weld and a gradually thinner mesh further away. A simplified geometry technique was used to simplify the finite element model, ensuring improved computational efficiency without significant loss of accuracy. The simplified geometric model has only 10080 elements and 11571 nodes, while the original model had 87600 elements and 95126 nodes. The incremental step size was fixed, with the heat source center located at a node in each step.

[0104] The heat source model, with its initial parameters set, is used as a load to calculate the welding temperature field within the finite element model. In Abaqus, the created numerical simulation model is converted into a Job file. Then, Python is used to submit these Job files in batches to the Abaqus solver. The solver performs calculations on the Job files. During this process, the `read_sta_file` function is defined in Python to automatically detect the completion status of the Job files. After the calculation is complete, the results are output, yielding a temperature contour map of the weld layer.

[0105] In the calculation of the welding temperature field, the weld activation method adopts the field variable correlation method. During the simulation, the material is correlated with the field variables. Based on the dependence of material properties on temperature during the welding simulation, the elastic modulus, coefficient of thermal expansion, etc. are dynamically adjusted according to the temperature change at the integration point. The change in thermal conductivity is controlled by the integral temperature to simulate the weld filling process. The adiabatic phenomenon of the material is achieved by reducing the thermal conductivity of the material by two orders of magnitude. In actual operation, the field variables are set in the Abaqus material definition. FV Related to, among which FV When the thermal conductivity is 2, the thermal conductivity of the material is 1% of the thermal conductivity at room temperature, to simulate an unactivated weld. FV When =1, it is set as the normal weld material parameter; 1 < FV When the value is less than 2, the material properties are smoothly transitioned through linear interpolation to set the material parameters; FV When =0, it is set as the material parameter of the base material.

[0106] like Figure 5 As shown, the initial and cooling stages of the weld field variables are set. FV =1, while the change of field variables during welding is due to the distance between the node and the center of the heat source. z The change is used to determine this. This includes the distance between the node and the center of the heat source. z Larger than the effective heat source radius r Distance traveled to the heat source d When and when, FV =2; when smaller than the effective heat source radius r Distance traveled to the heat source d The sum is greater than the distance traveled by the heat source. d hour, FV Between 1 and 2; when less than or equal to the distance traveled by the heat source d hour, FV =1. Initial settings for the base material. FV =0, the change of field variables during welding is controlled by the nodal temperature ( NT The temperature is judged by changes in temperature. Using 1500℃ (for Q355B steel, the portion exceeding 1500℃ is generally considered the weld pool zone) as the dividing point, if the node temperature is greater than or equal to 1500℃... FV =1, node temperature less than 1500℃ FV =0. Final cooling stage of the base material. FV The setting should be based on whether the node temperature exceeds 1500℃ during the welding process. If it does, then... FV =1, if not exceeding, then FV =0.

[0107] S3: Connect to the OpenCV computer vision library, set the peak temperature of the component to a custom output variable in the Abaqus subroutine UVARM, then use OpenCV to extract the maximum molten pool cross section. Then, based on the welding simulation results of step S2, set the RGB value range of the molten pool shape in the image to 160-180, i.e., 160≤R&G&B≤180, to complete image preprocessing.

[0108] S4: Use OpenCV to extract the molten pool region and boundary shape from the preprocessed image.

[0109] S5: Use OpenCV to obtain the weld width and depth of the simulated weld. Combine this with the weld width and depth of the actual weld obtained from the experiment to determine whether the weld width and depth of this generation of simulated welds meet the convergence requirements or reach the maximum number of iterations. If they do, stop the iterative calculation. If they do not meet the requirements, use an improved genetic algorithm in Python to optimize the heat source optimization parameters and pass the next generation of heat source optimization parameters to the DFLUX heat source subroutine. Apply these parameters to Abaqus for temperature field calculation and continue iterative calculation until the convergence requirements are met or the maximum number of iterations is reached.

[0110] S6: After stopping the iterative calculation, determine that the weld is a multi-layer, multi-pass weld, and use the heat source parameter temperature field calculation results after the optimization of the previous layer of weld as the initial conditions for the optimization of the next layer of weld.

[0111] In this embodiment, the optimization of the heat source optimization parameters is time-sensitive, requiring only the maximum number of iterations to be reached, which is set to the 15th generation. The heat source optimization parameters are optimized using an improved genetic algorithm, with the evolution results of the 15th generation (initial population size of 10) taken for each of the four weld passes. The resulting heat source optimization parameters are shown in Table 3.

[0112] Table 3 Optimization Results of Heat Source Parameters

[0113]

[0114] A comparison diagram of the simulated molten pool shape and the actual molten pool shape after optimization of heat source parameters is shown below. Figure 8 As shown in Table 4, the specific data comparison between the measured weld width and depth and the simulated weld width and depth is presented (since the weld is a full penetration weld, the measured weld depth = the simulated weld depth). The shape of the simulated weld pool almost coincides with the shape of the actual weld pool, and the difference between the measured weld width and depth and the simulated weld width and depth for each weld pass is within 5%.

[0115] Table 4 Comparison of Specific Data for Measured and Simulated Melt Width and Depth

[0116]

[0117] The above embodiments merely illustrate the basic principles and characteristics of the present invention, but are not limited to the above implementation schemes. It should be understood that those skilled in the art can make various changes and modifications to the present invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of this invention is defined freely by the appended claims and their equivalents.

Claims

1. A computer vision-based numerical simulation method for optimizing heat sources in welding, characterized in that, Includes the following steps: S1: Confirm the heat source model and heat source optimization parameters, set the value range of the weight coefficient and heat source optimization parameters, establish the heat source model and set the initial values ​​of the heat source model parameters. The heat source model adopts the double ellipsoid heat source model. S2: Use Abaqus software to build a simplified finite element model and set initial and boundary conditions. Load the heat source model into the simplified finite element model to calculate the welding temperature field. S3: Use OpenCV to extract the maximum molten pool cross-section and preprocess the extracted image; S4: Use OpenCV to extract the molten pool region and boundary shape from the preprocessed image; S5: Use OpenCV to obtain the weld width and depth of the simulated weld. Combine this with the actual weld width and depth obtained from the experiment to determine whether the weld width and depth of the simulated weld meet the convergence requirements or reach the maximum number of iterations. If they do, stop the iterative calculation. If they do not meet the requirements, use an improved genetic algorithm to optimize the heat source optimization parameters and continue the iterative calculation until the convergence requirements are met or the maximum number of iterations is reached. In step S5, the optimization model for optimizing the heat source parameters is as follows: in, For plate thickness, mm ; , and These are the error weighting coefficients; , , and For ellipsoid shape parameters; For welding thermal efficiency, different welding methods have different ranges of thermal efficiency values; The ratio of the semi-axis of the rear half to the semi-axis of the front half of the ellipsoid shape is used to simulate the different energy distributions in the front and rear halves during the movement of the heat source; subscript Indicates the results of finite element simulation; subscript Indicates the actual dimensions of the weld; In the optimization model, the objective function R The method is to use the shape of the weld pool as the basis for error calculation, and to simulate the penetration depth of the weld cross-section. , Weld width at the point , Weld width at the point Penetration depth of the actual weld cross-section , Weld width at the point , Weld width at the point The sum of squared errors is used as the objective function; S6: After stopping the iterative calculation, determine whether the weld is a multi-layer, multi-pass weld. If not, obtain the optimal heat source optimization parameters; if so, use the heat source parameter temperature field calculation results after the optimization of the previous weld layer as the initial conditions for the optimization of the next weld layer.

2. The method for optimizing the heat source in welding numerical simulation based on computer vision according to claim 1, characterized in that, In step S1, the DFLUX heat source subroutine is edited using Fortran to establish a double-ellipsoidal heat source model. The heat flux density distribution function within the ellipsoid of the first half of the double-ellipsoidal heat source model is: The heat flux density distribution function within the ellipsoid of the latter half of the double-ellipsoidal heat source model is: in, For the effective power of the electric arc, take... ; For welding voltage, For welding current, For welding thermal efficiency; , and The coordinates of the heat source center; , , and For ellipsoid shape parameters; For welding speed, mm / s ; This refers to the time required for the welding process. and These are the heat distribution parameters of the front and rear ellipsoids, respectively. .

3. The method for optimizing the heat source in welding numerical simulation based on computer vision according to claim 1, characterized in that, In step S2, the specific process of establishing the simplified finite element model is as follows: after establishing the finite element model in Abaqus, the finite element model is then simplified using simplified geometry techniques.

4. The method for optimizing the heat source in welding numerical simulation based on computer vision according to claim 1, characterized in that, In step S2, the weld activation method adopts the field variable correlation method in the welding temperature field calculation.

5. The method for optimizing the heat source in welding numerical simulation based on computer vision according to claim 4, characterized in that, The specific process of the field variable correlation method is as follows: Step 1: Define field variables: In the model definition, set field variables to represent different material states; Step 2: Write USDFLD subroutines: Write USDFLD subroutines based on the Fortran language to dynamically adjust material parameters according to the values ​​of field variables and add field variable values ​​to the material properties; Step 3: Associate material properties with field variables: In the material definition, associate the relevant material properties with the field variables.

6. The method for optimizing the heat source in welding numerical simulation based on computer vision according to claim 1, characterized in that, In step S3, the specific process of image preprocessing is as follows: the RGB value range of the molten pool shape in the image is set according to the welding simulation results in step S2.

7. The method for optimizing the heat source in welding numerical simulation based on computer vision according to claim 1, characterized in that, In step S5, the specific process of optimizing the heat source optimization parameters using the improved genetic algorithm includes: Step 1: Initialize the population and set parameters: Randomly generate an initial population, each individual is encoded by chromosome to represent a potential solution, and set key parameters, including population size, crossover probability, and mutation probability. Then, introduce a chaotic sequence as a tool for generating subsequent crossover points and mutation values. Step 2: Fitness Assessment and Ranking: Calculate the fitness value of each individual based on the objective function, and sort all individuals in ascending / descending order according to the objective function value; Step 3: Matching Parents Based on Social Status: Breaking the traditional random pairing rules, targeted pairing of individuals with similar fitness is performed based on the ranking results; Step 4: Chaos-guided single-point crossover: Perform crossover on each pair of parent individuals; Step 5: Multigene Chaotic Mutation: Independent of the crossover operation, perform directional mutation; Step Six: Elite Preservation and Population Update: Merge the offspring generated by crossover and mutation into a new generation of population, while forcibly preserving the current best individual; Step 7: Termination condition judgment: Check whether the preset termination condition is met. If it is met, output the optimal solution; otherwise, return to step 2 to continue iterative optimization.

Citation Information

Patent Citations

  • Method for predicting surfacing cladding layer components based on numerical analog simulation

    CN117272712A

  • Simulation optimization method for heat source distribution of alloy welding structural member and terminal

    CN119623250A