Full-automatic CFD modeling method and system for laser and hybrid welding process thereof based on real light field distribution

Through the integration of Python and Fluent, a welding heat source model with real light field distribution is generated, which solves the problem of difficult to simulate the non-uniformity of light field distribution in the existing technology, and realizes high-precision simulation and automated modeling of laser and its composite welding process.

CN119538784AActive Publication Date: 2025-02-28HUAZHONG UNIV OF SCI & TECH

Patent Information

Application Number
CN202411601501.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-02-28
Estimated Expiration
2044-11-11

Smart Images

  • Figure CN119538784A_ABST
    Figure CN119538784A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of welding, and discloses a laser and a full-automatic CFD modeling method and system in the hybrid welding process of the laser. On the basis of the prior art, a series of innovative improvements are provided for overcoming the defects in the laser and composite welding process of the laser, and therefore the performance and the application value of the system are remarkably improved in multiple aspects. Firstly, by introducing a laser heat source model based on real light field distribution, the precision of welding process simulation is greatly improved; a traditional welding heat source model generally assumes that laser energy is uniformly distributed, non-uniformity of a light field in an actual space is ignored, and the simplified assumption causes a certain deviation between a simulation result and an actual situation. According to the heat source model, the distribution of laser energy in the space and the interaction between the laser energy and a welding material are accurately calculated through a ray tracing method, and particularly under the multi-reflection and multi-scattering conditions, the transmission path and the distribution rule of the energy in the laser welding process can be truly reflected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of welding technology, and in particular relates to a fully automatic CFD modeling method and system for laser and composite welding processes. Background Art

[0002] With the increasing demand for efficient and high-quality welding technology in the manufacturing industry, laser and its hybrid welding technology have gradually become one of the important welding methods in modern manufacturing. Laser welding is widely used in automobile manufacturing, aerospace, shipbuilding and other fields due to its advantages such as concentrated energy, narrow weld, small heat-affected zone and fast welding speed. Laser welding can effectively solve the problems existing in traditional welding methods when dealing with high-melting-point materials or high-strength alloy materials. At the same time, with the development of CNC technology and intelligent manufacturing, the automation and intelligence level of the welding process has been continuously improved, and the fully automatic welding system that can meet the complex process requirements has become the direction of future development. At present, in high-precision and high-demand welding occasions, hybrid welding technologies, such as laser and arc hybrid welding, have gradually shown unique advantages. Laser and arc hybrid welding combines the high energy density of laser welding and the flexibility of arc welding, making the welding process more stable and the weld quality better, which is suitable for thick plate welding and complex welding structures.

[0003] However, in the complex welding process, the selection and control of welding process parameters become the key factors affecting the welding quality. In particular, the accurate simulation and prediction of the actual light field distribution, energy transfer, molten pool formation and metal evaporation in the laser welding process has always been an important topic in the field of welding research. Traditional welding simulation technology usually relies on empirical formulas and experimental data, and it is difficult to fully consider the complex physical mechanisms in light-matter interaction. Therefore, numerical simulation technology based on computational fluid dynamics (CFD) came into being and has been widely used in recent years. CFD can provide high-precision numerical analysis of fluid flow, heat conduction, molten pool dynamics, metal evaporation and weld formation in the welding process, greatly improving the optimization efficiency of the welding process.

[0004] At present, the modeling and simulation of laser and hybrid welding processes mainly rely on finite element analysis. For the simulation of heat sources in laser welding, ray tracing algorithms are usually used to calculate the energy distribution of the laser in the molten pool, while arc welding needs to consider the heating and force of the arc plasma on the molten pool. This type of technology has been applied to the optimization of welding processes, such as improving weld formation and reducing welding defects. However, the existing technology still has certain limitations in simulating the real light field distribution. It is usually assumed that the energy of the light source is uniformly distributed, and it is difficult to accurately simulate the non-uniformity of the light field. In addition, the various physical effects in hybrid welding, such as metal evaporation, molten pool dynamics, thermal fluid coupling, surface tension, buoyancy and other complex physical phenomena, also make it difficult for traditional numerical simulation methods to achieve high-precision predictions.

[0005] In this technical field, the fully automatic modeling method of laser and its hybrid welding process based on CFD is not mature enough. For example, how to accurately capture the coupled heat source of laser and arc, how to reflect the light field distribution in real time in three-dimensional space, how to realize the coupled simulation of multiple physical fields, etc., are all technical problems that need to be further solved. At present, some studies have proposed a solution to achieve refined welding simulation through customized heat source models and physical parameters, but a systematic and automated modeling and simulation method has not yet been formed. In addition, the existing welding simulation software on the market, such as ANSYS Fluent, although it can perform CFD simulation analysis, has limited support for welding heat source models, often requiring users to manually set complex parameters, and lacks intelligent and automated support.

[0006] Through the above analysis, the problems and defects of the prior art are as follows:

[0007] Existing studies have proposed solutions to achieve refined welding simulation through customized heat source models and physical parameters, but a systematic and automated modeling and simulation method has not yet been formed. In addition, existing welding simulation software on the market, such as ANSYS Fluent, although it can perform CFD simulation analysis, has limited support for welding heat source models and often requires users to manually set complex parameters, lacking intelligent and automated support. Summary of the invention

[0008] In view of the problems existing in the prior art, the present invention provides a fully automatic CFD modeling method and system for laser and composite welding processes.

[0009] The present invention is implemented as follows: a fully automatic CFD modeling method for laser and hybrid welding processes includes:

[0010] Step 1: Use Python to call the Tkinter library to create the graphical user interface of the system and realize the multi-level interactive interface of the welding simulation system, including the main menu and multiple sub-function interfaces, including the modules of establishing the calculation domain, selecting the welding method, setting the calculation time step and viewing the calculation results;

[0011] Step 2: Create a material property library through Python script to store and manage the physical properties of various materials;

[0012] The material property library contains the density, viscosity, thermal conductivity, and specific heat capacity parameters of various common materials, and can be dynamically expanded to support user-defined materials. The data structure of the material library is designed in dictionary or JSON format for easy search and call. The physical properties of each material are indexed by a unique identifier to ensure that the material properties can be quickly retrieved and assigned during the simulation process.

[0013] Step 3: Read the .rpl file content through the Python script, dynamically generate the corresponding Tcl script, call the ICEMCFD batch execution, automatically execute the creation of geometric models, specify boundary conditions, and mesh division functions, and generate the welding calculation domain .msh format file;

[0014] Step 4: Use Python to call the open() function to create the C language subroutine file welding.c of the laser welding basic module;

[0015] By defining a C language code string containing welding heat source, radiation heat dissipation, convection heat dissipation, recoil pressure and evaporation condensation source items in the Python script, calling the open() function to open the file in write mode ("w"), and using the write() method to write the C code string to the welding.c file, the generation of the C language module is realized; this step ensures that the core calculation module of the welding simulation can be saved in the form of C language for subsequent compilation and execution;

[0016] Step 5: Start Ansys Fluent simulation software by calling Fluent Python API through Python;

[0017] Use the pyfluent.launch_fluent method to set the simulation dimension (2D or 3D mode) and calculation accuracy (single precision or double precision); at the same time, specify the meshing mode (meshing_mode), working directory (work_dir) and Fluent root path (root_path), and enable parallel computing as needed (set parallel = True and solverprocesses to calculate the number of cores); this step achieves seamless connection between Fluent software and Python environment by accurately configuring the above parameters;

[0018] Step 6: Import the simulation mesh file through the Python script, and use the tui.file.read_mesh command in the Fluent TUI (Text User Interface) interface to load the mesh file of the specified path into the Fluent environment; this step initializes the mesh model by calling the mesh file path;

[0019] Step 7: Based on the material property library created in step 1, use the Fluent TUI command in this step to assign physical parameters to the selected material;

[0020] The Python script will call the material property library, use the material name as an index, retrieve the corresponding physical properties from the material library, and assign these parameters to the Fluent simulation model through the tui.define.materials.modify command; this step ensures that the material properties are correctly loaded into the simulation model;

[0021] Step 8: Compile and load the user-defined function (UDF) subroutine through the Python script, and use the Fluent TUI command tui.compile.uda to compile the specified UDF source file;

[0022] After successful compilation, use tui.define.user_defined.function_hooks.read to load the source items or custom functions in the UDF file so that they can be called in the subsequent simulation process; this step realizes the correct loading of custom physical models or source items;

[0023] Step 9: Set the boundary conditions in the simulation through Fluent's TUI command;

[0024] First, use the tui.define.boundary_conditions.set command to assign corresponding physical conditions to the inlet, outlet, and wall boundaries. For example, you can set the velocity for the inlet, the pressure for the outlet, and the temperature or no-slip condition for the wall. This step ensures that each boundary condition in the simulation correctly reflects the physical meaning.

[0025] Step 10: Associate the source terms in the compiled and loaded user-defined function with the corresponding regions or boundary conditions;

[0026] Use the tui.define.user_defined.function_hooks.source_term command to bind the loaded source term to the boundary condition or a specific area. This step ensures that the source term can affect the boundary condition during the simulation calculation and realize complex physical field simulation.

