Extraction and rapid calculation method for working medium physical property data of super real-time fluid pipeline network
By using REFPROP software and an encrypted grid algorithm in the ultra-real-time fluid pipeline network of a nuclear power plant, an automatically encrypted physical property database is generated, which solves the problems of slow calculation speed and low accuracy in existing technologies and enables flexible and efficient calculation of multiple working fluids.
Patent Information
- Application Number
- CN202510742967.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-05
- Publication Date
- 2025-09-09
AI Technical Summary
Existing physical property calculation software is too slow and inaccurate for ultra-real-time fluid pipeline network simulation in nuclear power plants. It also has difficulty in uniformly managing the physical property calculations of multiple working fluids, affecting simulation efficiency.
REFPROP software is used in combination with the encrypted grid algorithm and the encrypted interpolation algorithm to collect working fluid parameters in real time and generate a parameter matrix. High-precision physical property data is obtained through two-dimensional and one-dimensional interpolation calculations, and an automatically encrypted physical property database is constructed.
It realizes flexible calculation of various working fluids, meets the requirements of high speed and high precision, provides physical property calculation support for ultra-real-time pipeline network simulation, and improves calculation efficiency and accuracy.
Smart Images

Figure CN120613033A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of real-time simulation of nuclear power plants, and in particular to a method for extracting and rapidly calculating working fluid physical property data in an ultra-real-time fluid pipeline network. Background Art
[0002] In the ultra-real-time fluid pipeline network (pipe network) simulation of nuclear power plants, physical property calculation, as a module with a large number of calculations and a significant impact on calculation accuracy, requires both very fast calculation speed and high calculation accuracy.
[0003] The existing software that serves as a standard for physical property calculations and provides high-precision physical property calculations is REFPROP, developed by the National Institute of Standards and Technology (NIST). While this software offers high accuracy, it involves numerous iterations and suffers from slow calculation speeds. Existing physical property interpolation software also falls short of meeting the requirements for ultra-real-time pipeline network calculations due to factors such as insufficient or excessive interpolation density and the cumbersome steps involved in finding interpolation points. Furthermore, with the advancement of simulation technology, existing flow network calculations often involve the coupling of multiple fluids. Existing physical property calculation programs are primarily targeted at a single fluid, and flow network simulations require switching between different programs when calculating different types of fluids. Simulators must write multiple interfaces for different physical property programs when constructing flow network models, making unified management and modification of these programs difficult and impacting their computational efficiency. Therefore, ultra-real-time pipeline network simulations require a physical property calculation method that offers fast calculation speed, high accuracy, and the ability to perform multiple physical property calculations. Summary of the Invention
[0004] The purpose of the present invention is to provide a method for extracting and quickly calculating the physical property data of working fluids in ultra-real-time fluid pipeline networks, which can not only meet the flexibility of calculating a variety of working fluids, but also meet the requirements of high-speed calculation and high precision, and provide support for physical property calculation for ultra-real-time pipeline network simulation.
[0005] To achieve the above object, the present invention provides the following solutions:
[0006] A method for extracting and rapidly calculating working fluid physical property data from an ultra-real-time fluid pipeline network, comprising:
[0007] Collect working fluid parameters of the fluid pipeline network in real time and process them into parameter matrix;
[0008] REFPROP is called to perform physical property calculation on the parameter matrix, and the working fluid physical property data is obtained and written into the physical property database, wherein the encrypted grid algorithm and the encrypted interpolation algorithm are combined in the process of performing the physical property calculation.
[0009] Optionally, the working fluid parameters include: a working fluid name array, a working fluid component array, related parameters and ranges, and the number of data points.
[0010] Optionally, processing the parameter matrix includes:
[0011] Based on the number of data points, a one-dimensional grid matrix and a two-dimensional grid matrix are generated in combination with the relevant parameters and ranges, and memory is allocated to the physical property variables to be calculated and the grid identification numbers of the one-dimensional grid matrix and the two-dimensional grid matrix.
[0012] Optionally, calling REFPROP to calculate physical properties of the parameter matrix includes:
[0013] Performing single-phase physical property calculation on the two-dimensional grid matrix using two-dimensional interpolation to obtain two-dimensional single-phase physical property calculation results;
[0014] The saturated physical property range is determined based on the two-dimensional single-phase physical property calculation result, and the saturated physical property calculation is performed on the one-dimensional grid matrix using one-dimensional interpolation to obtain the one-dimensional saturated physical property calculation result.
[0015] Optionally, performing single-phase physical property calculation on the two-dimensional grid matrix using two-dimensional interpolation includes:
[0016] S1.1. Read the two-dimensional grid matrix and obtain relevant parameter values of each two-dimensional grid;
[0017] S1.2. Call REFPROP to calculate the physical property value of each two-dimensional grid based on the relevant parameter values, and perform linear interpolation to obtain the physical property value of the center point of each two-dimensional grid;
[0018] S1.3. Compare the physical property value of each two-dimensional grid with the physical property value of the corresponding center point. If the deviation does not meet the first preset value, mark the two-dimensional grid as encrypted, subdivide the two-dimensional grid matrix, construct a sub-level two-dimensional grid matrix, and return to S1.1 until the calculated physical property deviation meets the first preset value, and output the two-dimensional grid level and physical property range.
[0019] Optionally, performing saturation property calculation on the one-dimensional grid matrix using one-dimensional interpolation includes:
[0020] S2.1. Read the one-dimensional grid matrix and obtain relevant parameter values of each one-dimensional grid;
[0021] S2.2. Call REFPROP to calculate the physical property value of each one-dimensional grid based on the relevant parameter values, and perform linear interpolation to obtain the physical property value of the center point of each one-dimensional grid;
[0022] S2.3. Compare the physical properties of each one-dimensional grid with the physical properties of the corresponding center point. If the deviation does not meet the second preset value, mark the one-dimensional grid as encrypted, subdivide the one-dimensional grid matrix, construct a sub-level two-dimensional grid matrix, and return to S2.1 until the calculated physical property deviation meets the second preset value, and output the one-dimensional grid level and saturation physical property value.
[0023] Optionally, writing into the physical property database includes:
[0024] The two-dimensional single-phase physical property calculation results are written into the physical property database according to the two-dimensional grid level, and the one-dimensional saturated physical property calculation results are written into the physical property database according to the one-dimensional grid level, wherein the writing includes the level grid number, level grid number, level grid identification number, level grid data point number, and level grid data point value.
[0025] Optionally, the physical property database is stored in a memory in a store-overwrite cycle, including:
[0026] S3.1. Check the input working fluid type to determine whether the physical property database of the corresponding working fluid exists in the memory. If so, point the physical property database pointer to the corresponding storage address and return the physical property database pointer. If not, proceed to S3.2.
[0027] S3.2. Determine the storage space of the memory. If the storage space is full, the storage pointer points to the beginning of the storage space; if the storage space is not full, the storage pointer moves one position back.
[0028] S3.3. Read the physical property database, allocate space for the physical property database, write it into the storage space, and return a physical property database pointer pointing to the corresponding storage address.
[0029] The beneficial effects of the present invention are:
[0030] The present invention is based on the REFPROP software to construct a method for extracting and quickly calculating the physical properties of working fluids in ultra-real-time fluid pipeline networks, generate a database that can be automatically encrypted, and a program that can quickly calculate physical properties. Users can freely choose the type of working fluid for which they want to generate a physical property database, and support the calculation of saturated physical properties based on temperature, pressure, specific enthalpy, and density; support the calculation of single-phase physical properties based on temperature-pressure, pressure-specific enthalpy, and temperature-specific enthalpy. This method of database generation combined with interpolation calculation can not only meet the flexibility of calculating multiple working fluids, but also meet the requirements of high-speed calculation and high precision, providing support for physical property calculation for ultra-real-time pipeline network simulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0032] Figure 1 This is a flow chart of a method for extracting and rapidly calculating working fluid physical property data from an ultra-real-time fluid pipeline network according to an embodiment of the present invention;
[0033] Figure 2 A workflow diagram for generating a physical property database according to an embodiment of the present invention;
[0034] Figure 3 A one-dimensional encryption workflow diagram for generating a physical property database according to an embodiment of the present invention;
[0035] Figure 4 A two-dimensional encrypted workflow diagram for generating a physical property database according to an embodiment of the present invention;
[0036] Figure 5 1. A flowchart of the physical property calculation process according to an embodiment of the present invention;
[0037] Figure 6 This is a flowchart of the physical property database storage workflow of an embodiment of the present invention. DETAILED DESCRIPTION
[0038] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0039] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0040] This embodiment provides a method for extracting and rapidly calculating working fluid physical property data from a super real-time fluid pipeline network. Figure 1 Shown, including:
[0041] Collect working fluid parameters of the fluid pipeline network in real time and process them into parameter matrix;
[0042] REFPROP is called to perform physical property calculation on the parameter matrix, and the working fluid physical property data is obtained and written into the physical property database, wherein the encrypted grid algorithm and the encrypted interpolation algorithm are combined in the process of performing the physical property calculation.
[0043] Specifically, this embodiment is based on the REFPROP software to construct a method for extracting and quickly calculating the physical property data of working fluids in ultra-real-time fluid pipeline networks, generate a database that can be automatically encrypted, and a program that can quickly calculate physical properties. Users can freely choose the type of working fluid for which they want to generate a physical property database, and support the calculation of saturated physical properties based on temperature, pressure, specific enthalpy, and density; support the calculation of single-phase physical properties based on temperature-pressure, pressure-specific enthalpy, and temperature-specific enthalpy. This method of database generation combined with interpolation calculation can not only meet the flexibility of calculating multiple working fluids, but also meet the requirements of high-speed calculation and high precision, providing support for physical property calculation for ultra-real-time pipeline network simulation.
[0044] Furthermore, the working fluid parameters include: a working fluid name array, a working fluid component array, related parameters and ranges, and the number of data points.
[0045] Furthermore, processing into the parameter matrix includes:
[0046] Based on the number of data points, a one-dimensional grid matrix and a two-dimensional grid matrix are generated in combination with the relevant parameters and ranges, and memory is allocated to the physical property variables to be calculated and the grid identification numbers of the one-dimensional grid matrix and the two-dimensional grid matrix.
[0047] Furthermore, calling REFPROP to calculate the physical properties of the parameter matrix includes:
[0048] Performing single-phase physical property calculation on the two-dimensional grid matrix using two-dimensional interpolation to obtain two-dimensional single-phase physical property calculation results;
[0049] The saturated physical property range is determined based on the two-dimensional single-phase physical property calculation result, and the saturated physical property calculation is performed on the one-dimensional grid matrix using one-dimensional interpolation to obtain the one-dimensional saturated physical property calculation result.
[0050] Furthermore, performing single-phase physical property calculation on the two-dimensional grid matrix using two-dimensional interpolation includes:
[0051] S1.1. Read the two-dimensional grid matrix and obtain relevant parameter values of each two-dimensional grid;
[0052] S1.2. Call REFPROP to calculate the physical property value of each two-dimensional grid based on the relevant parameter values, and perform linear interpolation to obtain the physical property value of the center point of each two-dimensional grid;
[0053] S1.3. Compare the physical property value of each two-dimensional grid with the physical property value of the corresponding center point. If the deviation does not meet the first preset value, mark the two-dimensional grid as encrypted, subdivide the two-dimensional grid matrix, construct a sub-level two-dimensional grid matrix, and return to S1.1 until the calculated physical property deviation meets the first preset value, and output the two-dimensional grid level and physical property range.
[0054] Furthermore, performing saturation property calculation on the one-dimensional grid matrix using one-dimensional interpolation includes:
[0055] S2.1. Read the one-dimensional grid matrix and obtain relevant parameter values of each one-dimensional grid;
[0056] S2.2. Call REFPROP to calculate the physical property value of each one-dimensional grid based on the relevant parameter values, and perform linear interpolation to obtain the physical property value of the center point of each one-dimensional grid;
[0057] S2.3. Compare the physical properties of each one-dimensional grid with the physical properties of the corresponding center point. If the deviation does not meet the second preset value, mark the one-dimensional grid as encrypted, subdivide the one-dimensional grid matrix, construct a sub-level two-dimensional grid matrix, and return to S2.1 until the calculated physical property deviation meets the second preset value, and output the one-dimensional grid level and saturation physical property value.
[0058] Furthermore, writing into the physical property database includes:
[0059] The two-dimensional single-phase physical property calculation results are written into the physical property database according to the two-dimensional grid level, and the one-dimensional saturated physical property calculation results are written into the physical property database according to the one-dimensional grid level, wherein the writing includes the level grid number, level grid number, level grid identification number, level grid data point number, and level grid data point value.
[0060] Furthermore, the physical property database is stored in the memory in a store-overwrite cycle, including:
[0061] S3.1. Check the input working fluid type to determine whether the physical property database of the corresponding working fluid exists in the memory. If so, point the physical property database pointer to the corresponding storage address and return the physical property database pointer. If not, proceed to S3.2.
[0062] S3.2. Determine the storage space of the memory. If the storage space is full, the storage pointer points to the beginning of the storage space; if the storage space is not full, the storage pointer moves one position back.
[0063] S3.3. Read the physical property database, allocate space for the physical property database, write it into the storage space, and return a physical property database pointer pointing to the corresponding storage address.
[0064] The following describes in detail a method for extracting and rapidly calculating working fluid physical property data of a super-real-time fluid pipeline network proposed in this embodiment, using temperature and pressure as relevant parameters. Figure 2 Shown, including:
[0065] (1) Input the working fluid parameters of the fluid pipeline network and process them into a parameter matrix;
[0066] Enter the working fluid name array, working fluid component array, temperature range, pressure range, and number of data points. The temperature and pressure ranges are optional; if omitted, the default temperature and pressure ranges are used. A one-dimensional temperature grid matrix, a one-dimensional pressure grid matrix, and a two-dimensional temperature-pressure grid matrix are generated based on the number of data points. Memory is allocated for the physical property variables to be calculated and the grid identification numbers for these three matrices.
[0067] After reading the working fluid name array and working fluid composition array, the program checks whether the input fluid supports the calculation. If the pre-set fluid option is not found, the program terminates and returns an error message. Next, the name of the physical property file to be used is set, and the input fluid quantity, mixture composition, and physical property file name are entered into the SETUP function for initialization.
[0068] Create a basic information file for the working fluid using the given working fluid type and write relevant information about the working fluid, including the working fluid name, working fluid components, temperature and pressure ranges, number of data points, and triple point, to facilitate the construction of working fluid physical property data points for subsequent physical property calculations.
[0069] (2) Figure 5 As shown, REFPROP is called to calculate the physical properties of the parameter matrix and extract the working fluid physical property data;
[0070] (2.1) The single-phase point physical properties of the working fluid are calculated using the temperature-pressure two-dimensional grid matrix.
[0071] Call the pressure-temperature calculation function in REFPROP to calculate a series of physical properties such as density, internal energy, and constant-pressure specific heat using temperature and pressure. Before calculating each physical property, first determine whether the fluid has been initialized. If not, initialize it first and then calculate.
[0072] After the calculation process of each of the above functions is completed, identify the return error identifier of the function. If it is not equal to 0, set the parameters of the physical properties calculated by the function to -1, and set the identification number of the grid containing this node to 0, marking it as not requiring encryption, and then continue to calculate the next function and node.
[0073] Two-dimensional encryption is used when calculating physical properties. The specific process is as follows Figure 4As shown. First read the temperature-pressure grid matrix generated above to obtain the temperature and pressure of each grid center point in the two-dimensional grid, then linearly interpolate the physical properties of the center point based on the calculated physical properties, and then call the REFPROP related functions based on the center point of the grid to calculate the accurate physical properties. Compare the previous physical property with the next physical property. If the deviation is greater than 1%, set the identification number of this temperature grid to 1 and mark it as encrypted. Create a new sub-level temperature grid and sub-level temperature node with a node number of 3×3 and a grid number of 4. Store the sub-grid number and node number in the array of the upper-level grid and restart the above process. After the final encryption calculation is completed, end and return the number of grid layers.
[0074] After the calculation is completed, the range of specific enthalpy and density is determined, and the minimum and maximum values of the physical properties when calculating the two-dimensional grid matrix are used as the range of saturated physical properties.
[0075] The inputs to the 2D interpolation function include the input property range, the number of data points, the property database array, and the input property value. If the input value is out of range, the calculation stops and an error message is returned. Otherwise, the input temperature and pressure coordinates are calculated, the corresponding grid data points are found, and the mesh identification number is used to determine whether the mesh is refined. For unrefined meshes, the interpolation position and density value are directly calculated. For refined meshes, the subgrid number is recursively searched until an unrefined mesh is found, and the calculation is completed. The final density is calculated based on the grid node values and the coordinate remainders.
[0076] For example, using temperature and pressure to calculate density, the inputs for the two-dimensional interpolation function are a database with a temperature range of [t1, t2], a pressure range of [p1, p2], m number of temperature data points, n number of pressure data points, a density array dat[m×n], an input temperature value t, and an input pressure value p. If the input temperature or pressure value is outside the range, the two-dimensional interpolation function stops calculating and returns an error message. Otherwise, the input temperature and pressure coordinates are calculated, using the same formula as the one-dimensional interpolation function.
[0077] Set the coordinate value to t label , p label After obtaining the coordinates, start looking for the grid data points corresponding to the physical parameters. The corresponding grid number is the coordinates of the temperature coordinate and the pressure coordinate rounded down: f grid =[floor(t label ),floor(p label )]. If the grid identification number corresponding to the grid number is 0, it means that the grid is in a non-encrypted state, and the interpolation data point position is calculated directly:
[0078] lab1=n·t label +p label ;
[0079] lab2=n·tlabel +p label +1;
[0080] lab3=n·(t label +1)+p label ;
[0081] lab4=n·(t label +1)+p label +1;
[0082] After obtaining the position, calculate the density corresponding to the temperature boundary of the grid:
[0083] mid1=dat[lab1]+(dat[lab2]-dat[lab1])(p label -floor(p label ));
[0084] mid2=dat[lab3]+(dat[lab4]-dat[lab3])(p label -floor(p label ));
[0085] Then calculate the density corresponding to the input value:
[0086] ρ=mid1+(mid2-mid1)(t label -floor(t label ));
[0087] If the grid identification number corresponding to the grid number is 1, it means that the grid is in an encrypted state, and the subgrid number is found by the grid number. And calculate t label and p label The remainder, if t label and p label are all less than 0.5, then the grid number is [f grid ,1]; if t label Greater than 0.5, p label Less than 0.5, the grid number is [f grid ,2]; if t label Less than 0.5, p label If it is greater than 0.5, the grid number is [f grid ,3]; if t label and p label are greater than 0.5, then the grid number is [f grid,4]. After calculating the grid number, multiply the remainder by 2 to calculate the next level grid number. After entering the subgrid, check again whether the grid identification number is 1 and repeat the above process. Finally, after entering the grid with grid identification number 0, read the node number and node values t1p1, t1p2, t2p1 and t2p2 corresponding to the grid, and calculate the density corresponding to the temperature boundary of the grid:
[0088] mid1=t1p1+(t1p2-t1p1)(p label -floor(p label ));
[0089] mid2=t2p1+(t2p2-t2p1)(p label -floor(p label ));
[0090] Then calculate the density corresponding to the input value:
[0091] ρ=mid1+(mid2-mid1)(t label -floor(t label )).
[0092] After calculating the pressure and specific enthalpy data points, physical property calculations are performed using the pressure-specific enthalpy grid matrix and the temperature-specific enthalpy grid matrix. The pressure-specific enthalpy calculation function and the temperature-specific enthalpy calculation function in REFPROP are called respectively to calculate their respective related parameters. The remaining calculation, identifier marking, and encryption processes are the same as those for physical property calculations using temperature and pressure data points.
[0093] (2.2) After calculating the two-dimensional parameters, the saturated physical properties of the one-dimensional parameters are calculated.
[0094] First, the temperature saturation calculation function is called through the temperature one-dimensional grid matrix to calculate the pressure and density, and then a series of physical properties such as specific enthalpy, viscosity, and constant pressure specific heat are calculated through temperature and density.
[0095] One-dimensional encryption is used when calculating saturated physical properties. The specific process is as follows Figure 3 As shown, first read the one-dimensional grid matrix of temperature, pressure, etc. generated above to obtain the value of each grid midpoint in the one-dimensional grid. Then, linearly interpolate the physical properties of the midpoint based on the calculated physical properties. Then, call the REFPROP related functions based on the midpoint of the temperature grid to calculate the accurate physical properties. Compare the previous physical properties with the next physical properties. If the deviation is greater than 1%, set the identification number of this temperature grid to 1 and mark it as encrypted. Create a new sub-level temperature grid and sub-level temperature node with 3 nodes and 2 grids, and restart the above process. After the final encryption calculation is completed, end and return the number of grid layers.
[0096] For example, to calculate the saturated liquid density using temperature, the inputs to the one-dimensional interpolation function are the database temperature range [t1, t2], the number of temperature data points n, the saturated liquid density array dat[n], and the input temperature value t. If the input temperature value is outside the database temperature range, the one-dimensional interpolation function stops calculating and returns an error message. Otherwise, the calculation of the input temperature coordinate begins, using the following formula:
[0097] t label =(t-t1)·(n-1) / (t2-t1)+1;
[0098] After obtaining the coordinates, start looking for the grid data points corresponding to the physical parameters. The corresponding grid number is the coordinates for the temperature coordinates rounded down: f grid =floor(t label ). If the grid identification number corresponding to the grid number is 0, it means that the grid is in a non-encrypted state, and the values of the interpolation data points t1 and t2 are directly read. The node numbers are f grid and f grid +1. Then calculate the saturated liquid density value based on the value:
[0099] ρ l =t1+(t label -f grid )·(t2-t1);
[0100] If the grid identification number corresponding to the grid number is 1, it means that the grid is in an encrypted state, and the subgrid number is found by the grid number. And calculate t label The remainder t m =mod(t label ), if t m <0.5, then the grid number is [f grid ,1], the temperature coordinate is updated to t label =2t m Otherwise, the grid number is [f grid ,2], the temperature coordinate is t label =2t m -1. After entering the subgrid, check again whether the grid identification number is 1 and repeat the above process. Finally, after entering the grid with grid identification number 0, read the node number and node values t1 and t2 corresponding to the grid, and calculate the saturated liquid phase density value:
[0101] ρ l =t1+(1-t label )·(t2-t1).
[0102] After calculating the temperature data points, the saturated physical properties are calculated using the pressure, specific enthalpy, and density data points. The saturated physical property calculation functions such as SATP and SATH are called respectively to calculate the saturated temperature, saturated gas phase density, and saturated liquid phase density. The remaining calculation process is the same as the process of calculating the saturated physical properties using the temperature data points.
[0103] (3) Writing into the physical property database;
[0104] (3.1) For the one-dimensional saturated physical property calculation results, the order of writing the physical property database is grid level, first-level grid number, first-level grid number and grid identification number, first-level grid data point number and data point value, second-level grid number, second-level grid number and grid identification number (two in a group), second-level grid data point number and data point value (two in a group), and subsequent sub-level grids and data points are written in the second-level grid and data point format.
[0105] (3.2) For two-dimensional physical property calculation results, the order of writing the physical property database is grid level number, first-level grid number, first-level grid number and grid identification number, first-level grid data point, second-level grid number, second-level grid number and grid identification number (groups of four), second-level grid data point number and data point value (groups of four). Subsequent sub-level grids and data points are written in the same format as the second-level grids and data points. The "end" identifier is written at the end of each level of grid identification number or grid data point, indicating that reading the data related to the grid at that level stops and reading the data of the next level of grid begins.
[0106] For a working fluid, two files will be generated, namely the basic information file and the physical property database file. The one-dimensional and two-dimensional calculation results are stored in a physical property database file, and the working fluid related information is stored in the basic information file.
[0107] (4) Physical property database storage;
[0108] First, the basic information file is read, and the physical property grid is constructed based on the range and number of data points of physical properties such as temperature, pressure, and specific enthalpy. Then, the saturated physical property database and the single-phase physical property database are read and stored in the physical property grid.
[0109] The storage-overwrite cycle is used to store the physical property database of various working fluids in memory to improve the calculation efficiency. Figure 6As shown, the input working fluid type is first checked to determine whether the working fluid database has been stored in the memory; if it exists, the database pointer is pointed to the corresponding storage address and the database pointer is returned, and the database data is searched and called through the pointer in subsequent calculations; if it does not exist, the database reading stage is entered, and first it is determined whether the storage space is full. If the storage space is full, the storage pointer points to the beginning of the storage space; if the storage space is not full, the storage pointer moves one position back, and then the basic information of the physical property database is read, including the physical property range and the number of data points, space is allocated for the database, the database file is read and written into the storage space; then the database pointer is pointed to the corresponding storage address, and the database pointer is returned after pointing is completed.
[0110] The embodiments described above are merely descriptions of preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by persons skilled in the art should fall within the scope of protection defined by the claims of the present invention.
Claims
1. A method for extracting and rapidly calculating working fluid physical property data from an ultra-real-time fluid pipeline network, characterized in that: include: Collect working fluid parameters of the fluid pipeline network in real time and process them into parameter matrix; REFPROP is called to perform physical property calculation on the parameter matrix, and the working fluid physical property data is obtained and written into the physical property database, wherein the encrypted grid algorithm and the encrypted interpolation algorithm are combined in the process of performing the physical property calculation.
2. The method for extracting and rapidly calculating working fluid physical property data of a super-real-time fluid pipeline network according to claim 1 is characterized in that: The working fluid parameters include: working fluid name array, working fluid component array, related parameters and ranges, and the number of data points.
3. The method for extracting and rapidly calculating working fluid physical property data of a super-real-time fluid pipeline network according to claim 2 is characterized in that: Processing for the parameter matrix includes: Based on the number of data points, a one-dimensional grid matrix and a two-dimensional grid matrix are generated in combination with the relevant parameters and ranges, and memory is allocated to the physical property variables to be calculated and the grid identification numbers of the one-dimensional grid matrix and the two-dimensional grid matrix.
4. The method for extracting and rapidly calculating working fluid physical property data of a super-real-time fluid pipeline network according to claim 3 is characterized in that: Calling REFPROP to calculate the physical properties of the parameter matrix includes: Performing single-phase physical property calculation on the two-dimensional grid matrix using two-dimensional interpolation to obtain two-dimensional single-phase physical property calculation results; The saturated physical property range is determined based on the two-dimensional single-phase physical property calculation result, and the saturated physical property calculation is performed on the one-dimensional grid matrix using one-dimensional interpolation to obtain the one-dimensional saturated physical property calculation result.
5. The method for extracting and rapidly calculating working fluid physical property data of a super-real-time fluid pipeline network according to claim 4 is characterized in that: Calculating single-phase physical properties of the two-dimensional grid matrix using two-dimensional interpolation includes: S1.
1. Read the two-dimensional grid matrix and obtain relevant parameter values of each two-dimensional grid; S1.
2. Call REFPROP to calculate the physical property value of each two-dimensional grid based on the relevant parameter values, and perform linear interpolation to obtain the physical property value of the center point of each two-dimensional grid; S1.
3. Compare the physical property value of each two-dimensional grid with the physical property value of the corresponding center point. If the deviation does not meet the first preset value, mark the two-dimensional grid as encrypted, subdivide the two-dimensional grid matrix, construct a sub-level two-dimensional grid matrix, and return to S1.1 until the calculated physical property deviation meets the first preset value, and output the two-dimensional grid level and physical property range.
6. The method for extracting and rapidly calculating working fluid physical property data of a super-real-time fluid pipeline network according to claim 4 is characterized in that: Calculating saturated physical properties of the one-dimensional grid matrix using one-dimensional interpolation includes: S2.
1. Read the one-dimensional grid matrix and obtain relevant parameter values of each one-dimensional grid; S2.
2. Call REFPROP to calculate the physical property value of each one-dimensional grid based on the relevant parameter values, and perform linear interpolation to obtain the physical property value of the center point of each one-dimensional grid; S2.
3. Compare the physical properties of each one-dimensional grid with the physical properties of the corresponding center point. If the deviation does not meet the second preset value, mark the one-dimensional grid as encrypted, subdivide the one-dimensional grid matrix, construct a sub-level two-dimensional grid matrix, and return to S2.1 until the calculated physical property deviation meets the second preset value, and output the one-dimensional grid level and saturation physical property value.
7. The method for extracting and rapidly calculating working fluid physical property data of a super-real-time fluid pipeline network according to claim 1 is characterized in that: Writing into the physical property database includes: The two-dimensional single-phase physical property calculation results are written into the physical property database according to the two-dimensional grid level, and the one-dimensional saturated physical property calculation results are written into the physical property database according to the one-dimensional grid level, wherein the writing includes the level grid number, level grid number, level grid identification number, level grid data point number, and level grid data point value.
8. The method for extracting and rapidly calculating working fluid physical property data of a super-real-time fluid pipeline network according to claim 7 is characterized in that: The physical property database is stored in the memory in a store-overwrite cycle, including: S3.
1. Check the input working fluid type to determine whether the physical property database of the corresponding working fluid exists in the memory. If so, point the physical property database pointer to the corresponding storage address and return the physical property database pointer. If not, proceed to S3.
2. S3.
2. Determine the storage space of the memory. If the storage space is full, the storage pointer points to the beginning of the storage space; if the storage space is not full, the storage pointer moves one position back. S3.
3. Read the physical property database, allocate space for the physical property database, write it into the storage space, and return a physical property database pointer pointing to the corresponding storage address.
Citation Information
Cited By
Mass flow metering method and device for impurity-containing carbon dioxide
CN121297968A