Historical simulation result-based thermal hydraulic model initialization assignment device and method suitable for Modelica specification
Through the thermal hydraulic model initialization device based on historical simulation results, the self-consistent problem of the initialization parameter field of the complex thermal hydraulic system model under the Modelica specification is solved, efficient and interference-free staged initialization is achieved, and simulation efficiency and quality are improved.
Patent Information
- Application Number
- CN202510469785.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2025-08-15
AI Technical Summary
In the initialization process of complex thermal hydraulic system models based on Modelica, the prior art is difficult to ensure the self-consistentness of the initialization parameters of model components in the physical and spatial dimensions, resulting in the self-consistentness of the initialization parameter field, and the mutual interference between model components is difficult to avoid, affecting simulation efficiency and convergence.
The thermal hydraulic model initialization device based on historical simulation results is adopted, including the thermal hydraulic system topology generation module, the basic node unit data container module, the historical simulation result storage module and the initialization parameter reading and writing module. Through planarization processing and data container storage, the self-consistent initialization parameter assignment of model components is realized, and phased initialization is supported.
It effectively solves the problem of initialization parameter field assignment of complex configuration multi-condition thermal hydraulic system models, improves the efficiency and quality of initialization, avoids mutual interference between model components, and realizes an initial variable parameter field that is closer to the expected.
Smart Images