[0027] Step 11: Initialize the model by calling the Fluent TUI command through the Python script;

[0028] First, use the solver.tui.solve.initialize.initialize_flow() method to perform standard initialization, and specify the initialization to act on all grid areas through set_parameters; then use set_reference_frame to set the reference system relative to the unit area, and then use set_initial_conditions to set the initial physical conditions for the flow field; finally, execute_initialization() to start the initialization process to ensure that the model initialization is completed successfully;

[0029] Step 12: Call the Fluent TUI command through the Python script to implement simulation calculation settings;

[0030] Set the time step using solver.tui.solve.set.time_step; and set the number of simulation time steps using solver.tui.solve.set.number_of_time_steps;

[0031] Call solver.tui.solve.set.max_iterations_per_time_step to set the maximum number of iterations per time step, and solver.tui.solve.set.reporting_interval

[0032] and solver.tui.solve.set.profile_update_interval to set the report and profile update interval;

[0033] Finally, execute solver.tui.solve.execute_calculation() to start the simulation calculation;

[0034] Step 13: Use the Python script to call the EnSight Python API to import the simulation results of Fluent and export the animation in MP4 format;

[0035] First, use the ens.Session() method to start the EnSight session and call the session.data.import_fluid() method to import Fluent's .cas and .dat files.

[0036] Then, the temperature field isosurface is generated through the scene.add_iso_surface() method; then, the output path and file format are specified as MP4 through the scene.animation.start_output() method, and the animation frames are generated by calling scene.animation.export_frames().

[0037] Finally, use scene.animation.stop_output() to complete the animation export in MP4 format;

[0038] Step 14: Use Python to call the moviepy library and Tkinter to achieve real-time playback of the MP4 format video generated by EnSight in the simulation software interface;

[0039] First, use the VideoFileClip function of moviepy to load the video file in the specified path, and call the iter_frames method to read the video frame by frame;

[0040] Then, PIL (Python Imaging Library) is used to convert each frame into an image format supported by Tkinter and displayed on the user interface through the Tkinter Label component. During the playback process, the video playback rate is adjusted in real time through the Tkinter Scale control to ensure that the user can customize the playback speed and realize the visual dynamic display of the simulation results.

[0041] Furthermore, the welding heat source, radiation heat dissipation, convection heat dissipation, recoil pressure and evaporation condensation source items include:

[0042] 1) Arc heat source term:

[0043] The energy source term of the arc is modeled using a 3D double ellipsoid heat source, which captures the unique spatial characteristics of the arc and is defined by the following formula:

[0044]

[0045] Among them, f f and fr represent the proportion of the total heat energy allocated to the front ellipsoid and the rear ellipsoid, respectively; U and I represent the voltage and current intensity during welding, respectively; the semi-axes of the double ellipsoid heat source in the x, y and z directions are represented by af, b1 and k1 for the semi-axes of the front ellipsoid, and by ar, b2 and k2 for the semi-axes of the rear ellipsoid, respectively; v represents the welding speed;

[0046] 2) Arc pressure source term:

[0047] Arc pressure is a key factor affecting weld pool stability and depth and is modeled by the following formula:

[0048]

[0049] Where U0 is the vacuum permeability, I is the current intensity; Ra is the radius of influence of the arc, and ReARC is the coefficient of arc pressure; the arc pressure is crucial in determining the force components of the arc on the molten material in the x, y and z directions, which are defined as xarc_p, yarc_p and zarc_p respectively;

[0050] 3) Electromagnetic force source term:

[0051] The arc generates an electromagnetic force by causing the plasma to conduct electricity within the weld pool, defined by the following equation:

[0052]

[0053] Among them, u0 is the magnetic permeability of the medium, I is the current intensity, σ is the current distribution coefficient, and D represents the thickness of the workpiece;

[0054] 4) Droplet source term:

[0055] During arc welding, metal droplets are formed at the tip of the welding wire and then transferred to the molten pool. The metal transfer adopts a one-droplet-per-pulse mode, that is, the droplet separation frequency is consistent with the arc pulse frequency. In the simulation, each droplet is introduced at a specified position in the computational domain and modeled as a spherical fluid. The mass-momentum source term is characterized by the fluid density, initial temperature and velocity. The energy and momentum of the droplet are brought into the molten pool when it merges with the molten pool.

[0056] 5) Laser heat source:

[0057] The energy source of the laser uses a ray tracing method to simulate the reflection and absorption of energy on the wall of the pinhole. This method simulates the interaction between the laser beam and the pinhole by calculating the path and reflection point of the light and using trilinear interpolation. The trajectory of the laser light starts from the point (x0, y0, z0) and is determined by the direction cosines (U, V, W), which are solved by the following equation:

[0058]

[0059] Where D represents the distance along the ray, (Vx, Vy, Vz) represents the gradient of the VOF field in the computational unit, and the Gaussian beam profile based on the TEM00 mode is used to simulate the laser energy distribution, where the intensity I0(r, z) is expressed as:

[0060]

[0061] The beam radius r(z) along the propagation direction is expressed as:

[0062]

[0063] Where Q represents the laser power, r0 is the focal radius at the focal plane, and zr is the Rayleigh length. The absorption rate R of the laser energy is calculated using the Fresnel reflection theory, taking into account the incident angle and the emissivity of the pinhole wall, and is expressed as:

[0064]

[0065] Where φ is the angle of incidence and ε is the emissivity of the aperture wall;

[0066] 6) Recoil pressure source term:

[0067] 7) Surface tension source term:

[0068] 8) Heat dissipation source term;

[0069] 9) Buoyancy source term.

[0070] Furthermore, the recoil pressure source term:

[0071] The recoil pressure generated during laser welding is defined by the following equation:

[0072]

[0073] Wherein, Psat(T), P0, Lν, Tb and R represent saturation pressure, atmospheric pressure, latent heat of vaporization, boiling point temperature and gas constant, respectively.

[0074] Furthermore, the surface tension source term:

[0075] The surface tension generated during the welding process is modeled as a function of temperature as:

[0076]

[0077] Among them, γm represents the surface tension of pure metal at the melting point Tm, A is a constant related to the temperature gradient of the surface tension, and Kseg is the equilibrium segregation coefficient.

[0078] Furthermore, the heat dissipation source term:

[0079] The radiation and convection heat transfer between the molten pool surface and the surrounding air is calculated by the following formula:

[0080]

[0081] Among them, εrad is the radiation heat dissipation coefficient, σ is the Steffen-Boltzmann constant, hconv is the convection coefficient, and T0 is the ambient temperature.

[0082] Furthermore, the buoyancy source term:

[0083] Since the density of liquid metal decreases as temperature increases, thermal buoyancy arises from the temperature gradient within the molten pool and is defined by:

[0084] F b =ραg(TT m )

[0085] Where ρ represents the density of the liquid metal, α is the thermal expansion coefficient, g is the gravitational acceleration, and Tm is the ambient temperature.

[0086] Another object of the present invention is to provide a fully automatic CFD modeling system for laser and hybrid welding processes, comprising:

[0087] The calling module is used to create the graphical user interface of the system by calling the Tkinter library through Python, and realize the multi-level interactive interface of the welding simulation system, which includes the main menu and multiple sub-function interfaces, including the modules of establishing the calculation domain, selecting the welding method, setting the calculation time step and viewing the calculation results;

[0088] The storage management module is used to create a material property library through Python scripts to store and manage the physical properties of various materials. The material property library contains the density, viscosity, thermal conductivity, and specific heat capacity parameters of various common materials, and can be dynamically expanded to support user-defined materials. The data structure of the material library is designed in dictionary or JSON format for easy search and call. The physical properties of each material are indexed by a unique identifier to ensure that the material properties can be quickly retrieved and assigned during the simulation process.

[0089] The reading module is used to read the contents of the .rpl file through a Python script, dynamically generate the corresponding Tcl script, call the ICEMCFD batch execution, automatically execute the creation of geometric models, specify boundary conditions, meshing functions, and generate the welding calculation domain .msh format file;

[0090] The calling module is used to use Python to call the open() function to create the C language subroutine file welding.c of the laser welding basic module; by defining the C language code string containing the welding heat source, radiation heat dissipation, convection heat dissipation, recoil pressure and evaporation condensation source items in the Python script, calling the open() function to open the file in write mode ("w"), and using the write() method to write the C code string to the welding.c file, the generation of the C language module is realized; this step ensures that the core calculation module of the welding simulation can be saved in the form of C language for subsequent compilation and execution;

[0091] The startup module is used to start the Ansys Fluent simulation software by calling the Fluent Python API through Python; the pyfluent.launch_fluent method is used to set the simulation dimension (2D or 3D mode) and calculation accuracy (single precision or double precision); at the same time, the meshing mode (meshing_mode), working directory (work_dir) and Fluent root path (root_path) are specified, and parallel computing is enabled as needed (set parallel = True and solverprocesses to calculate the number of cores); this step realizes seamless connection between Fluent software and Python environment by accurately configuring the above parameters;

