Nuclear reactor thermal hydraulic simulation method and device
By using callback functions and dynamic link library technology in thermal hydraulic analysis programs, a control function is generated for thermal hydraulic simulation of nuclear reactors, which solves cross-compilation environment and programming language problems, improves the universality and maintainability of the simulation program, and achieves high-precision simulation results and training results.
Patent Information
- Application Number
- CN202510598210.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-09
- Publication Date
- 2025-09-02
AI Technical Summary
In the prior art, the thermal hydraulic simulation design of reactors in nuclear power plants requires a large number of special treatments for cross-compilation environments and programming language problems, resulting in poor universality of simulation programs, and the simulation data communication variables are deeply bound to the analysis software variables, making it difficult to update and maintain.
The callback function and dynamic link library technology are used to simulate and simulate through thermal hydraulic analysis programs, and control functions are generated to call target functions, so as to realize the packaging and processing of simulation data, and a data coupling interface is established. It is suitable for different programming languages and environments, improving the universality and maintainability of simulation programs.
It improves the versatility and maintainability of thermal hydraulic simulation of nuclear reactors, supports training and examinations for nuclear power plant operators, improves the simulation capabilities and training effects of simulators, and ensures high accuracy and reliability of simulation results.
Smart Images

Figure CN120579474A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of nuclear reactor simulation, and in particular to a method and device for thermal-hydraulic simulation of a nuclear reactor. Background Art
[0002] In the nuclear power industry, building simulation models for nuclear power plant reactors to analyze the operation of reactors and related facilities is a common technical R&D method. This helps identify potential problems and defects before reactor technology is implemented, thereby improving reliability. However, the simulation design of nuclear power plant reactor thermal hydraulic processes requires extensive special handling of cross-compilation environments and programming languages. For example, specialized code must be compiled specifically for the simulation environment to simulate the corresponding functions. This results in limited versatility in nuclear reactor thermal hydraulic simulation based on simulator development. Summary of the Invention
[0003] The main purpose of the embodiments of the present application is to propose a nuclear reactor thermal-hydraulic simulation method and device, which aims to simulate the thermal-hydraulics of a nuclear reactor based on a thermal-hydraulic analysis program (also referred to as thermal-hydraulic analysis software, hereinafter referred to as a thermal-hydraulic analysis program for explanation), thereby improving the versatility of the simulation of the thermal-hydraulics of a nuclear reactor.
[0004] To achieve the above-mentioned objectives, a first aspect of an embodiment of the present application provides a nuclear reactor thermal hydraulic simulation method, which is applied to a simulator and includes:
[0005] Obtain simulation requirements for nuclear reactor thermal hydraulics;
[0006] determining a target function corresponding to the simulation requirement among a plurality of control functions of a thermal hydraulic analysis program;
[0007] A control function of the target function is generated, and based on the control function, the thermal-hydraulic analysis program is called to run the target function to perform thermal-hydraulic simulation of a nuclear reactor.
[0008] In some embodiments, the method further comprises: calling the thermal-hydraulic analysis program based on the control function to run the target function to perform nuclear reactor thermal-hydraulic simulation;
[0009] Obtain simulation data of nuclear reactor thermal hydraulics;
[0010] Compiling the simulation data into a dynamic link library;
[0011] The dynamic link library is loaded based on the callback function, and the thermal hydraulic analysis program is called based on the control function to run the target function, and the simulation data encapsulated in the dynamic link library is processed to perform simulation analysis of nuclear reactor thermal hydraulics.
[0012] In some embodiments, calling the thermal-hydraulic analysis program based on the control function to run the target function and processing the simulation data encapsulated in the dynamic link library includes:
[0013] Storing the simulation data encapsulated in the dynamic link library as a first structure, wherein the first structure is of the same structure type as a second structure storing first target data in the thermal-hydraulic analysis program, wherein the first target data is data processed based on the target function;
[0014] Converting the simulation data in the first structure into simulation data in the second structure based on the callback function;
[0015] The thermal-hydraulic analysis program is called based on the control function to run the target function to process the simulation data of the second structural form.
[0016] In some embodiments, the method includes:
[0017] Based on the callback function, second target data in the second structural form is converted into data in the first structural form, wherein the second target data includes: simulation data after the thermal-hydraulic analysis program modifies the simulation data in the second structural form, or processing result data outputted after the thermal-hydraulic analysis program runs the target function to process the simulation data in the second structural form.
[0018] In some embodiments, after calling the thermal-hydraulic analysis program based on the control function to run the target function to perform nuclear reactor thermal-hydraulic simulation, the method further includes:
[0019] Receive third-party simulation data transmitted by third-party programs;
[0020] Based on the control function, the thermal-hydraulic analysis program is called to run the target function to process the third-party simulation data and perform simulation analysis on the thermal-hydraulics of the nuclear reactor.
[0021] In some embodiments, the method further comprises:
[0022] passing simulation control parameters to the third-party program;
[0023] The transmitting the simulation control parameter to the third-party program includes:
[0024] Obtaining an interface type of a preset simulation interface, wherein the simulation interface is a simulation interface between a simulation program of the simulator and the third-party program;
[0025] The simulation control parameters corresponding to the interface type are transmitted to the third-party program through the simulation interface.
[0026] In some embodiments, the interface types include: node and valve types, and boundary and pipe types; the simulation control parameters include: flow simulation control parameters, pressure simulation control parameters, and general simulation control parameters of flow network tools;
[0027] The transmitting the simulation control parameter corresponding to the interface type to the third-party program through the simulation interface includes:
[0028] In the case where the interface type is a node and valve type, the flow simulation control parameters and the flow network tool general simulation control parameters are transmitted to the third-party program through the simulation interface;
[0029] In the case where the interface type is a boundary and takeover type, the pressure simulation control parameters and the flow network tool general simulation control parameters are transmitted to the third-party program through the simulation interface.
[0030] In some embodiments, generating the control function of the target function includes:
[0031] Obtaining a location path of the target function in the thermal-hydraulic analysis program;
[0032] The position path is used as the calling target parameter of the simulation control function to generate a control function for the target function. The simulation control function is a control function in the simulation program of the simulator. The control function is used to call the thermal-hydraulic analysis program based on the position path to run the target function when the simulation program runs the simulation control function.
[0033] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a nuclear reactor thermal hydraulic simulation device, which is applied to a simulator and includes:
[0034] Acquisition module, used to obtain the simulation requirements of nuclear reactor thermal hydraulics;
[0035] A program function determination module, configured to determine a target function corresponding to the simulation requirement among a plurality of control functions of a thermal hydraulic analysis program;
[0036] The simulation control module is used to generate a control function of the target function, and based on the control function, call the thermal-hydraulic analysis program to run the target function to perform thermal-hydraulic simulation of a nuclear reactor.
[0037] In some embodiments, the apparatus further comprises:
[0038] The third-party data interaction module is used to receive third-party simulation data transmitted by third-party programs;
[0039] The simulation control module is further used to call the thermal-hydraulic analysis program based on the control function to run the target function to process the third-party simulation data and perform simulation analysis of nuclear reactor thermal-hydraulics.
[0040] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the various steps of the nuclear reactor thermal-hydraulic simulation method provided in the first aspect above.
[0041] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the various steps of the nuclear reactor thermal-hydraulic simulation method provided in the first aspect above.
[0042] To achieve the above-mentioned purpose, the fifth aspect of the embodiment of the present application proposes a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the various steps of the nuclear reactor thermal-hydraulic simulation method provided in the first aspect above.
[0043] The nuclear reactor thermal-hydraulic simulation method, apparatus, computer equipment, computer-readable storage medium, and computer program product proposed in the embodiments of the present application obtain the simulation requirements of the nuclear reactor thermal-hydraulics through a simulator; determine the target function corresponding to the simulation requirements among the multiple control functions of the thermal-hydraulics analysis program; generate a control function for the target function; and, based on the control function, call the thermal-hydraulics analysis program to run the target function to perform nuclear reactor thermal-hydraulics simulation. In other words, the embodiments of the present application implement the simulation of nuclear reactor thermal-hydraulics based on the thermal-hydraulics analysis program, without the need for special processing for cross-compilation environments and programming languages, thereby improving the versatility of nuclear reactor thermal-hydraulics simulation.
[0044] In addition, the embodiment of the present application is based on the simulation of thermal-hydraulic analysis software, which can be used to build a thermal-hydraulic simulation model for daily training and examination of nuclear power plant operators, so that simulator users can deeply understand the process of thermal-hydraulic simulation of nuclear power plants and improve the simulation capabilities and training effects of the simulator. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 A schematic flow chart of the steps of the nuclear reactor thermal hydraulic simulation method provided in some embodiments of the present application;
[0046] Figure 2 for Figure 1 Schematic diagram of the detailed process of step S103;
[0047] Figure 3 for Figure 1 Schematic diagram of the detailed process of step S103;
[0048] Figure 4 for Figure 3 Schematic diagram of the detailed steps of step S303;
[0049] Figure 5 A schematic flow chart of steps in other embodiments of the nuclear reactor thermal hydraulic simulation method provided in the embodiment of the present application;
[0050] Figure 6 A functional description of the simulation platform and a corresponding function design schematic diagram involved in some embodiments of the nuclear reactor thermal-hydraulic simulation method provided in the embodiments of the present application;
[0051] Figure 7 A schematic diagram of the functions and design of the simulation platform for realizing data input and output functions in some embodiments of the nuclear reactor thermal-hydraulic simulation method provided in the embodiments of the present application;
[0052] Figure 8 A schematic diagram of interface data transmission involved in some embodiments of the nuclear reactor thermal-hydraulic simulation method provided in the embodiments of the present application;
[0053] Figure 9 A schematic diagram of the structural framework of a nuclear reactor thermal-hydraulic simulation device provided in some embodiments of the present application;
[0054] Figure 10 A schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0056] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.
[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0058] Next, the overall concept of the nuclear reactor thermal hydraulic simulation method provided in the embodiment of the present application is further explained.
[0059] Since the simulation design of the thermal-hydraulic process of nuclear power plant reactors in related technologies requires a lot of special processing of cross-compilation environment and programming language issues, such as the need to compile special codes specifically for the simulation environment to achieve the corresponding functional simulation, etc., this will lead to poor versatility of nuclear reactor thermal-hydraulic simulation based on the development of simulator simulation programs.
[0060] Furthermore, the related art simulation design of nuclear power plant reactor thermal hydraulic processes relies heavily on source code, requiring complete compilation of the entire program code. This is highly detrimental to program stripping and data protection. Furthermore, the binding between simulation data communication variables used in the related art thermal hydraulic simulation and the thermal hydraulic analysis software variables is deep, and the code volume is large, making it difficult to update and maintain the simulation program version.
[0061] To this end, the embodiments of the present application provide a nuclear reactor thermal-hydraulic simulation method, apparatus, computer equipment, computer-readable storage medium, and computer program product, which simulate the thermal-hydraulic process of a nuclear power plant reactor through simulation development and modification based on a thermal-hydraulic analysis program, and in some embodiments, use callback functions, dynamic libraries, and communication data interfaces to develop methods suitable for thermal-hydraulic simulation programs, wherein the dynamic libraries and callback functions implement the simulation functions of the system analysis software, and the communication data interface establishes data communication with other software and interface parameter visualization, thereby improving the user-friendliness of the simulator program.
[0062] The embodiment of the present application is based on the simulation of thermal-hydraulic analysis software and can be used to build a thermal-hydraulic simulation model for daily training and examination of nuclear power plant operators, so that users of the simulator simulation program can deeply understand the process of thermal-hydraulic simulation of nuclear power plants and improve the simulator simulation capabilities and training effects.
[0063] It should be understood that the nuclear reactor thermal hydraulic simulation method provided in the embodiments of the present application can be applied to a terminal, can be applied to a server, and can also be software running on a terminal or a server. In some embodiments, the terminal can be a terminal device that integrates a nuclear power plant simulator, such as a smart phone, tablet computer, laptop computer, desktop computer, etc.; the server can be configured as an independent physical server, or as a server cluster or distributed system composed of multiple physical servers, or as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the nuclear reactor thermal hydraulic simulation method, etc., but is not limited to the above forms.
[0064] Alternatively, the present application may be used in a variety of general or specialized computer system environments or configurations. For example, personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer computer devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types.
[0065] For ease of understanding and explanation, the following text will use a nuclear power plant simulator (hereinafter referred to as a simulator) as an example to explain the application in detail the nuclear reactor thermal-hydraulic simulation method provided in the embodiments of the present application. The implementation of any of the above-mentioned subject matter using the nuclear reactor thermal-hydraulic simulation method provided in the embodiments of the present application can refer to the process of using the simulator to control the nuclear reactor thermal-hydraulic simulation method using steam pressure as described below.
[0066] Please refer to Figure 1 , Figure 1 The following is a flow chart of the steps in some embodiments of the nuclear reactor thermal hydraulic simulation method provided in the present application. Figure 1The execution order of some method steps is shown in the figure, but based on the different design requirements of actual applications, the nuclear reactor thermal hydraulic simulation method provided in the embodiment of the present application can certainly adopt an execution order different from the method steps shown in the figure. That is, Figure 1 The order of the steps in the method shown does not constitute a limitation on the execution logic order of the nuclear reactor thermal hydraulic simulation method provided in the embodiment of the present application. Figure 1 Reasonable changes in the sequence of the method steps shown should be included in the scope of protection of the nuclear reactor thermal-hydraulic simulation method provided in the embodiments of the present application.
[0067] like Figure 1 As shown, in some embodiments, the nuclear reactor thermal-hydraulic simulation method provided in the embodiments of the present application may include steps S101 to S103 as shown below.
[0068] Step S101: obtaining the simulation requirements of nuclear reactor thermal hydraulics.
[0069] When simulating nuclear reactor thermal hydraulics, the simulator first obtains the simulation requirements for the nuclear reactor thermal hydraulics. These requirements can be functional requirements for the nuclear reactor thermal hydraulics program on the simulator. For example, simulation requirements may include saving operating conditions, resetting / rolling back operating conditions, loading and unloading, freezing and running, and computing time synchronization.
[0070] In some embodiments, the simulator may receive simulation requirements manually input by staff who are engaged in simulation development and modification of thermal hydraulic software through a human-computer interaction interface.
[0071] In other embodiments, the simulator can also obtain simulation requirements from a preset big data platform (which provides services such as thermal hydraulic software simulation development and modification) through a communication connection with the big data platform.
[0072] Step S102: determining a target function corresponding to the simulation requirement among a plurality of control functions of a thermal-hydraulic analysis program.
[0073] It should be noted that the thermal-hydraulic analysis program can be a thermal-hydraulic analysis software for a light water reactor nuclear power plant. A simulator can be developed based on the thermal-hydraulic analysis software to obtain a simulator simulation program, which is used for simulation development and modification of the thermal-hydraulic software, improving the interactivity and extended simulation functions of the simulator simulation program, and tracking simulation calculation results and operating status in real time. The nuclear reactor thermal-hydraulic simulation method provided in the embodiment of the present application takes the thermal-hydraulic analysis program and the simulation platform (such as a simulator) as research objects. By studying the data structure and calculation process of the thermal-hydraulic analysis program, a coupling study between the thermal-hydraulic analysis program and the simulation platform is carried out. By modifying the process of the thermal-hydraulic analysis program and developing the functional modules of the simulation platform, the simulation function is realized to simulate the thermal-hydraulics of the nuclear reactor.
[0074] After obtaining the simulation requirements of nuclear reactor thermal hydraulics, the simulator analyzes the program calculation process and data storage method of the thermal hydraulic analysis program, and determines the target function corresponding to the simulation requirements among the multiple control functions of the thermal hydraulic analysis program.
[0075] For example, in response to the simulation requirement of "saving operating conditions," the simulator analyzes the thermal-hydraulic analysis program's calculation process and data storage method, confirming that the "save operating condition file" function, among the various control functions of the thermal-hydraulic analysis program, is the target function corresponding to the simulation requirement of "saving operating conditions." Similarly, the simulator further confirms that the "reset operating condition file" function in the thermal-hydraulic analysis program is the target function corresponding to the simulation requirement of "reset / rollback operating conditions," and that the "run / pause / load" function in the thermal-hydraulic analysis program is the target function corresponding to the simulation requirement of "load and unload, freeze and run," and that the "time synchronization" function in the thermal-hydraulic analysis program is the target function corresponding to the simulation requirement of "computation time synchronization."
[0076] Step S103: generating a control function of the target function, and calling the thermal-hydraulic analysis program based on the control function to run the target function to perform thermal-hydraulic simulation of a nuclear reactor.
[0077] After determining the target functions in the thermal-hydraulic analysis program that correspond to the simulation requirements, the simulator further generates control functions for each target function to implement these functions. These control functions include loading and unloading, freezing and running, computing time synchronization, and saving and resetting operating conditions. Thus, when simulating nuclear reactor thermal-hydraulic dynamics, the simulator can invoke the thermal-hydraulic analysis program to execute the target functions corresponding to the simulation requirements by running the generated control functions, thereby achieving the simulation function.
[0078] In some embodiments, the simulator may generate a control function capable of calling the target function to implement the control function based on the position parameters of the target function corresponding to the simulation requirements in the thermal-hydraulic analysis program.
[0079] Please refer to Figure 2 , Figure 2 for Figure 1 Schematic diagram of the detailed process flow of step S103.
[0080] like Figure 2 As shown, in some embodiments, the "generating the control function of the target function" in the above-mentioned step S103 may include the following steps S201 and S202.
[0081] Step S201: Obtain the location path of the target function in the thermal-hydraulic analysis program.
[0082] By studying the calculation process and data storage method of the thermal-hydraulic analysis program, the simulator obtains each previously determined target function corresponding to the simulation requirements and their respective location paths in the thermal-hydraulic analysis program.
[0083] Step S202: using the location path as a call target parameter of a simulation control function to generate a control function for the target function.
[0084] It should be noted that the simulation control function is the control function within the simulator's simulation program. The control function (also known as the thermal-hydraulic response function or thermal-hydraulic response program, hereinafter referred to as the control function) is used to call the thermal-hydraulic analysis program to run the target function based on the position path when the simulation program runs the simulation control function.
[0085] After obtaining the location paths of each target function in the thermal-hydraulic analysis program, the simulator uses the target function's location paths as the target parameters for calling the simulation control function in its own simulation program at runtime, thereby generating a control function for that target function. In this way, when the simulator is running the simulation program to perform nuclear reactor thermal-hydraulic simulation, the simulator can call the thermal-hydraulic analysis program to execute the target function based on the location paths of the target function corresponding to the simulation requirement by running the corresponding simulation control function.
[0086] For example, the simulator can use the location path of the target function "Store Condition File" corresponding to the simulation requirement "Save Condition" in the thermal-hydraulic analysis program as a call target parameter to generate a control function for achieving this target function, namely a "Data File Storage Function." Similarly, the simulator can also generate a control function for achieving the target function "Reset Condition File" as a "Rollback / Data File Reading Function," a thermal-hydraulic response program for achieving the target functions "Run / Pause / Load" as a "Call Thermal-hydraulic Main Program," and a control module for achieving the target function "Time Synchronization" as a "Time Step Control Module."
[0087] In the embodiment of the present application, a simulator first obtains the simulation requirements for nuclear reactor thermal hydraulics. Then, by analyzing the thermal hydraulic analysis program's calculation process and data storage method, a target function corresponding to the simulation requirements is determined from the program's multiple control functions. Finally, a control function is generated for each target function to implement the control function, including loading and unloading functions, freezing and running functions, computing time synchronization functions, and operating condition saving and resetting functions. Thus, when the simulator performs a nuclear reactor thermal hydraulic simulation, it can invoke the thermal hydraulic analysis program to execute the target function corresponding to the simulation requirements by running the generated control function, thereby implementing the simulation function.
[0088] In other words, the nuclear reactor thermal-hydraulic simulation method provided by the embodiments of the present application can simulate nuclear reactor thermal-hydraulics based on a thermal-hydraulics analysis program, eliminating the need for special processing for cross-compilation environments and programming languages, thereby improving the versatility of nuclear reactor thermal-hydraulics simulation. Furthermore, based on the simulation of thermal-hydraulics analysis software, the embodiments of the present application can be used to build thermal-hydraulics simulation models for daily training and examinations of nuclear power plant operators, enabling simulator users to gain a deeper understanding of the nuclear power plant thermal-hydraulics simulation process, thereby improving the simulator's simulation capabilities and training effectiveness.
[0089] Furthermore, the embodiment of the present application develops a simulator simulation program based on thermal-hydraulic analysis software, realizing an integrated development solution for thermal-hydraulic simulation programs for nuclear power plant simulators. This solution is suitable for transforming various thermal-hydraulic analysis programs into programs with simulation platform scheduling capabilities, thereby providing real-time scheduling and control functions for thermal-hydraulic simulations. Furthermore, the embodiment of the present application can adaptively adjust the calculation process of the thermal-hydraulic analysis program without changing the overall architecture of the thermal-hydraulic analysis program, thereby minimizing the impact on the original functions and performance of the thermal-hydraulic analysis program, maintaining the precision and calculation accuracy of the thermal-hydraulic analysis program, and thus making the simulation results of nuclear reactor thermal-hydraulic simulations highly accurate and reliable.
[0090] In some embodiments, the simulator can create a data coupling interface between the simulation program and the thermal-hydraulic analysis program, and implement data encapsulation and calling through callback functions and dynamic library compilation, which can also solve problems caused by differences in programming languages and compilation environments.
[0091] Please refer to Figure 3 , Figure 3 for Figure 1 Schematic diagram of the detailed process flow of step S103.
[0092] like Figure 3 As shown, in some embodiments, the above-mentioned step S103 of "calling the thermal-hydraulic analysis program based on the control function to run the target function to perform nuclear reactor thermal-hydraulic simulation" may include steps S301 to S303 as shown below.
[0093] Step S301: Acquire nuclear reactor thermal hydraulic simulation data.
[0094] During the simulation process of nuclear reactor thermal hydraulics, the simulator receives simulation data for simulation analysis of nuclear reactor thermal hydraulics through a human-computer interaction interface provided to staff, or obtains pre-stored simulation data from the local computer.
[0095] Step S302: compile the simulation data into a dynamic link library.
[0096] After the simulator obtains the simulation data, it compiles the obtained simulation data into a dynamic link library, thereby encapsulating and calling the simulation data through the dynamic library compilation.
[0097] In some embodiments, the simulator can compile the acquired simulation data into a dynamic link library through callback information reference and dynamic library compilation functions, so as to be called in subsequent nuclear reactor thermal hydraulic simulation analysis.
[0098] Step S303: loading the dynamic link library based on the callback function, calling the thermal-hydraulic analysis program based on the control function to run the target function, and processing the simulation data encapsulated in the dynamic link library to perform simulation analysis of nuclear reactor thermal-hydraulics.
[0099] After the simulator compiles the simulation data into a dynamic link library, it then uses a predefined callback function to load the dynamic link library when running the simulation program to perform nuclear reactor thermal-hydraulic simulation analysis. The simulator then executes one or more target functions in the thermal-hydraulic analysis program called by the simulation program's execution control function, processing the simulation data to perform nuclear reactor thermal-hydraulic simulation analysis.
[0100] In some embodiments, the simulator can define a callback function by running a simulation main program (simulation simulator) and call simulation data encapsulated in a dynamic link library.
[0101] In some embodiments, the simulator can implement interaction between simulation data and data from the thermal-hydraulic analysis program by studying the data structure of the program. Each component in the simulation program uses a structure to store data, so that parameters of the same control volume have the same format. By calling the parameter address, all parameters can be output to the global variables of the data coupling interface with the thermal-hydraulic analysis program. Similar operations are used for data from other components in the simulation program.
[0102] Please refer to Figure 4 , Figure 4 for Figure 3 Schematic diagram of the detailed process flow of step S303.
[0103] like Figure 4 As shown, in some embodiments, the above-mentioned step S303 of "calling the thermal-hydraulic analysis program based on the control function to run the target function and process the simulation data encapsulated in the dynamic link library" may include steps S401 to S403 as shown below.
[0104] Step S401: The simulation data encapsulated in the dynamic link library is stored as a first structure form, wherein the first structure form and the second structure form storing the first target data in the thermal-hydraulic analysis program are of the same structure type, and the first target data is data processed based on the target function.
[0105] It should be noted that the first structure form and the second structure form storing the first target data in the thermal-hydraulic analysis program belong to the same structure type. The first target data is the data processed by the thermal-hydraulic analysis program based on the running target function.
[0106] The simulator can pre-analyze the data structure of the thermal-hydraulic analysis program to determine the second structural form in which the first target data, processed by the program based on the execution of the target function, is stored within the thermal-hydraulic analysis software. This allows the simulator to process the simulation data by invoking the target function within the program based on the control function. The simulation data encapsulated in the dynamic link library can be stored as a first structural form with the same structure type as the second structural form. This facilitates subsequent transmission of the entire simulation data to the thermal-hydraulic analysis program.
[0107] Step S402: converting the simulation data in the first structure form into the simulation data in the second structure form based on the callback function.
[0108] After storing simulation data in the first structure, the simulator uses a predefined callback function to convert the simulation data from the first structure into the second structure, thereby transferring the entire simulation data to the thermal-hydraulic analysis program. For example, in the thermal-hydraulic analysis program, the control volume-related data (first target data) is stored in the vol1d structure (second structure), so interaction can be achieved through the entire transfer method. In the simulation program, a similar vol1dsim (stored in the first structure) is constructed and the callback function is used to set vol1dsim = vol1d, completing the transfer of all control volumes.
[0109] In some embodiments, after transferring simulation data from the simulation program to the thermal-hydraulic analysis program, the simulator can also output the simulation data in a graphical format. This visualization of interface parameters can improve the user-friendliness of using the simulator program for nuclear reactor thermal-hydraulic simulation analysis.
[0110] Step S403: Based on the control function, the thermal-hydraulic analysis program is called to run the target function to process the simulation data of the second structural form.
[0111] After the simulator transfers the simulation data from the simulation program to the thermal-hydraulic analysis program, it can process the simulation data that has been converted into the second structural form by calling the target function of the thermal-hydraulic analysis program based on executing the control function generated by the previous design when running the simulation control function of the simulation program, thereby realizing the simulation function of simulating the thermal hydraulics of the nuclear reactor.
[0112] In some embodiments, the nuclear reactor thermal hydraulic simulation method provided in the embodiments of the present application may further include the following steps:
[0113] The second target data in the second structure format is converted into data in the first structure format based on the callback function.
[0114] It should be noted that the second target data includes: simulation data after the thermal-hydraulic analysis program modifies the simulation data of the second structural form, or processing result data output after the thermal-hydraulic analysis program runs the target function to process the simulation data of the second structural form.
[0115] In addition to transmitting simulation data of the first structure form from the simulation program to the thermal-hydraulic analysis program, the simulator can also use a callback function to convert the second target data of the second structure form in the thermal-hydraulic analysis program into data of the first structure form, so as to transmit the second target data back to the simulation program, thereby achieving the effect of data interaction between the simulation program and the thermal-hydraulic analysis program. For example, based on the same idea as the above-mentioned transmission of the control volume related data as a whole to the thermal-hydraulic analysis program, after the staff modifies the relevant control volume data through the thermal-hydraulic analysis program, the callback function is used to set vol1d = vol1dsim, and the reverse value transmission can be completed, that is, the data obtained after the modification of the relevant control volume data (the second target data) is transmitted as a whole to the simulation program. For another example, after the thermal-hydraulic analysis program runs the target function to process the simulation data of the second structure form vol1d to obtain the processed result data also stored in the vol1d structure form, the simulator can also use the callback function to set vol1d = vol1dsim, so that the processed result data can be transmitted as a whole to the simulation program.
[0116] In this embodiment, the simulator pre-studies the data structure of the thermal-hydraulic analysis program. When the target function in the thermal-hydraulic analysis program is called based on the control function to process the simulation data, the simulation data encapsulated in the dynamic link library is stored as a first structure of the same structure type as the second structure, and a pre-defined callback function is used to convert the simulation data in the first structure into simulation data in the second structure, thereby achieving the overall transmission of the simulation data to the thermal-hydraulic analysis program. In this way, when the simulator runs the simulation control function of the simulation program, it can call the target function in the thermal-hydraulic analysis program based on the execution of the previously designed control function to process the simulation data that has been converted to the second structure, thereby achieving the simulation function of simulating the thermal hydraulics of the nuclear reactor. In addition, in this embodiment, the simulator uses the callback function to convert the second target data in the second structure of the thermal-hydraulic analysis program into data in the first structure, so that the second target data is returned to the simulation program, thereby achieving the effect of data interaction between the simulation program and the thermal-hydraulic analysis program.
[0117] In this way, this embodiment can address the challenges of thermal-hydraulic analysis programs in simulation applications, such as the large and difficult-to-process data content and complex data interactions with other programs. This makes it suitable for data visualization and inter-program data communication within simulation platforms. Furthermore, thermal-hydraulic analysis programs can be used as tools for nuclear reactor thermal-hydraulic simulation analysis and interface communication, improving the efficiency of simulation modeling and analysis. Furthermore, this embodiment can be adapted to different simulation platforms, leveraging dynamic library compilation and callback functions to effectively address issues arising from differences in programming languages and compilation environments.
[0118] In some embodiments, the simulator can also achieve more realistic thermal hydraulic simulation effects by exchanging data between the simulation program and other programs, that is, by establishing a simulation data and flow network tool simulation interface to interact with the programs.
[0119] Please refer to Figure 5 , Figure 5 A schematic flow chart of the steps of the nuclear reactor thermal-hydraulic simulation method provided in the embodiment of the present application in other embodiments.
[0120] like Figure 5 As shown, in some embodiments, after the above-mentioned step S103: generating a control function of the target function, and calling the thermal-hydraulic analysis program based on the control function to run the target function to perform nuclear reactor thermal-hydraulic simulation, the nuclear reactor thermal-hydraulic simulation method provided by the embodiment of the present application may also include steps S501 and S502 as shown below.
[0121] Step S501: receiving third-party simulation data transmitted by a third-party program.
[0122] It should be noted that the third-party program is a program other than the above-mentioned simulation program and thermal hydraulic analysis program, such as a fluid boundary control program, a fluid node control program, a fluid pipeline control program, etc. In addition, the third-party simulation data is parameters related to the thermal hydraulic simulation of a nuclear reactor, such as boundary flow, pipeline pressure, enthalpy, temperature, cavitation fraction, and common mass components, etc. It should be understood that based on the different design requirements of actual applications, the third-party program may of course also include other control programs not mentioned here, and the third-party simulation data may of course also include other parameters not mentioned here. The nuclear reactor thermal hydraulic simulation method provided in the embodiment of the present application is not limited to the specific types of the third-party program and the third-party simulation data.
[0123] When simulating the thermal hydraulics of a nuclear reactor, the simulator can also receive third-party simulation data transmitted by one or more third-party programs based on the communication connection with other third-party programs.
[0124] Step S502: Based on the control function, the thermal-hydraulic analysis program is called to run the target function to process the third-party simulation data and perform a simulation analysis of the thermal-hydraulics of the nuclear reactor.
[0125] After receiving the third-party simulation function, the simulator, based on the principle basically the same as the process shown in the above-mentioned steps S302, S303 and the refined steps S401 to S403 of step S303, when running the simulation control function of the simulation program, executes the control function generated by the previous design to call the thermal-hydraulic analysis program to run the target function therein, processes the third-party simulation data, and thus realizes the simulation function of simulating the thermal hydraulics of the nuclear reactor.
[0126] In some embodiments, the nuclear reactor thermal hydraulic simulation method provided in the embodiments of the present application may further include the following steps:
[0127] Simulation control parameters are passed to the third-party program.
[0128] When running a simulation program to simulate nuclear reactor thermal hydraulics, the simulator can also transfer parameters to other third-party programs through the simulation program, thereby enabling data exchange between the simulation program and the third-party program. For example, the simulator can transfer simulation control parameters such as pressure, enthalpy, and composition information to a fluid boundary control program through the simulation program. Another example is that the simulator can transfer simulation control parameters such as flow rate, enthalpy, and composition information to a fluid node control program through the simulation program.
[0129] In some embodiments, the above-mentioned step of "transmitting simulation control parameters to the third-party program" may include the following detailed steps:
[0130] Obtaining an interface type of a preset simulation interface, wherein the simulation interface is a simulation interface between a simulation program of the simulator and the third-party program;
[0131] The simulation control parameters corresponding to the interface type are transmitted to the third-party program through the simulation interface.
[0132] It should be noted that the simulation interface can be the above-mentioned simulation data and flow network tool simulation interface. The simulator can establish a simulation interface between the simulation program and a third-party program when developing and designing the simulation program.
[0133] When the simulator passes parameters to a third-party program through the simulation program, it first obtains the interface type of the pre-established simulation interface between the simulation program and the third-party program. It then identifies the simulation control parameters corresponding to the interface type, based on the parameter types that the simulation interface can pass, and then passes the simulation control parameters to the third-party program through the simulation interface.
[0134] In some embodiments, the interface types of the simulation interface between the simulation program and the third-party program may include: node and valve types, and boundary and pipe types. The simulation control parameters corresponding to the node and valve types include: flow simulation control parameters (i.e., the aforementioned "flow") and other general simulation control parameters of the flow network tool (e.g., the aforementioned "enthalpy" and "composition information"), while the simulation control parameters corresponding to the boundary and pipe types include: pressure simulation control parameters (i.e., the aforementioned "pressure") and other general simulation control parameters of the flow network tool.
[0135] In this case, the above-mentioned step of "transmitting the simulation control parameters corresponding to the interface type to the third-party program through the simulation interface" may include the following detailed steps:
[0136] In the case where the interface type is a node and valve type, the flow simulation control parameters and the flow network tool general simulation control parameters are transmitted to the third-party program through the simulation interface;
[0137] In the case where the interface type is a boundary and takeover type, the pressure simulation control parameters and the flow network tool general simulation control parameters are transmitted to the third-party program through the simulation interface.
[0138] When the simulator passes parameters to other third-party programs through the simulation program and passes parameters to a third-party program through the simulation program, when the interface type of the simulation interface between the simulation program and the third-party program is a node and valve type, according to the parameter type that can be passed by the simulation interface defined by the boundary and takeover type, the simulation control parameters corresponding to the node and valve type are confirmed to be flow simulation control parameters and general simulation control parameters of the flow network tool, thereby immediately passing the flow simulation control parameters and general simulation control parameters of the flow network tool to the third-party program through the simulation interface. When the interface type of the simulation interface between the simulation program and the third-party program obtained by the simulator is a boundary and takeover type, according to the parameter type that can be passed by the simulation interface defined by the boundary and takeover type, the simulation control parameters corresponding to the boundary and takeover type are confirmed to be pressure simulation control parameters and general simulation control parameters of the flow network tool, thereby immediately passing the pressure simulation control parameters and general simulation control parameters of the flow network tool to the third-party program through the simulation interface.
[0139] In this embodiment, the simulator receives third-party simulation data transmitted by one or more third-party programs through a communication connection with other third-party programs. Subsequently, when running the simulation control function of the simulation program, the simulator executes the control function previously designed and generated to call the target function of the thermal-hydraulic analysis program to process the third-party simulation data, thereby realizing the simulation function of simulating the thermal-hydraulics of the nuclear reactor. In addition, the simulator transmits parameters to other third-party programs through the simulation program, thereby realizing data interaction between the simulation program and the third-party programs. In other words, this embodiment can realize external input control of the thermal-hydraulic analysis program through a data interface, thereby improving human-computer interaction performance. In addition, this embodiment facilitates the coupling of other programs (third-party programs) to the thermal-hydraulic analysis program by providing a data communication interface (simulation interface), thereby coupling different types of calculation programs together to form a larger system, thereby realistically simulating different physical properties and their mutual influences, and meeting special operating requirements. Moreover, this embodiment adopts an open structure design for the simulation program and provides a programming interface, which can support the integration of third-party software with it in a plug-in or embedded manner, thereby improving the efficiency of simulator development.
[0140] Next, a complete embodiment of the nuclear reactor thermal hydraulic simulation method provided in the embodiment of the present application is proposed.
[0141] This embodiment takes the thermal-hydraulic analysis program and simulation platform as the research objects. By studying the data structure and calculation process, the coupling research between the thermal-hydraulic analysis program and the simulation platform is carried out. The simulation function is realized by the process transformation of the thermal-hydraulic analysis program and the development of the simulation platform functional modules.
[0142] This embodiment can be implemented by the technical solutions shown in the following steps 1 to 5:
[0143] Step 1: Study the calculation process and data storage method of the thermal hydraulic analysis program to realize the control functions, including: loading and unloading functions, freezing and running functions, calculation time synchronization functions, working condition saving and resetting functions.
[0144] The corresponding relationships between the simulation requirements, functions, and thermal-hydraulic response functions / programs between the simulation platform and the thermal-hydraulic analysis program are shown in the following table.
[0145] Simulation requirements Function Thermal-hydraulic response functions / programs Working condition saving Storage case files Data file storage function Working condition reset / rollback Reset working condition file Fallback / data file reading function Loading and unloading, freezing and running Run / Pause / Load Call the thermal hydraulic main program Computing time synchronization Time synchronization Time step control module
[0146] In addition, the functional description and corresponding function design of the simulation platform are as follows: Figure 6 As shown, Figure 6 The related functions of the thermal hydraulic analysis program are abbreviated using the prefix "TH".
[0147] Step 2: To realize the simulation data input and output functions, create a data coupling interface, and implement data encapsulation and calling through callback functions and dynamic library compilation, while solving problems caused by differences in programming languages and compilation environments.
[0148] Among them, the simulation platform functions and corresponding function designs involved in data encapsulation and calling are realized through callback functions and dynamic library compilation. Figure 7 shown.
[0149] Step 3: Study the data structure of the thermal-hydraulic analysis program to implement data exchange between simulation data and the program. In the main program on the simulation platform, each component uses structures to store data. That is, parameters for the same control volume share the same format. By calling the parameter address, all parameters can be output to the coupling interface global variables. For example, in the thermal-hydraulic analysis program, control volume-related data is stored in the vol1d structure, allowing for interaction through global transfer. Construct a similar vol1dsim in the main program, use a callback function to set vol1dsim = vol1d, complete the transfer of all control volumes, and then output graphically. Similarly, after modifying the relevant control volume data, set vol1d = vol1dsim to complete the reverse transfer, thus achieving data exchange. Similar operations are performed for other component data.
[0150] Step 4: Realize data interaction between the simulation platform and other programs, and conduct data interaction between programs through the established simulation data and flow network tool simulation interface, so as to achieve a more realistic thermal hydraulic simulation effect. Among them, the interface data transmission between the simulation data and the flow network tool simulation interface is as follows Figure 8 shown.
[0151] Step 5: Through the functions of the simulation platform designed and developed in steps 1 to 4 above, a thermal-hydraulic simulation model is built to implement simulation and analysis based on the thermal-hydraulic analysis program.
[0152] Based on the same inventive concept, embodiments of the present application also provide a nuclear reactor thermal-hydraulic simulation device for implementing the aforementioned nuclear reactor thermal-hydraulic simulation method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more of the following embodiments of the nuclear reactor thermal-hydraulic simulation device can be found in the aforementioned limitations of the nuclear reactor thermal-hydraulic simulation method and will not be further elaborated here.
[0153] In some embodiments, as Figure 9 As shown, a nuclear reactor thermal hydraulic simulation device is provided, which is applied to a simulator and includes: an acquisition module 901, a program function determination module 902 and a simulation control module 903, wherein:
[0154] An acquisition module 901 is used to obtain the simulation requirements of nuclear reactor thermal hydraulics;
[0155] A program function determination module 902 is configured to determine a target function corresponding to the simulation requirement among a plurality of control functions of the thermal hydraulic analysis program;
[0156] The simulation control module 903 is used to generate a control function of the target function, and based on the control function, call the thermal-hydraulic analysis program to run the target function to perform nuclear reactor thermal-hydraulic simulation.
[0157] In some embodiments, the apparatus further comprises:
[0158] The third-party data interaction module is used to receive third-party simulation data transmitted by third-party programs;
[0159] The simulation control module 903 is further configured to call the thermal-hydraulic analysis program based on the control function to run the target function to process the third-party simulation data and perform simulation analysis on the thermal-hydraulics of the nuclear reactor.
[0160] In some embodiments, the simulation control module 903 is also used to obtain simulation data of nuclear reactor thermal hydraulics; compile the simulation data into a dynamic link library; and load the dynamic link library based on a callback function, and call the thermal hydraulic analysis program based on the control function to run the target function, and process the simulation data encapsulated in the dynamic link library to perform simulation analysis of nuclear reactor thermal hydraulics.
[0161] In some embodiments, the simulation control module 903 is also used to store the simulation data encapsulated in the dynamic link library as a first structure form, the first structure form and the second structure form storing the first target data in the thermal-hydraulic analysis program belong to the same structure type, and the first target data is data processed based on the target function; based on the callback function, the simulation data in the first structure form is converted into the simulation data in the second structure form; and based on the control function, the thermal-hydraulic analysis program is called to run the target function to process the simulation data in the second structure form.
[0162] In some embodiments, the simulation control module 903 is also used to convert second target data in the second structural form into data in the first structural form based on a callback function; wherein, the second target data includes: simulation data after the thermal-hydraulic analysis program modifies the simulation data in the second structural form, or, processing result data output after the thermal-hydraulic analysis program runs the target function to process the simulation data in the second structural form.
[0163] In some embodiments, the simulation control module 903 is also used to pass simulation control parameters to the third-party program; specifically, it includes: obtaining the interface type of a preset simulation interface, where the simulation interface is the simulation interface between the simulation program of the simulator and the third-party program; and passing the simulation control parameters corresponding to the interface type to the third-party program through the simulation interface.
[0164] In some embodiments, the interface types include: node and valve type, and boundary and takeover type; the simulation control parameters include: flow simulation control parameters, pressure simulation control parameters, and general simulation control parameters of flow network tools; the simulation control module 903 is also used to, when the interface type is a node and valve type, pass the flow simulation control parameters and the general simulation control parameters of the flow network tool to the third-party program through the simulation interface; and, when the interface type is a boundary and takeover type, pass the pressure simulation control parameters and the general simulation control parameters of the flow network tool to the third-party program through the simulation interface.
[0165] In some embodiments, the program function determination module 902 is also used to obtain the location path of the target function in the thermal-hydraulic analysis program; and use the location path as the calling target parameter of the simulation control function to generate a control function for the target function; wherein the simulation control function is a control function in the simulation program of the simulator, and the control function is used to call the thermal-hydraulic analysis program based on the location path to run the target function when the simulation program runs the simulation control function.
[0166] Each module in the nuclear reactor thermal-hydraulic simulation device provided in the embodiments of the present application can be implemented in whole or in part through software, hardware, or a combination thereof. Each of the modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0167] In some embodiments, the present application provides a computer device, which may be a server, and its internal structure diagram may be as follows: Figure 10 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store model parameters related to liquid metal reactors. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a nuclear reactor thermal hydraulic simulation method is implemented.
[0168] Those skilled in the art will understand that Figure 10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0169] In some embodiments, a computer-readable storage medium is provided on which a computer program is stored. The steps implemented when the computer program is executed by a processor are the same as the steps implemented when the processor in the above-mentioned computer device executes the computer program. The same content will not be repeated here.
[0170] In one embodiment, a computer program product is provided, including a computer program. The steps implemented when the computer program is executed by a processor are the same as the steps implemented when the processor in the above-mentioned computer device executes the computer program. The same content will not be repeated here.
[0171] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0172] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0173] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A nuclear reactor thermal hydraulic simulation method, characterized in that: The method is applied to a simulator, and comprises: Obtain simulation requirements for nuclear reactor thermal hydraulics; determining a target function corresponding to the simulation requirement among a plurality of control functions of a thermal hydraulic analysis program; A control function of the target function is generated, and based on the control function, the thermal-hydraulic analysis program is called to run the target function to perform thermal-hydraulic simulation of a nuclear reactor.
2. The method according to claim 1, characterized in that The step of calling the thermal-hydraulic analysis program based on the control function to run the target function to perform thermal-hydraulic simulation of a nuclear reactor includes: Obtain simulation data of nuclear reactor thermal hydraulics; Compiling the simulation data into a dynamic link library; The dynamic link library is loaded based on the callback function, and the thermal hydraulic analysis program is called based on the control function to run the target function, and the simulation data encapsulated in the dynamic link library is processed to perform simulation analysis of nuclear reactor thermal hydraulics.
3. The method according to claim 2, characterized in that The step of calling the thermal-hydraulic analysis program based on the control function to run the target function and processing the simulation data encapsulated in the dynamic link library includes: Storing the simulation data encapsulated in the dynamic link library as a first structure, wherein the first structure is of the same structure type as a second structure storing first target data in the thermal-hydraulic analysis program, wherein the first target data is data processed based on the target function; Converting the simulation data in the first structure into simulation data in the second structure based on the callback function; The thermal-hydraulic analysis program is called based on the control function to run the target function to process the simulation data of the second structural form.
4. The method according to claim 3, characterized in that The method comprises: Converting the second target data in the second structure format into data in the first structure format based on the callback function; The second target data includes: simulation data after the thermal-hydraulic analysis program modifies the simulation data of the second structural form, or processing result data outputted after the thermal-hydraulic analysis program runs the target function to process the simulation data of the second structural form.
5. The method according to claim 1, wherein After calling the thermal-hydraulic analysis program based on the control function to run the target function to perform nuclear reactor thermal-hydraulic simulation, the method further includes: Receive third-party simulation data transmitted by third-party programs; Based on the control function, the thermal-hydraulic analysis program is called to run the target function to process the third-party simulation data and perform simulation analysis on the thermal-hydraulics of the nuclear reactor.
6. The method according to claim 5, characterized in that The method further comprises: passing simulation control parameters to the third-party program; The transmitting the simulation control parameter to the third-party program includes: Obtaining an interface type of a preset simulation interface, wherein the simulation interface is a simulation interface between a simulation program of the simulator and the third-party program; The simulation control parameters corresponding to the interface type are transmitted to the third-party program through the simulation interface.
7. The method according to claim 6, characterized in that The interface types include: node and valve types, and boundary and pipe types; the simulation control parameters include: flow simulation control parameters, pressure simulation control parameters, and general simulation control parameters of flow network tools; The transmitting the simulation control parameter corresponding to the interface type to the third-party program through the simulation interface includes: In the case where the interface type is a node and valve type, the flow simulation control parameters and the flow network tool general simulation control parameters are transmitted to the third-party program through the simulation interface; In the case where the interface type is a boundary and takeover type, the pressure simulation control parameters and the flow network tool general simulation control parameters are transmitted to the third-party program through the simulation interface.
8. The method according to any one of claims 1 to 7, characterized in that The control function for generating the target function includes: Obtaining a location path of the target function in the thermal-hydraulic analysis program; Using the position path as a call target parameter of a simulation control function to generate a control function for the target function; Among them, the simulation control function is a control function in the simulation program of the simulator, and the control function is used to call the thermal-hydraulic analysis program based on the position path to run the target function when the simulation program runs the simulation control function.
9. A nuclear reactor thermal hydraulic simulation device, characterized in that: The device is applied to a simulator, and comprises: Acquisition module, used to obtain the simulation requirements of nuclear reactor thermal hydraulics; A program function determination module, configured to determine a target function corresponding to the simulation requirement among a plurality of control functions of a thermal hydraulic analysis program; The simulation control module is used to generate a control function of the target function, and based on the control function, call the thermal-hydraulic analysis program to run the target function to perform thermal-hydraulic simulation of a nuclear reactor.
10. The device according to claim 9, characterized in that The device further comprises: The third-party data interaction module is used to receive third-party simulation data transmitted by third-party programs; The simulation control module is further used to call the thermal-hydraulic analysis program based on the control function to run the target function to process the third-party simulation data and perform simulation analysis of nuclear reactor thermal-hydraulics.