Figure CN120493778A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of thermal hydraulic technology, and in particular relates to a thermal hydraulic model initialization and assignment device and method based on historical simulation results applicable to Modelica specifications. Background Art
[0002] During the transient modeling and simulation of complex thermal-hydraulic systems based on Modelica, the initialization of variable parameters for each basic node element of the thermal-hydraulic system is a crucial step. This directly impacts the establishment of the variable parameter field of the thermal-hydraulic system at the initial moment and its evolution along the time dimension, further affecting simulation convergence and efficiency. Initialization parameters for thermal-hydraulic system models are typically configured through the user-accessible initialization parameter panel of the model component. This presents the following challenges: First, the configured initialization parameters are relatively limited, making it difficult to fully configure the initial parameters for basic node elements such as the control volume and nozzles of the model component. Second, due to the physical properties of the working fluid, complex constraints exist between parameters such as the pressure, temperature, mass vapor fraction, non-condensable gas fraction, and vapor-liquid flow rate of each nozzle in the model component's control volume, making it difficult to ensure the self-consistency of the manually configured initialization parameters. Third, due to the transport and conservation mechanisms of mass, energy, and momentum in the thermal-hydraulic system, complex constraints exist between the thermal-hydraulic parameters of adjacent basic node elements, adjacent model components, and mutually coupled loops, making it difficult to ensure the self-consistency of the manually configured initialization parameters in the spatial dimension. Therefore, it is difficult to meet the requirements of constructing a reasonable and self-consistent initial variable parameter field for a complex configuration and multi-condition thermal-hydraulic system model by only assigning initial parameters to the thermal-hydraulic system model through parameter configuration based on the model component initialization parameter panel.
[0003] The thermal-hydraulic model initialization assignment method based on historical simulation results can effectively solve the needs of constructing the initial variable parameter field of complex configuration and multi-operating condition thermal-hydraulic system models. It supports phased initialization from a single model component, a single subsystem model to the whole system model, reduces the difficulty of initializing complex thermal-hydraulic systems, and avoids mutual interference between various model components or subsystem models in the initialization assignment calculation process. Moreover, since the historical simulation results have self-consistent physical meaning and complete variable parameter values, the initialization parameter assignment of the thermal-hydraulic system model is closer to the expected initial variable parameter field, and the efficiency and quality of the initialization assignment calculation are greatly improved.
[0004] However, current Modelica-based thermal-hydraulic model compilation and analysis methods require the elimination of model component information and hierarchical modeling and packaging information during the flattening process. Furthermore, the numbering of each node unit in the model component is randomized during multiple compilations, making it difficult to initialize and assign historical simulation results to corresponding variable parameters using model component information and node unit numbers. This patent proposes a device and method for initializing and assigning values to a thermal-hydraulic model based on historical simulation results that is compatible with the Modelica specification. Summary of the Invention
[0005] The purpose of the present invention is to provide a device and method for initializing and assigning values to a thermal-hydraulic model based on historical simulation results that is applicable to the Modelica specification, and can meet the requirements for efficient initialization and assignment of thermal-hydraulic models based on Modelica.
[0006] The technical solution of the present invention is as follows: a thermal-hydraulic model initialization and assignment device based on historical simulation results that is applicable to the Modelica specification, including a thermal-hydraulic system topology structure generation module, a basic node unit data container module, a historical simulation result storage module, a basic node unit retrieval and positioning module, and an initialization parameter reading and writing module.
[0007] The thermal-hydraulic system topology structure generation module flattens the Modelica-based thermal-hydraulic system model, eliminates the hierarchical encapsulation information of the thermal-hydraulic model components, and converts the thermal-hydraulic system model into a flattened topology structure diagram that is completely connected in an orderly manner by the control body model and the takeover model according to the discrete node division of the thermal-hydraulic system.
[0008] The basic node unit data container module configures a corresponding data container for each control body model and takeover model of the flattened topology diagram, which is used to store the number, type, model component information, position information of the node unit in the model component, geometric structure parameters, characteristic curve parameters, initial state parameters, variable parameter time series change data, source term function information, etc. of the basic node unit, forming a data container for solving the basic node unit.
[0009] The data container includes a data container for solving basic node units, which is used to structuredly store all data information about the basic node units during the compilation and solution process of the two-fluid six-equation system, including the number, type, model component information of the basic node units, position information of the node units in the model components to which they belong, geometric structure parameters, characteristic curve parameters, initial state parameters, variable parameter time series change data, and source term function information.
[0010] In the data container for solving, the initial state parameters are consistent with the variable parameter types of the variable parameter time series change. The value of the variable parameter time series change at the initial time T0 is equal to the initial state parameters. For the basic node unit of the control body type, the initial state parameters include at least five basic solution variables: pressure, cavitation fraction, vapor phase internal energy, liquid phase internal energy, and non-condensable gas fraction; for the basic node unit of the pipe type, the initial state parameters include at least two basic solution variables: vapor phase flow rate and liquid phase flow rate. The source function information includes the generalized source function expression of the two-fluid six equations and the current time T n The input and output variables and intermediate process variables of each generalized source function are the time series changes of variable parameters at the current time T n The value of is input, and the output value of each generalized source function is calculated by combining the geometric structure parameters and characteristic curve parameters. n Assembly of coefficient matrices of six equations for two fluids. The generalized source term function refers to physical source terms such as wall heat transfer calculation, phase heat transfer calculation, phase friction calculation, wall friction calculation, local resistance calculation, etc., and the variable coefficients and constant terms of the discrete equations of conservation of mass, energy, and momentum, as well as the calculation preparation required to calculate these source terms, solve the variable coefficients, and constant terms, including physical property calculations, takeover variable calculations based on control body variables, and control body variable calculations based on takeover variables.
[0011] The historical simulation result storage module is used to load and store the historical simulation results of the thermal-hydraulic system model based on Modelica. It supports the use of basic node unit data containers to store data information of each basic node unit of the thermal-hydraulic system in the historical simulation results, forming a basic node unit historical data container, and supports the extraction of data on the basic node unit variable parameters that change over time at a certain historical moment.
[0012] The basic node unit retrieval and positioning module retrieves and locates the corresponding relationship between the solution data container and the historical data container of the same node unit through the model component information to which the node unit belongs and the position information of the node unit in the model component to which it belongs, under the condition that the basic node unit number may change during the recompilation and solution process of the thermal-hydraulic system model based on Modelica.
[0013] The historical data container includes a basic node unit historical data container for structured analysis and storage of all data information about the basic node unit in the historical simulation results. The data structure and data storage type are consistent with the data container used for solving the basic node unit, including the number, type, model component information of the basic node unit, the position information of the node unit in the model component, geometric structure parameters, characteristic curve parameters, initial state parameters, variable parameter time series change data, and source function information of the basic node unit. The historical simulation results are the simulation results obtained by the same set of thermal-hydraulic system models using the same compilation and solution rules under the pre-set operating parameters and simulation time. The data information of each node unit of the thermal-hydraulic system model within the historical simulation time is stored in the form of a basic node unit data container.
[0014] The initialization parameter reading and writing module assigns the value of the variable parameter time-series change data in the historical data container at a certain moment to the initialization state parameter of the node unit according to the correspondence between the solution data container and the historical data container of the same node unit, and writes it into the solution data container of the node unit.
[0015] The initialization module based on component parameter configuration calculates the initialization state parameters of the basic node unit according to the parameter configuration of the initialization parameter panel of the model component where the basic node unit is located, and adopts methods such as linear interpolation of import and export initialization configuration parameters, direct assignment of component initialization configuration parameters to the node unit, and copying of initialization state parameters of adjacent node units, and writes them into the data container for solution of the node unit. The initialization module based on component parameter configuration is suitable for basic node units that do not have corresponding historical data containers or basic node units for which users do not use historical simulation results for assignment.
[0016] The steps include:
[0017] Step 1: Based on the discrete node partitioning method of the thermal-hydraulic system model based on Modelica, the thermal-hydraulic system model is converted into a flattened topological structure diagram consisting entirely of control body models and nozzle models interlaced and orderly connected. The control body basic node units and nozzle basic node units on the topological structure diagram are numbered separately.
[0018] Step 2: Traverse the basic node units of the thermal flattening topology diagram, configure a data container for each basic node unit, and form a data container for solving the basic node unit, which is used to store all data information required for compiling and solving the two-fluid six-equation system about the basic node unit, including the basic node unit number, type, model component information, position information of the node unit in the model component, geometric structure parameters, characteristic curve parameters, initial state parameters, variable parameter time series change data, and source function information. The data container is a storage unit with a certain data structure in the memory space. The model component information of the basic node unit includes the model component type and name, which serves as a unique identifier for identifying the model component. The position information of the node unit in the model component refers to the number of control bodies or takeovers of the basic node unit from the import to the export of the model component.
[0019] Step 3: Load the historical simulation result file of the same thermal-hydraulic system model, parse the historical simulation result file in the form of a basic node unit data container, extract the number, type, model component information, position information of the node unit in the model component, geometric structure parameters, characteristic curve parameters, initial state parameters, variable parameter time series change data, and source function information of each basic node unit in the historical simulation result file, and store them in the corresponding basic node unit data container to form a basic node unit historical data container;
[0020] Step 4: Select the initialization assignment mode based on historical simulation results, including single model component initialization assignment, multiple model component initialization assignment, and full system initialization assignment, and determine the traversal range of basic node units that need to be initialized based on historical simulation results;
[0021] Step 5: According to the traversal range of the basic node unit, traverse the basic node unit, read the model component information of the basic node unit and the position information of the node unit in the model component stored in the data container for solving the basic node unit, and retrieve and locate the historical data container corresponding to the basic node unit through the model component information and the position information of the node unit in the model component;
[0022] Step 6: Determine whether the traversal of the basic node units that need to be initialized and assigned based on historical simulation results has been completed;
[0023] Step 7: traverse the basic node units of the thermal flattening topology diagram to identify whether the basic node units have completed initialization assignment based on historical simulation results;
[0024] Step 8: Determine whether the traversal of the basic node units of the thermal flattening topology graph is completed;
[0025] Step 9: The initialization and assignment of the thermal hydraulic system model are completed.
[0026] The step 4 includes the following three situations:
[0027] Case 1: Select the single model component initialization assignment mode, select the model component that needs to be initialized and assigned, and the traversal range is the basic node unit of the model component;
[0028] Case 2: Select multiple model component initialization assignment modes, select several model components that need to be initialized and assigned, and the traversal range is the basic node units of these model components;
[0029] Case 3: Select the full system initialization assignment mode, and the traversal range is the basic node units of the thermal hydraulic topology diagram.
[0030] The step 5 includes the following two situations:
[0031] Case 1: The historical data container corresponding to the basic node unit can be retrieved and located, and the value of the variable parameter time series change data in the historical data container at a certain moment is assigned to the initialization state parameter of the node unit and written into the solution data container of the node unit;
[0032] Case 2: The historical data container corresponding to the basic node unit cannot be retrieved and located, and the prompt "MM model component does not have historical simulation results, and the basic node unit numbered NN has not been initialized" is displayed. MM is the name of the model component where the basic node unit is located, and NN is the number in the data container used to solve the basic node unit.
[0033] The step 5 includes the following two situations:
[0034] Case 1: Not finished. Within the traversal range of basic node units, select any basic node unit that has not been traversed or select it according to the number size, and jump to step 5.
[0035] Case 2: End, skip to step 7.
[0036] The step 6 includes the following two situations:
[0037] Case 1: The basic node unit has completed the initialization assignment based on the historical simulation results and no operation is performed;
[0038] Case 2: The basic node unit has not been initialized based on the historical simulation results. According to the parameter configuration of the initialization parameter panel of the model component where the basic node unit is located, the initialization state parameters of the basic node unit are obtained by linear interpolation of the import and export initialization configuration parameters, direct assignment of the component initialization configuration parameters to the node unit, and copy calculation of the initialization state parameters of the adjacent node units, and write them into the data container for the solution of the node unit.
[0039] The step 5 includes the following two situations:
[0040] Case 1: Not finished, continue traversal and jump to step 7;
[0041] Case 2: End, jump to step 9.
[0042] The beneficial effects of the present invention are: the present invention can effectively solve the problem of reasonable and self-consistent initialization variable parameter field assignment of complex configuration multi-working condition thermal-hydraulic system models, supports initialization assignment based on historical simulation results and initialization calculation assignment based on model component initialization parameter configuration, supports staged initialization from a single model component, a single subsystem model to the entire system model, reduces the difficulty of initialization of complex thermal-hydraulic systems, avoids mutual interference between various model components or various subsystem models in the initialization assignment calculation process, and because historical simulation results have self-consistent physical meanings and complete variable parameter values, the initialization parameter assignment of the thermal-hydraulic system model based on historical simulation results is closer to the expected initial variable parameter field, and the efficiency and quality of initialization assignment are greatly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 This is a schematic diagram of the functional modules of a thermal hydraulic model initialization and assignment device based on historical simulation results that is applicable to the Modelica specification provided by the present invention;
[0044] Figure 2 Provides examples for flattening components of thermal hydraulic model and configuring data containers;
[0045] Figure 3 This is the logic diagram for initialization assignment based on historical simulation results. DETAILED DESCRIPTION
[0046] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0047] A thermal hydraulic model initialization and assignment device based on historical simulation results applicable to Modelica specifications comprises a thermal hydraulic system topology structure generation module, a basic node unit data container module, a historical simulation result storage module, a basic node unit retrieval and positioning module, and an initialization parameter reading and writing module.
[0048] The details are as follows:
[0049] The thermal-hydraulic system topology structure generation module flattens the Modelica-based thermal-hydraulic system model, eliminates the hierarchical encapsulation information of the thermal-hydraulic model components, and converts the thermal-hydraulic system model into a flattened topology structure diagram that is completely connected in an orderly manner by the control body model and the takeover model according to the discrete node division of the thermal-hydraulic system.
[0050] The basic node unit data container module configures a corresponding data container for each control volume model and takeover model of the flattened topology diagram, and is used to store the basic node unit's number, type, model component information, node unit's position information within the model component, geometric structure parameters, characteristic curve parameters, initial state parameters, variable parameter time series change data, source term function information, etc., forming a basic node unit solution data container. The basic node unit solution data container is used to structuredly store all data information related to the basic node unit during the compilation and solution process of the two-fluid six-equation system, including the basic node unit's number, type, model component information, node unit's position information within the model component, geometric structure parameters, characteristic curve parameters, initial state parameters, variable parameter time series change data, source term function information, and other data information.
[0051] In the data container for solving, the initial state parameters are consistent with the variable parameter types of the variable parameters whose time series changes. The value of the variable parameter whose time series changes at the initial time T0 is equal to the initial state parameters. For the basic node units of the control body type, the initial state parameters include at least five basic solution variables, such as pressure, cavitation fraction, vapor phase internal energy, liquid phase internal energy, and non-condensable gas fraction; for the basic node units of the pipe type, the initial state parameters include at least two basic solution variables, such as vapor phase flow rate and liquid phase flow rate. The source function information includes the generalized source function expression of the six equations of the two fluids and the current time T n The input and output variables and intermediate process variables of each generalized source function are the time series changes of variable parameters at the current time T n The value of is input, and the output value of each generalized source function is calculated by combining the geometric structure parameters and characteristic curve parameters. n The coefficient matrix assembly for the six equations of two fluids. The generalized source term function refers to physical source terms such as wall heat transfer calculations, interphase heat transfer calculations, interphase friction calculations, wall friction calculations, and local resistance calculations, as well as the variable coefficients and constant terms for solving the discrete equations for conservation of mass, energy, and momentum. It also includes the computational preparation required to calculate these source terms, solve the variable coefficients, and solve the constant terms, including physical property calculations, calculations of takeover variables based on control volume variables, and calculations of control volume variables based on takeover variables.
[0052] The historical simulation result storage module is used to load and store the historical simulation results of the thermal-hydraulic system model based on Modelica. It supports the use of basic node unit data containers to store data information of each basic node unit of the thermal-hydraulic system in the historical simulation results, forming a basic node unit historical data container, and supports the extraction of data on the basic node unit variable parameters that change over time at a certain historical moment.
[0053] The basic node unit retrieval and positioning module retrieves and locates the corresponding relationship between the solution data container and the historical data container of the same node unit through the model component information to which the node unit belongs and the position information of the node unit in the model component to which it belongs, under the condition that the basic node unit number may change during the recompilation and solution process of the thermal-hydraulic system model based on Modelica.
[0054] The basic node unit historical data container is used for structured analysis and storage of all data information about the basic node unit in the historical simulation results. The data structure and data storage type are consistent with the data container used for basic node unit solution, including the basic node unit number, type, model component information, node unit position information in the model component, geometric structure parameters, characteristic curve parameters, initial state parameters, variable parameter time series change data, source term function information, and other data information. The historical simulation results are the simulation results obtained by the same set of thermal-hydraulic system models using the same compilation and solution rules under the previously set operating parameters and simulation time. The data information of each node unit of the thermal-hydraulic system model during the historical simulation time is stored in the form of a basic node unit data container.
[0055] The basic node unit historical data container is bound to the basic node unit model component according to the model component information of the data container, and supports the following operations:
[0056] (1) When the model component is copied, a basic node unit historical data container is automatically created and automatically bound to the copied model component. In the data container, the basic node unit number is empty, and the model component information is the copied model component information. Except for the basic node unit number and the model component information, the structure and storage content of the data container are the same as the basic node unit historical data container bound to the model component before copying.
[0057] (2) When deleting the model component, the bound basic node unit historical data container is automatically deleted in the memory space to reduce the storage capacity of the memory space.
[0058] The initialization parameter reading and writing module assigns the value of the variable parameter time-series change data in the historical data container at a certain moment to the initialization state parameter of the node unit according to the correspondence between the solution data container and the historical data container of the same node unit, and writes it into the solution data container of the node unit.
[0059] The component parameter configuration-based initialization module calculates the initialization state parameters of the basic node unit based on the parameter configuration of the model component initialization parameter panel where the basic node unit is located, using methods such as linear interpolation of import and export initialization configuration parameters, direct assignment of component initialization configuration parameters to the node unit, and copying of initialization state parameters of adjacent node units, and writes them into the data container used for solution of the node unit. The component parameter configuration-based initialization module is applicable to basic node units without corresponding historical data containers or basic node units for which the user does not use historical simulation results for assignment.
[0060] A method for initializing and assigning values to a thermal-hydraulic model based on historical simulation results and applicable to Modelica specifications includes the following steps:
[0061] Step 1: According to the discrete node division method of the thermal-hydraulic system model based on Modelica, the thermal-hydraulic system model is converted into a flattened topological structure diagram that is completely connected by the control body model and the takeover model in an orderly interlaced manner, and the control body type basic node units and the takeover type basic node units on the topological structure diagram are numbered respectively.
[0062] Step 2: Traverse the basic node units of the thermal flattening topology diagram and configure a data container for each basic node unit to form a data container for solving the basic node unit, which is used to store all the data information required for compiling and solving the two-fluid six-equation system of the basic node unit, including the basic node unit number, type, model component information, node unit position information in the model component, geometric structure parameters, characteristic curve parameters, initial state parameters, variable parameter time series change data, source term function information, etc. The data container is a storage unit with a certain data structure in the memory space. The model component information of the basic node unit includes the model component type and name, which serves as a unique identifier to identify the model component. The node unit position information in the model component refers to the number of control bodies or takeovers of the basic node unit from the inlet to the outlet of the model component.
[0063] Step 3: Load the historical simulation result file of the same thermal-hydraulic system model, parse the historical simulation result file in the form of a basic node unit data container, extract the number, type, model component information, position information of the node unit in the model component, geometric structure parameters, characteristic curve parameters, initial state parameters, variable parameter time series change data, source term function information and other data information of each basic node unit in the historical simulation result file, and store them in the corresponding basic node unit data container to form a basic node unit historical data container.
[0064] Step 4: Select the initialization assignment mode based on historical simulation results, including single model component initialization assignment, multiple model component initialization assignment, and full system initialization assignment. Determine the traversal range of basic node units that need initialization assignment based on historical simulation results, which is divided into the following three cases:
[0065] Case 1: Select the single model component initialization assignment mode, select the model component that needs to be initialized and assigned, and the traversal range is the basic node unit of the model component.
[0066] Case 2: Select multiple model component initialization assignment modes, select several model components that need to be initialized and assigned, and the traversal range is the basic node units of these model components.
[0067] Case 3: Select the full system initialization assignment mode, and the traversal range is the basic node units of the thermal hydraulic topology diagram.
[0068] Step 5: According to the traversal range of the basic node unit, traverse the basic node unit, read the model component information of the basic node unit and the location information of the node unit in the model component stored in the data container for solving the basic node unit, and retrieve and locate the historical data container corresponding to the basic node unit through the model component information and the location information of the node unit in the model component. There are two cases:
[0069] Case 1: It is possible to retrieve and locate the historical data container corresponding to the basic node unit, assign the value of the variable parameter time series change data in the historical data container at a certain moment to the initialization state parameter of the node unit, and write it into the data container for solving the node unit.
[0070] Case 2: The historical data container corresponding to the basic node unit cannot be retrieved and located, and the prompt "MM model component does not have historical simulation results, and the basic node unit numbered NN has not been initialized" is displayed. MM is the name of the model component where the basic node unit is located, and NN is the number in the data container used to solve the basic node unit.
[0071] Step 6: Determine whether the traversal of the basic node units that need to be initialized and assigned based on historical simulation results has been completed. There are two cases:
[0072] Case 1: Not finished. Within the traversal range of basic node units, select any basic node unit that has not been traversed or select it according to the number size, and jump to step 5.
[0073] Case 2: End, jump to step 7.
[0074] Step 7: Traverse the basic node units of the thermal flattening topology diagram and identify whether the basic node units have completed initialization assignment based on historical simulation results. There are two cases:
[0075] Case 1: The basic node unit has completed the initialization assignment based on the historical simulation results and no operation is performed;
[0076] Case 2: The basic node unit has not been initialized based on the historical simulation results. According to the parameter configuration of the initialization parameter panel of the model component where the basic node unit is located, the initialization state parameters of the basic node unit are calculated by adopting methods such as linear interpolation of import and export initialization configuration parameters, direct assignment of component initialization configuration parameters to the node unit, and copying of initialization state parameters of adjacent node units, and then written into the data container for solution of the node unit.
[0077] Step 8: Determine whether the traversal of the basic node units of the thermal flattening topology graph is complete. There are two cases:
[0078] Case 1: Not finished, continue traversal and jump to step 7;
[0079] Case 2: End, jump to step 9.
[0080] Step 9: The initialization and assignment of the thermal hydraulic system model are completed.
Claims
1. A device for initializing and assigning values to a thermal hydraulic model based on historical simulation results and applicable to Modelica specifications, characterized by: It includes a thermal hydraulic system topology structure generation module, a basic node unit data container module, a historical simulation result storage module, a basic node unit retrieval and positioning module, and an initialization parameter reading and writing module.
2. The device for initializing and assigning values to a thermal-hydraulic model based on historical simulation results and applicable to the Modelica specification according to claim 1, characterized in that: The thermal-hydraulic system topology structure generation module flattens the Modelica-based thermal-hydraulic system model, eliminates the hierarchical encapsulation information of the thermal-hydraulic model components, and converts the thermal-hydraulic system model into a flattened topology structure diagram that is completely connected in an orderly manner by the control body model and the takeover model according to the discrete node division of the thermal-hydraulic system.
3. The device for initializing and assigning values to a thermal-hydraulic model based on historical simulation results and applicable to Modelica standards according to claim 1, characterized in that: The basic node unit data container module configures a corresponding data container for each control body model and takeover model of the flattened topology diagram, which is used to store the number, type, model component information, position information of the node unit in the model component, geometric structure parameters, characteristic curve parameters, initial state parameters, variable parameter time series change data, source term function information, etc. of the basic node unit, forming a data container for solving the basic node unit.
4. The device for initializing and assigning values to a thermal-hydraulic model based on historical simulation results and applicable to Modelica standards according to claim 3, characterized in that: The data container includes a data container for solving basic node units, which is used to structuredly store all data information about the basic node units during the compilation and solution process of the two-fluid six-equation system, including the number, type, model component information of the basic node units, position information of the node units in the model components to which they belong, geometric structure parameters, characteristic curve parameters, initial state parameters, variable parameter time series change data, and source term function information.
5. The device for initializing and assigning values to a thermal-hydraulic model based on historical simulation results and applicable to Modelica standards according to claim 4, characterized in that: In the data container for solving, the initial state parameters are consistent with the variable parameter types of the variable parameter time series change. The value of the variable parameter time series change at the initial time T0 is equal to the initial state parameters. For the basic node unit of the control body type, the initial state parameters include at least five basic solution variables: pressure, cavitation fraction, vapor phase internal energy, liquid phase internal energy, and non-condensable gas fraction; for the basic node unit of the pipe type, the initial state parameters include at least two basic solution variables: vapor phase flow rate and liquid phase flow rate. The source function information includes the generalized source function expression of the two-fluid six equations and the current time T n The input and output variables and intermediate process variables of each generalized source function are the time series changes of variable parameters at the current time T n The value of is input, and the output value of each generalized source function is calculated by combining the geometric structure parameters and characteristic curve parameters. n Assembly of coefficient matrices of six equations for two fluids. The generalized source term function refers to physical source terms such as wall heat transfer calculation, phase heat transfer calculation, phase friction calculation, wall friction calculation, local resistance calculation, etc., and the variable coefficients and constant terms of the discrete equations of conservation of mass, energy, and momentum, as well as the calculation preparation required to calculate these source terms, solve the variable coefficients, and constant terms, including physical property calculations, takeover variable calculations based on control body variables, and control body variable calculations based on takeover variables.
6. The device for initializing and assigning values to a thermal hydraulic model based on historical simulation results and applicable to Modelica standards according to claim 1, characterized in that: The historical simulation result storage module is used to load and store the historical simulation results of the thermal-hydraulic system model based on Modelica. It supports the use of basic node unit data containers to store data information of each basic node unit of the thermal-hydraulic system in the historical simulation results, forming a basic node unit historical data container, and supports the extraction of data on the basic node unit variable parameters that change over time at a certain historical moment.
7. The thermal-hydraulic model initialization and assignment device based on historical simulation results and applicable to Modelica standards according to claim 1, characterized in that: The basic node unit retrieval and positioning module retrieves and locates the corresponding relationship between the solution data container and the historical data container of the same node unit through the model component information to which the node unit belongs and the position information of the node unit in the model component to which it belongs, under the condition that the basic node unit number may change during the recompilation and solution process of the thermal-hydraulic system model based on Modelica.
8. The device for initializing and assigning values to a thermal hydraulic model based on historical simulation results and applicable to Modelica standards according to claim 1, characterized in that: The historical data container includes a basic node unit historical data container for structured analysis and storage of all data information about the basic node unit in the historical simulation results. The data structure and data storage type are consistent with the data container used for solving the basic node unit, including the number, type, model component information of the basic node unit, the position information of the node unit in the model component, geometric structure parameters, characteristic curve parameters, initial state parameters, variable parameter time series change data, and source function information of the basic node unit. The historical simulation results are the simulation results obtained by the same set of thermal-hydraulic system models using the same compilation and solution rules under the pre-set operating parameters and simulation time. The data information of each node unit of the thermal-hydraulic system model within the historical simulation time is stored in the form of a basic node unit data container.
9. The thermal-hydraulic model initialization and assignment device based on historical simulation results and applicable to Modelica standards according to claim 1, characterized in that: The initialization parameter reading and writing module assigns the value of the variable parameter time-series change data in the historical data container at a certain moment to the initialization state parameter of the node unit according to the correspondence between the solution data container and the historical data container of the same node unit, and writes it into the solution data container of the node unit.
10. The thermal hydraulic model initialization and assignment device based on historical simulation results and applicable to Modelica specification according to claim 1, characterized in that: The initialization module based on component parameter configuration calculates the initialization state parameters of the basic node unit according to the parameter configuration of the initialization parameter panel of the model component where the basic node unit is located, and adopts methods such as linear interpolation of import and export initialization configuration parameters, direct assignment of component initialization configuration parameters to the node unit, and copying of initialization state parameters of adjacent node units, and writes them into the data container for solution of the node unit. The initialization module based on component parameter configuration is suitable for basic node units that do not have corresponding historical data containers or basic node units for which users do not use historical simulation results for assignment.
11. A method for initializing and assigning values to a thermal hydraulic model based on historical simulation results, suitable for Modelica specifications, characterized in that: The steps include: Step 1: Based on the discrete node partitioning method of the thermal-hydraulic system model based on Modelica, the thermal-hydraulic system model is converted into a flattened topological structure diagram consisting entirely of control body models and nozzle models interlaced and orderly connected. The control body basic node units and nozzle basic node units on the topological structure diagram are numbered separately. Step 2: Traverse the basic node units of the thermal flattening topology diagram, configure a data container for each basic node unit, and form a data container for solving the basic node unit, which is used to store all data information required for compiling and solving the two-fluid six-equation system about the basic node unit, including the basic node unit number, type, model component information, position information of the node unit in the model component, geometric structure parameters, characteristic curve parameters, initial state parameters, variable parameter time series change data, and source function information. The data container is a storage unit with a certain data structure in the memory space. The model component information of the basic node unit includes the model component type and name, which serves as a unique identifier for identifying the model component. The position information of the node unit in the model component refers to the number of control bodies or takeovers of the basic node unit from the import to the export of the model component. Step 3: Load the historical simulation result file of the same thermal-hydraulic system model, parse the historical simulation result file in the form of a basic node unit data container, extract the number, type, model component information, position information of the node unit in the model component, geometric structure parameters, characteristic curve parameters, initial state parameters, variable parameter time series change data, and source function information of each basic node unit in the historical simulation result file, and store them in the corresponding basic node unit data container to form a basic node unit historical data container; Step 4: Select the initialization assignment mode based on historical simulation results, including single model component initialization assignment, multiple model component initialization assignment, and full system initialization assignment, and determine the traversal range of basic node units that need to be initialized based on historical simulation results; Step 5: According to the traversal range of the basic node unit, traverse the basic node unit, read the model component information of the basic node unit and the position information of the node unit in the model component stored in the data container for solving the basic node unit, and retrieve and locate the historical data container corresponding to the basic node unit through the model component information and the position information of the node unit in the model component; Step 6: Determine whether the traversal of the basic node units that need to be initialized and assigned based on historical simulation results has been completed; Step 7: traverse the basic node units of the thermal flattening topology diagram to identify whether the basic node units have completed initialization assignment based on historical simulation results; Step 8: Determine whether the traversal of the basic node units of the thermal flattening topology graph is completed; Step 9: The initialization and assignment of the thermal hydraulic system model are completed.
12. A method for initializing and assigning values to a thermal-hydraulic model based on historical simulation results and applicable to Modelica standards according to claim 11, wherein said step 4 includes the following three situations: Case 1: Select the single model component initialization assignment mode, select the model component that needs to be initialized and assigned, and the traversal range is the basic node unit of the model component; Case 2: Select multiple model component initialization assignment modes, select several model components that need to be initialized and assigned, and the traversal range is the basic node units of these model components; Case 3: Select the full system initialization assignment mode, and the traversal range is the basic node units of the thermal hydraulic topology diagram.
13. A method for initializing and assigning values to a thermal-hydraulic model based on historical simulation results and applicable to Modelica standards according to claim 11, wherein said step 5 includes the following two situations: Case 1: The historical data container corresponding to the basic node unit can be retrieved and located, and the value of the variable parameter time series change data in the historical data container at a certain moment is assigned to the initialization state parameter of the node unit and written into the solution data container of the node unit; Case 2: The historical data container corresponding to the basic node unit cannot be retrieved and located, and the prompt "MM model component does not have historical simulation results, and the basic node unit numbered NN has not been initialized" is displayed. MM is the name of the model component where the basic node unit is located, and NN is the number in the data container used for solving the basic node unit.
14. The method for initializing and assigning values to a thermal-hydraulic model based on historical simulation results and applicable to Modelica standards according to claim 11, wherein step 5 includes the following two situations: Case 1: Not finished. Within the traversal range of basic node units, select any basic node unit that has not been traversed or select it according to the number size, and jump to step 5. Case 2: End, skip to step 7.
15. The method for initializing and assigning values to a thermal-hydraulic model based on historical simulation results and applicable to Modelica standards according to claim 11, wherein step 6 includes the following two situations: Case 1: The basic node unit has completed the initialization assignment based on the historical simulation results and no operation is performed; Case 2: The basic node unit has not been initialized based on the historical simulation results. According to the parameter configuration of the initialization parameter panel of the model component where the basic node unit is located, the initialization state parameters of the basic node unit are obtained by linear interpolation of the import and export initialization configuration parameters, direct assignment of the component initialization configuration parameters to the node unit, and copy calculation of the initialization state parameters of the adjacent node units, and write them into the data container for the solution of the node unit.
16. The method for initializing and assigning values to a thermal-hydraulic model based on historical simulation results and applicable to Modelica standards according to claim 11, wherein step 5 includes the following two situations: Case 1: Not finished, continue traversal and jump to step 7; Case 2: End, jump to step 9.