Method for applying artificial neural network to material forming finite element simulation
By building a communication client and server in the finite element simulation, the artificial neural network and the finite element model are decoupled, which solves the problem of recompiling the code when updating the model in the existing technology. It achieves fast access and efficient calculation, and improves the accuracy and flexibility of the simulation results.
Patent Information
- Application Number
- CN202510911136.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-02
- Publication Date
- 2025-10-28
AI Technical Summary
Existing technologies require recompiling the code and debugging when updating the artificial neural network model, resulting in a high access threshold and difficulty in widespread application in finite element simulation.
By building a communication client and server, the artificial neural network model is decoupled from the finite element simulation process, enabling rapid access to various neural network models without the need to rewrite and compile subroutines.
It lowers the threshold for updating artificial neural network models and improves the computational efficiency and accuracy of finite element simulation, making it more flexible and accurate in describing complex material behavior.
Smart Images

Figure CN120850658A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of material forming simulation technology, and more specifically to a method for applying artificial neural networks to finite element simulation of material forming. Background Technology
[0002] The finite element method (FEM) is a widely used numerical method in engineering and technology for solving complex problems involving partial differential and integral equations. It is particularly effective in analyzing problems in structural mechanics, fluid dynamics, heat transfer, and electromagnetic fields. Its development has played a crucial role in advancing computational modeling and simulation in engineering disciplines.
[0003] To ensure the reliability of finite element method (FEM) calculation results, the accuracy of material parameters is crucial. Currently, both the Johnson-Cook and Arrhenius constitutive equations describe the viscoplastic constitutive behavior of materials under thermo-mechanical coupling. The Johnson-Cook constitutive model considers strain hardening, strain rate strengthening, and thermal softening effects, each of which acts independently on the flow stress. It is commonly used in cold working processes of metals due to its simplicity, small parameter count, and ease of solution. However, it assumes linear softening of the metal with temperature, which is inconsistent with the behavior of titanium alloys in a thermoplastic state. The Arrhenius constitutive model, on the other hand, considers the complex behavior of metals during hot working and is therefore widely used to describe the constitutive behavior of metals at high temperatures.
[0004] However, no single analytical expression can encompass the deformation behavior of all materials under all conditions. Artificial neural networks attempt to approximate complex functions using multilayer perceptrons. Each perceptron has multiple inputs, and after collecting the input data, the intensity of the input signal is transformed through a nonlinear activation function. Through complex connections of a large number of simple perceptrons, the model can generate a complex function. Artificial neural networks focus on high-dimensional information in the data, and after training, they can uncover complex behaviors in material deformation. Therefore, a large number of studies have attempted to use artificial neural networks to mine the deformation behavior of materials.
[0005] For embedding artificial neural networks into the finite element analysis process, existing techniques use scripts to automatically extract model weights, write them into Fortran source files, and then compile them. While this approach boasts high computational speed, it requires recompiling subroutines after each training run, resulting in low efficiency. It also lacks support for dynamic neural network models such as recurrent neural networks, and the current open-source tool only supports fully connected neural networks, limiting its applicability. Furthermore, it has a high deployment threshold, requiring users to fully deploy a Fortran development environment, a Python development environment, and a complete PyTorch environment in a production setting, which can easily lead to conflicts with the development environment. Additionally, it demands strong debugging skills from users, making it difficult for engineers and researchers without a programming background to use.
[0006] Therefore, there is a need to provide a method for applying artificial neural network models to finite element models without requiring recompilation and debugging of code as the artificial neural network model is updated, in order to solve the above problems. Summary of the Invention
[0007] To address the shortcomings and deficiencies in the aforementioned background technologies, this invention primarily targets the drawbacks of existing tools, such as high user requirements and cumbersome setup after model updates. It provides a simplified method for integrating existing artificial neural network model predictions into the finite element simulation process. This invention proposes a method for applying artificial neural networks to finite element simulation of material forming. This method allows for rapid integration of various artificial neural network models by writing a single communication client and server. When the artificial neural network model is updated, there is no need to rewrite and compile subroutines, thus lowering the barrier to entry.
[0008] The first objective of this invention is to provide a method for applying artificial neural networks to finite element simulation of material forming, comprising: Construct an artificial neural network and train it using material data to obtain a trained artificial neural network; Establish a finite element model and set the material parameters controlled by the user subroutine for the finite element model; Write a communication client for the user subroutine and a communication server for the trained artificial neural network; The client sends the material parameters of each integration point in the finite element solver to the server. The server receives the data packets from the client, parses the material parameters, and passes the material parameters to the trained artificial neural network for prediction. The server returns the prediction data to the client, receives the prediction data from the server, and returns it to the finite element solver. The finite element solver solves the problem by setting boundary conditions and obtains the finite element calculation results.
[0009] In one embodiment, the material data includes testing machine test results, computer calculation results, and existing peer-reviewed paper datasets.
[0010] In one embodiment, when training the artificial neural network, the network inputs the material forming temperature, strain, and strain rate, and the network outputs the material rheological stress. The optimal fully connected neural network structure is determined by K-fold cross-validation.
[0011] In one embodiment, the communication mechanism between the client and the server includes one of the following: UDP or a UDP-based communication protocol, TCP or a TCP-based communication protocol, and operating system-level inter-process communication.
[0012] In one embodiment, the finite element model can pass the integration point data to the user subroutine in each round of analysis, and send the integration point data to the server via the client to receive the predicted value and update the material state.
[0013] In one embodiment, the finite element calculation results include: stress values at the mesh and integration points, strain values at the mesh and integration points, temperature values at the mesh and integration points, and material state variables at the mesh and integration points.
[0014] A second objective of this invention is to provide a computer program product, including a computer program that, when executed by a processor, implements a method for applying an artificial neural network to finite element simulation of material forming.
[0015] A third objective of this invention is to provide an electronic device comprising: Processor; and Memory for storing the executable instructions of the processor; The processor is configured to execute a method of applying an artificial neural network to finite element simulation of material forming by executing the executable instructions.
[0016] The fourth objective of this invention is to provide a system for applying artificial neural networks to finite element simulation of material forming, comprising: The network training module is used to construct an artificial neural network and train it using material data to obtain a trained artificial neural network. The model building module is used to build finite element models and set material parameters controlled by user subroutines for the finite element models; The communication module is used to write a communication client for the user subroutine and a communication server for the trained artificial neural network. The client sends the material parameters of each integration point in the finite element solver to the server. The server receives the data packets from the client, parses the material parameters, and passes the material parameters to the trained artificial neural network for prediction. The server returns the prediction data to the client, and the client receives the prediction data from the server and returns it to the finite element solver. The finite element solver solves the problem by setting boundary conditions and obtains the finite element calculation results.
[0017] The present invention has at least the following beneficial effects: This invention provides a method for applying artificial neural networks to finite element simulation of material forming. To ensure the reliability of finite element calculation results, the accuracy of material parameters is crucial. Currently, finite element software commonly incorporates Johnson-Cook, Arrhenius, and many variant viscoplastic constitutive equations. However, each constitutive equation has a limited scope of application and is difficult to be compatible with all materials and all working conditions. For example, during welding, materials experience rapid temperature increases, rising from room temperature to the melting point in a short time. The mechanical response of the material during this process is difficult to describe using a single constitutive equation. Artificial neural networks, on the other hand, can easily capture high-dimensional information and accurately describe the mechanical behavior of materials over a wider range.
[0018] Numerous studies have established artificial neural network models that can accurately describe material behavior. However, there is no simple and reliable method to import material behavior data into the finite element solver. Even though there are open-source projects that can automatically write the weight data of the artificial neural network model into subroutines, this invention is powerless for artificial neural networks with complex structures. Furthermore, each time the artificial neural network is updated, the tool needs to be run again to write the weights, which is complex and error-prone. Therefore, this invention proposes to use a server and client to isolate the artificial neural network and the finite element model, thereby decoupling the two. This allows for easy updates to the artificial neural network without having to consider technical details, thus lowering the barrier to entry for users. Attached Figure Description
[0019] Figure 1 This is a flowchart of a numerical simulation method for a heat source in friction stir welding of titanium alloys with an auxiliary heat source, according to the present invention. Figure 2 This is a schematic diagram of the finite element model of the 1 / 4 hot compression model in an embodiment of the present invention; Figure 3 for Figure 2 A schematic diagram of the mesh generation results; Figure 4 for Figure 2 The stress cloud diagram was calculated using an artificial neural network constitutive model from the finite element model. Figure 5 for Figure 2 The stress contour plot was calculated using the Arrhenius constitutive model on the finite element model. Detailed Implementation
[0020] In order to illustrate the technical means and effects adopted by the present invention to achieve the intended purpose, the following detailed description is provided in conjunction with the embodiments.
[0021] This invention addresses the shortcomings of existing tools, such as high user requirements and cumbersome setup after model updates. It provides a simplified method for integrating existing artificial neural network model predictions into the finite element simulation process. By writing a communication client and server program once, various artificial neural network models can be quickly integrated. When the artificial neural network model is updated, there is no need to rewrite and compile subroutines, thus lowering the barrier to entry.
[0022] To achieve the above objectives, a method for applying artificial neural networks to finite element simulation of material forming includes: Construct an artificial neural network and train it using material data to obtain a trained artificial neural network; The materials data include test results from testing machines, computer calculation results, and datasets of existing peer-reviewed papers.
[0023] When training an artificial neural network, the network inputs are the temperature, strain, and strain rate of the material forming process, and the network output is the material rheological stress. The optimal fully connected neural network structure is determined through K-fold cross-validation.
[0024] Establish a finite element model and set the material parameters controlled by the user subroutine for the finite element model; In this process, the finite element model can input integration point data into the user subroutine in each round of analysis, and send the integration point data to the server via the client to receive the predicted values and update the material state.
[0025] Write a communication client for the user subroutine and a communication server for the trained artificial neural network; The client sends the material parameters of each integration point in the finite element solver to the server. The server receives the data packets from the client, parses the material parameters, and passes the material parameters to the trained artificial neural network for prediction. The server returns the prediction data to the client, receives the prediction data from the server, and returns it to the finite element solver. The finite element solver solves the problem by setting boundary conditions and obtains the finite element calculation results.
[0026] The communication mechanisms between the client and the server include: UDP or a UDP-based communication protocol, TCP or a TCP-based communication protocol, and one of the following: inter-process communication at the operating system level.
[0027] The finite element calculation results include: stress values at the mesh and integration points, strain values at the mesh and integration points, temperature values at the mesh and integration points, and material state variables at the mesh and integration points.
[0028] For example, see Figure 1 As shown, a method for applying artificial neural networks to finite element calculations includes: S1. Train the artificial neural network model; Artificial neural networks are used to fit the material data obtained from experiments to obtain an artificial neural network model that can make predictions. This model is pre-trained using the material data and is not trained in real time during the prediction stage. Specifically, an artificial neural network is trained to predict the rheological stress of a material by inputting temperature, strain, and strain rate. The optimal fully connected neural network structure is determined by K-fold cross-validation, and the optimal neural network structure is trained to obtain the optimal prediction model.
[0029] S2. Establish server and client connections; Write a communication client for the user subroutine, which can send material status to the model server and receive data packets from the server. Finally, parse the data in the data packets and return them to the finite element solver. Write a communication server for the artificial neural network that can receive data packets from the client, parse the material state, pass the parameters to the artificial neural network to predict the material data, and return the predicted value to the client. The server-side component involves querying the user's artificial neural network (ANN) upon startup. After user input, the server automatically retrieves the prediction result of the user-specified ANN model via function calls each time a client request is received. Specifically, the server should parse the request, call the prediction function of the ANN model, and send the return value to the client each time a client request is received.
[0030] The client is written to obtain the material parameters of each integration point in the finite element solver through a user subroutine, request them from the server, receive the server's response, parse the prediction results, and return them to the finite element solver as the return value of the subroutine.
[0031] S3. Establish a finite element model; Establish a finite element model and set the material parameters controlled by the user subroutine for the finite element model; Specifically, a finite element model is established, material properties are added to the entities in the model, then a mesh is generated, the task is submitted, and the client is linked into the solver for solving.
[0032] When the artificial neural network changes, there is no need to modify or recompile the client code; only the server needs to be restarted. S4. Obtain the stress and strain fields; Based on the predicted data from the artificial neural network and the calculation conditions set by the finite element model, the finite element calculation results are obtained. Specifically, the stress and strain fields are obtained according to the boundary conditions set by the model. Thus, the numerical simulation of the thermal simulation experiment is completed using the artificial neural network model.
[0033] To further illustrate the method of applying artificial neural networks to finite element calculation provided by the present invention, it is described in conjunction with the accompanying drawings.
[0034] First, an artificial neural network was trained using PyTorch to predict the rheological stress of materials based on input temperature, strain, and strain rate. Material data was acquired using a Gleeble-3500 thermal simulation test chamber as the training set, and the optimal fully connected neural network structure was determined through 5-fold cross-validation. The AdamW optimizer was selected to update the model parameters during training, and the ReduceLROnPlateau scheduler was used to continuously adjust the model's learning rate during training to obtain the optimal prediction model.
[0035] Next, based on the UDP network communication protocol, a server-side program is developed. Upon startup, the server queries the user for the artificial neural network model. After the user inputs the data, it automatically retrieves the prediction result of the user-specified artificial neural network model via function calls each time a client request is received. Specifically, this server is written in Python, using the socket library to establish a UDP server. Each time a client request is received, it can parse the request, call the prediction function of the PyTorch model, and send the return value back to the client.
[0036] Simultaneously, a client was developed based on the UDP network communication protocol. This client retrieves the material parameters for each integration point in Abaqus / Explicit via the VUHARD subroutine, requests them from the server, receives the server's response, parses the prediction results, and returns them as the return value of the VUHARD subroutine to the finite element solver. Specifically, the client uses C functions, bound to the ISO_C_BINDING interface in Fortran, ensuring that the input / output types and memory layout conform to the C binary specification. After completion, it is compiled using the MSVC compiler to obtain an obj format binary file.
[0037] Create a thermal simulation finite element model in Abaqus / Explicit, such as Figure 2 As shown, the model consists of three parts: an upper anvil, a lower anvil, and a thermal simulation specimen, with specific dimensions of Φ8×12 mm. Both the upper and lower anvils are three-dimensional shells with a thickness of 1 mm. Since the thermal simulation specimen is a cylinder, a 1 / 4 scale model is used to speed up the calculation.
[0038] Material properties consistent with TC4 titanium alloy were added to all entities in the model. Subsequently, meshing was performed. The mesh type for the thermodynamic simulation specimen was C3D8RT, and the mesh type for the upper and lower anvils was S3RT. The mesh size was set to 0.5 mm. The meshing result is shown below. Figure 3 As shown. After binding the upper and lower anvils as rigid bodies, boundary conditions are added to the upper and lower anvils. The lower anvil has all degrees of freedom fixed, and the upper anvil has 5 degrees of freedom fixed. The Z-direction motion speed is controlled by a table, keeping the upper anvil in place for 5 seconds. -1 The sample was continuously compressed at a compression rate, with the initial temperature set at 900 ℃.
[0039] Submit the task and start solving it. Place the pre-compiled .obj format binary file in the subroutine field, and the Abaqus preprocessor will automatically link the binary file.
[0040] By setting boundary conditions based on the model and obtaining the stress and strain fields, the numerical simulation of the thermal simulation experiment is completed using the artificial neural network model.
[0041] Combination Figure 4 and Figure 5 Comparing the results, in the 1 / 4 hot compression model, the artificial neural network model obtained a more accurate stress distribution than the Arrhenius model. Comparing the stress distribution and dynamic recrystallization region distribution during the hot compression process of titanium alloys in existing studies, under conditions where friction is not negligible, the central region of the sample typically exhibits the maximum stress. Figure 5 The stress value in the central region of the hot-compressed sample was lower than that on the upper, lower, and outer surfaces, indicating that the Arrhenius constitutive model's fitting accuracy to the experimental data was insufficient, neglecting some important rheological behaviors of titanium alloys during high-temperature deformation. Figure 4 The central region of the hot-compressed sample is larger than the upper and lower surfaces, which is consistent with previous experimental and simulation results, proving the reliability of the prediction results of the artificial neural network constitutive model.
[0042] The present invention provides a computer program product, including a computer program that, when executed by a processor, implements a method for applying an artificial neural network to finite element simulation of material forming.
[0043] This invention provides an electronic device, comprising: Processor; and Memory for storing the executable instructions of the processor; The processor is configured to execute a method of applying an artificial neural network to finite element simulation of material forming by executing the executable instructions.
[0044] This invention provides a system for applying artificial neural networks to finite element simulation of material forming, comprising: The network training module is used to construct an artificial neural network and train it using material data to obtain a trained artificial neural network. The model building module is used to build finite element models and set material parameters controlled by user subroutines for the finite element models; The communication module is used to write a communication client for the user subroutine and a communication server for the trained artificial neural network. The client sends the material parameters of each integration point in the finite element solver to the server. The server receives the data packets from the client, parses the material parameters, and passes the material parameters to the trained artificial neural network for prediction. The server returns the prediction data to the client, and the client receives the prediction data from the server and returns it to the finite element solver. The finite element solver solves the problem by setting boundary conditions and obtains the finite element calculation results.
[0045] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for applying artificial neural networks to finite element simulation of material forming, characterized in that, include: Construct an artificial neural network and train it using material data to obtain a trained artificial neural network; Establish a finite element model and set the material parameters controlled by the user subroutine for the finite element model; Write a communication client for the user subroutine and a communication server for the trained artificial neural network; The client sends the material parameters of each integration point in the finite element solver to the server. The server receives the data packets from the client, parses the material parameters, and passes the material parameters to the trained artificial neural network for prediction. The server returns the prediction data to the client, receives the prediction data from the server, and returns it to the finite element solver. The finite element solver solves the problem by setting boundary conditions and obtains the finite element calculation results.
2. The method for applying artificial neural networks to finite element simulation of material forming according to claim 1, characterized in that, The materials data include test results from testing machines, computer calculation results, and datasets of existing peer-reviewed papers.
3. The method for applying artificial neural networks to finite element simulation of material forming according to claim 1, characterized in that, When training an artificial neural network, the network inputs are the temperature, strain, and strain rate of the material forming process, and the network output is the material rheological stress. The optimal fully connected neural network structure is determined through K-fold cross-validation.
4. The method for applying artificial neural networks to finite element simulation of material forming according to claim 1, characterized in that, The communication mechanisms between the client and the server include: UDP or a UDP-based communication protocol, TCP or a TCP-based communication protocol, and one of the following: inter-process communication at the operating system level.
5. The method for applying artificial neural networks to finite element simulation of material forming according to claim 1, characterized in that, The finite element model can input integration point data into the user subroutine in each round of analysis, and send the integration point data to the server via the client to receive the predicted values and update the material state.
6. The method for applying artificial neural networks to finite element simulation of material forming according to claim 1, characterized in that, The finite element calculation results include: stress values at the mesh and integration points, strain values at the mesh and integration points, temperature values at the mesh and integration points, and material state variables at the mesh and integration points.
7. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the method of applying artificial neural networks to finite element simulation of material forming as described in any one of claims 1 to 6.
8. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the method of applying an artificial neural network to finite element simulation of material forming as described in any one of claims 1 to 6 by executing the executable instructions.
9. A system for applying artificial neural networks to finite element simulation of material forming, characterized in that, include: The network training module is used to construct an artificial neural network and train it using material data to obtain a trained artificial neural network. The model building module is used to build finite element models and set material parameters controlled by user subroutines for the finite element models; The communication module is used to write a communication client for the user subroutine and a communication server for the trained artificial neural network. The client sends the material parameters of each integration point in the finite element solver to the server. The server receives the data packets from the client, parses the material parameters, and passes the material parameters to the trained artificial neural network for prediction. The server returns the prediction data to the client, and the client receives the prediction data from the server and returns it to the finite element solver. The finite element solver solves the problem by setting boundary conditions and obtains the finite element calculation results.