Thermal-hydraulic model topology generation method, device and medium

By using visualization modeling software based on the Modelica language, the topology of thermal hydraulic models can be automatically identified and generated, solving the problems of time-consuming, labor-intensive, and error-prone pipe connection relationships in traditional thermal hydraulic software, and realizing fast and accurate topology information generation and simplifying the modeling process.

CN115828478BActive Publication Date: 2026-04-21CHENGDU GONGYUAN TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHENGDU GONGYUAN TECH CO LTD
Filing Date
2022-11-18
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Traditional thermal hydraulics software is time-consuming, labor-intensive, and prone to errors when modeling pipe connections, making it unsuitable for visualization modeling needs. Furthermore, traditional topology information storage and retrieval methods are complex, making it difficult to quickly generate and identify connection relationships for visualization modeling.

Method used

The system employs a visualization modeling software based on the Modelica language. By identifying model connectors, it generates graph data structures, uses a depth-first search algorithm to traverse vertices, and automatically establishes the topology of pipes and connectors, simplifying the user's modeling process and facilitating subsequent algorithm development.

Benefits of technology

It enables rapid and automatic identification of visual pipeline modeling connection relationships, simplifies the user modeling process, reduces manual workload, facilitates program maintenance and subsequent algorithm development, and improves the usability and accuracy of topology information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115828478B_ABST
    Figure CN115828478B_ABST
Patent Text Reader

Abstract

The application discloses a kind of thermotechnical hydraulic model topological structure generation method, equipment and medium, belong to thermotechnical hydraulic simulation software field, including steps: S1, identification model connector;S2, read model parameter, read and save the model parameters of upstream and downstream nodes on connection line, the upstream and downstream nodes on connection line include pipe and connector;S3, generate graph data structure, generate graph data structure vertex and edge and error for connection error;S4, generate topological structure, traverse vertex and number pipe and connector, and connect upstream and downstream;S5, supplement topological structure information, and give the initial parameters of pipe and connector to the corresponding node in topological structure.This application not only can identify visual pipe modeling connection relationship and quickly and automatically establish topological information structure, but also facilitate program maintenance and subsequent algorithm developer application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of thermal-hydraulic simulation software, and more specifically, to a method, device, and medium for generating the topology of a thermal-hydraulic model. Background Technology

[0002] Traditional thermal hydraulics software, especially for safety analysis of thermal hydraulic systems in the nuclear industry, typically uses text-based modeling. When establishing pipe connections, pipe numbers are usually directly set in the text, along with the inlet and outlet pipe numbers. The simulation software then reads this information directly from the text and generates a topological relationship array for each pipe. This array is then used to create the solution matrix or to coordinate the pipe calculation results.

[0003] This traditional method emerged before the development of visual modeling. In order to reduce the software's memory usage, users were required to directly provide the pipeline connection relationships via text. This method has the following main problems: (1) It is not suitable for the development of visual modeling, and users spend a lot of time and effort on modeling; (2) After the software generates the topological relationship array, multiple arrays are required to express the complete topological relationship. It is easy to make mistakes when solving the matrix to identify the array, and it is not convenient to intuitively obtain topological information and debug the model, which is not friendly to algorithm developers. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method, device and medium for generating the topology of a thermal hydraulic model. This method can not only identify the connection relationship of the visualized pipeline modeling and quickly and automatically establish the topology information structure, but also facilitate program maintenance and subsequent application by algorithm developers.

[0005] The objective of this invention is achieved through the following solution:

[0006] A method for generating the topology of a thermal-hydraulic model includes the following steps:

[0007] S1, Recognition Model Connector;

[0008] S2, Read model parameters, read and save the upstream and downstream node model parameters of the connection line, the upstream and downstream node model of the connection line includes pipes and pipes;

[0009] S3 generates a graph data structure, including vertices and edges, and reports connection errors.

[0010] S4 generates the topology, traverses the vertices to number the pipes and connectors, and connects the upstream and downstream.

[0011] S5, supplement the topology information, and give the initial parameters of the pipes and connectors to the corresponding nodes in the topology.

[0012] Further, following step S5, step S6 is included, which involves printing the generated topology.

[0013] Furthermore, in step S1, identifying the model connection lines specifically includes the following sub-steps:

[0014] A thermal-hydraulic modeling software based on the Modelica language is used to perform the model compilation process. During the model compilation process, connectors are identified to obtain two connected models, including pipes, nozzles, and boundaries. At the same time, when there are multiple connectors in the model, the thermal-hydraulic modeling software based on the Modelica language is used to directly identify the connectors between the thermal-hydraulic models, and then read the model information connected by the connectors.

[0015] Further, in step S2, reading the model parameters includes the following sub-steps:

[0016] After identifying the model connectors, the information of the two models connected by the connectors is saved in a structure and then saved in a map container by key. The map container's characteristics are used to avoid saving the models repeatedly.

[0017] Further, in step S3, the generation of the graph data structure, including the generation of graph data structure vertices and edges and the reporting of connection errors, includes the following sub-steps:

[0018] The design graph data structure type includes member variables such as vertices, edges, number of vertices, number of edges, free vertices, and free edges; and member functions such as traversal algorithm function, downstream vertex function, downstream vertex count function, and upstream vertex count function.

[0019] The model information parameter structure of the two models connected by the connecting line is used to generate the vertices of the graph data structure, and the connecting line is used to generate the edges of the graph data structure.

[0020] Further, in step S4, generating the topology structure, traversing the vertices to number the pipes and connectors, and connecting the upstream and downstream includes the following sub-steps:

[0021] The graph data structure vertices are traversed using a depth-first search algorithm. Pipe control bodies and pipe connections are numbered, and pipe control body and pipe connection numbers for upstream and downstream connection points are generated to form a pipeline mesh topology. Multiple mesh topologies are generated for complex topologies such as multi-branch and loop networks.

[0022] Further, in step S5, supplementing the topology information and assigning the initial parameters of the pipes and connections to the corresponding nodes in the topology includes the following sub-steps:

[0023] For models written in the Modelica language, supplement the initial parameter information of the topology, pipelines, and connectors during the model compilation process.

[0024] Furthermore, in step S6, the printing of the generated topology information includes the sub-step of printing the topology information into a txt document for users to view, facilitating debugging and modeling.

[0025] A computer device comprising a processor and a memory, the memory storing a computer program which, when loaded by the processor, executes the method as described in any of the preceding claims.

[0026] A dual-engine driven multimodal data retrieval system, characterized in that it includes the computer equipment described above.

[0027] The beneficial effects of this invention include:

[0028] This invention not only enables rapid and automatic establishment of topological information structures by recognizing and visualizing pipeline connection relationships, but also facilitates program maintenance and subsequent application by algorithm developers. Specifically, it has the following advantages: 1) Modeling is more convenient, simplifying the manual modeling process. Automatic recognition of pipeline connections in the visual pipeline interface greatly reduces the user's modeling workload and the amount of manual modeling required. 2) The graph data structure expressing the topological relationships makes it easy to traverse and extract relevant information from pipeline nodes, facilitating the subsequent construction of the solution matrix. Attached Figure Description

[0029] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0030] Figure 1 This is a flowchart of the method steps in an embodiment of the present invention;

[0031] Figure 2 A flowchart for establishing the graph data structure in this embodiment of the invention;

[0032] Figure 3 This is a flowchart illustrating the basic topology generation process of an embodiment of the present invention.

[0033] Figure 4 This is a flowchart illustrating the generation process of multi-branch, multi-type topology structures according to an embodiment of the present invention. Detailed Implementation

[0034] The invention will be further described below with reference to the accompanying drawings and embodiments. All features disclosed in all embodiments of this specification, or steps in all methods or processes implied in the disclosure, may be combined and / or extended or substituted in any way, except for mutually exclusive features and / or steps.