[0092] The import module is used to import the simulation mesh file through the Python script, and use the tui.file.read_mesh command in the Fluent TUI (Text User Interface) interface to load the mesh file of the specified path into the Fluent environment; this step initializes the mesh model by calling the mesh file path;

[0093] The assignment module is used to assign physical parameters of the selected material using the Fluent TUI command in this step according to the created material property library; the Python script will call the material property library, use the material name as an index, retrieve the corresponding physical properties from the material library, and assign these parameters to the Fluent simulation model through the tui.define.materials.modify command; this step ensures that the material properties are correctly loaded into the simulation model;

[0094] The loading module is used to compile and load the user-defined function (UDF) subroutine through the Python script. The Fluent TUI command tui.compile.uda is used to compile the specified UDF source file. After successful compilation, tui.define.user_defined.function_hooks.read is used to load the source items or custom functions in the UDF file so that they can be called in the subsequent simulation process. This step realizes the correct loading of custom physical models or source items.

[0095] The setting module is used to set the boundary conditions in the simulation through Fluent's TUI command;

[0096] The association module is used to associate the source items in the compiled and loaded user-defined functions with the corresponding regions or boundary conditions; through the tui.define.user_defined.function_hooks.source_term command, the loaded source items are bound to the boundary conditions or specific regions; this step ensures that the source items can affect the boundary conditions during the simulation calculation process, realizing complex physical field simulation;

[0097] Initialization module, used to initialize the model by calling Fluent TUI commands through Python scripts;

[0098] The calculation setting module is used to call Fluent TUI commands through Python scripts to implement simulation calculation settings;

[0099] The export module is used to call the EnSight Python API through Python scripts to import Fluent simulation results and export animations in MP4 format;

[0100] Generate a module for using Python to call the moviepy library and Tkinter to achieve real-time playback of MP4 format videos generated by EnSight in the simulation software interface.

[0101] Another object of the present invention is to provide a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the fully automatic CFD modeling method for the laser and its hybrid welding process.

[0102] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to execute the steps of the fully automatic CFD modeling method for the laser and hybrid welding process.

[0103] Another object of the present invention is to provide an information data processing terminal, which is used to implement a fully automatic CFD modeling system for the laser and hybrid welding process.

[0104] In combination with the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solutions to be protected by the present invention are as follows:

[0105] First, the present invention proposes a fully automatic CFD modeling method and system for laser and hybrid welding processes based on real light field distribution, which can realize high-precision and fully automatic laser welding process simulation. Based on the existing CFD simulation technology, the present invention automatically generates a welding heat source model containing real light field distribution through the integrated control of Python language and Fluent software, and combines factors such as arc effect and molten pool dynamics in the welding process to realize the full process simulation and analysis of laser and hybrid welding processes.

[0106] Based on the prior art, the present invention proposes a series of innovative improvements to address the deficiencies in laser and its composite welding process, thereby significantly improving the performance and application value of the system in many aspects. First, the present invention greatly improves the accuracy of welding process simulation by introducing a laser heat source model based on the real light field distribution. Traditional welding heat source models usually assume that the laser energy is evenly distributed, ignoring the non-uniformity of the light field in the actual space. This simplified assumption leads to a certain deviation between the simulation results and the actual situation. The heat source model of the present invention accurately calculates the distribution of laser energy in space and its interaction with welding materials through ray tracing, especially under multi-reflection and multi-scattering conditions, and can truly reflect the energy transfer path and distribution law during laser welding. This improvement ensures a high degree of consistency between numerical simulation and actual welding results, thereby better predicting the molten pool morphology and welding quality.

[0107] Secondly, the present invention adopts a fully automatic CFD modeling process, which greatly reduces the operational complexity of numerical simulation of welding process. When establishing the CFD model of laser-arc hybrid welding, the prior art often needs to manually set multiple boundary conditions, heat source parameters and complex physical models, which is cumbersome and error-prone. By calling Fluent software with Python and combining its TUI interface, the present invention realizes a fully automatic modeling and solution process. This method realizes a fully automated process from geometric modeling, heat source loading to numerical solution by automatically identifying material properties, generating grids and calling preset physical parameters, greatly improving modeling efficiency and accuracy. In addition, the automated process not only reduces the possibility of human operating errors, but also makes the simulation and optimization of large-scale welding processes possible, providing a solid technical guarantee for welding quality monitoring in the production process.

[0108] In addition to the optimization of the welding heat source model, the present invention also innovatively introduces a complex source term model based on ray tracing and multi-physics field coupling, including arc pressure, electromagnetic force, and weld droplet detachment. The introduction of these physical fields further improves the simulation accuracy of the composite welding process, and can more realistically reflect the behavior of the molten pool under the coupling of laser and arc and the microscopic dynamic changes during the welding process. These improvements not only ensure the welding quality and structural performance, but also reduce the cost and time of process debugging, making the numerical simulation of complex welding process more efficient and reliable.

[0109] In general, the present invention achieves a significant improvement in simulation accuracy, degree of automation and ease of operation through improvements in multiple key technical points in the laser and its composite welding process. It not only significantly improves the accuracy of welding quality control, but also provides a more reliable and efficient technical means for the simulation optimization of complex welding processes.

[0110] Second, as auxiliary evidence of the inventiveness of the claims of the present invention, it is also reflected in the following important aspects:

[0111] (1) The expected benefits and commercial value of the technical solution of the present invention after transformation are:

[0112] The technical solution of the present invention significantly improves the simulation accuracy and efficiency of the welding process by providing a fully automated CFD modeling system for laser and composite welding processes based on real light field distribution. The automation characteristics of the system reduce the need for manual intervention, making the simulation of complex welding processes more convenient and rapid. Expected benefits include shortening the R&D cycle, reducing production costs, and reducing quality problems caused by welding defects. The commercial value is reflected in the fact that the system can be widely used in industries that require high-precision welding, such as automobile manufacturing, aerospace, and shipbuilding, helping companies improve production efficiency and product quality, and has great market potential.

[0113] (2) The technical solution of the present invention fills the technical gap in the industry at home and abroad:

[0114] The fully automatic CFD modeling and simulation system based on real light field distribution proposed in the present invention fills the gap in multi-physical field coupling simulation technology in laser and composite welding processes. Existing welding simulation technology is usually unable to accurately reflect the complex light field distribution in the actual welding process, especially the heat source distribution and energy transfer of laser and arc coupling. The present invention innovatively combines CFD simulation technology and customized physical parameters to achieve high-precision simulation of complex welding phenomena, and solves the limitations of traditional methods in dealing with multi-physical effects such as metal evaporation, molten pool dynamics, and thermal fluid coupling. It provides advanced technical tools for the laser welding field at home and abroad, filling the gap in automated and intelligent modeling.

[0115] (3) The technical solution of the present invention solves the technical problems that people have been eager to solve but have never been able to solve successfully:

[0116] The present invention solves the technical problem of accurate simulation of multi-physical fields in laser and hybrid welding processes, which has long been a difficult problem that has not been effectively solved. In the past, light field distribution, energy transfer, molten pool dynamics, and complex thermal-fluid coupling phenomena in welding processes were difficult to describe comprehensively and accurately through existing numerical simulation technologies. Traditional simulation methods usually rely on empirical formulas or manually set complex parameters, which are difficult to cope with dynamic changes in the welding process, especially when dealing with non-uniform light source distribution and multi-physical effects. The present invention combines CFD simulation, automated modeling, and a custom heat source model to achieve accurate simulation of these complex phenomena for the first time, and can provide comprehensive numerical analysis for laser and hybrid welding processes, truly breaking through this technical bottleneck that has long plagued the welding field.

[0117] (4) The technical solution of the present invention overcomes technical prejudice:

[0118] Traditionally, simulations of laser and hybrid welding usually assume that the energy of the light source is evenly distributed, ignoring the actual non-uniformity of the light field, and there are inherent simplifications and limitations in the processing of complex multi-physical field coupling phenomena. In the prior art, welding simulations mainly rely on empirical formulas or manually set parameters, making it difficult to achieve refined and automated simulations. The present invention breaks this traditional prejudice by innovatively adopting real light field distribution, fully automatic CFD modeling, and multi-physical field coupling simulation. It is no longer limited to overly simplified assumptions, but through more accurate physical models and automated processes, it comprehensively improves the accuracy and efficiency of simulations.

[0119] Third, the technical problems of the prior art solved by the technical solution of the present invention in industrial applications and significant technical progress:

[0120] 1. Problems with existing technologies:

[0121] Low degree of automation: In the existing laser and hybrid welding process, traditional computational fluid dynamics (CFD) modeling requires a lot of manual intervention, especially in the simulation of welding heat source, the assignment of material properties and the setting of boundary conditions. It relies on manual operation and is inefficient.

[0122] Multiple steps and complexity: In the existing technology, the various steps of welding simulation are scattered in different software modules. For example, meshing, material property assignment, heat source setting, etc. all require manual execution of different tools or scripts, resulting in a cumbersome process.

