Modeling simulation method suitable for diversified hydrogen fuel cell system

Through a modeling and simulation method including human-computer interactive end, database end and simulation model end, the problem that the existing hydrogen fuel cell system simulation model cannot adapt to the diversified system structure is solved, and the adaptive modeling and simulation of diversified hydrogen fuel cell systems is realized, which improves the universality and practicality of the model.

CN119864455APending Publication Date: 2025-04-22TIANJIN UNIV OF TECH & EDUCATION (TEACHER DEV CENT OF CHINA VOCATIONAL TRAINING & GUIDANCE)
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411940899.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

The existing hydrogen fuel cell system simulation models are mostly aimed at specific working processes and specific system structures, and cannot adapt to the diverse hydrogen fuel cell system structure, resulting in poor versatility and practicality.

Method used

A modeling and simulation method including human-computer interactive end, database end and simulation model end is adopted to complete the establishment of the simulation model of the fuel cell system and display the simulation results through a graphical interface, supporting the structural modeling and simulation of diversified hydrogen fuel cell systems.

Benefits of technology

Adaptive modeling and simulation of diversified hydrogen fuel cell systems is realized, which improves the versatility and practicality of the model, and saves development time and cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119864455A_ABST
    Figure CN119864455A_ABST
Patent Text Reader

Abstract

The invention provides a modeling simulation method suitable for a diversified hydrogen fuel cell system. Comprising the following steps: designing an overall structure of a framework, digitizing and symbolizing a simulation model of the hydrogen fuel cell system at a human-computer interaction end, formatting and storing data at a database end, and realizing the structure performance simulation of the diversified fuel cell system at a simulation model end. The implementation method can effectively solve the problems that an autonomously established hydrogen fuel cell system simulation model is not suitable for diversified system structures and is poor in universality and practicability, modeling and simulation of the hydrogen fuel cell diversified structure are achieved, and technical support is provided for diversified research and design of a fuel cell system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of hydrogen fuel cell performance simulation software development, and in particular to a modeling simulation method suitable for diversified hydrogen fuel cell systems. Background Art

[0002] Hydrogen fuel cells are electrochemical devices that directly convert the chemical energy of hydrogen fuel and oxidant into electrical energy (direct current), heat and reaction products. They are an important form of application of hydrogen energy technology.

[0003] Establishing a hydrogen fuel cell performance simulation model and conducting simulation analysis on the performance of hydrogen fuel cells can advance the development node of hydrogen fuel cells and save development time and R&D costs. In the process of users independently developing hydrogen fuel cell system models using basic computer languages ​​such as Python, the hydrogen fuel cell system models they establish are mostly targeted at specific working processes and specific hydrogen fuel cell system structures, and cannot adapt to the diverse structural forms of hydrogen fuel cell systems, and are poor in practicality and versatility. Summary of the invention

[0004] The purpose of the present invention is to provide a modeling and simulation method suitable for diversified hydrogen fuel cell systems to achieve modeling and simulation of diversified hydrogen fuel cell structures, in order to address the problem that the independently established hydrogen fuel cell system simulation model is not suitable for diversified system structures and has poor versatility and practicality.

[0005] The technical solution adopted to achieve the purpose of the present invention is:

[0006] A modeling and simulation method suitable for diversified hydrogen fuel cell systems, including a human-computer interaction end, a database end, and a simulation model end;

[0007] The human-computer interaction terminal is a graphical interface for users to complete the establishment of a fuel cell system simulation model and display simulation results;

[0008] The fuel cell system simulation model of the human-computer interaction end is established, and the user selects the fuel cell system components in the human-computer interaction end component library, and then determines the connection relationship between the selected components, sets the component model, inputs the component model parameters, and completes the establishment of the simulation model. Finally, the fuel cell system simulation model established by the user is digitized and symbolized, and saved in a fixed format in the database end;

[0009] The human-machine interaction end component library is a four-level structure, wherein the first level is the human-machine interaction end component library, the second level is various types of hydrogen fuel cell libraries, the third level is the component library of each component system contained in the various types of hydrogen fuel cell libraries, the auxiliary component library and the system environment component library, and the fourth level is the component library of each component system, the auxiliary component library and the corresponding components contained in the system environment component library, wherein the components in the system environment component library include simulation environment and boundary environment, the simulation environment component is used for setting the overall simulation environment of the system, and the boundary environment component is used for setting the import or export boundary environment of the simulation system; the components constituting various types of hydrogen fuel cells are divided into actuator type, cavity type and electrical type according to their functions, and the corresponding component category codes are set respectively to distinguish them in the data transmission and simulation calculation between the human-machine interaction end, the database end and the simulation model end;

[0010] The connection relationship between the components is determined by connecting the components through the wiring between the component interfaces. The component interfaces include four types: input end, output end, receiving end and transmitting end. The input end and the output end are used for the transmission of fluid media, and the receiving end and the transmitting end are used for the transmission of analog or digital electrical signals.

[0011] In the component model setting, the component model is divided into a component model model, a component theoretical model and a self-built component model, wherein the component model model is a component model calibrated for a specific product model, the component theoretical model is a theoretical model established according to the component structure and working principle, and the self-built component model is divided into two types, one is the user's own experimental data, and the other is the component model developed by the user; different types of component models are distinguished by codes;

[0012] The component model parameter input, in the component model, the user needs to complete the input of the initial value parameters; in the component theoretical model, the user needs to complete the input of the component structure parameters and initial value parameters; in the self-built component model, the user completes the input of its component structure and initial value parameters, and realizes the parameter update through the interface between the self-built component model and the system framework;

