A co-simulation method for calculating liquid coupling dynamics of a liquid tank truck
Patent Information
- Application Number
- CN202310538171.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-12
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2043-05-12
AI Technical Summary
[0004]本申请基于上述车液耦合联合仿真方法不普及及StarCCM+与TruckSim联合仿真方法不明确的问题,提供了以Matlab/Simulink为中介的StarCCM+与TruckSim车液耦合联合仿真方法
[0024]与现有技术相比,本申请实施例的有益效果是:①本申请实施例提出的联合仿真方法可以有效实现互相原本并无联合仿真接口的StarCCM+软件和TruckSim软件之间的联合仿真,拓展了车液耦合的联合仿真方式;②联合仿真方法准确性高,相比其他利用等效机械模型代替液体进行的计算,通过CFD方法可以准确计算液罐车操纵过程中车辆与液体的耦合作用,实现可信的各种工况下的液罐车动力学仿真;③联合仿真方法的用途广泛,可以用于验证各类受控对象为液罐车的控制算法,也可用于液罐改型对于液罐车行驶影响的验证;④联合仿真方法通用性好,不同类型的液罐车、不同几何的液罐均可使用同样的方法进行联合仿真。
Smart Images

Figure CN116842860B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle simulation and control technology, and in particular to a co-simulation method for calculating the vehicle-liquid coupling dynamics of a liquid tanker truck. Background Technology
[0002] Liquid tanker trucks, as a common road transport vehicle for hazardous chemicals, have a high center of gravity and heavy load. Due to standard restrictions prohibiting full loading, the liquid is prone to sloshing, further reducing lateral stability after vehicle-liquid dynamic coupling, making them susceptible to rollovers that could lead to hazardous chemical leaks or even explosions. Therefore, in future intelligent vehicle cyber-physical systems, the manual driving of liquid tanker trucks, which is purely for transportation and involves high risks and labor intensity, will be replaced by autonomous driving. For autonomous liquid tanker trucks, designing anti-rollover control algorithms that consider liquid sloshing and establishing a convenient and reliable vehicle-liquid coupling simulation verification platform to validate these algorithms is a necessary process for achieving reliable autonomous driving of liquid tanker trucks.
[0003] For vehicle-liquid coupling simulation of tank trucks, existing research typically uses equivalent mechanical models, such as equivalent simple pendulums or elliptical pendulums, to approximate the liquid. These models are then simulated using a combination of TruckSim and Matlab / Simulink to establish nonlinear models of the pendulums in Simulink, mimicking the force coupling between the liquid and the tank truck. However, this coupling method is inaccurate. Even with accurate parameter identification, equivalent pendulum models can only reflect the dominant frequency sloshing of the liquid, resulting in weak overall nonlinearity and an inability to reflect higher-order sloshing and the resulting forces. This leads to inherently large model errors when using equivalent pendulum models for verification, especially in extreme conditions like rollover prevention control. In these cases, equivalent pendulum models cannot adequately represent the sloshing of the liquid, thus failing to fully simulate the fluid dynamics during a critical rollover and consequently, cannot reliably verify the effectiveness of rollover prevention algorithms. A few studies have used a combination of TruckSim and Fluent for algorithm verification, but the methods for combining other mainstream commercial fluid dynamics software, such as StarCCM+, with TruckSim remain unclear. Summary of the Invention
[0004] This application addresses the issues of the lack of widespread adoption of the aforementioned vehicle-hydraulic coupling co-simulation method and the unclear nature of the StarCCM+ and TruckSim co-simulation method by providing a StarCCM+ and TruckSim vehicle-hydraulic coupling co-simulation method using Matlab / Simulink as an intermediary.
[0005] This application provides a co-simulation method for calculating the vehicle-liquid coupling dynamics of a liquid tanker truck, including the following steps:
[0006] Step 1: Establish the vehicle dynamics model of the liquid tanker truck, calibrate it, and set the input and output variables;
[0007] Step 2: Establish a three-dimensional or two-dimensional CFD liquid sloshing model corresponding to the vehicle dynamics model established in Step 1, which includes both liquid and gas phases, and set the input and output variables.
[0008] Step 3: Write a program to automatically output the output of the vehicle dynamics model to a specified file, and to automatically read variables from the specified file as input to the vehicle dynamics model;
[0009] Step 4: Write a program to automatically output the output of the CFD liquid sloshing model to a specified file, and automatically read the variables in the specified file as the input of the CFD liquid sloshing model;
[0010] Step 5: Write a program to automatically set the simulation parameters of the CFD fluid sloshing model based on the simulation parameters of the vehicle dynamics model;
[0011] Step 6: Create four files: CFD data exchange file, CFD flag file, vehicle dynamics model data exchange file, and vehicle dynamics model flag file;
[0012] Step 7: While setting the simulation parameters of the vehicle dynamics model and automatically updating the simulation parameters of the CFD liquid sloshing model, set the initial value of the output of the CFD liquid sloshing model to the specified CFD data exchange file to obtain the specified CFD flag file.
[0013] Step 8: Read the specified CFD data exchange file, use the output of the CFD fluid sloshing model as input to calculate the state quantity of the vehicle dynamics model at the current moment, and select a portion of the state quantity to output to the specified vehicle dynamics model data exchange file to obtain the specified vehicle dynamics flag file. Allow the CFD fluid sloshing model to collect vehicle state data, and continuously read the specified CFD flag file, waiting for the CFD fluid sloshing model to complete the calculation of the next time step.
[0014] Step 9: Continuously read the specified vehicle dynamics flag file. When the vehicle dynamics model completes a calculation, read the specified vehicle dynamics data exchange file, use the output of the vehicle state model as the input of the CFD fluid sloshing model to calculate the data of the CFD fluid sloshing model at the next moment, and output the set output to the specified CFD data exchange file to obtain the specified CFD flag file with the back setting, allowing the vehicle dynamics model to collect CFD data.
[0015] Step 10: Repeat steps 8 and 9 until the set stopping condition is met.
[0016] Furthermore, in one embodiment of this application, step 1 includes: establishing the vehicle dynamics model of the tanker truck using TruckSim software, and setting it to perform co-simulation with Matlab / Simulink.
[0017] Furthermore, in one embodiment of this application, step 1 includes setting the input quantities of the vehicle dynamics model to include user-defined axle lateral force, user-defined axle vertical force, and / or user-defined sprung mass roll moment.
[0018] Furthermore, in one embodiment of this application, step 2 includes: setting the input variable of the CFD liquid sloshing model to the gravitational acceleration component of the liquid Euler phase.
[0019] Furthermore, in one embodiment of this application, step 2 includes: setting the output variables of the CFD liquid sloshing model to include the lateral force of the liquid on the tank, the vertical force of the liquid on the tank, and / or the tilting moment of the liquid on any point in the tank coordinate system.
[0020] Furthermore, in one embodiment of this application, step 2 includes: using StarCCM+ software to establish a two-phase fluid sloshing CFD model in the liquid tank, and setting a gravity model in the Eulerian phase.
[0021] Furthermore, in one embodiment of this application, step 3 includes: using Matlab's M language to write functions to implement Simulink's automated file I / O operations.
[0022] Furthermore, in one embodiment of this application, the function is a Matlab Function or an S-Function.
[0023] Furthermore, in one embodiment of this application, step 4 includes: using Java language to write macro programs to implement automated file I / O operations of the CFD software StarCCM+.
[0024] Compared with the prior art, the beneficial effects of the embodiments of this application are: ① The co-simulation method proposed in the embodiments of this application can effectively realize the co-simulation between StarCCM+ software and TruckSim software, which originally had no co-simulation interface, thus expanding the co-simulation method of vehicle-fluid coupling; ② The co-simulation method has high accuracy. Compared with other calculations that use equivalent mechanical models to replace liquids, the CFD method can accurately calculate the coupling effect between the vehicle and the liquid during the operation of the liquid tanker truck, realizing reliable dynamic simulation of the liquid tanker truck under various working conditions; ③ The co-simulation method has a wide range of applications. It can be used to verify control algorithms for various controlled objects that are liquid tankers, and it can also be used to verify the impact of liquid tanker modification on the driving of the liquid tanker truck; ④ The co-simulation method has good versatility. Different types of liquid tankers and liquid tanks with different geometries can all be co-simulated using the same method.
[0025] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0026] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:
[0027] Figure 1 This is a flowchart illustrating a co-simulation method for calculating the vehicle-liquid coupling dynamics of a liquid tanker truck, according to an embodiment of this application.
[0028] Figure 2 This is a flowchart of a co-simulation method for calculating the vehicle-liquid coupling dynamics of a liquid tanker truck according to one embodiment of this application. Detailed Implementation
[0029] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0030] To achieve tightly coupled simulation of vehicle dynamics and fluid dynamics in liquid tank commercial vehicles, this application provides a co-simulation method for calculating the vehicle-liquid coupled dynamics of liquid tank vehicles. Combined with... Figure 1 and Figure 2 As shown, the specific steps include:
[0031] Step 1: Utilize TruckSim software to establish a vehicle dynamics model of the liquid tanker truck, preferably a five-axle semi-trailer liquid tanker truck as the simulation object. Calculate the vehicle's inertial parameters based on the simulated tank filling rate to calibrate the model parameters. Gasoline is preferred as the liquid carried, and a 50% filling rate is preferred. Based on the dimensions of a certain model of elliptical cross-section liquid tank (major axis 2.48m, minor axis 1.8m, tank length 11m), the semi-trailer's sprung mass is calculated to be 20387kg. The moments of inertia of the vehicle coordinate system around the trailer's center of gravity are: I... 2xx = 34652 kg·m 2 I 2yy = 336297 kg·m 2 I 2zz = 331380 kg·m 2 .
[0032] Preferredly, Matlab / Simulink is used for co-simulation. Input and output variables are set. In this embodiment, the preferred input variables include at least user-defined axle lateral force, user-defined axle vertical force, and user-defined sprung mass roll moment. Specifically, in this example, at least the variables IMP_FYGEXA2, IMP_FYGEXA3, IMP_FYGEXA4, IMP_FYGEXA5, IMP_FZGEXA2, IMP_FZGEXA3, IMP_FZGEXA4, IMP_FZGEXA5, and IMP_MXGEXT2 are included. The trailer center-of-gravity lateral acceleration Ay_SM_2 and the semi-trailer roll angle Roll_2 are preferably used as output variables.
[0033] It should be clarified that the input and output variables can be determined according to the specific simulation needs. For example, if active steering control is required at the same time, the front wheel steering angle can be added as an input; if differential braking control is required at the same time, the master cylinder pressure and the pressure of each wheel cylinder can be added as inputs, etc.
[0034] Step 2: Preferably using StarCCM+ software, establish a CFD liquid sloshing model corresponding to the vehicle dynamics model established in Step 1, including liquid and gas phases. Preferably using a two-dimensional model, the preferred model includes multi-interaction → interphase interaction, wall distance → implicit tree, multiphase → Eulerian phase. Preferably using gasoline and air as two Eulerian phases, setting the gasoline phase material name to C8H17 (Gasoline) and the air phase material name to Air, using default constants for density and dynamic viscosity, adaptive time step → time step provider: free surface CFL condition, fluid domain volume (VOF) → HRIC → HRIC gradient smoothing, separated flow, realizable K-Epsilon two-layer model, Reynolds-averaged Navier-Stokes, two-layer full y+ wall treatment, gradient, turbulence, implicit unsteady state, gravity, multiphase equations of state, K-Epsilon turbulence.
[0035] And set the input and output variables: The preferred input variable of the CFD liquid sloshing model is the gravitational acceleration component of the liquid Eulerian phase. The preferred output variables of the CFD liquid sloshing model include at least the lateral force of the liquid on the tank, the vertical force of the liquid on the tank, and the tilting moment of the liquid on a point in the tank coordinate system. The preferred method of variable output is to create a corresponding report of the above output quantities, create a plot based on the report, and then use the plot export function to export the plot data of the output quantities to a specified *.csv file.
[0036] Step 3: Preferably, use Matlab's M language to write Matlab Functions to implement automated file I / O operations in Simulink. This will automatically output the output of the vehicle dynamics model to the specified vehicle dynamics data exchange file and automatically read variables from the specified CFD data exchange file as input to the dynamics model.
[0037] Step 4: Preferably, use Java to write macro programs to automate file I / O operations of the CFD software StarCCM+, automatically outputting the output of the CFD liquid sloshing model to the specified CFD data exchange file, and automatically reading variables from the specified vehicle dynamics data exchange file as input to the CFD liquid sloshing model.
[0038] Step 5: Preferably, use M-script to write a program to automatically set the simulation parameters of the CFD liquid sloshing model based on the simulation parameters of the vehicle dynamics model.
[0039] Step 6: Create four files: CFD data exchange file, CFD flag file, vehicle dynamics model data exchange file, and vehicle dynamics model flag file. Preferably, use *.csv format files. Preferably, the flag file should be ASCII encoded and comma-separated. Preferably, use the ASCII characters "0" and "1" as the flag file's content during reset and set operations, respectively. The four files are: java_output.csv, java_flag.csv, matlab_output.csv, and matlab_flag.csv.
[0040] Step 7: Preferred settings for vehicle dynamics model simulation parameters: simulation time 10s, time step 0.001s, and automatic update of CFD liquid sloshing model simulation parameters. Set the initial value of the CFD liquid sloshing model output [0,0,0,0] to the specified CFD data exchange file java_output.csv. After completion, set the specified CFD flag file java_flag.csv.
[0041] Step 8: Read the specified CFD data exchange file java_output.csv, then reset the specified CDF flag file java_flag.csv. Use the output of the CFD fluid sloshing model as input to calculate the state variables of the vehicle dynamics model at the current time step, and select a portion of these state variables to output to the specified vehicle dynamics data exchange file matlab_output.csv. After completion, set the vehicle dynamics flag file matlab_flag.csv to allow the CFD fluid sloshing model to collect vehicle state data, and continuously read the specified CDF flag file java_flag.csv, waiting for the CFD model to complete the calculation of the next time step.
[0042] Step 9: Continuously read the specified vehicle dynamics flag file matlab_flag.csv. When the vehicle dynamics model completes a calculation step, reset the flag file, read the specified vehicle dynamics data exchange file matlab_output.csv, use the output of the vehicle state model as the input of the CFD fluid sloshing model to calculate the data of the CFD fluid sloshing model at the next moment, and output the set output to the specified CFD data exchange file java_output.csv. After completion, set the specified CFD flag file java_flag.csv to allow the vehicle dynamics model to collect CFD data.
[0043] Step 10: Repeat steps 8 and 9 until the set stopping condition is met.
[0044] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0045] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0046] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0047] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0048] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0049] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0050] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0051] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.
Claims
1. A co-simulation method for calculating the vehicle-liquid coupling dynamics of a liquid tanker truck, comprising the following steps: Step 1: Establish the vehicle dynamics model of the liquid tanker truck, calibrate it, and set the input and output variables; This includes: using TruckSim software to establish the vehicle dynamics model of the tanker truck and setting it to perform co-simulation with Matlab / Simulink; Step 2: Establish a three-dimensional or two-dimensional CFD liquid sloshing model corresponding to the vehicle dynamics model established in Step 1, which includes liquid and gas phases, and set input and output variables; including: using StarCCM+ software to establish a two-phase fluid sloshing CFD model in the liquid tank, and setting a gravity model in the Eulerian phase; Step 3: Write a program to automatically output the output of the vehicle dynamics model to a specified file and automatically read the variables in the specified file as the input of the vehicle dynamics model; Step 4: Write a program to automatically output the output of the CFD liquid sloshing model to a specified file, and automatically read the variables in the specified file as the input of the CFD liquid sloshing model; Step 5: Write a program to automatically set the simulation parameters of the CFD fluid sloshing model based on the simulation parameters of the vehicle dynamics model; Step 6: Create four files: CFD data exchange file, CFD flag file, vehicle dynamics model data exchange file, and vehicle dynamics model flag file; Step 7: While setting the simulation parameters of the vehicle dynamics model and automatically updating the simulation parameters of the CFD liquid sloshing model, set the initial value of the output of the CFD liquid sloshing model to the specified CFD data exchange file to obtain the specified CFD flag file. Step 8: Read the specified CFD data exchange file, use the output of the CFD fluid sloshing model as input to calculate the state quantity of the vehicle dynamics model at the current moment, and select a portion of the state quantity to output to the specified vehicle dynamics model data exchange file to obtain the specified vehicle dynamics flag file. Allow the CFD fluid sloshing model to collect vehicle state data, and continuously read the specified CFD flag file, waiting for the CFD fluid sloshing model to complete the calculation of the next time step. Step 9: Continuously read the specified vehicle dynamics flag file. When the vehicle dynamics model completes a calculation, read the specified vehicle dynamics model data exchange file. Use the output of the vehicle state model as the input of the CFD fluid sloshing model to calculate the data of the CFD fluid sloshing model at the next moment, and output the set output to the specified CFD data exchange file to obtain the specified CFD flag file with the back setting, allowing the vehicle dynamics model to collect CFD data. Step 10: Repeat steps 8 and 9 until the set stopping condition is met.
2. The co-simulation method as described in claim 1, characterized in that, Step 1 includes: The inputs to the vehicle dynamics model include user-defined axle lateral forces, user-defined axle vertical forces, and / or user-defined sprung mass roll moments.
3. The co-simulation method as described in claim 2, characterized in that, Step 2 includes: The input variable of the CFD liquid sloshing model is the gravitational acceleration component of the liquid Euler phase.
4. The co-simulation method as described in claim 2, characterized in that, Step 2 includes: The output variables of the CFD liquid sloshing model include the lateral force of the liquid on the tank, the vertical force of the liquid on the tank, and / or the tilting moment of the liquid on any point in the tank coordinate system.
5. The co-simulation method as described in claim 1, characterized in that, Step 3 includes: Use Matlab's M language to write functions to automate file I / O operations in Simulink.
6. The co-simulation method as described in claim 5, characterized in that, The function is a Matlab Function or S-Function.
7. The co-simulation method as described in claim 1, characterized in that, Step 4 includes: Write macro programs in Java to automate file I / O operations in the CFD software StarCCM+.
Citation Information
Patent Citations
CFD automatic modeling and analysis system and method based on ANSA and StarCCM + platform
CN112163270A
Automatic Design Assessment and Smart Analysis
US20230028912A1