[0123] Poor visualization of simulation results: In the existing technology, the simulation results of the welding process lack intuitive visualization methods and often require professional software to view, which is not conducive to real-time feedback and dynamic display of the results.

[0124] Insufficient flexibility of the material library: The existing material property management is inflexible, the material database is difficult to expand, and cannot quickly adapt to the welding requirements of different materials.

[0125] 2. Technological advancement:

[0126] Realize fully automatic modeling: The present invention automatically executes a series of simulation modeling processes from mesh division, material property assignment to boundary condition setting through Python scripts, which greatly improves the automation level of simulation modeling, reduces manual intervention, and improves simulation efficiency.

[0127] Integrated interactive interface: The system's multi-level interactive interface is created through Python's Tkinter library, integrating all modeling and simulation steps. Users can complete all welding simulation operations in the same interface, simplifying the operation process and improving ease of use.

[0128] Dynamic material library: The present invention creates a dynamically expanding material property library that can flexibly store and manage the physical properties of different materials. Users can customize materials according to their needs, greatly improving the flexibility and efficiency of assigning material properties.

[0129] Automatically generate simulation result animation: Through seamless connection with Fluent and EnSight, the present invention can automatically generate simulation result animation in MP4 format after simulation calculation, and display it in real time through the user interface, which greatly enhances the visualization effect of the simulation results.

[0130] Parallel computing and optimization: This method calls parallel computing through Python scripts to improve the calculation speed of welding simulation, especially in complex three-dimensional simulations, which can complete the simulation in a shorter time and improve production efficiency in industrial applications.

[0131] Therefore, while solving the problems of the prior art, the present invention realizes fully automatic modeling, dynamic visualization of simulation results and flexible management of the material library. It has significant technological progress, can effectively improve the efficiency and operability of welding simulation, and has great industrial application value. BRIEF DESCRIPTION OF THE DRAWINGS

[0132] Figure 1 It is a flow chart of a fully automatic CFD modeling method for laser and hybrid welding processes provided by an embodiment of the present invention.

[0133] Figure 2It is a structural block diagram of a fully automatic CFD modeling system for laser and hybrid welding processes provided by an embodiment of the present invention.

[0134] Figure 3 It is a system interface diagram provided by an embodiment of the present invention.

[0135] Figure 4 1 is a diagram of welding materials and their physical property parameters provided by an embodiment of the present invention.

[0136] Figure 5 It is a welding calculation domain establishment diagram provided by an embodiment of the present invention.

[0137] Figure 6 It is a welding parameter and simulation environment configuration diagram provided by an embodiment of the present invention.

[0138] Figure 7 It is a material property diagram of the loading calculation domain provided by an embodiment of the present invention.

[0139] Figure 8 It is a boundary condition and source item loading diagram provided by an embodiment of the present invention.

[0140] Fig. 9 It is a time step diagram for setting calculation provided by an embodiment of the present invention.

[0141] Fig.10 It is a welding process video file diagram generated by Ensight provided in an embodiment of the present invention.

[0142] Fig.11 This is a real-time monitoring diagram of the welding simulation process provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0143] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0144] like Figure 1 As shown, a fully automatic CFD modeling method for laser and hybrid welding process provided by an embodiment of the present invention includes the following steps:

[0145] S101: The graphical user interface of the system is created by calling the Tkinter library through Python to realize the multi-level interactive interface of the welding simulation system, which includes the main menu and multiple sub-function interfaces, including the modules of establishing the calculation domain, selecting the welding method, setting the calculation time step and viewing the calculation results;

[0146] S102: Create a material property library through Python scripts to store and manage the physical properties of various materials;

[0147] The material property library contains the density, viscosity, thermal conductivity, and specific heat capacity parameters of various common materials, and can be dynamically expanded to support user-defined materials. The data structure of the material library is designed in dictionary or JSON format for easy search and call. The physical properties of each material are indexed by a unique identifier to ensure that the material properties can be quickly retrieved and assigned during the simulation process.

[0148] S103: Read the .rpl file content through the Python script, dynamically generate the corresponding Tcl script, call the ICEMCFD batch execution, automatically execute the creation of geometric model, specify boundary conditions, meshing functions, and generate the welding calculation domain .msh format file;

[0149] S104: using Python to call the open() function to create a C language subroutine file welding.c of the laser welding basic module;

[0150] By defining a C language code string containing welding heat source, radiation heat dissipation, convection heat dissipation, recoil pressure and evaporation condensation source items in the Python script, calling the open() function to open the file in write mode ("w"), and using the write() method to write the C code string to the welding.c file, the generation of the C language module is realized; this step ensures that the core calculation module of the welding simulation can be saved in the form of C language for subsequent compilation and execution;

[0151] S105: Start Ansys Fluent simulation software by calling Fluent Python API through Python;

[0152] Use the pyfluent.launch_fluent method to set the simulation dimension (2D or 3D mode) and calculation accuracy (single precision or double precision); at the same time, specify the meshing mode (meshing_mode), working directory (work_dir) and Fluent root path (root_path), and enable parallel computing as needed (set parallel = True and solverprocesses to calculate the number of cores); this step achieves seamless connection between Fluent software and Python environment by accurately configuring the above parameters;

[0153] S106: Import the simulation mesh file through the Python script, and use the tui.file.read_mesh command in the Fluent TUI (Text User Interface) interface to load the mesh file of the specified path into the Fluent environment; this step initializes the mesh model by calling the mesh file path;

[0154] S107: According to the material property library created in step S101, in this step, the physical parameters of the selected material are assigned using the Fluent TUI command;

[0155] The Python script will call the material property library, use the material name as an index, retrieve the corresponding physical properties from the material library, and assign these parameters to the Fluent simulation model through the tui.define.materials.modify command; this step ensures that the material properties are correctly loaded into the simulation model;

[0156] S108: Compile and load a user-defined function (UDF) subroutine through a Python script, and use a Fluent TUI command tui.compile.uda to compile a specified UDF source file;

[0157] After successful compilation, use tui.define.user_defined.function_hooks.read to load the source items or custom functions in the UDF file so that they can be called in the subsequent simulation process; this step realizes the correct loading of custom physical models or source items;

[0158] S109: Set the boundary conditions in the simulation through Fluent TUI commands;

[0159] First, use the tui.define.boundary_conditions.set command to assign corresponding physical conditions to the inlet, outlet, and wall boundaries. For example, you can set the velocity for the inlet, the pressure for the outlet, and the temperature or no-slip condition for the wall. This step ensures that each boundary condition in the simulation correctly reflects the physical meaning.

[0160] S110: Associating the source items in the compiled and loaded user-defined function with the corresponding regions or boundary conditions;

[0161] Use the tui.define.user_defined.function_hooks.source_term command to bind the loaded source term to the boundary condition or a specific area. This step ensures that the source term can affect the boundary condition during the simulation calculation and realize complex physical field simulation.

[0162] S111: Initialize the model by calling Fluent TUI command through Python script;

[0163] First, use the solver.tui.solve.initialize.initialize_flow() method to perform standard initialization, and specify the initialization to act on all grid areas through set_parameters; then use set_reference_frame to set the reference system relative to the unit area, and then use set_initial_conditions to set the initial physical conditions for the flow field; finally, execute_initialization() to start the initialization process to ensure that the model initialization is completed successfully;

[0164] S112: Calling Fluent TUI commands through Python scripts to implement simulation calculation settings;

[0165] Set the time step using solver.tui.solve.set.time_step; and set the number of simulation time steps using solver.tui.solve.set.number_of_time_steps;

[0166] Call solver.tui.solve.set.max_iterations_per_time_step to set the maximum number of iterations per time step, and solver.tui.solve.set.reporting_interval

[0167] and solver.tui.solve.set.profile_update_interval to set the report and profile update interval;

[0168] Finally, execute solver.tui.solve.execute_calculation() to start the simulation calculation;

[0169] S113: Call EnSight Python API through Python script to import Fluent simulation results and export animation in MP4 format;

[0170] First, use the ens.Session() method to start the EnSight session and call the session.data.import_fluid() method to import Fluent's .cas and .dat files.

[0171] Then, the temperature field isosurface is generated through the scene.add_iso_surface() method; then, the output path and file format are specified as MP4 through the scene.animation.start_output() method, and the animation frames are generated by calling scene.animation.export_frames().

[0172] Finally, use scene.animation.stop_output() to complete the animation export in MP4 format;

[0173] S114: Use Python to call the moviepy library and Tkinter to achieve real-time playback of the MP4 format video generated by EnSight in the simulation software interface;

[0174] First, use the VideoFileClip function of moviepy to load the video file in the specified path, and call the iter_frames method to read the video frame by frame;

[0175] Then, PIL (Python Imaging Library) is used to convert each frame into an image format supported by Tkinter and displayed on the user interface through the Tkinter Label component. During the playback process, the video playback rate is adjusted in real time through the Tkinter Scale control to ensure that the user can customize the playback speed and realize the visual dynamic display of the simulation results.

[0176] The welding heat source, radiation heat dissipation, convection heat dissipation, recoil pressure and evaporation condensation source items provided in the embodiment of the present invention include:

[0177] 1) Arc heat source term:

[0178] The energy source term of the arc is modeled using a 3D double ellipsoid heat source, which captures the unique spatial characteristics of the arc and is defined by the following formula:

[0179]

[0180] Among them, ff and fr represent the proportion of the total heat energy allocated to the front ellipsoid and the rear ellipsoid respectively; U and I are the voltage and current intensity during welding respectively; the semi-axes of the double ellipsoid heat source in the x, y and z directions are represented by af, b1, k1 for the semi-axes of the front ellipsoid, and ar, b2, k2 for the semi-axes of the rear ellipsoid, and v represents the welding speed;

[0181] 2) Arc pressure source term:

[0182] Arc pressure is a key factor affecting weld pool stability and depth and is modeled by the following formula:

[0183]

[0184] Where U0 is the vacuum permeability, I is the current intensity; Ra is the radius of influence of the arc, and ReARC is the coefficient of arc pressure; the arc pressure is crucial in determining the force components of the arc on the molten material in the x, y and z directions, which are defined as xarc_p, yarc_p and zarc_p respectively;

[0185] 3) Electromagnetic force source term:

[0186] The arc generates an electromagnetic force by causing the plasma to conduct electricity within the weld pool, defined by the following equation:

[0187]

[0188] Among them, u0 is the magnetic permeability of the medium, I is the current intensity, σ is the current distribution coefficient, and D represents the thickness of the workpiece;

[0189] 4) Droplet source term:

[0190] During arc welding, metal droplets are formed at the tip of the welding wire and then transferred to the molten pool. The metal transfer adopts a one-droplet-per-pulse mode, that is, the droplet separation frequency is consistent with the arc pulse frequency. In the simulation, each droplet is introduced at a specified position in the computational domain and modeled as a spherical fluid. The mass-momentum source term is characterized by the fluid density, initial temperature and velocity. The energy and momentum of the droplet are brought into the molten pool when it merges with the molten pool.

[0191] 5) Laser heat source:

[0192] The energy source of the laser uses a ray tracing method to simulate the reflection and absorption of energy on the wall of the pinhole. This method simulates the interaction between the laser beam and the pinhole by calculating the path and reflection point of the light and using trilinear interpolation. The trajectory of the laser light starts from the point (x0, y0, z0) and is determined by the direction cosines (U, V, W), which are solved by the following equation:

[0193]

[0194] Where D represents the distance along the ray, (Vx, Vy, Vz) represents the gradient of the VOF field in the computational unit, and the Gaussian beam profile based on the TEM00 mode is used to simulate the laser energy distribution, where the intensity I0(r, z) is expressed as:

[0195]

[0196] The beam radius r(z) along the propagation direction is expressed as:

[0197]

[0198] Where Q represents the laser power, r0 is the focal radius at the focal plane, and zr is the Rayleigh length. The absorption rate R of the laser energy is calculated using the Fresnel reflection theory, taking into account the incident angle and the emissivity of the pinhole wall, and is expressed as:

[0199]

[0200] Where φ is the angle of incidence and ε is the emissivity of the aperture wall;

[0201] 6) Recoil pressure source term:

[0202] 7) Surface tension source term:

[0203] 8) Heat dissipation source term;

[0204] 9) Buoyancy source term.

[0205] The recoil pressure source term provided by the embodiment of the present invention is:

[0206] The recoil pressure generated during laser welding is defined by the following equation:

[0207]

[0208] Wherein, Psat(T), P0, Lν, Tb and R represent saturation pressure, atmospheric pressure, latent heat of vaporization, boiling point temperature and gas constant, respectively.

[0209] The surface tension source term provided by the embodiment of the present invention is:

[0210] The surface tension generated during the welding process is modeled as a function of temperature as:

[0211]

[0212] Among them, γm represents the surface tension of pure metal at the melting point Tm, A is a constant related to the temperature gradient of the surface tension, and Kseg is the equilibrium segregation coefficient.

[0213] The heat dissipation source item provided by the embodiment of the present invention is:

[0214] The radiation and convection heat transfer between the molten pool surface and the surrounding air is calculated by the following formula:

[0215]

[0216] Among them, εrad is the radiation heat dissipation coefficient, σ is the Steffen-Boltzmann constant, hconv is the convection coefficient, and T0 is the ambient temperature.

[0217] The buoyancy source term provided by the embodiment of the present invention is:

[0218] Since the density of liquid metal decreases as temperature increases, thermal buoyancy arises from the temperature gradient within the molten pool and is defined by:

[0219] F b =ραg(TT m )

[0220] Where ρ represents the density of the liquid metal, α is the thermal expansion coefficient, g is the gravitational acceleration, and Tm is the ambient temperature.

[0221] like Figure 2 As shown, a fully automatic CFD modeling system for laser and hybrid welding processes provided by an embodiment of the present invention includes:

[0222] The calling module is used to create the graphical user interface of the system by calling the Tkinter library through Python, and realize the multi-level interactive interface of the welding simulation system, which includes the main menu and multiple sub-function interfaces, including the modules of establishing the calculation domain, selecting the welding method, setting the calculation time step and viewing the calculation results;

[0223] The storage management module is used to create a material property library through Python scripts to store and manage the physical properties of various materials. The material property library contains the density, viscosity, thermal conductivity, and specific heat capacity parameters of various common materials, and can be dynamically expanded to support user-defined materials. The data structure of the material library is designed in dictionary or JSON format for easy search and call. The physical properties of each material are indexed by a unique identifier to ensure that the material properties can be quickly retrieved and assigned during the simulation process.

[0224] The reading module is used to read the contents of the .rpl file through a Python script, dynamically generate the corresponding Tcl script, call the ICEMCFD batch execution, automatically execute the creation of geometric models, specify boundary conditions, meshing functions, and generate the welding calculation domain .msh format file;

[0225] The calling module is used to use Python to call the open() function to create the C language subroutine file welding.c of the laser welding basic module; by defining the C language code string containing the welding heat source, radiation heat dissipation, convection heat dissipation, recoil pressure and evaporation condensation source items in the Python script, calling the open() function to open the file in write mode ("w"), and using the write() method to write the C code string to the welding.c file, the generation of the C language module is realized; this step ensures that the core calculation module of the welding simulation can be saved in the form of C language for subsequent compilation and execution;

[0226] The startup module is used to start the Ansys Fluent simulation software by calling the Fluent Python API through Python; the pyfluent.launch_fluent method is used to set the simulation dimension (2D or 3D mode) and calculation accuracy (single precision or double precision); at the same time, the meshing mode (meshing_mode), working directory (work_dir) and Fluent root path (root_path) are specified, and parallel computing is enabled as needed (set parallel = True and solverprocesses to calculate the number of cores); this step realizes seamless connection between Fluent software and Python environment by accurately configuring the above parameters;

[0227] The import module is used to import the simulation mesh file through the Python script, and use the tui.file.read_mesh command in the Fluent TUI (Text User Interface) interface to load the mesh file of the specified path into the Fluent environment; this step initializes the mesh model by calling the mesh file path;

[0228] The assignment module is used to assign physical parameters of the selected material using the Fluent TUI command in this step according to the created material property library; the Python script will call the material property library, use the material name as an index, retrieve the corresponding physical properties from the material library, and assign these parameters to the Fluent simulation model through the tui.define.materials.modify command; this step ensures that the material properties are correctly loaded into the simulation model;

[0229] The loading module is used to compile and load the user-defined function (UDF) subroutine through the Python script. The Fluent TUI command tui.compile.uda is used to compile the specified UDF source file. After successful compilation, tui.define.user_defined.function_hooks.read is used to load the source items or custom functions in the UDF file so that they can be called in the subsequent simulation process. This step realizes the correct loading of custom physical models or source items.

[0230] The setting module is used to set the boundary conditions in the simulation through Fluent's TUI command;

[0231] The association module is used to associate the source items in the compiled and loaded user-defined functions with the corresponding regions or boundary conditions; through the tui.define.user_defined.function_hooks.source_term command, the loaded source items are bound to the boundary conditions or specific regions; this step ensures that the source items can affect the boundary conditions during the simulation calculation process, realizing complex physical field simulation;

[0232] Initialization module, used to initialize the model by calling Fluent TUI commands through Python scripts;

[0233] The calculation setting module is used to call Fluent TUI commands through Python scripts to implement simulation calculation settings;

[0234] The export module is used to call the EnSight Python API through Python scripts to import Fluent simulation results and export animations in MP4 format;

[0235] Generate a module for using Python to call the moviepy library and Tkinter to achieve real-time playback of MP4 format videos generated by EnSight in the simulation software interface.

[0236] Another object of the present invention is to provide a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the fully automatic CFD modeling method for the laser and its hybrid welding process.

[0237] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to execute the steps of the fully automatic CFD modeling method for the laser and hybrid welding process.

[0238] Another object of the present invention is to provide an information data processing terminal, which is used to implement a fully automatic CFD modeling system for the laser and hybrid welding process.

[0239] The present invention is specifically implemented:

