Modelica-based thermal hydraulic system model equipment elevation automatic checking and positioning method
The automated method for checking and positioning device heights and pipe lengths in thermal-hydraulic systems using Modelica addresses manual checking inefficiencies, ensuring accurate and efficient model building by identifying and correcting inconsistencies.
Patent Information
- Application Number
- CN202510292864.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-13
- Publication Date
- 2025-07-15
AI Technical Summary
During the Modelica-based thermal hydraulic system modeling process, when manually checking parameters such as equipment elevation, runner angle and runner length of equipment components, the workload is large and error-prone, resulting in incomplete model.
The automatic inspection method is adopted to obtain the import elevation, outlet elevation and flow channel length of the equipment components by traversing the thermal hydraulic system model, and perform planarization processing, calculate the length and center point elevation of the control body and the connector, form a planarization model connection diagram, and store basic node unit information through the data container to automatically determine and locate the equipment components with incorrect elevation or flow channel length configuration.
It realizes fast and complete equipment elevation and runner length inspection, improves the debugging efficiency and quality of the model, supports uniform and uneven discrete node division, and is suitable for linear and curved runners.
Smart Images

Figure CN120316933A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of thermal hydraulics, and particularly relates to a method for automatically checking and positioning the elevation of a thermal hydraulic system model device based on Modelica. Background Art
[0002] In the process of modeling a thermal hydraulic system based on Modelica, parameters such as the elevation of the thermal hydraulic device components, the flow channel angle, and the flow channel length need to be configured to express the position and size of the thermal hydraulic devices in physical space, and the fluid interfaces of each device component are connected by connecting lines to form a thermal hydraulic system model. There are constraint relationships between the connected thermal hydraulic device components in terms of elevation and flow channel length to ensure that the layout of the thermal hydraulic system model in physical space is self-consistent, that is, the flow channel length between any two control volume nodes in the thermal hydraulic system model is not less than the difference in elevation between these two control volume nodes. However, manually checking the parameters such as the elevation of the device components, the flow channel angle, and the flow channel length configured by the user is laborious, incomplete, and prone to errors. Summary of the Invention
[0003] The purpose of the present invention is to provide a method for automatically checking and positioning the elevation of a thermal hydraulic system model device based on Modelica, which can quickly and completely check the numerical relationship between the elevation of all device components and the flow channel length, judge and locate the thermal hydraulic device components with incorrect configuration of elevation, flow channel angle, or flow channel length, and improve the modeling efficiency and quality.
[0004] The technical solution of the present invention is as follows: A method for automatically checking and positioning the elevation of a thermal hydraulic system model device based on Modelica includes the following steps:
[0005] Step 1: Traverse the device components directly operated by the user in the thermal hydraulic system model to obtain the inlet elevation, outlet elevation, and flow channel length of the device components. The device components refer to pipes, containers, and other device components with discrete nodes defined inside, as well as higher-level complex device components formed by connecting and encapsulating device components.
[0006] Step 2: Flatten the flow channels of the device components. According to the hierarchical encapsulation information and discrete nodes of the device components, convert the flow channels of the device components into model components with an alternating directed connection of control volume models and takeover models, and calculate the length and center point elevation of each control volume of the device components and the length of each takeover according to the inlet elevation, outlet elevation, flow channel length, and device configuration of the device components. The control volume and the takeover are discrete nodes based on an alternating grid in the thermal hydraulic system.
[0007] Step 3: Traverse the basic node unit models directly operated by the user in the thermal-hydraulic system model to obtain the control volume length and the center point elevation of the basic node unit model of the control volume class. The basic node unit model refers to the model corresponding to the discrete nodes of the thermal-hydraulic system based on the staggered grid, including the control volume model v, the nozzle model j, the time-dependent control volume model tdv, and the time-dependent nozzle model tdj. The equipment component information of the basic node unit model directly operated by the user is empty;
[0008] Step 4: According to the connection relationship between the thermal-hydraulic models, connect the flattened equipment components and the basic node unit models to form the overall connection diagram of the flattened model corresponding to the thermal-hydraulic system model;
[0009] Step 5: Traverse the basic node units of the overall connection diagram of the flattened model, number the basic node units, and define a data container for each basic node unit. The data container stores the basic node unit number, type, equipment component information of the basic node unit model, parameters, and variables. If the basic node unit is a control volume class model, the parameter types stored in the data container at least include the control volume length and the center point elevation; if the basic node unit is a nozzle class model, the parameter types stored in the data container at least include the nozzle length;
[0010] Step 6: Traverse the nozzle class models in the overall connection diagram of the flattened model to obtain the nozzle class models with empty equipment component information of the basic node unit model and their upstream and downstream control volume numbers. Obtain the control volume lengths stored in the corresponding data containers of the upstream and downstream control volumes according to the upstream and downstream control volume numbers. The nozzle length of the nozzle class model is equal to 1 / 2 of the sum of the upstream and downstream control volume lengths.
[0011] Step 7: Traverse the nozzle class models in the overall connection diagram of the flattened model to obtain the upstream and downstream control volume numbers of the nozzle class model, store them in the corresponding data container of the nozzle class model, and obtain the control volume lengths and the center point elevations stored in the corresponding data containers of the upstream and downstream control volumes according to the upstream and downstream control volume numbers;
[0012] Step 8: Determine whether the absolute value of the difference between the center point elevations of the upstream and downstream control volumes of the nozzle is greater than the nozzle length;
[0013] Step 9: Whether the traversal of the nozzle class models in the overall connection diagram of the flattened model is completed;
[0014] Step 10: According to the recorded nozzle number, obtain the upstream and downstream control volume numbers stored in the data container of the nozzle, and obtain the equipment component information of the upstream and downstream control volumes from their data containers according to the upstream and downstream control volume numbers.
[0015] Step 11: Determine whether the equipment component information of the upstream and downstream control volumes is empty;
[0016] Step 12: Determine whether the device components to which the upstream control volume and the downstream control volume belong are the same device component;
[0017] Step 13: Determine whether the information of the device components to which the upstream control volume and the downstream control volume belong is both empty;
[0018] Step 14: End the automatic inspection and positioning of the equipment elevation.
[0019] The flow channel forms of the device components in Step 2 include single-inlet single-outlet straight flow channels, single-inlet single-outlet curved flow channels, and multi-inlet multi-outlet flow channels. Among them, the multi-inlet multi-outlet flow channel is a combination of several single-inlet single-outlet flow channels in configuration. By decomposing the multi-inlet multi-outlet flow channel of the device component into several single-inlet single-outlet flow channels, the flattening process and calculation process of the multi-inlet multi-outlet flow channel are transformed into the flattening process and calculation process of the single-inlet single-outlet flow channel.
[0020] For the single-inlet single-outlet straight flow channel, the flattening process, its basic node unit length, and elevation method are as follows:
[0021] Step 211: Obtain the inlet elevation H in of the flow channel, the outlet elevation H out , the flow channel length L, the number of discrete nodes N, and the discrete non-uniformity factor If the flow channel is evenly discretized, then
[0022] Step 212: According to the number of discrete nodes N, perform flattening processing on the flow channel, divide the flow channel into N control volume models and N - 1 connection pipe models, and the control volume models and the connection pipe models are connected alternately;
[0023] Step 213: Calculate the length ΔL V (i) of each control volume of the flow channel and the center point elevation H(i), and the calculation formulas are as follows:
[0024]
[0025] Step 214: Calculate the length ΔL J (j) of each connection pipe of the flow channel, and the calculation formula is as follows:
[0026]
[0027] For the single-inlet single-outlet curved flow channel, the flattening process, its basic node unit length, and elevation calculation method are as follows:
[0028] Step 221: Obtain the inlet elevation H in of the flow channel, the outlet elevation Hout 、the runner length L, the elevation function h(x) (0 ≤ x ≤ L) of the runner along the flow path relative to the inlet, the number of discrete nodes N, and the discrete non-uniformity factor If the runner is discretized uniformly, then For the elevation function h(x) of the runner along the flow path relative to the inlet, h(0) = 0 and h(L) = H out -H in ;
[0029] Step 222: According to the number of discrete nodes N, flatten the runner, divide the runner into N control volume models and N - 1 connection pipe models, and the control volume models and connection pipe models are connected alternately;
[0030] Step 223: Calculate the length ΔL V (i) and the center point elevation H(i) of each control volume of the runner. The calculation formulas are as follows:
[0031]
[0032] Step 224: Calculate the length ΔL J (j) of each connection pipe of the runner. The calculation formulas are as follows:
[0033]
[0034] In the basic node unit data container in step 5 above, the data containers correspond one-to-one to the basic node unit models in the overall connection diagram of the flattened model, and are used to store the basic node unit numbers, types, information on the equipment components to which the basic node unit models belong, parameters, and variable information. The data containers are stored and read / written using a fixed data structure. The data structure defines the number of data information entries stored, the memory space size, and the names and values of the data information stored in sequence. Users can directly read the value corresponding to a certain data information in the data container through the value-taking function based on the data container, or assign an external value to a certain data information in the data container through the writing function based on the data container. The value-taking function locates the corresponding data container according to the basic node unit number, and then reads the value at the corresponding memory location according to the data information name or serial number. The writing function locates the corresponding data container according to the basic node unit number, and then assigns the external value to the corresponding memory location according to the data information name or serial number;
[0035] The information on the equipment components to which the basic node unit models belong is obtained according to the equipment component flattening process, and refers to the names of the equipment components at the upper or higher levels to which the basic node unit models belong, up to the name of the equipment component directly operated by the user. If the basic node unit model belongs to the thermohydraulic model directly operated by the user in the thermohydraulic system model, the information on the equipment components to which the basic node unit model belongs is empty.
[0036] Step 8 mentioned above is divided into the following two cases:
[0037] Case 1: If the absolute value of the difference in elevation between the center points of the upstream and downstream control volumes is greater than the length of the connecting pipe, record the connecting pipe number and jump to Step 10;
[0038] Case 2: If the absolute value of the difference in elevation between the center points of the upstream and downstream control volumes is not greater than the length of the connecting pipe, jump to Step 9.
[0039] Step 9 mentioned above is divided into the following two cases:
[0040] Case 1: The traversal is completed, jump to Step 14;
[0041] Case 2: The traversal is not completed, jump to Step 7.
[0042] Step 11 mentioned above is divided into the following two cases:
[0043] Case 1: If the equipment component information of both the upstream and downstream control volumes is not empty, jump to Step 12;
[0044] Case 2: If there is an empty situation in the equipment component information of the upstream and downstream control volumes, jump to Step 13.
[0045] Step 12 mentioned above is divided into the following two cases:
[0046] Case 1: If the equipment components to which the upstream and downstream control volumes belong are the same equipment component, locate the equipment component and prompt "The elevation or flow path length of the equipment component's inlet and outlet is set unreasonably", and jump to Step 14;
[0047] Case 2: If the equipment component information of the upstream and downstream control volumes is not the same equipment component, locate the equipment components to which the upstream and downstream control volumes belong and prompt "The elevation or flow path length of adjacent equipment components is set unreasonably", and jump to Step 14.
[0048] Step 13 mentioned above is divided into the following three cases:
[0049] Case 1: If the equipment component information of both the upstream and downstream control volumes is empty, locate the upstream and downstream control volumes and prompt "The elevation or length of the center points of the upstream and downstream control volume models is set unreasonably", and jump to Step 14;
[0050] Case 2: If the equipment information of the upstream control volume is empty while the equipment information of the downstream control volume is not empty, locate the upstream control volume and the equipment components to which the downstream control volume belongs and prompt "The elevation or length of the upstream control volume and the downstream equipment component is set unreasonably", and jump to Step 14;
[0051] Case 3: The device information of the downstream control volume is empty while the device information of the upstream control volume is not empty. Locate the device components to which the downstream control volume and the upstream control volume belong, and prompt "The elevation or length setting of the downstream control volume and the upstream device components is unreasonable", then jump to step 14.
[0052] The beneficial effects of the present invention are as follows: (1) The present invention realizes the automatic inspection and positioning of the elevation of equipment in the thermal-hydraulic system model based on Modelica, avoiding problems such as large workload, incomplete inspection, and easy error when manually checking the elevation of equipment configured by users. It can quickly judge and locate the thermal-hydraulic equipment components with incorrect elevation, flow channel angle, or flow channel length configuration, improving the efficiency and quality of model debugging. (2) The present invention can automatically calculate the length of each control volume and the elevation of the center point in the system, as well as the length of each connecting pipe according to the discrete node division method of the thermal-hydraulic system model, providing necessary data input for the equation assembly of the thermal-hydraulic system model. The present invention supports both uniform and non-uniform discrete node divisions, and supports both straight and curved flow channels. Description of the Drawings
[0053] Figure 1 It is an example of the division of a straight flow channel control volume and a connecting pipe;
[0054] Figure 2 It is an example of the division of a curved flow channel control volume and a connecting pipe;
[0055] Figure 3 It is an example of the general connection diagram of the flattened model of the hydraulic characteristics system model of parallel channels. Detailed Embodiment
[0056] The present invention will be further described in detail below in conjunction with the drawings and specific embodiments.
[0057] A method for automatically inspecting and positioning the elevation of equipment in a thermal-hydraulic system model based on Modelica includes the following steps:
[0058] Step 1: Traverse the equipment components directly operated by the user in the thermal-hydraulic system model, and obtain the inlet elevation, outlet elevation, and flow channel length of the equipment components. The equipment components refer to pipes, containers, and other equipment components that can define discrete nodes internally, as well as higher-level complex equipment components formed by encapsulating the connection of equipment components.
[0059] Step 2: Flatten the flow channels of the equipment components. According to the hierarchical packaging information and discrete nodes of the equipment components, convert the flow channels of the equipment components into model components with an interleaved directed connection of control volume models and nozzle models, and calculate the length and center point elevation of each control volume of the equipment components and the length of each nozzle according to the inlet elevation, outlet elevation, flow channel length, and equipment configuration of the equipment components. The control volume and nozzle are discrete nodes of the thermal-hydraulic system based on an interleaved grid.
[0060] In the process of modeling the thermal-hydraulic system based on Modelica, the flow channel forms of the equipment components include single-inlet single-outlet straight flow channels, single-inlet single-outlet curved flow channels, and multi-inlet multi-outlet flow channels. Among them, the multi-inlet multi-outlet flow channel is a combination of several single-inlet single-outlet flow channels in terms of configuration. Therefore, by decomposing the multi-inlet multi-outlet flow channel of the equipment components into several single-inlet single-outlet flow channels, the flattening process and calculation process of the multi-inlet multi-outlet flow channel are transformed into the flattening process and calculation process of the single-inlet single-outlet flow channel.
[0061] For the single-inlet single-outlet straight flow channel, the flattening process and the method for calculating the length and elevation of its basic node units are as follows:
[0062] Step 211: Obtain the inlet elevation H in of the flow channel through the parameter configuration of the equipment component model and the equipment configuration out , outlet elevation H , flow channel length L, number of discrete nodes N, discrete non-uniformity factor
[0063] If the flow channel is uniformly discretized, then
[0064] Step 212: Flatten the flow channel according to the number of discrete nodes N, and divide the flow channel into N control volume models and N - 1 nozzle models, with the control volume models and nozzle models connected in an interleaved manner.
[0064] Step 213: Calculate the length ΔL V (i) of each control volume of the flow channel and the center point elevation H(i), and the calculation formulas are as follows:
[0065]
[0066] Step 214: Calculate the length ΔL J (j) of each nozzle of the flow channel, and the calculation formula is as follows:
[0067]
[0068] In the formula, both i and j are quantities.
[0069] For the single-inlet single-outlet curved flow channel, the flattening process and the method for calculating the length and elevation of its basic node units are as follows:
[0070] Step 221: Obtain the inlet elevation H of the flow channel through the parameter configuration of the equipment component model and the equipment configuration in , Exit elevation H out , flow channel length L, elevation function of the flow channel relative to the inlet h(0) (0≤x≤L), number of discrete nodes N, discrete non-uniform factor If the flow channel is uniformly discrete, then For the elevation function h(x) along the flow channel relative to the inlet, h(0)=0, h(L)=H out -H in .
[0071] Step 222: According to the number of discrete nodes N, the flow channel is flattened and divided into N control body models and N-1 takeover models. The control body model and the takeover model are connected in an alternating manner.
[0072] Step 223: Calculate the length ΔL of each control body of the flow channel V (i) and the center point elevation H(i), the calculation formula is as follows:
[0073]
[0074] Step 224: Calculate the length ΔL of each pipe of the flow channel J (j), the calculation formula is as follows:
[0075]
[0076] Step 3: Traverse the basic node unit model directly operated by the user in the thermal hydraulic system model, and obtain the control body length and center point elevation of the control body basic node unit model, the basic node unit model refers to the model corresponding to the discrete node of the thermal hydraulic system based on the staggered grid, including the control body model v, the takeover model j, the time-related control body model tdv, and the time-related takeover model tdj. The device component information of the basic node unit model directly operated by the user is empty.
[0077] Step 4: According to the connection relationship between the thermal-hydraulic models, connect the flattened equipment components and the basic node unit models to form a flattened model connection diagram corresponding to the thermal-hydraulic system model.
[0078] Step 5: Traverse the basic node units of the flattened model connection general diagram, number the basic node units, and define a data container for each basic node unit. The data container stores the basic node unit number, type, information about the equipment component to which the basic node unit model belongs, parameters, variables, etc. If the basic node unit is a control volume type model, the parameter types stored in the data container include at least the control volume length and the elevation of the center point; if the basic node unit is a nozzle type model, the parameter types stored in the data container include at least the nozzle length.
[0079] The data container for the basic node unit, which corresponds one-to-one to the basic node unit model of the flattened model connection general diagram, is used to store data information such as the basic node unit number, type, information about the equipment component to which the basic node unit model belongs, parameters, variables, etc. The data container is stored and read / written using a fixed data structure, which defines the number of data information entries stored, the memory space size, and the names and values of the data information stored by sequence number. Users can directly read the value corresponding to a certain data information in the data container through the value-taking function based on the data container, or assign an external value to a certain data information in the data container through the writing function based on the data container. The value-taking function locates the corresponding data container according to the basic node unit number, and then reads the value at the corresponding memory location according to the data information name or sequence number. The writing function locates the corresponding data container according to the basic node unit number, and then assigns the external value to the corresponding memory location according to the data information name or sequence number.
[0080] The information about the equipment component to which the basic node unit model belongs is obtained according to the equipment component flattening process, and refers to the name of the equipment component at the upper level or higher level to which the basic node unit model belongs, all the way to the name of the equipment component directly operated by the user. If the basic node unit model belongs to the thermohydraulic model directly operated by the user in the thermohydraulic system model, the information about the equipment component to which the basic node unit model belongs is empty.
[0081] Taking the flattened model connection general diagram of the parallel channel hydraulic characteristics system model as an example, the models directly operated by the user include the flow boundary model, the inlet pipeline model, the parallel channel model, the outlet control volume model, and the pressure boundary model. The information about the equipment component to which the basic node unit model belongs is divided into the following three cases:
[0082] Case 1: For the outlet control volume model, no flattening process is required, and the information about the equipment component to which it belongs is empty;
[0083] Case 2: For the flow boundary model, the inlet pipeline model, and the pressure boundary model, there is only one layer of encapsulation information. The equipment component information of the basic node unit model obtained by flattening these models has only one level of equipment component name. For example, the equipment component information of the control volume model obtained by flattening the inlet pipeline model is the inlet pipeline model;
[0084] Case 3: For the parallel channel model, there are two layers of encapsulation information. The equipment component information of the basic node unit model obtained by flattening the parallel channel model has two levels of equipment component names. For example, the equipment component information of the nozzle model obtained by flattening Branch 1 includes the Branch 1 model at the first level and the parallel channel model at the second level.
[0085] Step 6: Traverse the nozzle models in the flattened model connection general drawing, obtain the nozzle models whose equipment component information of the basic node unit model is empty and their upstream and downstream control volume numbers, obtain the control volume lengths stored in the corresponding data containers of the upstream and downstream control volumes according to the upstream and downstream control volume numbers, and the nozzle length of the nozzle model is equal to 1 / 2 of the sum of the upstream and downstream control volume lengths.
[0086] Step 7: Traverse the nozzle models in the flattened model connection general drawing, obtain the upstream and downstream control volume numbers of the nozzle models, store them in the corresponding data containers of the nozzle models, and obtain the control volume lengths and center point elevations stored in the corresponding data containers of the upstream and downstream control volumes according to the upstream and downstream control volume numbers.
[0087] Step 8: Determine whether the absolute value of the difference between the center point elevations of the upstream and downstream control volumes of this nozzle is greater than the nozzle length, which is divided into the following two cases:
[0088] Case 1: If the absolute value of the difference between the center point elevations of the upstream and downstream control volumes is greater than the nozzle length, record the nozzle number, and then jump to Step 10;
[0089] Case 2: If the absolute value of the difference between the center point elevations of the upstream and downstream control volumes is not greater than the nozzle length, then jump to Step 9.
[0090] Step 9: Whether the traversal of the nozzle models in the flattened model connection general drawing is completed, which is divided into the following two cases:
[0091] Case 1: The traversal is completed, jump to Step 14;
[0092] Case 2: The traversal is not completed, jump to Step 7.
[0093] Step 10: According to the recorded nozzle number, obtain the upstream and downstream control volume numbers stored in the data container of this nozzle, and obtain the equipment component information of the upstream and downstream control volumes from their data containers according to the upstream and downstream control volume numbers.
[0094] Step 11: Determine whether the device component information of the upstream control volume and the downstream control volume is empty; it is divided into the following two cases:
[0095] Case 1: If the device component information of both the upstream control volume and the downstream control volume is not empty, then jump to Step 12;
[0096] Case 2: If there is an empty situation in the device component information of the upstream control volume and the downstream control volume, then jump to Step 13.
[0097] Step 12: Determine whether the device components to which the upstream control volume and the downstream control volume belong are the same device component, which is divided into the following cases:
[0098] Case 1: If the device components to which the upstream control volume and the downstream control volume belong are the same device component, locate this device component, prompt "The elevation or flow path length of the device component inlet and outlet is set unreasonably", and jump to Step 14;
[0099] Case 2: If the device component information of the upstream control volume and the downstream control volume is not the same device component, locate the device component to which the upstream control volume belongs and the device component to which the downstream control volume belongs, prompt "The elevation or flow path length of adjacent device components is set unreasonably", and jump to Step 14.
[0100] Step 13: Determine whether the device component information of the upstream control volume and the downstream control volume is both empty, which is divided into the following cases:
[0101] Case 1: If the device component information of both the upstream control volume and the downstream control volume is empty, locate the upstream control volume and the downstream control volume, prompt "The elevation or length of the center point of the upstream and downstream control volume models is set unreasonably", and jump to Step 14;
[0102] Case 2: If the device information of the upstream control volume is empty while the device information of the downstream control volume is not empty, locate the upstream control volume and the device component to which the downstream control volume belongs, prompt "The elevation or length of the upstream control volume and the downstream device component is set unreasonably", and jump to Step 14;
[0103] Case 3: If the device information of the downstream control volume is empty while the device information of the upstream control volume is not empty, locate the downstream control volume and the device component to which the upstream control volume belongs, prompt "The elevation or length of the downstream control volume and the upstream device component is set unreasonably", and jump to Step 14.
[0104] Step 14: The automatic inspection and positioning of the device elevation ends.
Claims
1. A method for automatically checking and positioning the elevation of a thermal-hydraulic system model device based on Modelica, characterized in that, It includes the following steps: Step 1: Traverse the equipment components directly operated by the user in the thermal-hydraulic system model, and obtain the inlet elevation, outlet elevation, and flow path length of the equipment components; Step 2: Flatten the flow path of the equipment components. According to the hierarchical encapsulation information and discrete nodes of the equipment components, convert the flow path of the equipment components into a model component with an interleaved directed connection of a control volume model and a nozzle model, and calculate the length and center point elevation of each control volume of the equipment components and the length of each nozzle according to the inlet elevation, outlet elevation, flow path length, and equipment configuration of the equipment components; Step 3: Traverse the basic node unit model directly operated by the user in the thermal-hydraulic system model, and obtain the control volume length and center point elevation of the basic node unit model of the control volume type; Step 4: According to the connection relationship between the thermal-hydraulic models, connect the equipment components and the basic node unit model after the flattening process to form a general connection diagram of the flattened model corresponding to the thermal-hydraulic system model; Step 5: Traverse the basic node units of the general connection diagram of the flattened model, number the basic node units, and define a data container for each basic node unit; Step 6: Traverse the nozzle models of the general connection diagram of the flattened model, obtain the nozzle models whose equipment component information of the basic node unit model is empty and their upstream and downstream control volume numbers, and obtain the control volume lengths stored in the corresponding data containers of the upstream and downstream control volumes according to the upstream and downstream control volume numbers. The nozzle length of the nozzle model is equal to 1 / 2 of the sum of the upstream and downstream control volume lengths; Step 7: Traverse the nozzle models of the general connection diagram of the flattened model, obtain the upstream and downstream control volume numbers of the nozzle models, store them in the corresponding data containers of the nozzle models, and obtain the control volume lengths and center point elevations stored in the corresponding data containers of the upstream and downstream control volumes according to the upstream and downstream control volume numbers; Step 8: Judge whether the absolute value of the difference between the center point elevations of the upstream and downstream control volumes of the nozzle is greater than the nozzle length; Step 9: Whether the traversal of the nozzle models in the general connection diagram of the flattened model is completed; Step 10: According to the recorded nozzle number, obtain the upstream and downstream control volume numbers stored in the data container of the nozzle, and obtain the equipment component information of the upstream control volume and the downstream control volume from their data containers according to the upstream and downstream control volume numbers. Step 11: Judge whether the equipment component information of the upstream control volume and the downstream control volume is empty; Step 12: Judge whether the equipment components to which the upstream control volume and the downstream control volume belong are the same equipment component; Step 13: Judge whether the equipment component information of both the upstream control volume and the downstream control volume is empty; Step 14: The automatic inspection and positioning of the equipment elevation are completed.
2. The automatic inspection and positioning method for the elevation of a thermal-hydraulic system model device based on Modelica according to claim 1, characterized in that: In step 2, the flow path forms of the equipment components include single-inlet single-outlet straight flow paths, single-inlet single-outlet curved flow paths, and multi-inlet multi-outlet flow paths. Among them, the multi-inlet multi-outlet flow path is a combination of several single-inlet single-outlet flow paths in terms of configuration. By decomposing the multi-inlet multi-outlet flow path of the equipment components into several single-inlet single-outlet flow paths, the flattening process and calculation process of the multi-inlet multi-outlet flow path are transformed into the flattening process and calculation process of the single-inlet single-outlet flow path.
3. The method for automatically checking and positioning the elevation of a thermal-hydraulic system model device based on Modelica according to claim 2, characterized in that, For the single-inlet and single-outlet straight flow channel, the flattening process, the basic node unit length, and the elevation method are as follows: Step 211: Obtain the inlet elevation H of the flow channel through the parameter configuration of the device component model and the device configuration in , the outlet elevation H out , the flow channel length L, the number of discrete nodes N, the discrete non-uniformity factor If the flow channel is discretized uniformly, then Step 212: According to the number of discrete nodes N, perform flattening on the flow channel, divide the flow channel into N control volume models and N - 1 connection pipe models, and the control volume models and the connection pipe models are connected alternately; Step 213: Calculate the length ΔL of each control volume of the flow channel V (i) and the elevation H(i) of the center point, and the calculation formula is as follows: Step 214: Calculate the length ΔL of each connecting pipe of the flow channel J (j), and the calculation formula is as follows:
4. The automatic inspection and positioning method for the elevation of a thermal-hydraulic system model device based on Modelica according to claim 2, characterized in that, For the single-inlet and single-outlet curved flow channel, the flattening process, the basic node unit length, and the elevation calculation method are as follows: Step 221: Obtain the inlet elevation H of the flow channel through the parameter configuration of the device component model and the device configuration in , the outlet elevation H out , the flow channel length L, the elevation function h(x) (0 ≤ x ≤ L) of the flow channel along the path relative to the inlet, the number of discrete nodes N, and the discrete non-uniformity factor If the flow channel is discretized uniformly, then For the elevation function h(x) of the flow channel along the path relative to the inlet, h(0) = 0, h(L) = H out -H in ; Step 222: According to the number of discrete nodes N, perform flattening on the flow channel, divide the flow channel into N control volume models and N - 1 connection pipe models, and the control volume models and the connection pipe models are connected alternately; Step 223: Calculate the length ΔL of each control volume of the flow channel V (i) and the elevation H(i) of the center point, and the calculation formula is as follows: Step 224: Calculate the length ΔL of each connecting pipe of the flow channel J (j), and the calculation formula is as follows:
5. The automatic inspection and positioning method for the elevation of a thermal-hydraulic system model device based on Modelica according to claim 1, characterized in that: In the basic node unit data container in step 5 above, the data container corresponds one-to-one to the basic node unit model in the general connection diagram of the flattening model, and is used to store the basic node unit number, type, equipment component information to which the basic node unit model belongs, parameters, and variable information. The data container is stored and read and written using a fixed data structure. The data structure defines the number of data information entries stored, the memory space size, and the name and value of the data information stored in sequence. The user can directly read the value corresponding to a certain data information in the data container through the value-taking function based on the data container, or assign an external value to a certain data information in the data container through the writing function based on the data container. The value-taking function locates the corresponding data container according to the basic node unit number, and then reads the value at the corresponding memory location according to the data information name or serial number. The writing function locates the corresponding data container according to the basic node unit number, and then assigns the external value to the corresponding memory location according to the data information name or serial number; The equipment component information to which the basic node unit model belongs is obtained according to the equipment component flattening process, and refers to the name of the equipment component at the upper level or higher level to which the basic node unit model belongs, until the name of the equipment component directly operated by the user. If the basic node unit model belongs to the thermal-hydraulic model directly operated by the user in the thermal-hydraulic system model, the equipment component information to which the basic node unit model belongs is empty.
6. The automatic inspection and positioning method for the elevation of a thermal-hydraulic system model device based on Modelica according to claim 1, characterized in that, Step 8 above is divided into the following two cases: Case 1: If the absolute value of the difference in elevation between the center points of the upstream and downstream control volumes is greater than the length of the connection pipe, record the connection pipe number, and then jump to step 10; Case 2: If the absolute value of the difference in elevation between the center points of the upstream and downstream control volumes is not greater than the length of the connection pipe, then jump to step 9.
7. A method for automatically checking and positioning the elevation of a thermal-hydraulic system model device based on Modelica according to claim 1, characterized in that Step 9 above is divided into the following two cases: Case 1: The traversal ends, and jump to step 14; Case 2: The traversal has not ended, and jump to step 7.
8. The method for automatically checking and positioning the elevation of a thermal-hydraulic system model device based on Modelica according to claim 1, characterized in that, Step 11 above is divided into the following two cases: Case 1: If the equipment component information of both the upstream control volume and the downstream control volume is not empty, then jump to step 12; Case 2: If there is an empty situation in the equipment component information of the upstream control volume and the downstream control volume, then jump to step 13.
9. The automatic inspection and positioning method for the elevation of a thermal-hydraulic system model device based on Modelica according to claim 1, characterized in that, Step 12 above is divided into the following two cases: Case 1: The device components to which the upstream control volume and the downstream control volume belong are the same device component. Locate this device component, prompt "The elevation of the inlet and outlet of the device component or the length of the flow channel is set unreasonably", and jump to step 14; Case 2: The information of the device components to which the upstream control volume and the downstream control volume belong is not the same device component. Locate the device component to which the upstream control volume belongs and the device component to which the downstream control volume belongs, prompt "The elevation of adjacent device components or the length of the flow channel is set unreasonably", and jump to step 14.
10. The automatic inspection and positioning method for the elevation of a thermal-hydraulic system model device based on Modelica according to claim 1, characterized in that, The said step 13 is divided into the following three cases: Case 1: The information of the device components to which the upstream control volume and the downstream control volume belong is both empty. Locate the upstream control volume and the downstream control volume, prompt "The elevation or length of the center point of the upstream and downstream control volume models is set unreasonably", and jump to step 14; Case 2: The information of the device to which the upstream control volume belongs is empty while the information of the device to which the downstream control volume belongs is not empty. Locate the upstream control volume and the device component to which the downstream control volume belongs, prompt "The elevation or length of the upstream control volume and the downstream device component is set unreasonably", and jump to step 14; Case 3: The information of the device to which the downstream control volume belongs is empty while the information of the device to which the upstream control volume belongs is not empty. Locate the downstream control volume and the device component to which the upstream control volume belongs, prompt "The elevation or length of the downstream control volume and the upstream device component is set unreasonably", and jump to step 14.