Modelica language-based engine model modeling method and system
By using the Modelica language to establish an engine model, the problem of failure to comprehensively analyze engine thermodynamic balance, fuel consumption and emission substances in the prior art is solved, and a comprehensive analysis of the engine working process and efficient and accurate model construction are achieved.
Patent Information
- Application Number
- CN202510487767.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-04-18
AI Technical Summary
The existing engine modeling method only considers the dynamic model, and fails to comprehensively analyze the thermodynamic balance, fuel consumption and emission materials during the engine operation, making it difficult to build an efficient and accurate model.
The engine model is established using the Modelica language. By reading the engine ECU command information, the average effective pressure and ideal output torque are calculated, and the dynamic and thermodynamic balance calculation is carried out in combination with temperature and dynamic correction coefficients, and an external interactive interface is established to achieve comprehensive analysis.
It realizes a comprehensive analysis of dynamic speed and torque during engine operation, and can evaluate the economic and environmental protection of the engine, providing an efficient and accurate engine modeling method.
Smart Images

Figure CN120012279A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automobile component simulation modeling, and in particular to a method and system for modeling an engine model based on Modelica language. Background Art
[0002] As the core component of the car, the engine's performance is closely related to the vehicle's power, efficiency, emissions and other factors. In the vehicle design process, it is often necessary to model and analyze the engine's torque, fuel consumption, emissions and other information to verify the vehicle's overall performance. An efficient and accurate engine model plays an intuitive and important role in the reasonable analysis of the vehicle's performance.
[0003] Patent CN118395685A discloses a modeling and simulation method, system and storage medium for a planetary hybrid system. The engine model converts the engine demand torque into the engine output torque according to its own operating characteristics. However, the engine model constructed in this patent only models and analyzes the torque and only considers the dynamic model. The thermodynamic equilibrium is not processed and the fuel consumption and emission substances are not analyzed. Therefore, it is difficult to make an efficient and accurate model with the current simulation method. Summary of the invention
[0004] Technical purpose: In view of the defects in the prior art, the present invention discloses an engine modeling method and system based on the Modelica language. An engine model is established based on the Modelica language, which makes it possible to comprehensively analyze the dynamic speed and torque conditions of the engine during operation, and at the same time analyze the engine's economic, environmental protection and other characteristics during the process.
[0005] Technical solution: In order to achieve the above technical objectives, the present invention adopts the following technical solution.
[0006] A method for modeling an engine model based on Modelica language, the method comprising: Read external engine ECU command information; Calculate the current engine mean effective pressure and ideal output torque based on engine power parameter characteristics and ECU command information; The engine's external torque output value is calculated by combining the engine's ideal output torque, temperature and dynamic correction coefficient; An external interaction interface is established, and the engine model is obtained by combining the dynamic balance and thermodynamic balance calculations of the engine's external torque output value, wherein the external interaction interface includes a thermal interface and a flange interface. The thermal interface is used to connect the engine to the cooling component, and the flange interface is used to connect the engine to the load component.
[0007] An engine model building system based on Modelica language, used to implement the above-mentioned engine model building method based on Modelica language, comprises: Instruction reading module, used to read external engine ECU instruction information; The modeling module is used to calculate the current engine average effective pressure and ideal output torque according to the engine power parameter characteristics and ECU command information; calculate the engine external torque output value in combination with the engine ideal output torque, temperature and dynamic correction coefficient; establish an external interaction interface, and perform dynamic balance and thermodynamic balance calculations in combination with the engine external torque output value to obtain an engine model, wherein the external interaction interface includes a thermal interface and a flange interface, the thermal interface is used to connect the engine to the cooling component, and the flange interface is used to connect the engine to the load component.
[0008] Beneficial effects: Modelica language is an object-oriented, open source, non-causal, multi-physics modeling language that uses equations to represent system behavior and supports dynamic, discrete physical system modeling. It is widely used in modeling and simulation of complex physical systems in multiple fields and can be used for virtual design and simulation optimization of engine models. The present invention establishes an engine model based on the Modelica language, so that the dynamic speed and torque conditions during the engine operation process can be comprehensively analyzed, and the economic and environmental characteristics of the engine in the process can also be analyzed. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 A flowchart of the method steps of an embodiment of the present invention; Figure 2 is a flowchart of an embodiment of the present invention; Figure 3 Schematic diagram of an external interface simulation framework according to an embodiment of the present invention. DETAILED DESCRIPTION
[0010] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0011] Example As attached Figure 1 and attached Figure 2 As shown, a method for modeling an engine model based on the Modelica language in this embodiment, modeling a generator using the Modelica language, includes the following steps: Step 1, read the external engine ECU command information; The ECU command information varies between 0 and 1, 1 represents a full-load working command, and 0 represents a no-load command, wherein commands within the range of 0-1 represent partial-load working commands.
[0012] Step 2: Calculate the current engine mean effective pressure and ideal output torque according to the engine power parameter characteristics and ECU command information; wherein the engine power parameter characteristics are expressed in the form of a BMEP table, which is provided by the user; According to the engine power parameter characteristics, the maximum and minimum values of the engine mean effective pressure are queried, and the current value of the engine mean effective pressure is calculated in combination with the current ECU command; Specifically, the calculation method is: , in, , They are the maximum and minimum values of the brake mean effective pressure, in bar. The above variables are obtained by querying the brake mean effective pressure table. The input information of the table is the engine speed. is the brake mean effective pressure, in bar. is the ECU command, i.e. the ECU command information obtained in step 1, and its value range is 0~1.
[0013] The ideal torque is calculated based on the current engine mean effective pressure and engine power parameter characteristics. The specific method for calculating the ideal torque is as follows: For four-stroke engines: , , For two-stroke engines: , , Among them, FMEP is the friction mean effective pressure, the unit is bar, this variable is obtained by querying the FMEP table, and the input information of the table is the engine speed and temperature information. is the ideal output torque of the engine, in Nm; is the ideal friction torque of the engine, in Nm; V is the engine displacement.
[0014] Step 3: Calculate the engine's external torque output value by combining the engine's ideal output torque, temperature and dynamic correction coefficient; Among them, the dynamic correction mainly considers the difference between the current environmental conditions and the obtained engine performance, and then corrects the maximum torque according to the environmental conditions. The calculation formula of the dynamic correction coefficient is: , in, is the dynamic correction coefficient; is the current ambient air density, in kg / m 3 ; is the reference ambient air density, in kg / m 3 ; is the current ambient air temperature, in K; is the reference ambient temperature in degC.
[0015] Any change in the friction mean effective pressure FMEP under different temperature conditions will affect the engine's torque performance, so the calculation formula for the engine torque temperature correction value is as follows: , in, is the engine torque temperature correction value; is the friction torque at the engine reference temperature, in Nm; T hot is the engine reference temperature in degC. The engine reference temperature is set by the user and is selected according to the actual situation. The friction torque at the engine reference temperature is obtained by looking up the engine friction mean effective pressure table, that is, the FMEP table, and then calculated in combination with the formula in step 2. The input quantity of the table is the engine speed and the engine reference temperature. is the friction torque at the current temperature of the engine, in Nm; Temp is the current engine temperature in degC.
[0016] After the two correction factors of temperature and dynamic correction coefficient are added together, the actual torque output is obtained, that is, the external torque output value of the engine. The calculation formula is: , in, The ideal output torque of the engine, is the dynamic correction coefficient, is the engine torque temperature correction value. After the engine external torque output value is calculated, it can be used as the table input value in the subsequent steps.
[0017] Step 4: As attached Figure 3As shown, an external interactive interface is established, and the engine model is obtained by combining the engine's external torque output value to perform dynamic balance and thermodynamic balance calculations, wherein the external interactive interface includes a thermal interface and a flange interface. The thermal interface is used to connect the engine to the cooling component, and the flange interface is also called a power interface, which is used to connect the engine to the load component. The present invention is used to provide an efficient and fast engine modeling solution method, and at the same time provides an effective simulation tool for users who have needs in engine power and energy consumption characteristic evaluation. The specific method is: Kinetic balance includes: A standard flange interface with speed as potential variable and torque as flow variable is established, and dynamic balance calculation is performed with external driving components. The interaction characteristics between the two are that the potential variables are equal and the sum of the flow variables is 0: the formula is as follows: , , , Thermodynamic equilibrium equations include: A standard thermal interface with temperature as potential variable and heat flux as flow variable is established to perform thermodynamic equilibrium calculation with the external cooling component interface. The interaction characteristics between the two are that the potential variables are equal and the sum of the flow variables is 0: The calculation formula is: , , , in, is the engine power interface torque, is the load power interface torque, obtained based on external modeling and coupled with the engine power interface torque, It is the engine power interface speed, which is a dynamic variable. After the power interface coupling is established, the constraints are established by the externally modeled dynamic characteristics. The rotational acceleration or deceleration is generated according to the torque difference and the external equivalent inertia, and the interface speed is obtained by integration. After the interface coupling is established, this variable depends on the external dynamic characteristics. is the load power interface speed, is the heat flow rate of the engine thermal interface, is the heat flow rate of the thermal interface of the cooling component, is the thermal interface temperature of the thermal motor, is the thermal interface temperature of the cooling component, The temperature value will change with After the thermal interface coupling is established, this variable depends on the thermodynamic properties of the cooling medium.
[0018] In the process of modeling, the present invention also calculates state parameters, including the real fuel consumption ratio, engine emission mass, and exhaust temperature, for use in subsequent engine model work analysis. The calculation process of state parameters includes: Fuel consumption calculation based on engine fuel characteristics combined with the influence of temperature and starting coefficient; The engine fuel consumption is read from the fuel consumption table, and the engine start-up excessive consumption is corrected by temperature influence. The specific method is as follows: , in, is the real fuel consumption ratio, in g / kwh; The fuel consumption value is read from the fuel consumption table, which is obtained by looking up the table using the engine speed and torque information; It is the excess consumption coefficient of the engine when starting, which is defined by the user; is the low temperature effect coefficient, which is defined by the user and is an expression related to the engine temperature, namely f ( T engine ), which is a function with temperature as an independent variable and a multiplication factor of the fuel consumption value. The actual fuel consumption ratio obtained by calculation is used as the state variable in the engine model for subsequent model work analysis.
[0019] The engine emission mass and exhaust temperature are calculated based on the current engine operating conditions and temperature information; when the engine speed is less than the idle speed, the engine is in the starting condition, which means that the engine is starting. During the engine starting process, the speed increases from 0 to the idle speed and above. Whether the engine is in the starting condition is used to determine the excessive consumption coefficient of the engine when starting. Whether it is effective. When the engine speed is greater than or equal to the idle speed, the excessive consumption coefficient when the engine starts The value is 1.
[0020] The calculation of engine emission quality includes the calculation of engine equivalence ratio, exhaust gas mass flow rate, and pollutant emission information. The process is as follows: The equivalent ratio is calculated by looking up the table combined with startup and temperature correction. The current equivalent ratio calculation formula is: , in, is the current equivalence ratio; To use the engine effective pressure and speed to query the engine equivalence ratio table to obtain the value. The engine equivalence ratio table is a user-defined table based on engine characteristics. It is the excess consumption coefficient when the engine starts, which is set by the user; It is the correction factor for low temperature effect, set by the user.
[0021] The exhaust gas mass flow rate is calculated using the fuel consumption and equivalence ratio. The calculation formula is as follows: , in, is the exhaust gas mass flow rate, in g / s, is the stoichiometric air / fuel ratio, which is an inherent property of the fuel and is determined by the user, is the engine speed in rev / min, is the engine idle speed, in rev / min, It is the fresh air mass flow rate at idle speed, in g / s. Driving condition refers to the condition when the engine speed is greater than the load component, and braking condition refers to the condition when the engine speed is less than or equal to the load component, also called reverse drag condition.
[0022] Pollutant emissions are calculated as follows: The pollutant emissions are corrected by combining the lookup information of torque and speed with temperature. The calculation expression of the actual pollutant emission value is as follows: , , , in, It is the actual emission value of pollutants, with the unit of g / kWh, which refers to the mass of pollutants produced for every 1kwh of energy generated. The emission value is read from the engine emission pollutant ratio table. The engine emission pollutant ratio table is a table customized by the user based on the engine characteristics. is the emission correction factor, defined by the user, The engine start enrichment coefficient is defined by the user. is the engine temperature in degC, The lower limit of the engine temperature threshold, in degC, is defined by the user; The upper limit of the engine temperature threshold is in degC and is defined by the user; , is the temperature correction coefficient. When the engine temperature is between the upper and lower limits of the engine temperature threshold, linear interpolation is used to correct the coefficient.
[0023] The exhaust temperature calculation process includes: The exhaust temperature, that is, the exhaust gas temperature, is obtained by combining the table lookup function with the temperature correction coefficient. The calculation formula is as follows: , in, is the actual exhaust temperature, The exhaust temperature is obtained by looking up the engine exhaust temperature table. The unit is degC. The input is torque and engine speed. The engine exhaust temperature table is a table customized by the user based on engine characteristics. is the temperature effect correction coefficient, which is defined by the user.
[0024] The present invention also discloses an engine model building system based on Modelica language, which is used to implement the above-mentioned engine model building method based on Modelica language, comprising: Instruction reading module, used to read external engine ECU instruction information; The modeling module is used to calculate the current engine average effective pressure and ideal output torque according to the engine power parameter characteristics and ECU command information; calculate the engine external torque output value in combination with the engine ideal output torque, temperature and dynamic correction coefficient; establish an external interaction interface, and perform dynamic balance and thermodynamic balance calculations in combination with the engine external torque output value to obtain an engine model, wherein the external interaction interface includes a thermal interface and a flange interface, the thermal interface is used to connect the engine to the cooling component, and the flange interface is used to connect the engine to the load component.
[0025] The present invention establishes an engine model based on the Modelica language, so that the dynamic speed and torque conditions during the engine operation process can be comprehensively analyzed, and the economic and environmental protection characteristics of the engine in the process can also be analyzed.
[0026] The "first" and "second" in the names such as "first" and "second" (if any) mentioned in the embodiments of the present application are only used as name identifiers and do not represent the first or second in order.
[0027] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for modeling an engine model based on Modelica language, characterized in that: include: Read external engine ECU command information; Calculate the current engine mean effective pressure and ideal output torque based on engine power parameter characteristics and ECU command information; The engine's external torque output value is calculated by combining the engine's ideal output torque, temperature and dynamic correction coefficient; An external interaction interface is established, and the engine model is obtained by combining the dynamic balance and thermodynamic balance calculations of the engine's external torque output value, wherein the external interaction interface includes a thermal interface and a flange interface. The thermal interface is used to connect the engine to the cooling component, and the flange interface is used to connect the engine to the load component.
2. The engine modeling method based on Modelica language according to claim 1, characterized in that: The calculation formula of dynamic correction coefficient is: , in, is the dynamic correction coefficient; is the current ambient air density; is the reference ambient air density; is the current ambient air temperature; is the reference ambient temperature.
3. The engine modeling method based on Modelica language according to claim 1, characterized in that: The calculation formula of engine torque temperature correction value is: , in, is the engine torque temperature correction value; is the friction torque at the engine reference temperature; is the friction torque at the current engine temperature.
4. The engine modeling method based on Modelica language according to claim 1, characterized in that: Engine external torque output value The calculation formula is: , in, The ideal output torque of the engine, is the dynamic correction coefficient, is the engine torque temperature correction value.
5. The engine modeling method based on Modelica language according to claim 1, characterized in that: Dynamic balance includes: establishing a standard flange interface with speed as potential variable and torque as flow variable, and performing dynamic balance calculation with external driving components. The interaction characteristics between the two are that the potential variables are equal and the sum of the flow variables is 0; Thermodynamic equilibrium includes: establishing a standard thermal interface with temperature as the potential variable and heat flow as the flow variable, and performing thermodynamic equilibrium calculations with the external cooling component interface. The interaction characteristics between the two are that the potential variables are equal and the sum of the flow variables is 0.
6. The engine modeling method based on Modelica language according to claim 5, characterized in that: The kinetic equilibrium formula includes: , , , in, is the engine power interface torque, is the load power interface torque, is the engine power interface speed, is the load power interface speed, is the external torque output value of the engine.
7. The engine modeling method based on Modelica language according to claim 5, characterized in that: Thermodynamic equilibrium equations include: , , , in, is the heat flow rate of the engine thermal interface, is the heat flow rate of the cooling component thermal interface, is the thermal interface temperature of the thermal motor, is the thermal interface temperature of the cooling component, is the engine power interface speed, is the friction torque at the current engine temperature.
8. The engine modeling method based on Modelica language according to claim 1, characterized in that: During the modeling process, the present invention also calculates state parameters, including the real fuel consumption ratio, the mass of engine emissions, and the exhaust temperature; for use in the subsequent engine model work analysis; the calculation of the engine emission quality includes the calculation of the engine equivalence ratio, the exhaust gas mass flow rate, and the pollutant emission information, and the equivalence ratio is calculated by table lookup combined with startup and temperature correction; the exhaust gas mass flow rate is calculated using the fuel consumption and the equivalence ratio; and the pollutant emissions are corrected by table lookup information of torque and speed combined with temperature.
9. The engine modeling method based on Modelica language according to claim 6, characterized in that: The current equivalence ratio is calculated as: , in, is the current equivalence ratio; The value is obtained by looking up the table using the engine effective pressure and speed; It is the excess consumption coefficient of the engine when starting the engine; is the low temperature effect correction factor; The calculation formula of exhaust gas mass flow is: , in, is the exhaust gas mass flow rate, is the stoichiometric air / fuel ratio, is the engine speed, is the engine idle speed, is the fresh air mass flow at idle speed; is the real fuel consumption ratio; The calculation formula for the actual pollutant emission value is: , , , in, is the actual pollutant emission value, is the emission value read from the table, is the emission correction factor, is the engine start enrichment coefficient, is the engine temperature, is the lower threshold of engine temperature; is the upper limit of engine temperature threshold; , is the temperature correction factor.
10. An engine model building system based on Modelica language, used to implement an engine model building method based on Modelica language as claimed in any one of claims 1 to 9, characterized in that: include: Instruction reading module, used to read external engine ECU instruction information; Modeling module, used to calculate the current engine mean effective pressure and ideal output torque based on engine power parameter characteristics and ECU command information; The engine's external torque output value is calculated by combining the engine's ideal output torque, temperature and dynamic correction coefficient; An external interaction interface is established, and the engine model is obtained by combining the dynamic balance and thermodynamic balance calculations of the engine's external torque output value, wherein the external interaction interface includes a thermal interface and a flange interface. The thermal interface is used to connect the engine to the cooling component, and the flange interface is used to connect the engine to the load component.
Citation Information
Patent Citations
Modelica language-based engine cooling system simulation modeling method
CN105067271A
Modeling simulation method of turbojet engine modified hot snow blowing device equipment
CN111339644A
Carrier rocket whole-process dynamics rapid simulation modeling method based on Modelica unified modeling language
CN119720830A
Mathematical modelling method for single spool turbojet engine
US20210209265A1
Method for constructing start performance model for naval-ship gas turbine
WO2024120432A1