[0240] Step 1: Use Python to call the Tkinter library to create the graphical user interface (GUI) of the system, and realize the multi-level interactive interface of the welding simulation system, including the main menu and multiple sub-function interfaces, including modules such as establishing the calculation domain, selecting the welding method, setting the calculation time step, and viewing the calculation results. Figure 3 shown.

[0241] Step 2: Create a material property library through Python scripts to store and manage the physical properties of various materials. The material property library contains parameters such as density, viscosity, thermal conductivity, specific heat capacity, etc. of various common materials, and can be dynamically expanded to support user-defined materials. The data structure of the material library is designed in dictionary or JSON format for easy search and call. The physical properties of each material are indexed by a unique identifier (such as material name or ID) to ensure that the material properties can be quickly retrieved and assigned during the simulation process, such as Figure 4 The figure shows the selection of 316L stainless steel as the welding material.

[0242] Step 3: Read the contents of the .rpl file through the Python script, dynamically generate the corresponding Tcl script, call the ICEMCFD batch execution, automatically execute functions such as creating geometric models, specifying boundary conditions, and meshing, and generate the welding calculation domain .msh format file, such as Figure 5 Shown is the interface for creating a computational domain and the computational domain it creates.

[0243] Step 4: Use Python to call the open() function to create the C language subroutine file welding.c of the laser welding basic module. By defining a C language code string containing source items such as welding heat source, radiation heat dissipation, convection heat dissipation, recoil pressure, and evaporation condensation in the Python script, calling the open() function to open the file in write mode ("w"), and using the write() method to write the C code string to the welding.c file, the generation of the C language module is realized. This step ensures that the core calculation module of the welding simulation can be saved in the form of C language for subsequent compilation and execution. The theoretical part of the source items such as welding heat source, radiation heat dissipation, convection heat dissipation, recoil pressure, and evaporation condensation is as follows:

[0244] 1. Arc heat source term:

[0245] The energy source term of the arc is modeled using a 3D double ellipsoid heat source, which captures the unique spatial characteristics of the arc and is defined by the following formula:

[0246]

[0247] Among them, ff and fr represent the proportion of the total heat energy allocated to the front ellipsoid and the rear ellipsoid, respectively. U and I are the voltage and current intensity during welding, respectively. The semi-axes of the double ellipsoid heat source in the x, y and z directions are represented by af, b1, k1 for the semi-axes of the front ellipsoid, ar, b2, k2 for the semi-axes of the rear ellipsoid, and v represents the welding speed.

[0248] 2. Arc pressure source term:

[0249] Arc pressure is a key factor affecting weld pool stability and depth and is modeled by the following formula:

[0250]

[0251] Where U0 is the vacuum permeability and I is the current intensity. Ra is the radius affected by the arc and ReARC is the coefficient of arc pressure. Arc pressure is crucial in determining the components of the arc force on the molten material in the x, y and z directions, which are defined as xarc_p, yarc_p and zarc_p, respectively.

[0252] 3. Electromagnetic force source term:

[0253] The arc generates an electromagnetic force by causing the plasma to conduct electricity within the weld pool, defined by the following equation:

[0254]

[0255] Among them, u0 is the magnetic permeability of the medium, I is the current intensity, σ is the current distribution coefficient, and D represents the thickness of the workpiece.

[0256] 4. Droplet source term:

[0257] During arc welding, metal droplets are formed at the tip of the wire and then transferred to the molten pool. Metal transfer is performed in a one-droplet-per-pulse mode, i.e., the droplet separation frequency is consistent with the arc pulse frequency. In the simulation, each droplet is introduced at a specified location in the computational domain and modeled as a spherical fluid. The mass-momentum source term is characterized by the fluid density, initial temperature, and velocity. The energy and momentum of the droplet are carried into the molten pool when it merges with the molten pool.

[0258] 5. Laser heat source:

[0259] The laser energy source uses a ray tracing method to simulate the reflection and absorption of energy on the pinhole wall. This method simulates the interaction between the laser beam and the pinhole by calculating the path and reflection point of the light and using trilinear interpolation. The trajectory of the laser light starts from the point (x0, y0, z0) and is determined by the direction cosines (U, V, W), which are solved by the following equation:

[0260]

[0261] Where D represents the distance along the ray and (Vx, Vy, Vz) represents the gradient of the VOF field in the computational unit. A Gaussian beam profile based on the TEM00 mode is used to simulate the laser energy distribution, where the intensity I0(r, z) is expressed as:

[0262]

[0263] The beam radius r(z) along the propagation direction is expressed as:

[0264]

[0265] Where Q represents the laser power, r0 is the focal radius at the focal plane, and zr is the Rayleigh length. The absorption rate R of the laser energy is calculated using the Fresnel reflection theory, taking into account the incident angle and the emissivity of the pinhole wall, and is expressed as:

[0266]

[0267] Where φ is the angle of incidence and ε is the emissivity of the aperture wall.

[0268] 6. Recoil pressure source term:

[0269] The recoil pressure generated during laser welding is defined by the following equation:

[0270]

[0271] Wherein, Psat(T), P0, Lν, Tb and R represent saturation pressure, atmospheric pressure, latent heat of vaporization, boiling point temperature and gas constant, respectively.

[0272] 7. Surface tension source term:

[0273] The surface tension generated during the welding process is modeled as a function of temperature as:

[0274]

[0275] Among them, γm represents the surface tension of pure metal at the melting point Tm, A is a constant related to the temperature gradient of the surface tension, and Kseg is the equilibrium segregation coefficient.

[0276] 8. Heat dissipation source

[0277] The radiation and convection heat transfer between the molten pool surface and the surrounding air is calculated by the following formula:

[0278]

[0279] Among them, εrad is the radiation heat dissipation coefficient, σ is the Steffen-Boltzmann constant, hconv is the convection coefficient, and T0 is the ambient temperature.

[0280] 9. Buoyancy source term:

[0281] Since the density of liquid metal decreases as temperature increases, thermal buoyancy arises from the temperature gradient within the molten pool and is defined by:

[0282] F b =ραg(TT m )

[0283] Where ρ represents the density of the liquid metal, α is the thermal expansion coefficient, g is the gravitational acceleration, and Tm is the ambient temperature.

[0284] Step 5: Start the Ansys Fluent simulation software by calling the Fluent Python API through Python, and use the pyfluent.launch_fluent method to set the simulation dimension (2D or 3D mode) and calculation accuracy (single precision or double precision). At the same time, specify the meshing mode (meshing_mode), working directory (work_dir) and Fluent root path (root_path), and enable parallel computing as needed (set parallel = True and solverprocesses to calculate the number of cores). At the same time, write relevant process parameters such as laser power, welding speed, defocus, etc. into the welding.c subroutine. This step achieves seamless connection between the Fluent software and the Python environment by accurately configuring the above parameters, such as Figure 6 shown.

[0285] Step 6: Import the simulation mesh file through the Python script, and use the tui.file.read_mesh command in the Fluent TUI (Text User Interface) interface to load the mesh file of the specified path into the Fluent environment. This step initializes the mesh model by calling the mesh file path.

[0286] Step 7: Based on the material property library created in step 1, use the Fluent TUI command in this step to assign physical parameters to the selected material. The Python script will call the material property library, use the material name as an index, retrieve the corresponding physical properties (such as density, viscosity, thermal conductivity, and specific heat capacity) from the material library, and assign these parameters to the Fluent simulation model through the tui.define.materials.modify command. This step ensures that the material properties are correctly loaded into the simulation model, such as Figure 7 shown.

[0287] Step 8: Compile and load the user-defined function (UDF) subroutine through the Python script, and use Fluent's TUI command tui.compile.uda to compile the specified UDF source file. After successful compilation, use tui.define.user_defined.function_hooks.read to load the source items or custom functions in the UDF file so that they can be called in subsequent simulation processes. This step implements the correct loading of custom physical models or source items.

[0288] Step 9: Set the boundary conditions in the simulation through Fluent's TUI command. First, use the tui.define.boundary_conditions.set command to assign corresponding physical conditions to the inlet, outlet, and wall boundaries. For example, you can set the velocity for the inlet, the pressure for the outlet, and the temperature or no-slip condition for the wall. This step ensures that each boundary condition in the simulation correctly reflects the physical meaning, such as Figure 8 shown.

[0289] Step 10: Associate the source term in the compiled and loaded user-defined function with the corresponding region or boundary condition. Use the tui.define.user_defined.function_hooks.source_term command to bind the loaded source term to the boundary condition or specific region. This step ensures that the source term can affect the boundary condition during the simulation calculation and realize complex physical field simulation. Figure 8 shown.

[0290] Step 11: Initialize the model by calling Fluent TUI commands through Python scripts. First, use the solver.tui.solve.initialize.initialize_flow() method to perform standard initialization, and specify the initialization to act on all grid regions through set_parameters. Then use set_reference_frame to set the reference system relative to the unit region, and then use set_initial_conditions to set the initial physical conditions for the flow field. Finally, execute the execute_initialization() command to start the initialization process to ensure that the model initialization is completed successfully.