[0013] The component model parameter input also includes the input of the simulation environment parameters of the fuel cell system such as the simulation duration, simulation step length, initial simulation environment temperature, initial relative humidity of the gas, initial mole fraction of hydrogen in the simulation environment component, and the setting of the simulation system import or export boundary environment parameters in the boundary environment component;

[0014] The database end is used, on the one hand, to store the digitized and symbolized fuel cell system simulation model and system simulation environment parameters established by the human-computer interaction end; on the other hand, the database end is used to store the fuel cell system performance simulation data completed by the simulation model end;

[0015] The simulation model end is a simulation program for realizing fuel cell system performance simulation, which is divided into: a framework program and a component model function program according to the function of the program; the component model function program includes a component model model function program, a component theoretical model function program and a user-built component model function program; according to the functions of the fuel cell system components, the component model function program is further divided into an actuator component function program, a cavity component function program and an electrical component function program.

[0016] In the above technical solution, the various types of hydrogen fuel cell libraries of the second level of the human-machine interaction end component library include: proton exchange membrane fuel cell library, solid oxide fuel cell library, phosphate fuel cell library and alkaline fuel cell library, etc.

[0017] In the above technical solution, the human-computer interaction terminal is a software interface on the local computer or a browser based on the Internet.

[0018] In the above technical scheme, during the component interface connection process, according to the principle that the input and output ends of the actuator-type components should be connected to the cavity-type components, and the receiving end or the transmitting end should be connected to the electrical components; the input and output ends of the cavity-type components need to be connected to the actuator-type components or the boundary environment components, and the receiving end or the transmitting end should be connected to the electrical components, the component category code is applied to check the connection relationship between the components, and an error prompt is given for the wrong connection relationship between the components; on the premise that the connection relationship between the components is correct, the simulation environment component is numbered 1, the boundary environment component is numbered 2, and the remaining components are numbered according to their positions, in order from left to right and from top to bottom, starting from the last boundary environment component number + 1, and then the connection relationship between the components is determined according to the number of the components connected to the input and output ends of each component.

[0019] In the above technical scheme, the naming method of the component model is: FC_Hydrogen fuel cell type_Subsystem name_Component name_Model; the naming method of the component theoretical model is: FC_Hydrogen fuel cell type_Subsystem name_Component name; the component model distinction code in the system environment component library is 00, the simulation environment model name is unified as: FC_Hydrogen fuel cell type_Env_Sim, and the boundary environment model name is unified as: FC_Hydrogen fuel cell type_Env_Bou.

[0020] In the above technical solution, the digitized and symbolic fuel cell system simulation model and system simulation environment parameters established by the human-computer interaction terminal are stored in the following formats: component number, component category code, component model name or self-built component model name, model type distinction code, component input terminal connection component number, component output terminal connection component number, component receiving terminal connection component number, component sending terminal connection component number, component model parameters; wherein when there are multiple component input, output, receiving or sending terminal connection component numbers and component model parameters, different component numbers or component model parameters are separated by spaces.

[0021] In the above technical scheme, the fuel cell system performance simulation data simulated by the simulation model end is stored in the following format: simulation time, component number 1 input performance simulation data, component number 1 output performance simulation data, component number 2 output performance simulation data, component number 3 output performance simulation data... component number N input performance simulation data, component number N output performance simulation data.

[0022] In the above technical scheme, the naming rule of the component model function program is: Fun_subsystem name_component name_model, and the naming rule of the component theoretical model function program is: Fun_subsystem name_component name. The user-built component model function program is developed using Python, C language or Simulink, and the name of the self-built component model is the corresponding function model name.

[0023] In the above technical solution, the input parameter format in the actuator component function program is: simulation time step, temperature, inlet medium pressure, outlet medium pressure, relative humidity of gas, mole fraction of hydrogen, model's own parameter list, wherein the model's own parameter list is a list of parameters that ensure the operation of the actuator component model function program;

[0024] The output parameter format in the actuator component function program is: outlet medium mass flow, temperature, relative humidity of gas, mole fraction of hydrogen, model-specific parameter list, wherein the model-specific parameter list is a list consisting of the value of the next simulation time step of each parameter in the model-specific parameter list of the input parameters in the actuator component function program, so the model-specific parameter list in the output parameter should be strictly consistent with the model-specific parameter list in the input parameter in terms of parameter type and parameter order;

[0025] The input parameter format of the cavity component function program is: simulation time step, temperature, inlet medium mass flow rate, outlet medium mass flow rate, gas relative humidity, hydrogen mole fraction, model own parameter list, wherein the model own parameter list is a list of unique parameters that ensure the operation of the cavity component model function program;

[0026] The output parameter format in the cavity component function program is: cavity medium pressure, temperature, relative humidity of gas, mole fraction of hydrogen, and model-specific parameter list of the component, wherein the model-specific parameter list is a list composed of the value of the next simulation time step of each parameter in the model-specific parameter list of the input parameters in the cavity component function program. Therefore, the model-specific parameter list of the output parameters should be strictly consistent with the model-specific parameter list of the input parameters in terms of parameter type and parameter order.

[0027] In the above technical solution, the framework program is the main program of the simulation model end, and the steps of simulating the fuel cell system model established at the human-computer interaction end are as follows:

