Fluent and Simulink joint simulation method based on UDP (User Datagram Protocol)
Through the combined simulation method of Fluent and Simulink based on the UDP protocol, the problem of inaccurate prediction of high ground clearance spray locomotive fluid coupling model in the prior art is solved, and the precise simulation of complex shape liquid tanks is achieved, and the vehicle's shaking suppression performance is optimized.
Patent Information
- Application Number
- CN202411467474.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-01-03
AI Technical Summary
The prior art is difficult to accurately predict vehicle dumping behavior when describing the vehicle fluid coupling model of high ground clearance sprayers, especially in the shape of non-standard liquid tanks, which simplified models bring problems of rapid and convenient calculations but not accurate enough.
Using the combined simulation method of Fluent and Simulink based on UDP protocol, a numerical model of complex shape tanks is established in Fluent, a semi-vehicle dynamic model is established in Simulink, and data interoperability is achieved through UDP protocol, using Fluent's secondary development function for Data interaction realizes synchronous simulation of liquid tank and body model.
It realizes a more accurate description of the rolling behavior of the high ground clearance sprayer, develops and optimizes more effective shaking suppression solutions, meets the simulation needs of complex-shaped liquid tanks, and reduces calculation errors.
Smart Images

Figure CN119249966A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of system modeling and simulation computing, and in particular to a Fluent and Simulink joint simulation method based on UDP protocol. Background Art
[0002] New energy high-clearance sprayers have problems such as unstable driving when driving on complex road conditions in the field, and are prone to lateral shaking when equipped with a liquid tank, which further affects the stability of the sprayer. In the actual situation of liquid shaking and vehicle coupling, it is difficult to derive a complete theoretical coupling equation to predict the vehicle's tipping behavior.
[0003] At present, the method of vehicle-fluid coupling model for high-ground clearance sprayers remains at the level of dynamic calculation, establishing a spring-mass-damping model or a single pendulum model in various standard-shaped liquid tanks and then combining it with the half-vehicle dynamics model to establish a coupling model. This simplification brings the advantages of fast and convenient calculation, but in reality, it is difficult to find the relevant parameters of the simplified model for non-standard complex-shaped liquid tanks, and there are errors in the calculation. Summary of the invention
[0004] The purpose of the present invention is to provide a Fluent and Simulink joint simulation method based on UDP protocol, which applies two simulation softwares, Fluent and Simulink, to establish a numerical model of a complex-shaped liquid tank in Fluent, to establish a half-vehicle dynamics model in Simulink, and to realize data intercommunication between the two softwares by using the UDP network protocol, and to realize data assignment and extraction of Fluent by using the UDF secondary developed in Fluent. The roll behavior of a high-ground clearance sprayer can be better and more accurately described, and a better anti-sway solution can be developed and optimized by analyzing its posture.
[0005] A Fluent and Simulink joint simulation method based on UDP protocol, comprising:
[0006] Create a liquid tank model in Fluent;
[0007] Build a car body model in Simulink;
[0008] Establish data interaction module;
[0009] The UDP protocol is used to synchronously simulate the liquid tank model and the vehicle body model in the data interaction module.
[0010] Preferably, establishing a liquid tank model in Fluent includes:
[0011] Construct numerical models in Fluent;
[0012] Create a liquid tank model in Fluent;
[0013] The liquid tank model is simulated to obtain the liquid sloshing force, liquid sloshing trend animation and liquid sloshing velocity cloud map in the liquid tank.
[0014] Preferably, establishing a vehicle body model in Simulink includes:
[0015] Establish a half-car vertical dynamics model as a car body model in Simulink;
[0016] The vehicle body model is simulated to obtain the roll angular acceleration, roll angle and vertical displacement of the vehicle body platform.
[0017] Preferably, the constructing of a numerical model in Fluent includes:
[0018] The main mechanical features of the liquid tank are retained;
[0019] The overall dimensions of the liquid tank are set to be symmetrical, and the angular acceleration excitation of the liquid tank around the y-axis is established, and the resulting shaking is symmetrical with the xz plane.
[0020] Preferably, the establishing of the data interaction module comprises:
[0021] Use Fluent's user-defined functions to build the data interaction module of Fluent;
[0022] Use DEFINE_INIT macro function to initialize UDP protocol;
[0023] Use the DEFINE_SOURCE macro function to load the angular acceleration parameters transmitted by Simulink;
[0024] The DEFINE_EXECUTE_AT_END macro function is used for data interaction to transmit liquid sloshing force and receive angular acceleration values.
[0025] Preferably, simulating the vehicle body model to obtain the roll acceleration, roll angle and vertical displacement of the vehicle body platform includes:
[0026] The car body model is established using the Lagrangian energy method, which is expressed as:
[0027]
[0028] Z b is the vertical displacement of the center of mass; Z F and Z R is the vertical displacement of the left and right sprung masses; Z tF and Z tR is the vertical displacement of the unsprung mass; ZwF and Z wR is the vertical displacement excitation of the road surface; m sc is the center of mass of the sprung mass; k sF , k sR 、c sF and c sR are the equivalent stiffness and equivalent damping coefficient of the front and rear suspensions respectively; I sc is the moment of inertia of the half vehicle; since the damping coefficient of the tire is very small and can be ignored, the only equivalent stiffness is k tF and k tR ; l f and l r is the distance from the center of mass to the left and right wheels and l f = l r .
[0029] Preferably, the synchronous simulation of the tank model and the vehicle body model in the data interaction module using the UDP protocol includes:
[0030] In the data interaction module, modify the simulation step and simulation duration in Simulink, receive the liquid sloshing force value sent by the Fluent end, and send the angular acceleration value of the Simulink end.
[0031] A Fluent and Simulink joint simulation system based on UDP protocol, comprising:
[0032] Liquid tank model building module, used to build liquid tank model in Fluent;
[0033] The body model building module is used to build the body model in Simulink;
[0034] A data interaction building module is used to build a data interaction module;
[0035] The synchronous simulation module is used to synchronously simulate the liquid tank model and the vehicle body model in the data interaction module using the UDP protocol.
[0036] An electronic device comprises: a processor and a memory, wherein the memory is used to store computer program codes, and the computer program codes include computer instructions. When the processor executes the computer instructions, the electronic device executes a Fluent and Simulink joint simulation method based on a UDP protocol.
[0037] A computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes a Fluent and Simulink joint simulation method based on a UDP protocol.
[0038] The beneficial effects of the present invention are as follows: 1. The present invention utilizes the data receiving and sending functions in the UDP protocol, which includes blocking reception, to realize the synchronous waiting joint simulation of Fluent and Simulink, and meet the complex simulation requirements of the same time step. 2. The present invention utilizes the writable C file of Fluent secondary development to realize the writing of the UDP protocol, obtain the various calculation result information of the numerical model, and package and send it. 3. The coupling model produced by the present invention can more accurately describe the roll behavior of the high-ground clearance sprayer. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0041] Figure 1 It is a flow chart of a Fluent and Simulink joint simulation method based on UDP protocol of the present invention;
[0042] Figure 2 It is a structural schematic diagram of a Fluent and Simulink joint simulation system based on UDP protocol of the present invention;
[0043] Figure 3 It is a schematic diagram of the structure of the liquid tank body model of the present invention;
[0044] Figure 4 Establishing a vehicle body model structure diagram for the Lagrangian energy method of the present invention;
[0045] Figure 5 It is a schematic diagram of the structure of the half-car vertical dynamics model of the present invention. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] It should be noted that all directional indications in the embodiments of the present invention (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0048] In addition, the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0049] A joint simulation method of Fluent and Simulink based on UDP protocol, reference Figure 1 ,include:
[0050] S100, build a liquid tank model in Fluent;
[0051] S200, build the car body model in Simulink;
[0052] S300, establishing a data interaction module;
[0053] S400 uses the UDP protocol to synchronously simulate the tank model and the vehicle body model in the data interaction module.
[0054] Preferably, S100, establishing a liquid tank model in Fluent includes:
[0055] S110, build the numerical model in Fluent;
[0056] S120, build a liquid tank model in Fluent;
[0057] S130, simulating the liquid tank model to obtain the liquid sloshing force, liquid sloshing trend animation and liquid sloshing velocity cloud map in the liquid tank.
[0058] Preferably, S200, reference Figure 5 , building a car body model in Simulink includes:
[0059] S210, establish a half-car vertical dynamics model as a car body model in Simulink;
[0060] S220, simulating the vehicle body model to obtain the roll acceleration, roll angle, and vertical displacement of the vehicle body platform.
[0061] Preferably, reference Figure 3 , S110, building the numerical model in Fluent includes:
[0062] S111, retain the main mechanical features of the liquid tank body;
[0063] S112, setting the overall dimensions of the liquid tank to be symmetrical, establishing angular acceleration excitation of the liquid tank around the y-axis, and making the generated shaking symmetrical with the xz plane.
[0064] Construct a numerical model in Fluent, retain the main mechanical features of the box, and select a rectangular liquid tank with a length of 360mm, a width of 180mm, and a height of 180mm as the simulation object. The overall dimensions of the liquid tank are symmetrical. Only the angular acceleration excitation of the liquid tank around the y-axis is considered, and the resulting sloshing is symmetrical with the xz plane. The established numerical model of the liquid tank has the characteristics of a complex structure.
[0065] Preferably, S300, establishing a data interaction module includes:
[0066] S310, using Fluent's user-defined function to establish a data interaction module of the Fluent part;
[0067] S320, use the DEFINE_INIT macro function to initialize the UDP protocol;
[0068] S330, use the DEFINE_SOURCE macro function to load the angular acceleration parameters transmitted by Simulink;
[0069] S340 uses the DEFINE_EXECUTE_AT_END macro function for data exchange, transmitting liquid sloshing force and receiving angular acceleration values.
[0070] Preferably, reference Figure 4 , S220, simulating the vehicle body model to obtain the roll angle acceleration, roll angle and vertical displacement of the vehicle body platform, including:
[0071] The car body model is established using the Lagrangian energy method, which is expressed as:
[0072]
[0073]
[0074] Z b is the vertical displacement of the center of mass; Z F and Z R is the vertical displacement of the left and right sprung masses; Z tF and Z tR is the vertical displacement of the unsprung mass; Z wF and Z wR is the vertical displacement excitation of the road surface; m sc is the center of mass of the sprung mass; k sF , k sR 、c sF and c sR are the equivalent stiffness and equivalent damping coefficient of the front and rear suspensions respectively; I sc is the moment of inertia of the half vehicle; since the damping coefficient of the tire is very small and can be ignored, the only equivalent stiffness is k tF and k tR ; l f and l r is the distance from the center of mass to the left and right wheels and l f = l r .
[0075] Preferably, S400, using the UDP protocol to synchronously simulate the tank model and the vehicle body model in the data interaction module includes:
[0076] In the data interaction module, modify the simulation step and simulation duration in Simulink, receive the liquid sloshing force value sent by the Fluent end, and send the angular acceleration value of the Simulink end.
[0077] A data interaction module is established in the Matlab script, and the module can modify the simulation step and simulation duration in Simulink, receive the liquid sloshing force value sent by the Fluent end, and send the angular acceleration value of the Simulink end.
[0078] Example 2
[0079] A Fluent and Simulink joint simulation system based on UDP protocol, reference Figure 2 ,include:
[0080] Liquid tank model building module, used to build liquid tank model in Fluent;
[0081] The body model building module is used to build the body model in Simulink;
[0082] A data interaction building module is used to build a data interaction module;
[0083] The synchronous simulation module is used to synchronously simulate the liquid tank model and the vehicle body model in the data interaction module using the UDP protocol.
[0084] Example 3
[0085] An electronic device includes: a processor and a memory, the memory is used to store computer program codes, the computer program codes include computer instructions, when the processor executes the computer instructions, the electronic device executes a Fluent and Simulink joint simulation method based on UDP protocol.
[0086] Example 4
[0087] A computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes a Fluent and Simulink joint simulation method based on a UDP protocol.
[0088] The present invention utilizes the data receiving and sending function in the UDP protocol, which includes blocking reception, to realize the synchronous waiting joint simulation of Fluent and Simulink, and meet the complex simulation requirements of the same time step. The present invention utilizes the writable c file of Fluent secondary development to realize the writing of the UDP protocol, obtain the various calculation result information of the numerical model, and package and send it. The coupling model produced by the present invention can more accurately describe the roll behavior of the high ground clearance sprayer.
[0089] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A Fluent and Simulink joint simulation method based on UDP protocol, characterized in that: include: Create a liquid tank model in Fluent; Build a car body model in Simulink; Establish data interaction module; The UDP protocol is used to synchronously simulate the liquid tank model and the vehicle body model in the data interaction module.
2. According to a UDP protocol-based Fluent and Simulink joint simulation method according to claim 1, it is characterized in that: The establishment of the liquid tank model in Fluent includes: Construct numerical models in Fluent; Create a liquid tank model in Fluent; The liquid tank model is simulated to obtain the liquid sloshing force, liquid sloshing trend animation and liquid sloshing velocity cloud map in the liquid tank.
3. The Fluent and Simulink joint simulation method based on UDP protocol according to claim 1, characterized in that: The establishment of the vehicle body model in Simulink includes: Establish a half-car vertical dynamics model as a car body model in Simulink; The vehicle body model is simulated to obtain the roll angular acceleration, roll angle and vertical displacement of the vehicle body platform.
4. The Fluent and Simulink joint simulation method based on UDP protocol according to claim 2, characterized in that: The construction of the numerical model in Fluent includes: The main mechanical features of the liquid tank are retained; The overall dimensions of the liquid tank are set to be symmetrical, and the angular acceleration excitation of the liquid tank around the y-axis is established, and the resulting shaking is symmetrical with the xz plane.
5. The Fluent and Simulink joint simulation method based on UDP protocol according to claim 1, characterized in that: The establishment of the data interaction module comprises: Use Fluent's user-defined functions to build the data interaction module of Fluent; Use DEFINE_INIT macro function to initialize UDP protocol; Use the DEFINE_SOURCE macro function to load the angular acceleration parameters transmitted by Simulink; The DEFINE_EXECUTE_AT_END macro function is used for data interaction to transmit liquid sloshing force and receive angular acceleration values.
6. The Fluent and Simulink joint simulation method based on UDP protocol according to claim 3 is characterized in that: The simulating the vehicle body model to obtain the roll acceleration, roll angle and vertical displacement of the vehicle body platform includes: The car body model is established using the Lagrangian energy method, which is expressed as: Z b is the vertical displacement of the center of mass; Z F and Z R is the vertical displacement of the left and right sprung masses; Z tF and Z tR is the vertical displacement of the unsprung mass; Z wF and Z wR is the vertical displacement excitation of the road surface; m sc is the center of mass of the sprung mass; k sF , k sR 、c sF and c sR are the equivalent stiffness and equivalent damping coefficient of the front and rear suspensions respectively; I sc is the moment of inertia of the half vehicle; since the damping coefficient of the tire is very small and can be ignored, the only equivalent stiffness is k tF and k tR ; l f and l r is the distance from the center of mass to the left and right wheels and l f = l r .
7. The Fluent and Simulink joint simulation method based on UDP protocol according to claim 1, characterized in that: The synchronous simulation of the tank model and the vehicle body model in the data interaction module using the UDP protocol includes: In the data interaction module, modify the simulation step and simulation duration in Simulink, receive the liquid sloshing force value sent by the Fluent end, and send the angular acceleration value of the Simulink end.
8. A Fluent and Simulink joint simulation system based on UDP protocol, characterized in that: include: Fluent module, used to build a liquid tank model in Fluent; Simulink module, used to build the car body model in Simulink; A data interaction building module is used to build a data interaction module; The UDP module is used to synchronously simulate the liquid tank model and the vehicle body model in the data interaction module using the UDP protocol.
9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory is used to store computer program codes, wherein the computer program codes include computer instructions, and when the processor executes the computer instructions, the electronic device executes a Fluent and Simulink joint simulation method based on a UDP protocol as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes a Fluent and Simulink joint simulation method based on a UDP protocol as described in any one of claims 1 to 7.