[0291] Step 12: Call Fluent TUI commands through Python scripts to implement simulation calculation settings. Use solver.tui.solve.set.time_step to set the time step, and use solver.tui.solve.set.number_of_time_steps to set the number of simulation time steps. Call solver.tui.solve.set.max_iterations_per_time_step to set the maximum number of iterations per time step, and solver.tui.solve.set.reporting_interval and solver.tui.solve.set.profile_update_interval to set the reporting and profile update intervals. Finally, execute solver.tui.solve.execute_calculation() to start the simulation calculation, such as Fig. 9 shown.

[0292] Step 13: Call the EnSight Python API through the Python script to import the simulation results of Fluent and export the animation in MP4 format. First, use the ens.Session() method to start the EnSight session and call the session.data.import_fluid() method to import Fluent's .cas and .dat files. Then, generate the temperature field isosurface through the scene.add_iso_surface() method. Subsequently, specify the output path and file format as MP4 through the scene.animation.start_output() method, call scene.animation.export_frames() to generate animation frames, and finally use scene.animation.stop_output() to complete the animation export in MP4 format, as shown in the following figure. Fig.10 shown.

[0293] Step 14: Use Python to call the moviepy library and Tkinter to achieve real-time playback of the MP4 format video generated by EnSight in the simulation software interface. First, use the VideoFileClip function of moviepy to load the video file in the specified path, and call the iter_frames method to read the video frame by frame. Then, use PIL (Python Imaging Library) to convert each frame into an image format supported by Tkinter, and display it in the user interface through the TkinterLabel component. During playback, the video playback rate is adjusted in real time through the Scale control of Tkinter to ensure that the user can customize the playback speed and realize the visual dynamic display of the simulation results, such as Fig.11 shown.

[0294] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. It can be understood by a person of ordinary skill in the art that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in a processor control code, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the carrier medium. The device and its modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.

[0295] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.

Claims

1. A fully automatic CFD modeling method for laser and hybrid welding processes, characterized in that: The following steps are involved: The graphical user interface of the system is created by calling the Tkinter library through Python, and a multi-level interactive interface of the welding simulation system is realized, including a main menu and multiple sub-function interfaces; Create a material property library through Python scripts to store and manage the physical properties of various materials. The material library is stored in dictionary or JSON format; Read the .rpl file content through Python script, generate the corresponding Tcl script, call ICEMCFD to execute geometric model creation, boundary condition specification and meshing, and generate the welding calculation domain .msh format file; Generate a C language subroutine file welding.c through Python script to simulate welding heat source, radiation heat dissipation, convection heat dissipation, recoil pressure and evaporation condensation source items; Call the Fluent Python API to start the Ansys Fluent simulation software, import the simulation mesh file, and load the mesh model, set the simulation boundary conditions, and initialize the physical field through the Fluent TUI interface; Compile and load user-defined functions (UDFs), associate source terms in UDFs with simulation regions or boundary conditions, and perform complex simulations of physical fields; Call the Fluent TUI command to set the simulation calculation, including the time step, number of iterations, etc., and start the simulation calculation; Import simulation results through EnSight Python API, generate temperature field isosurfaces and export animations in MP4 format; By calling the moviepy library and Tkinter through Python, real-time playback of simulation results can be achieved, and the simulation calculation results can be dynamically displayed.

2. The fully automatic CFD modeling method for laser and hybrid welding process as claimed in claim 1, characterized in that: The specific steps include: Step 1: Use Python to call the Tkinter library to create the graphical user interface of the system and realize the multi-level interactive interface of the welding simulation system, including the main menu and multiple sub-function interfaces, including the modules of establishing the calculation domain, selecting the welding method, setting the calculation time step and viewing the calculation results; Step 2: Create a material property library through Python script to store and manage the physical properties of various materials; The material property library contains the density, viscosity, thermal conductivity, and specific heat capacity parameters of various common materials, and can be dynamically expanded to support user-defined materials. The data structure of the material library is designed in dictionary or JSON format for easy search and call. The physical properties of each material are indexed by a unique identifier to ensure that the material properties can be quickly retrieved and assigned during the simulation process. Step 3: Read the .rpl file content through the Python script, dynamically generate the corresponding Tcl script, call the ICEMCFD batch execution, automatically execute the creation of geometric models, specify boundary conditions, and mesh division functions, and generate the welding calculation domain .msh format file; Step 4: Use Python to call the open() function to create the C language subroutine file welding.c of the laser welding basic module; By defining a C language code string containing welding heat source, radiation heat dissipation, convection heat dissipation, recoil pressure and evaporation condensation source items in the Python script, calling the open() function to open the file in write mode ("w"), and using the write() method to write the C code string to the welding.c file, the generation of the C language module is realized; this step ensures that the core calculation module of the welding simulation can be saved in the form of C language for subsequent compilation and execution; Step 5: Start Ansys Fluent simulation software by calling Fluent Python API through Python; Use the pyfluent.launch_fluent method to set the simulation dimension (2D or 3D mode) and calculation accuracy (single precision or double precision); at the same time, specify the meshing mode (meshing_mode), working directory (work_dir) and Fluent root path (root_path), and enable parallel computing as needed (set parallel = True and solverprocesses to calculate the number of cores); this step achieves seamless connection between Fluent software and Python environment by accurately configuring the above parameters; Step 6: Import the simulation mesh file through the Python script, and use the tui.file.read_mesh command in the FluentTUI (TextUserInterface) interface to load the mesh file of the specified path into the Fluent environment; this step initializes the mesh model by calling the mesh file path; Step 7: Based on the material property library created in step 1, use the FluentTUI command in this step to assign physical parameters to the selected material; The Python script will call the material property library, use the material name as an index, retrieve the corresponding physical properties from the material library, and assign these parameters to the Fluent simulation model through the tui.define.materials.modify command; this step ensures that the material properties are correctly loaded into the simulation model; Step 8: Compile and load the user-defined function (UDF) subroutine through the Python script, and use the Fluent TUI command tui.compile.uda to compile the specified UDF source file; After successful compilation, use tui.define.user_defined.function_hooks.read to load the source items or custom functions in the UDF file so that they can be called in the subsequent simulation process; this step realizes the correct loading of custom physical models or source items; Step 9: Set the boundary conditions in the simulation through Fluent's TUI command; First, use the tui.define.boundary_conditions.set command to assign corresponding physical conditions to the inlet, outlet, and wall boundaries. For example, you can set the velocity for the inlet, the pressure for the outlet, and the temperature or no-slip condition for the wall. This step ensures that each boundary condition in the simulation correctly reflects the physical meaning. Step 10: Associate the source terms in the compiled and loaded user-defined function with the corresponding regions or boundary conditions; Use the tui.define.user_defined.function_hooks.source_term command to bind the loaded source term to the boundary condition or a specific area. This step ensures that the source term can affect the boundary condition during the simulation calculation and realize complex physical field simulation. Step 11: Call the FluentTUI command through the Python script to initialize the model; First, use the solver.tui.solve.initialize.initialize_flow() method to perform standard initialization, and specify the initialization to act on all grid areas through set_parameters; then use set_reference_frame to set the reference system relative to the unit area, and then use set_initial_conditions to set the initial physical conditions for the flow field; finally, execute_initialization() to start the initialization process to ensure that the model initialization is completed successfully; Step 12: Call the FluentTUI command through the Python script to implement the simulation calculation settings; Set the time step using solver.tui.solve.set.time_step; and set the number of simulation time steps using solver.tui.solve.set.number_of_time_steps; Call solver.tui.solve.set.max_iterations_per_time_step to set the maximum number of iterations per time step, and solver.tui.solve.set.reporting_interval and solver.tui.solve.set.profile_update_interval to set the report and profile update interval; Finally, execute solver.tui.solve.execute_calculation() to start the simulation calculation; Step 13: Use the Python script to call EnSight Python API to import the simulation results of Fluent and export the animation in MP4 format; First, use the ens.Session() method to start the EnSight session and call the session.data.import_fluid() method to import Fluent's .cas and .dat files. Then, the temperature field isosurface is generated through the scene.add_iso_surface() method; then, the output path and file format are specified as MP4 through the scene.animation.start_output() method, and the animation frames are generated by calling scene.animation.export_frames(). Finally, use scene.animation.stop_output() to complete the animation export in MP4 format; Step 14: Use Python to call the moviepy library and Tkinter to achieve real-time playback of the MP4 format video generated by EnSight in the simulation software interface; First, use the VideoFileClip function of moviepy to load the video file in the specified path, and call the iter_frames method to read the video frame by frame; Then, PIL (Python Imaging Library) is used to convert each frame into an image format supported by Tkinter and displayed on the user interface through the TkinterLabel component. During the playback process, the video playback rate is adjusted in real time through the Tkinter Scale control to ensure that the user can customize the playback speed and realize the visual dynamic display of the simulation results.