[0028] Step 1. Initialization, define 14 empty lists, namely: value is used to store the performance data of each component model in a cycle step. The performance data of actuator components is mass flow, and the performance data of cavity components is medium pressure; record_value is used to record the performance data of each component model in each cycle step; own_parameters is used to store the model's own parameter list corresponding to each component model function program in a cycle step; record_own_parameters is used to record the model's own parameter list corresponding to each component model function program in each cycle step; record_t is used to record the simulation time in each cycle step; model_data is used to store the fuel cell system data read from the database; record_fc_am_temp is used to record each The simulation environment temperature of each component in each cycle step; record_humd_H2 is used to record the relative humidity of the gas in each component in each cycle step; record_mole_fraction_H2 is used to record the mole fraction of hydrogen in each component in each cycle step; model_name is used to store the component model function name, component number, component category code and model type distinguishing code in the order of component number; in_number is used to store the number of the component connected to the input end of the component in the order of component number; out_number is used to store the number of the component connected to the output end of the component in the order of component number; receive_number is used to store the number of the component connected to the receiving end of the component in the order of component number; send_number is used to store the number of the component connected to the sending end of the component in the order of component number;

[0029] Step 2. Connect to the database end, read the fuel cell system data established by the human-computer interaction end stored in the database end, and store the simulation environment component data in the system_data tuple according to the component numbering sequence, and store the remaining component data in the model_data tuple according to the component numbering sequence;

[0030] Step 3. For the component model parameter data in the system_data tuple, apply Python's built-in split function to split the data according to the spaces between the component model parameters, and then assign the values ​​to the corresponding variables or lists respectively to complete the setting of the corresponding variables in the simulation environment;

[0031] Step 4. Traverse the model_data tuple, apply Python's built-in split function to its component model name or self-built component model name data, split the data according to the "_" between the component model parameters, and combine the data with an index greater than or equal to 2 with the "Fun" sequence through "_" to form the component model function name; then store it in the model_name list together with the component number, component category code and model type distinguishing code in the model_data tuple;

[0032] Step 5. Traverse the model_name list, determine the component model settings according to its component model function name, and obtain the component model parameter data in the model_data tuple according to the component number, apply the Python built-in split function, and split the data according to the component input, output, receiving or sending end connection component number and the space between the component model parameters, and then assign the component input connection component number to the in_number list; the output connection component number is assigned to the out_number list; the receiving end connection component number is assigned to the receive_number list; the sending end connection component number is assigned to the send_number list; the performance data of the component model is assigned to the value list, the performance data of the actuator type component is mass flow, and the performance data of the cavity type component is medium pressure; the model's own parameter list of each component model function program is assigned to the own_parameters list;

[0033] Step 6. Use Python's for loop statement and Python's built-in range() function to start the simulation loop. The simulation start time is t_start, the simulation end time is t_end, and the simulation step length is derta_t. In each loop step, use Python's for loop statement to traverse the component number data in the model_name list and start the performance simulation of each component.

[0034] During the simulation, the locals function is used to directly call the component model function through the component model function name data in the model_name list; the return value of the component model simulation is assigned to return_value;

[0035] Step7. According to the return value return_value of the component model function program, complete the update and recording of the performance parameter values ​​such as value, record_value, own_parameters, record_own_parameters, fc_am_temp, record_fc_am_temp, humd_H2, record_humd_H2, mole_fraction_H2 and record_mole_fraction_H2. After the update and recording data operations are completed, write the simulation time t and performance data return_value[0] in real time into the table named with the component "component model function name" on the database side, and then return to Step6 until the simulation end time t_end is reached;

[0036] Step8. After all simulations are completed, connect to the database and write record_value, record_own_parameters, record_fc_am_temp, record_humd_H2 and record_mole_fraction_H2 to the database.

[0037] Compared with the prior art, the present invention has the following beneficial effects:

[0038] The present invention provides a framework implementation method for hydrogen fuel cell diversified structure modeling and simulation technology, including: overall framework structure design, human-computer interaction end hydrogen fuel cell system simulation model digitization and symbolization method, database end data formatting storage and simulation model end to achieve diversified fuel cell system structure performance simulation technology and steps. The implementation method can effectively solve the problem that the self-established hydrogen fuel cell system simulation model is not suitable for diversified system structures and has poor versatility and practicality, and achieves modeling and simulation of diversified structures of hydrogen fuel cells, providing technical support for diversified research and design of fuel cell systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 Shown is the framework structure of the hydrogen fuel cell diversified structure modeling and simulation technology.

[0040] Figure 2 Shown is the structure diagram of the human-computer interaction component library.

[0041] Figure 3 Shown is the connection relationship and numbering between the components in Example 1.

[0042] Figure 4 The figure shows the hydrogen path simulation model established in Example 1, which is stored in the database.

[0043] Figure 5 The figure shows the storage of component performance data in the database during the performance simulation process in Example 3.

[0044] Figure 6 Shown is a flow chart for simulating fuel cell system performance on the simulation model side. DETAILED DESCRIPTION

[0045] A modeling and simulation method suitable for diversified hydrogen fuel cell systems, including a human-computer interaction end, a database end, and a simulation model end (see Appendix Figure 1 ), the following is a performance simulation process of a hydrogen path in a proton exchange membrane fuel cell as an example, and the present invention is further described in detail in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0046] Example 1

[0047] The human-computer interaction terminal is a graphical interface for users to complete the establishment of a fuel cell system simulation model and display simulation results. It can be either a software interface on the local computer or a browser based on the Internet.