[0035] In view of the background technology, the inventors of this invention have further discovered the following technical problems: 1) Text modeling, where users directly provide the pipeline connection relationships, is time-consuming, labor-intensive, and prone to errors, and is no longer suitable for the development of simulation software; 2) Visual modeling is currently the mainstream trend in simulation software development, but there are problems with the recognition of pipeline connection relationships in visual modeling. Visual modeling generally adopts drag-and-drop modeling, where the visualized pipeline model is dragged and connected. Because the text relationship of upstream and downstream connections is not directly provided, the software cannot directly read the text to generate topology information. It is necessary to automatically recognize the connection relationship modeled in the visual interface and establish a data structure; 3) Traditional methods of storing and retrieving topology information are complex. After being read by the simulation software, it is generally saved through a complex array structure and needs to cover all possible pipeline connection situations. This method makes it difficult to subsequently establish a solution matrix to read the topology relationship, especially when the topology is complex, which makes it difficult to input subsequent numerical calculations. It is necessary to establish a more user-friendly pipeline connection data structure to facilitate the establishment of topology information structure.

[0036] Visual simulation software needs to quickly generate topology information structures that cover all pipe connections, and these topology information structures should facilitate subsequent retrieval of relevant information. To address these technical problems, the inventors of this invention, through creative thinking, have developed a method for automatically generating topology information suitable for visual modeling. This method not only identifies the connection relationships in visual pipe modeling and quickly and automatically establishes topology information structures, but also facilitates program maintenance and subsequent application by algorithm developers. The invention includes: 1) Based on Modeliaca language modeling rules, identifying the connection relationships between pipes and creating a graph data structure, with each pipe and connector forming a vertex, and the connection relationships between each pipe forming edges; 2) Using a depth-first search algorithm, traversing each vertex of the graph to establish various types of topology information data structures.

[0037] In a further conceptualization, the technical solution of this invention aims to: a) identify the connection relationships between pipes while saving pipe information, create vertices of a graph data structure using the pipe information, establish edges of the graph data structure using the pipe connection line numbers, and avoid repeated visits to vertices and edges; b) select initial vertices to start traversing pipe nodes, number them and obtain upstream and downstream pipe connection numbers, and consider various complex pipe connection relationships to obtain a complete topology structure; c) based on graph data structure algorithms, traverse vertices to supplement or print topology structure information.

[0038] In the specific implementation process, such as Figure 1 As shown, a method for generating the topology of a thermal-hydraulic model according to the technical solution of the present invention includes the following steps:

[0039] S1, Identify model connection lines;

[0040] S2, Read model parameters, read and save the parameters of upstream and downstream node models (pipes and connectors) on the connection line;

[0041] S3 generates a graph data structure, including vertices and edges, and reports connection errors.

[0042] S4 generates the topology, traverses the vertices to number the pipes and connectors, and connects the upstream and downstream.

[0043] S5, supplement the topology information and give the initial parameters of the pipes and connectors to the corresponding nodes in the topology;

[0044] S6, print the topology.

[0045] In step S1, identifying the model connection lines specifically includes the following sub-steps:

[0046] The visualization-based thermal-hydraulic modeling software involved in this invention is developed using the Modelica language. Connections between models are represented as connecting lines in the graphical interface and as connectors in the text interface. During model compilation, the software kernel identifies the connectors and identifies the two connected models. For thermal-hydraulic simulation software, the two connected models are typically pipes, nozzles, and boundaries.

[0047] Meanwhile, the model layer defines the connector types between thermal hydraulic models. When there are multiple connectors in the model, the software kernel can directly identify the connectors between the thermal hydraulic models and then read the model information connected by the connectors.

[0048] In step S2, reading the model parameters includes the following sub-steps:

[0049] After identifying the model connectors, the information of the two models connected by the connectors is saved in a structure and then saved in a map container by key. The map container's characteristics are used to avoid saving the models repeatedly.

[0050] In step S3, generating the graph data structure includes the following sub-steps:

[0051] like Figure 2As shown, the design graph data structure type includes member variables such as vertices, edges, number of vertices, number of edges, free vertices, and free edges. Member functions include traversal algorithm functions, downstream vertex functions, downstream vertex count functions, and upstream vertex count functions.

[0052] The model information parameter structure of the two models connected by the connecting line is used to generate the vertices of the graph data structure, and the connecting line is used to generate the edges of the graph data structure.

[0053] In step S4, generating the topology includes the following sub-steps:

[0054] like Figure 3 As shown, in the process of generating the topology, a depth-first search algorithm is used to traverse the vertices of the graph data structure, number the pipe control bodies and pipe connections, and generate the pipe control body and pipe connection numbers for upstream and downstream connection points, thus forming the pipe mesh topology. Figure 4 As shown, complex topologies such as multi-branch paths and loops generate multiple or more mesh topologies.