3. The fully automatic CFD modeling method for laser and hybrid welding process as claimed in claim 1, characterized in that: The welding heat source, radiation heat dissipation, convection heat dissipation, recoil pressure and evaporation condensation source items include: 1) Arc heat source term: The energy source term of the arc is modeled using a 3D double ellipsoid heat source, which captures the unique spatial characteristics of the arc and is defined by the following formula: Among them, ff and fr represent the proportion of the total heat energy allocated to the front ellipsoid and the rear ellipsoid respectively; U and I are the voltage and current intensity during welding respectively; the semi-axes of the double ellipsoid heat source in the x, y and z directions are represented by af, b1, k1 for the semi-axes of the front ellipsoid, and ar, b2, k2 for the semi-axes of the rear ellipsoid, and v represents the welding speed; 2) Arc pressure source term: Arc pressure is a key factor affecting weld pool stability and depth and is modeled by the following formula: Where U0 is the vacuum permeability, I is the current intensity; Ra is the radius of influence of the arc, and ReARC is the coefficient of arc pressure; the arc pressure is crucial in determining the force components of the arc on the molten material in the x, y and z directions, which are defined as xarc_p, yarc_p and zarc_p respectively; 3) Electromagnetic force source term: The arc generates an electromagnetic force by causing the plasma to conduct electricity within the weld pool, defined by the following equation: Among them, u0 is the magnetic permeability of the medium, I is the current intensity, σ is the current distribution coefficient, and D represents the thickness of the workpiece; 4) Droplet source term: During arc welding, metal droplets are formed at the tip of the welding wire and then transferred to the molten pool. The metal transfer adopts a one-droplet-per-pulse mode, that is, the droplet separation frequency is consistent with the arc pulse frequency. In the simulation, each droplet is introduced at a specified position in the computational domain and modeled as a spherical fluid. The mass-momentum source term is characterized by the fluid density, initial temperature and velocity. The energy and momentum of the droplet are brought into the molten pool when it merges with the molten pool. 5) Laser heat source: The energy source of the laser uses a ray tracing method to simulate the reflection and absorption of energy on the wall of the pinhole. This method simulates the interaction between the laser beam and the pinhole by calculating the path and reflection point of the light and using trilinear interpolation. The trajectory of the laser light starts from the point (x0, y0, z0) and is determined by the direction cosines (U, V, W), which are solved by the following equation: Where D represents the distance along the ray, (Vx, Vy, Vz) represents the gradient of the VOF field in the computational unit, and the Gaussian beam profile based on the TEM00 mode is used to simulate the laser energy distribution, where the intensity I0(r, z) is expressed as: The beam radius r(z) along the propagation direction is expressed as: Where Q represents the laser power, r0 is the focal radius at the focal plane, and zr is the Rayleigh length. The absorption rate R of the laser energy is calculated using the Fresnel reflection theory, taking into account the incident angle and the emissivity of the pinhole wall, and is expressed as: Where φ is the angle of incidence and ε is the emissivity of the aperture wall; 6) Recoil pressure source term: 7) Surface tension source term: 8) Heat dissipation source term; 9) Buoyancy source term.

4. The fully automatic CFD modeling method for laser and hybrid welding process as claimed in claim 3, characterized in that: The recoil pressure source term: The recoil pressure generated during laser welding is defined by the following equation: Wherein, Psat(T), P0, Lν, Tb and R represent saturation pressure, atmospheric pressure, latent heat of vaporization, boiling point temperature and gas constant, respectively.

5. The fully automatic CFD modeling method for laser and hybrid welding process as claimed in claim 3, characterized in that: The surface tension source term: The surface tension generated during the welding process is modeled as a function of temperature and expressed as: Among them, γm represents the surface tension of pure metal at the melting point Tm, A is a constant related to the temperature gradient of the surface tension, and Kseg is the equilibrium segregation coefficient.

6. The fully automatic CFD modeling method for laser and hybrid welding process as claimed in claim 3, characterized in that: The heat dissipation source term: The radiation and convection heat transfer between the molten pool surface and the surrounding air is calculated by the following formula: Among them, εrad is the radiation heat dissipation coefficient, σ is the Steffen-Boltzmann constant, hconv is the convection coefficient, and T0 is the ambient temperature.

7. The fully automatic CFD modeling method for laser and hybrid welding process as claimed in claim 3, characterized in that: The buoyancy source term: Since the density of liquid metal decreases as temperature increases, thermal buoyancy arises from the temperature gradient within the molten pool and is defined by: F b =ραg(T-T m ) Where ρ represents the density of the liquid metal, α is the thermal expansion coefficient, g is the gravitational acceleration, and Tm is the ambient temperature.

8. A fully automatic CFD modeling system for laser and hybrid welding processes implementing the fully automatic CFD modeling method for laser and hybrid welding processes as claimed in any one of claims 1 to 7, characterized in that: The fully automatic CFD modeling system for laser and hybrid welding processes includes: The calling module is used to create the graphical user interface of the system by calling the Tkinter library through Python, and realize the multi-level interactive interface of the welding simulation system, which includes the main menu and multiple sub-function interfaces, including the modules of establishing the calculation domain, selecting the welding method, setting the calculation time step and viewing the calculation results; The storage management module is used to create a material property library through Python scripts to store and manage the physical properties of various materials. The material property library contains the density, viscosity, thermal conductivity, and specific heat capacity parameters of various common materials, and can be dynamically expanded to support user-defined materials. The data structure of the material library is designed in dictionary or JSON format for easy search and call. The physical properties of each material are indexed by a unique identifier to ensure that the material properties can be quickly retrieved and assigned during the simulation process. The reading module is used to read the contents of the .rpl file through a Python script, dynamically generate the corresponding Tcl script, call the ICEMCFD batch execution, automatically execute the creation of geometric models, specify boundary conditions, meshing functions, and generate the welding calculation domain .msh format file; The calling module is used to use Python to call the open() function to create the C language subroutine file welding.c of the laser welding basic module; by defining the C language code string containing the welding heat source, radiation heat dissipation, convection heat dissipation, recoil pressure and evaporation condensation source items in the Python script, calling the open() function to open the file in write mode ("w"), and using the write() method to write the C code string to the welding.c file, the generation of the C language module is realized; this step ensures that the core calculation module of the welding simulation can be saved in the form of C language for subsequent compilation and execution; The startup module is used to start the Ansys Fluent simulation software by calling the Fluent Python API through Python; the pyfluent.launch_fluent method is used to set the simulation dimension (2D or 3D mode) and calculation accuracy (single precision or double precision); at the same time, the meshing mode (meshing_mode), working directory (work_dir) and Fluent root path (root_path) are specified, and parallel computing is enabled as needed (set parallel = True and solverprocesses to calculate the number of cores); this step realizes seamless connection between Fluent software and Python environment by accurately configuring the above parameters; The import module is used to import the simulation mesh file through the Python script, and use the tui.file.read_mesh command in the Fluent TUI (Text User Interface) interface to load the mesh file of the specified path into the Fluent environment; this step initializes the mesh model by calling the mesh file path; The assignment module is used to assign physical parameters of the selected material using the Fluent TUI command in this step according to the created material property library; the Python script will call the material property library, use the material name as an index, retrieve the corresponding physical properties from the material library, and assign these parameters to the Fluent simulation model through the tui.define.materials.modify command; this step ensures that the material properties are correctly loaded into the simulation model; The loading module is used to compile and load the user-defined function (UDF) subroutine through the Python script. The Fluent TUI command tui.compile.uda is used to compile the specified UDF source file. After successful compilation, tui.define.user_defined.function_hooks.read is used to load the source items or custom functions in the UDF file so that they can be called in the subsequent simulation process. This step realizes the correct loading of custom physical models or source items. The setting module is used to set the boundary conditions in the simulation through Fluent's TUI command; The association module is used to associate the source items in the compiled and loaded user-defined functions with the corresponding regions or boundary conditions; through the tui.define.user_defined.function_hooks.source_term command, the loaded source items are bound to the boundary conditions or specific regions; this step ensures that the source items can affect the boundary conditions during the simulation calculation process, realizing complex physical field simulation; Initialization module, used to initialize the model by calling Fluent TUI commands through Python scripts; The calculation setting module is used to call Fluent TUI commands through Python scripts to implement simulation calculation settings; The export module is used to call the EnSight Python API through Python scripts to import Fluent simulation results and export animations in MP4 format; Generate a module for using Python to call the moviepy library and Tkinter to achieve real-time playback of MP4 format videos generated by EnSight in the simulation software interface.

9. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the fully automatic CFD modeling method for laser and hybrid welding processes as claimed in any one of claims 1 to 7.

10. An information data processing terminal, characterized in that: The information data processing terminal is used to implement the fully automatic CFD modeling system for the laser and hybrid welding process as described in claim 8.

Citation Information

Patent Citations

  • Keyhole dynamic forming numerical simulation method of laser deep melting point welding

    CN103279630A

  • Numerical modeling method for improving morphology simulation precision of continuous laser deep penetration welding molten pool

    CN113627063A

  • Fluent-software-based method for simulating damage of aviation arc fault

    WO2023103233A1

Cited By

  • OpenFOAM dictionary file automatic generation method and CFD automatic calculation system

    CN120217479A