[0048] Step 1: The proton exchange membrane fuel cell library of the component library of the human-computer interaction end includes the stack component library, hydrogen circuit component library, air circuit component library, thermal management circuit component library, electrical component library, auxiliary component library and boundary environment module (see Appendix Figure 2 ), the components contained in each component library and the component category codes are shown in the following table.

[0049]

[0050]

[0051] First, in the stack component library, hydrogen circuit component library, auxiliary component library and system environment component library of the proton exchange membrane fuel cell library, complete the selection of components of this embodiment. The components in this hydrogen circuit embodiment mainly include: hydrogen cylinder, pressure reducing valve, connecting pipeline, electromagnetic stop valve, stack anode, boundary environment and simulation environment. Among them, the pressure reducing valve, electromagnetic stop valve and hydrogen exhaust valve are actuators, and the component category code is 1; the hydrogen cylinder, connecting pipeline and stack anode are cavity types, and the component category code is 0; the component category code of the boundary environment and simulation environment is 3.

[0052] Step 2: During the component interface connection process, according to the principle that the input and output ends of actuator-type components should be connected to cavity-type components, and the receiving or transmitting ends should be connected to electrical components; the input and output ends of cavity-type components need to be connected to actuator-type components or boundary environment components, and the receiving or transmitting ends should be connected to electrical components, the component category code is applied to check the connection relationship between components, and error prompts are given for incorrect connection relationships between components; on the premise that the connection relationship between components is correct, the components are numbered from 1 from left to right and from top to bottom according to their positions, and then the connection relationship between components is determined according to the number of the components connected to the input and output ends of each component. The connection relationship and numbering between components in this embodiment are as follows: Figure 3 shown.

[0053] Step 3: Component model setting and parameter input. In this embodiment, the hydrogen cylinder is selected as the component theoretical model, the distinguishing code is: 1, the model name is: FC_PEMFC_Anode_HST, and the input parameters are: hydrogen pressure in the hydrogen cylinder = 75MPa; hydrogen cylinder volume = 140e6mm 3 ; The pressure reducing valve is selected as the component model, the distinguishing code is: 0, the model name is: FC_PEMFC_Anode_HPR_RS2, and the input parameters are: initial mass flow rate = 0kg / s; medium target pressure = 1MPa; the connecting pipeline is selected as the component theoretical model, the distinguishing code is: 1, the model name is: FC_PEMFC_Auxiliary_Pipe, and the input parameters are: initial hydrogen pressure = 1MPa; total pipeline volume = 1e6 mm 3 ; The electromagnetic stop valve is selected as the component theoretical model, the distinction code is: 1, the model name is: FC_PEMFC_Anode_COV, and the input parameters are: initial mass flow rate = 0kg / s; initial control chamber pressure = 1MPa, initial pilot (control) valve core displacement = 0mm, initial pilot (control) valve core movement speed = 0mm / s, initial stop valve core displacement = 0mm, initial stop valve core movement speed = 0mm / s, pilot (control) valve core spring pre-compression = 3mm, stop valve core spring pre-compression = 1.5mm, pilot (control) valve core maximum lift = 2.6mm, stop valve core maximum lift = 1.5mm, pilot (control) valve minimum air gap = 0.5mm, pilot (control) valve core spring stiffness = 30N / mm, stop valve core spring stiffness = 1.3N / mm, pilot (control) valve assembly mass = 0.04kg, stop valve core assembly mass = 0.2kg, control chamber volume = 426mm 3, control chamber inlet radius = 0.3 mm, control chamber outlet radius = 1 mm, stop valve outlet radius = 3 mm, stop valve conduit inner radius = 5.35 mm; the stack anode is selected as the component theoretical model, the distinction code is: 1, the model name is: FC_PEMFC_Stack_Anode, the input parameters are: initial hydrogen pressure = 1 MPa; anode total volume = 70e6 mm 3 ; The hydrogen exhaust valve is selected as the component model, the distinguishing code is: 0, the model name is: FC_PEMFC_Anode_HEV_H1, and the input parameters are: initial mass flow rate = 0kg / s; medium flow area = 5mm 2 ; The boundary environment component does not need to set the component model, the distinction code is: 00, the model name is: FC_PEMFC_Env_Bou, and the input parameters are: environmental medium pressure = 0.1MPa; The simulation environment component does not need to set the component model, the distinction code is: 00, the model name is: FC_PEMFC_Env_Sim, and the input parameters are: simulation start time = 0s; simulation end time = 50s, simulation time step = 0.0001s, fuel cell system working environment temperature = 293.15k, hydrogen mole fraction = 1, gas relative humidity = 0.

[0054] Step 4: Display of component model performance simulation data. During the fuel cell system simulation, the human-computer interaction terminal can read the performance simulation data in the table named "component model function name" on the database side in real time ( Figure 5 ) and display it in real time on the human-computer interaction terminal.

[0055] Example 2

[0056] On the one hand, the database end is used to store the parameters of the digitized and symbolized fuel cell system simulation model established by the human-computer interaction end, and the storage format is as follows: component number, component category code, component model name or self-built component model name, model type distinction code, component input end connection component number, component output end connection component number, component receiving end connection component number, component sending end connection component number, component model parameters. When there are multiple numbers of component input, output, receiving or sending end connection components and component model parameters, different component numbers or component model parameters are separated by "spaces", and when the parameters of certain items do not exist, they are represented by N. The hydrogen path simulation model established in Example 1 is stored in the database end data as follows: Figure 4 shown.