[0055] In step S5, supplementing the topology information includes the following sub-steps:

[0056] The model compilation process (for models written in Modelica) includes supplementing information such as topology, pipelines, and initial parameters of connectors.

[0057] In step S6, the topology information is printed as a txt document for users to view, facilitating debugging of modeling issues.

[0058] The technical solution of this invention provides a method for identifying and establishing topology information based on visual modeling of thermal hydraulic software, forming a unique topology generation method that differs from traditional methods.

[0059] The technical solution of this invention provides a topology generation method based on graph data structure, which facilitates the traversal of pipeline information and simplifies the extraction process of pipeline information in the topology.

[0060] The technical solutions of this invention cover all possible pipe connection methods, simplifying the user's modeling connection process.

[0061] Example 1

[0062] A method for generating the topology of a thermal-hydraulic model includes the following steps:

[0063] S1, Recognition Model Connector;

[0064] S2, Read model parameters, read and save the upstream and downstream node model parameters of the connection line, the upstream and downstream node model of the connection line includes pipes and pipes;

[0065] S3 generates a graph data structure, including vertices and edges, and reports connection errors.

[0066] S4 generates the topology, traverses the vertices to number the pipes and connectors, and connects the upstream and downstream.

[0067] S5, supplement the topology information, and give the initial parameters of the pipes and connectors to the corresponding nodes in the topology.

[0068] Example 2

[0069] Based on Example 1, after step S5, the following step is included: S6, printing the generated topology.

[0070] Example 3

[0071] Based on Example 1, step S1, identifying the model connection lines specifically includes the following sub-steps:

[0072] A thermal-hydraulic modeling software based on the Modelica language is used to perform the model compilation process. During the model compilation process, connectors are identified to obtain two connected models, including pipes, nozzles, and boundaries. At the same time, when there are multiple connectors in the model, the thermal-hydraulic modeling software based on the Modelica language is used to directly identify the connectors between the thermal-hydraulic models, and then read the model information connected by the connectors.

[0073] Example 4

[0074] Based on Example 1, step S2, reading the model parameters includes the following sub-steps:

[0075] After identifying the model connectors, the information of the two models connected by the connectors is saved in a structure and then saved in a map container by key. The map container's characteristics are used to avoid saving the models repeatedly.

[0076] Example 5

[0077] Based on Example 1, step S3, which generates the graph data structure, generates the vertices and edges of the graph data structure, and reports connection errors, includes the following sub-steps:

[0078] The design graph data structure type includes member variables such as vertices, edges, number of vertices, number of edges, free vertices, and free edges; and member functions such as traversal algorithm function, downstream vertex function, downstream vertex count function, and upstream vertex count function.

[0079] The model information parameter structure of the two models connected by the connecting line is used to generate the vertices of the graph data structure, and the connecting line is used to generate the edges of the graph data structure.

[0080] Example 6

[0081] Based on Example 1, in step S4, generating the topology structure, traversing the vertices to number the pipes and connectors, and connecting the upstream and downstream includes the following sub-steps:

[0082] The graph data structure vertices are traversed using a depth-first search algorithm. Pipe control bodies and pipe connections are numbered, and pipe control body and pipe connection numbers for upstream and downstream connection points are generated to form a pipeline mesh topology. Multiple mesh topologies are generated for complex topologies such as multi-branch and loop networks.

[0083] Example 7

[0084] Based on Example 1, in step S5, supplementing the topology information and assigning the initial parameters of the pipes and connectors to the corresponding nodes in the topology includes the following sub-steps:

[0085] For models written in the Modelica language, supplement the initial parameter information of the topology, pipelines, and connectors during the model compilation process.

[0086] Example 8

[0087] Based on Example 1, in step S6, the printed topology information includes the sub-step of printing the topology information into a txt document for users to view, facilitating debugging and modeling.

[0088] Example 9

[0089] A computer device includes a processor and a memory, wherein the memory stores a computer program that is loaded by the processor and executed as described in any one of Embodiments 1 to 8.

[0090] Example 10

[0091] A dual-engine driven multimodal data retrieval system includes the computer device as described in Example 9.

[0092] The units described in the embodiments of the present invention can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.

[0093] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various alternative implementations described above.

[0094] In another aspect, this application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods described in the above embodiments.

[0095] All parts not covered in this invention are the same as or can be implemented using existing technologies.

[0096] The above technical solution is only one embodiment of the present invention. For those skilled in the art, based on the application methods and principles disclosed in the present invention, it is easy to make various types of improvements or modifications, and not limited to the methods described in the above specific embodiments of the present invention. Therefore, the methods described above are only preferred and are not restrictive.

[0097] In addition to the examples above, other embodiments may be obtained by those skilled in the art based on the above disclosure or by making modifications using knowledge or technology in related fields. The features of each embodiment may be interchanged or replaced. Modifications and changes made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.

Claims

1. A method for generating a thermal-hydraulic model topology, characterized in that, The method comprises the following steps: S1, identifying a model connector; S2, reading model parameters, reading and saving model parameters of upstream and downstream nodes connected by a connection line, the upstream and downstream nodes connected by the connection line including a pipe and a connector; in step S2, reading model parameters comprises the following sub-steps: after identifying the model connector, information of two models connected by the connector is saved in a structure and saved in a map container through a keyword, and the map container is used to avoid repeated saving of the models; S3, generating a graph data structure, generating vertices and edges of the graph data structure and reporting errors for connection errors; S4, generating a topology structure, numbering the pipe and the connector by traversing the vertices and connecting upstream and downstream; S5, supplementing topology structure information, and providing initial parameters of the pipe and the connector to corresponding nodes in the topology structure.

2. The thermohydraulic model topology generation method according to claim 1, characterized in that, After step S5, the method comprises the following step: S6, printing the generated topology structure.

3. The thermohydraulic model topology generation method according to claim 1, characterized in that, In step S1, identifying the connection line of the model specifically comprises the following sub-steps: In the model compilation process, the Modelica language-based visual modeling thermal hydraulic modeling software is used to identify the connect connector, obtain two connected models, and the two connected models include a pipe, a connector and a boundary; meanwhile, when multiple connectors exist in the model, the Modelica language-based visual modeling thermal hydraulic modeling software is used to directly identify the connectors between the thermal hydraulic models, and then read model information of the connected connectors.

4. The thermodynamic hydraulic model topology generation method according to claim 1, characterized by, In step S3, the generating of the graph data structure, the generating of vertices and edges of the graph data structure and the reporting of errors for connection errors comprises the following sub-steps: A graph data structure type is designed, member variables of the graph data structure type include vertices, edges, vertex quantity, edge quantity, free vertices and free edges, and member functions of the graph data structure type include a traversal algorithm function, a downstream vertex function, a downstream vertex quantity function and an upstream vertex quantity function; A model information parameter structure body of two models connected by a connection line is generated into a graph data structure vertex, and the connection line is generated into a graph data structure edge.

5. The thermodynamic hydraulic model topology generation method according to claim 1, characterized by, In step S4, the generating of the topology structure, the numbering of the pipe and the connector by traversing the vertices and the connecting of upstream and downstream comprises the following sub-steps: A depth-first algorithm is used to traverse the graph data structure vertex, the pipe control body and the connector are numbered, pipe control body and connector numbers of upstream and downstream connection points are generated, and a pipe grid topology structure is formed; multiple grid topology structures are generated for a multi-branch and loop complex topology structure.

6. The thermodynamic hydraulic model topology generation method according to claim 1, characterized by, In step S5, the supplementing of topology structure information, the providing of initial parameters of the pipe and the connector to corresponding nodes in the topology structure comprises the following sub-steps: For a model written in the Modelica language, topology structure pipe and connector initial parameter information is supplemented in the model compilation process.

7. The thermodynamic hydraulic model topology generation method according to claim 2, characterized by, In step S6, the printing of the generated topology structure comprises the following sub-step: printing the topology structure information into a txt document for user viewing and facilitating model debugging.

8. A computer device, comprising: The computer device comprises a processor and a memory, the memory stores a computer program, and the program executes the method in any one of claims 1-7.

9. A dual engine driven multi-modal data retrieval system characterized in that, The computer device as claimed in claim 8 is included.