[0057] The database end is used to store the fuel cell system performance simulation data completed by the simulation model end, and the storage format is: sequence number, simulation time, performance data, such as Figure 5 shown.

[0058] Example 3

[0059] The simulation model end is a simulation program for realizing the performance simulation of the fuel cell system, which is divided into: a framework program and a component model function program according to the function of the program.

[0060] In the component function program, according to the functions of the fuel cell system components, the component model function program is divided into an actuator component function program, a cavity component function program and an electrical component function program.

[0061] In the hydrogen path simulation model established in Example 1, the hydrogen cylinder belongs to a cavity-type component and adopts a component theoretical model. Therefore, the name of its component model function program is: Fun_Anode_HST. According to the input and output parameter format in the cavity-type component function program, its input parameter statement is: def Fun_Anode_HST(derta_t,fc_am_Temp,fc_Anode_HST_In_Mass_flow_H2,fc_Anode_HST_Out_Mass_flow_H2,humd_H2,mole_fraction_H2,own_parameters), and the output parameter statement is: return fc_Anode_HST_Pres,fc_am_Temp,humd_H2,mole_fraction_H2,own_parameters.

[0062] The pressure reducing valve belongs to the actuator component and adopts the component model, so its component model function name is: Fun_Anode_HPR_RS2. According to the input and output parameter format in the actuator component function program, its input parameter statement is: def Fun_Anode_HPR_RS2(derta_t,fc_am_Temp,fc_Anode_HPR_In_Pres,fc_Anode_HPR_Out_Pres,humd_H2,mole_fraction_H2,own_parameters), and the output parameter statement is: return fc_Anode_HPR_Mass_flow_H2,fc_am_Temp,humd_H2,mole_fraction_H2,own_parameters.

[0063] The connecting pipe belongs to the cavity component and adopts the component theoretical model. Therefore, the name of its component model function program is: Fun_Auxiliary_Pipe. According to the input and output parameter format in the cavity component function program, its input parameter statement is: def Fun_Auxiliary_Pipe(derta_t,fc_am_Temp,fc_Auxiliary_Pipe_In_Mass_flow_H2,fc_Auxiliary_Pipe_Out_Mass_flow_H2,humd_H2,mole_fraction_H2,own_parameters), and the output parameter statement is: return fc_Auxiliary_Pipe_Pres,fc_am_Temp,humd_H2,mole_fraction_H2,own_parameters.

[0064] The solenoid stop valve belongs to the actuator component and adopts the component theoretical model, so its component model function name is: Fun_Anode_COV. According to the input and output parameter format in the actuator component function program, its input parameter statement is: def Fun_Anode_COV(derta_t,fc_am_Temp,fc_Anode_COV_In_Pres,fc_Anode_COV_Out_Pres,humd_H2,mole_fraction_H2,own_parameters), and the output parameter statement is: returnfc_Anode_COV_Mass_flow_H2,fc_am_Temp,humd_H2,mole_fraction_H2,own_parameters.

[0065] The stack anode belongs to a cavity component and adopts a component theoretical model. Therefore, the name of its component model function program is: Fun_Stack_Anode. According to the input and output parameter format in the cavity component function program, its input parameter statement is: def Fun_Stack_Anode(derta_t,fc_am_Temp,fc_Stack_Anode_In_Mass_flow_H2,fc_Stack_Anode_Out_Mass_flow_H2,humd_H2,mole_fraction_H2,own_parameters), and the output parameter statement is: return fc_Stack_Anode_Pres,fc_am_Temp,humd_H2,mole_fraction_H2,own_parameters.

[0066] The hydrogen exhaust valve belongs to the actuator component and adopts the component model, so its component model function name is: Fun_Anode_HEV_H1. According to the input and output parameter format in the actuator component function program, its input parameter statement is: def Fun_Anode_HEV_H1(derta_t,fc_am_Temp,fc_Anode_HEV_In_Pres,fc_Anode_HEV_Out_Pres,humd_H2,mole_fraction_H2,own_parameters), and the output parameter statement is: returnfc_Anode_HEV_Mass_flow_H2,fc_am_Temp,humd_H2,mole_fraction_H2,own_parameters.

[0067] The framework program is the main program of the simulation model end, which is developed in Python language. The steps and implementation techniques for implementing the performance simulation of the hydrogen path simulation model established in Example 1 are as follows:

[0068] Step 1. Initialize and define 14 empty lists. The specific implementation statements are as follows:

[0069] value=[]#Used to store the performance data of each component model in a cycle step. The performance data of actuator components is mass flow, and the performance data of cavity components is medium pressure;

[0070] record_value = [] # Used to record the performance data of each component model in each cycle step;

[0071] own_parameters = [] # used to store the "model own parameter list" unique to each component model function program in a loop step;

[0072] record_own_parameters = [] # Used to record the "model own parameter list" unique to each component model function program in each loop step;

[0073] record_t=[]#Used to record the simulation time in each cycle step;

[0074] model_data = [] # used to store the fuel cell system data read from the database;

[0075] record_fc_am_temp=[]#Used to record the simulation environment temperature of each component in each cycle step;

[0076] record_humd_H2=[]#Used to record the relative humidity of the gas in each component in each cycle step;

[0077] record_mole_fraction_H2=[]#Used to record the mole fraction of hydrogen in each component in each cycle step;

[0078] model_name = [] # used to store the component model function name, component number, component category code and model type distinguishing code in the order of component numbers;

[0079] in_number = [] # used to store the numbers of the components connected to the component input terminals in the order of component numbers;

[0080] out_number = [] # used to store the numbers of the components connected to the output end of the component in the order of the component numbers;

[0081] receive_number=[]# used to store the numbers of the connected components at the component receiving end in the order of component numbers;

[0082] send_number = [] # used to store the numbers of the components connected to the component sending end in the order of component numbers;

[0083] Step 2. Connect to the database end, read the hydrogen path simulation model data established in Example 1 at the human-computer interaction end stored in the database end, and store the simulation environment component data in the system_data tuple according to the component numbering sequence, and store the data of the remaining components in the model_data tuple according to the component numbering sequence.

[0084] Step 3. For the "component model parameter" data in the system_data tuple, apply Python's built-in split function to split the data according to the "spaces" between the component model parameters, and then assign the values ​​to the corresponding variables or lists respectively.

[0085] The implementation statement is:

[0086] a=system_data[-1].split(”)#Split the data according to the “spaces” between component model parameters

[0087] t_start = float (a [0]) # simulation start time, unit: s

[0088] t_end=float(a[1])#Simulation end time, unit: s

[0089] derta_t = float(a[2]) #Simulation step length, unit: s

[0090] fc_am_Temp=[float(a[3])for_in range(model_data[-1][0]-2)]#Set the initial working environment temperature of the component, unit: K

[0091] mole_fraction_H2 = [float(a[4])for_in range(model_data[-1][0]-2)] #Set the initial mole fraction of hydrogen in the component

[0092] humd_H2 = [float(a[5])for_in range(model_data[-1][0]-2)] #Set the initial relative humidity of the gas in the component

[0093] Step 4. Traverse the model_data tuple, and apply Python's built-in split function to its "component model name or self-built component model name" data, split the data according to the "_" between the component model parameters, and combine the data with an index greater than or equal to 2 with the "Fun" sequence through "_" to form the component model function name. Then store it in the model_name list together with the "component number", "component category code" and "model type distinction code" in the model_data tuple. The implementation statement is:

[0094]

[0095]

[0096] Step 5. Traverse the model_name list, determine the component model settings according to its "component model function name", and obtain the "component model parameter" data in the model_data tuple according to the "component number", and apply Python's built-in split function to split the data according to the component input, output, receiving or sending end connection component number and the "space" between the component model parameters, and then assign the component input connection component number to the in_number list; the output connection component number is assigned to the out_number list; the receiving end connection component number is assigned to the receive_number list; the sending end connection component number is assigned to the send_number list; the performance data of the component model is assigned to the value list, the performance data of the actuator component is the mass flow rate, and the performance data of the cavity component is the medium pressure; the "model own parameter list" unique to each component model function program is assigned to the own_parameters list.

[0097] The implementation statement of this step is:

[0098] for a in range(len(model_name)):#Traverse the model_name list

[0099] b = model_data[a][-1].split(”)# Split the data

[0100] value.append(float(b[0]))#Assign the performance data of the component model to the value list

[0101] own_parameters.append([float(num)for numin list(b)])#Each component model function program's unique "model own parameter list" is assigned to the own_parameters list

[0102] in_number.append(model_data[a][4].split(”))#Store the numbers of the components connected to the component input terminal in the order of the component numbers;

[0103] out_number.append(model_data[a][5].split(”))#Store the numbers of the components connected to the output end of the component in the order of the component numbers;

[0104] receive_number.append(model_data[a][6].split(”))#Store the numbers of the connected components at the receiving end of the component in the order of the component numbers;

[0105] send_number.append(model_data[a][7].split(”))#Store the numbers of the components connected to the sending end of the component in the order of the component numbers;

[0106] Step 6. Use Python's "for" loop statement and Python's built-in range() function to start the simulation loop. The simulation start time is: t_start, the simulation end time is: t_end, and the simulation step length is: derta_t. In each loop step, use Python's "for" loop statement to traverse the component number data in the model_name list and start the performance simulation of each component.

[0107] During the simulation, the locals function is used to directly call the component model function through the "component model function name" data in the model_name list. The return value of the component model simulation is assigned to return_value.

[0108]

[0109]

[0110] Step7. According to the return value return_value of the component model function program, complete the update and recording of the performance parameter values ​​such as value, record_value, own_parameters, record_own_parameters, fc_am_temp, record_fc_am_temp, humd_H2, record_humd_H2, mole_fraction_H2 and record_mole_fraction_H2. After the update and recording data operations are completed, write the simulation time t and performance data return_value[0] in real time into the table named with the "component model function name" of the component on the database side, and then return to Step6 until the simulation end time t_end is reached.

Claims

1. A modeling and simulation method suitable for a diversified hydrogen fuel cell system, characterized in that: Including human-computer interaction end, database end and simulation model end; The human-computer interaction terminal is a graphical interface for users to complete the establishment of a fuel cell system simulation model and display simulation results; The fuel cell system simulation model of the human-computer interaction end is established, and the user selects the fuel cell system components in the human-computer interaction end component library, and then determines the connection relationship between the selected components, sets the component model, inputs the component model parameters, and completes the establishment of the simulation model. Finally, the fuel cell system simulation model established by the user is digitized and symbolized, and saved in a fixed format in the database end; The human-machine interaction end component library is a four-level structure, wherein the first level is the human-machine interaction end component library, the second level is various types of hydrogen fuel cell libraries, the third level is the component library of each component system contained in the various types of hydrogen fuel cell libraries, the auxiliary component library and the system environment component library, and the fourth level is the component library of each component system, the auxiliary component library and the corresponding components contained in the system environment component library, wherein the components in the system environment component library include simulation environment and boundary environment, the simulation environment component is used for setting the overall simulation environment of the system, and the boundary environment component is used for setting the import or export boundary environment of the simulation system; the components constituting various types of hydrogen fuel cells are divided into actuator type, cavity type and electrical type according to their functions, and the corresponding component category codes are set respectively to distinguish them in the data transmission and simulation calculation between the human-machine interaction end, the database end and the simulation model end; The connection relationship between the components is determined by connecting the components through the wiring between the component interfaces. The component interfaces include four types: input end, output end, receiving end and transmitting end. The input end and the output end are used for the transmission of fluid media, and the receiving end and the transmitting end are used for the transmission of analog or digital electrical signals. In the component model setting, the component model is divided into a component model model, a component theoretical model and a self-built component model, wherein the component model model is a component model calibrated for a specific product model, the component theoretical model is a theoretical model established according to the component structure and working principle, and the self-built component model is divided into two types, one is the user's own experimental data, and the other is the component model developed by the user; different types of component models are distinguished by codes; The component model parameter input, in the component model, the user needs to complete the input of the initial value parameters; in the component theoretical model, the user needs to complete the input of the component structure parameters and initial value parameters; in the self-built component model, the user completes the input of its component structure and initial value parameters, and realizes the parameter update through the interface between the self-built component model and the system framework; The component model parameter input also includes the input of the simulation environment parameters of the fuel cell system such as the simulation duration, simulation step length, initial simulation environment temperature, initial relative humidity of the gas, initial mole fraction of hydrogen in the simulation environment component, and the setting of the simulation system import or export boundary environment parameters in the boundary environment component; The database end is used, on the one hand, to store the digitized and symbolized fuel cell system simulation model and system simulation environment parameters established by the human-computer interaction end; on the other hand, the database end is used to store the fuel cell system performance simulation data completed by the simulation model end; The simulation model end is a simulation program for realizing fuel cell system performance simulation, which is divided into: a framework program and a component model function program according to the function of the program; the component model function program includes a component model model function program, a component theoretical model function program and a user-built component model function program; according to the functions of the fuel cell system components, the component model function program is further divided into an actuator component function program, a cavity component function program and an electrical component function program.

2. The modeling and simulation method for a diversified hydrogen fuel cell system according to claim 1, characterized in that: The various types of hydrogen fuel cell libraries of the second level of the human-machine interaction terminal component library include: proton exchange membrane fuel cell library, solid oxide fuel cell library, phosphate fuel cell library and alkaline fuel cell library, etc.

3. The modeling and simulation method for a diversified hydrogen fuel cell system according to claim 1, characterized in that: The human-computer interaction terminal is a software interface on the local computer or a browser based on the Internet.

4. The modeling and simulation method for a diversified hydrogen fuel cell system according to claim 1, characterized in that: During the component interface connection process, according to the principle that the input and output ends of actuator-type components should be connected to cavity-type components, and the receiving or transmitting ends should be connected to electrical components; the input and output ends of cavity-type components need to be connected to actuator-type components or boundary environment components, and the receiving or transmitting ends should be connected to electrical components, the component category code is applied to check the connection relationship between components, and an error prompt is given for the incorrect connection relationship between components; on the premise that the connection relationship between components is correct, the simulation environment component is numbered 1, the boundary environment component is numbered 2, and the remaining components are numbered according to their positions, from left to right, from top to bottom, starting from the last boundary environment component number + 1, and then the connection relationship between components is determined according to the number of the components connected to the input and output ends of each component.

5. The modeling and simulation method for a diversified hydrogen fuel cell system according to claim 4, characterized in that: The naming method of the component model is: FC_Hydrogen fuel cell type_Subsystem name_Component name_Model; the naming method of the component theoretical model is: FC_Hydrogen fuel cell type_Subsystem name_Component name; the component model distinction code in the system environment component library is 00, the simulation environment model name is unified as: FC_Hydrogen fuel cell type_Env_Sim, and the boundary environment model name is unified as: FC_Hydrogen fuel cell type_Env_Bou.

6. The modeling and simulation method for a diversified hydrogen fuel cell system according to claim 5, characterized in that: The digitized and symbolic fuel cell system simulation model and system simulation environment parameters established by the human-computer interaction terminal are stored in the following formats: component number, component category code, component model name or self-built component model name, model type distinction code, component input terminal connection component number, component output terminal connection component number, component receiving terminal connection component number, component sending terminal connection component number, component model parameters; wherein when there are multiple component input, output, receiving or sending terminal connection component numbers and component model parameters, different component numbers or component model parameters are separated by spaces.

7. The modeling and simulation method for a diversified hydrogen fuel cell system according to claim 6, characterized in that: The fuel cell system performance simulation data simulated by the simulation model end is stored in the following format: simulation time, component number 1 input performance simulation data, component number 1 output performance simulation data, component number 2 output performance simulation data, component number 3 output performance simulation data... component number N input performance simulation data, component number N output performance simulation data.

8. The modeling and simulation method for a diversified hydrogen fuel cell system according to claim 7, characterized in that: The naming rule of the component model function program is: Fun_subsystem name_component name_model, and the naming rule of the component theoretical model function program is: Fun_subsystem name_component name. User-built component model function programs are developed using Python, C language or Simulink, and the name of the self-built component model is the corresponding function model name.

9. The modeling and simulation method for a diversified hydrogen fuel cell system according to claim 8, characterized in that: The input parameter format of the actuator component function program is: simulation time step, temperature, inlet medium pressure, outlet medium pressure, relative humidity of gas, mole fraction of hydrogen, model's own parameter list, wherein the model's own parameter list is a list of parameters that ensure the operation of the actuator component model function program; The output parameter format in the actuator component function program is: outlet medium mass flow, temperature, relative humidity of gas, mole fraction of hydrogen, model-specific parameter list, wherein the model-specific parameter list is a list consisting of the value of the next simulation time step of each parameter in the model-specific parameter list of the input parameters in the actuator component function program, so the model-specific parameter list in the output parameter should be strictly consistent with the model-specific parameter list in the input parameter in terms of parameter type and parameter order; The input parameter format of the cavity component function program is: simulation time step, temperature, inlet medium mass flow rate, outlet medium mass flow rate, gas relative humidity, hydrogen mole fraction, model own parameter list, wherein the model own parameter list is a list of unique parameters that ensure the operation of the cavity component model function program; The output parameter format in the cavity component function program is: cavity medium pressure, temperature, relative humidity of gas, mole fraction of hydrogen, and model-specific parameter list of the component, wherein the model-specific parameter list is a list composed of the value of the next simulation time step of each parameter in the model-specific parameter list of the input parameters in the cavity component function program. Therefore, the model-specific parameter list of the output parameters should be strictly consistent with the model-specific parameter list of the input parameters in terms of parameter type and parameter order.

10. The modeling and simulation method applicable to a diversified hydrogen fuel cell system according to claim 9, characterized in that: The framework program is the main program of the simulation model end, and the steps of simulating the fuel cell system model established at the human-computer interaction end are as follows: Step1. Initialization, define 14 empty lists, namely: value is used to store the performance data of each component model in a cycle step. The performance data of actuator components is mass flow, and the performance data of cavity components is medium pressure; record_value is used to record the performance data of each component model in each cycle step; own_parameters is used to store the model's own parameter list corresponding to each component model function program in a cycle step; record_own_parameters is used to record the model's own parameter list corresponding to each component model function program in each cycle step; record_t is used to record the simulation time in each cycle step; model_data is used to store the fuel cell system data read from the database; record_fc_am_temp is used to record the simulation environment temperature of each component in each cycle step; record_humd_H2 is used to record the relative humidity of the gas in each component in each cycle step; record_mole_fraction_H2 is used to record the mole fraction of hydrogen in each component in each cycle step; model_name is used to store the component model function name, component number, component category code and model type distinguishing code in the order of component number; in_number is used to store the number of the component connected to the input end of the component in the order of component number; out_number is used to store the number of the component connected to the output end of the component in the order of component number; receive_number is used to store the number of the component connected to the receiving end of the component in the order of component number; send_number is used to store the number of the component connected to the sending end of the component in the order of component number; Step 2. Connect to the database end, read the fuel cell system data established by the human-computer interaction end stored in the database end, and store the simulation environment component data in the system_data tuple according to the component numbering sequence, and store the remaining component data in the model_data tuple according to the component numbering sequence; Step 3. For the component model parameter data in the system_data tuple, apply Python's built-in split function to split the data according to the spaces between the component model parameters, and then assign the values ​​to the corresponding variables or lists respectively to complete the setting of the corresponding variables in the simulation environment; Step 4. Traverse the model_data tuple, apply Python's built-in split function to its component model name or self-built component model name data, split the data according to the "_" between the component model parameters, and combine the data with index greater than or equal to 2 with the "Fun" sequence through "_" to form the component model function name; then store it in the model_name list together with the component number, component category code and model type distinguishing code in the model_data tuple; Step 5. Traverse the model_name list, determine the component model settings according to its component model function name, and obtain the component model parameter data in the model_data tuple according to the component number, apply the Python built-in split function, and split the data according to the component input, output, receiving or sending end connection component number and the space between the component model parameters, and then assign the component input connection component number to the in_number list; the output connection component number is assigned to the out_number list; the receiving end connection component number is assigned to the receive_number list; the sending end connection component number is assigned to the send_number list; the performance data of the component model is assigned to the value list, the performance data of the actuator type component is mass flow, and the performance data of the cavity type component is medium pressure; the model's own parameter list of each component model function program is assigned to the own_parameters list; Step 6. Use Python's for loop statement and Python's built-in range() function to start the simulation loop. The simulation start time is t_start, the simulation end time is t_end, and the simulation step length is derta_t. In each loop step, use Python's for loop statement to traverse the component number data in the model_name list and start the performance simulation of each component. During the simulation, the locals function is used to directly call the component model function through the component model function name data in the model_name list; the return value of the component model simulation is assigned to return_value; Step7. According to the return value return_value of the component model function program, complete the update and recording of the performance parameter values ​​such as value, record_value, own_parameters, record_own_parameters, fc_am_temp, record_fc_am_temp, humd_H2, record_humd_H2, mole_fraction_H2 and record_mole_fraction_H2. After the update and recording data operations are completed, write the simulation time t and performance data return_value[0] in real time into the table named with the component "component model function name" on the database side, and then return to Step6 until the simulation end time t_end is reached; Step8. After all simulations are completed, connect to the database and write record_value, record_own_parameters, record_fc_am_temp, record_humd_H2 and record_mole_fraction_H2 to the database.

Citation Information

Cited By

  • Simulation method of hydrogen fuel cell in vehicle performance simulation model and model

    CN121189016A