Method and device for calculating real physical properties of working medium by GPU based on tree structure, equipment and medium
By using a tree structure -based method in the GPU calculation, to generate adaptive grids and build target state equations, solve the problem of insufficient CPU processing capacity and delay of GPU memory access in large -scale fluid simulation calculations, and achieve efficient working quality Real physical properties and improvement of fluid simulation efficiency.
Patent Information
- Application Number
- CN202411072793.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2025-01-28
AI Technical Summary
Existing real-time computing methods based on thermodynamic models are difficult to meet the needs of high-speed parallel search in large-scale fluid simulation computing, especially because the CPU computing core is limited and it is difficult to deal with large-scale parallel searches. At the same time, existing GPU solutions have failed to effectively solve the memory access latency problem caused by GPU memory access characteristics.
The GPU calculation method based on tree structure is adopted, and the efficient calculation of the real and physical properties of the real and physical properties of the work quality is achieved through adaptive grid generation, Morton code conversion technology, local state equation construction, and target status equation tree search. This method uses the GPU parallel computing power to reduce the transmission of unnecessary data and the occupation of GPU memory through the construction and search for internal node trees of the tree structure, and improve the efficiency of fluid simulation calculation.
Through the construction of the tree structure and the parallel computing of the GPU, the memory access delay problem during the GPU processing query is solved, the high efficiency of the large -scale fluid simulation calculation is achieved, and the level of fluid dynamic simulation technology is improved.
Smart Images

Figure CN119376908A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to a technology for acquiring real physical properties, and in particular to a method, device, equipment and medium for calculating the real physical properties of a working fluid using a GPU based on a tree structure. Background Art
[0002] Current real-time calculation methods based on thermodynamic models, such as Refprop, need to maintain a large amount of physical property data from experimental measurements and theoretical calculations internally, and use database indexing technology and traditional algorithms (such as binary search trees and hash tables) to achieve fast search and interpolation on the CPU. However, in large-scale fluid simulation calculations, it is necessary to query a large number of grid point feature results at high speed. Due to the limited number of computing cores, the CPU is difficult to meet the needs of large-scale parallel search.
[0003] To address the above issues, the parallel computing capabilities of GPUs can significantly improve query speed and resolve the contradiction between large-scale parallel scientific computing needs and insufficient CPU processing capabilities. However, none of the existing solutions can solve the memory access latency problem caused by the GPU memory access characteristics.
[0004] Therefore, one or more methods are needed to solve the above problems.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0006] The purpose of the present disclosure is to provide a tree-structured GPU method, apparatus, device and medium for calculating the real physical properties of working fluids, thereby overcoming one or more problems caused by limitations and defects of related technologies at least to a certain extent.
[0007] According to one aspect of the present disclosure, a tree-structured GPU method for calculating the real physical properties of a working fluid is provided, comprising:
[0008] Calculating the error of the center point of the initial grid unit based on the user's preset input information to generate a physical property error value, determining the physical property error value based on the error tolerance, and generating an adaptive grid;
[0009] Based on the adaptive grid, the adaptive grid is transformed into one dimension through the Morton code conversion technology to generate a Morton code partition binary tree, and the value range of the input variable is obtained based on the Morton code partition binary tree to generate a search internal node tree;
[0010] Generate a local state equation by performing a two-dimensional cubic layout on the adaptive grid, and construct the local state equation based on the node order of the search internal node tree to generate a target state equation tree;
[0011] Based on the parallel computing capability of the GPU, the target index number is obtained by searching the internal node tree, and the input variable is indexed in the target state equation tree by the target index number to obtain the target variable, thereby completing the calculation and acquisition of the real physical properties of the working fluid.
[0012] In an exemplary embodiment of the present disclosure, the user preset input information includes error tolerance, a preset maximum number of grid splitting times, a physical property lookup table, and input variables.
[0013] In an exemplary embodiment of the present disclosure, the error of the center point of the initial grid unit is calculated according to the user preset input information, including:
[0014] Performing uniform data point search on the input variable by table lookup method to generate initial grid cells;
[0015] Searching the physical property lookup table by table lookup method to generate vertex target variables and center point target variables of the initial grid unit;
[0016] Generate an interpolation target variable by performing linear interpolation calculation on the vertex target variable;
[0017] The physical property error value is generated by calculating the difference between the central point target variable and the interpolation target variable.
[0018] In an exemplary embodiment of the present disclosure, it further includes:
[0019] If the physical property error value is less than the error tolerance, the initial grid units are combined to generate an adaptive grid;
[0020] If the physical property error value is not less than the error tolerance, the number of times the initial grid unit is split is determined; if the number of times the initial grid unit is split is less than the preset maximum number of times the initial grid unit is split, the initial grid unit is split to generate split grid units, and the split grid units are combined to generate an adaptive grid;
[0021] If the number of times the initial grid unit is split is not less than a preset maximum number of times the grid is split, the initial grid units are combined to generate an adaptive grid.
[0022] In an exemplary embodiment of the present disclosure, the adaptive grid is transformed into one dimension by using a Morton code conversion technology to generate a Morton code partition binary tree, and the value range of the input variable is obtained based on the Morton code partition binary tree to generate a search internal node tree, including:
[0023] Based on the adaptive grid, the center point coordinates are generated by averaging the vertex coordinates;
[0024] Performing one-dimensional transformation on the center point coordinates by using Morton code conversion technology to generate a one-dimensional center coordinate serial number, and sorting the one-dimensional center coordinate serial number in a preset order to generate a segmentation serial number;
[0025] Based on the segmentation sequence number, the one-dimensional center coordinate sequence number is segmented and sorted to generate a Morton code segmentation binary tree;
[0026] The value range of the input variable is obtained by indexing the leaf nodes of the Morton code partition binary tree with the absolute position coordinates of the input variable;
[0027] Based on the value range of the input variable, a search internal node tree is generated by constructing a BVH tree for the adaptive grid.
[0028] In an exemplary embodiment of the present disclosure, a local state equation is generated by performing a two-dimensional cubic layout on the adaptive grid, including:
[0029] Based on a table lookup method, interpolation discrete points are generated by uniformly interpolating the adaptive grid;
[0030] Based on the data driven fitting method, the local state equation is generated by performing a two-dimensional cubic layout of the interpolation discrete points.
[0031] In an exemplary embodiment of the present disclosure, obtaining a target index number by searching the search internal node tree includes:
[0032] Based on the one-dimensional data vector arrangement property of the search internal node tree and the target state equation tree, the corresponding table head address and array range information are generated by left and right indexing the search internal node tree and the target state equation tree;
[0033] Based on the first address of the corresponding table and the array range information, the search internal node tree is calculated by the GPU to obtain the target physical property characteristics;
[0034] Based on the target physical property characteristics, the search internal node tree is searched by a breadth-first algorithm to obtain a target index number.
[0035] In one aspect of the present disclosure, a tree-structured GPU-based device for calculating the real physical properties of a working fluid is provided, comprising:
[0036] An adaptive grid generation module, used to generate a physical property error value by calculating the error of the center point of the initial grid unit, and to determine the physical property error value based on the error tolerance to generate an adaptive grid;
[0037] A search internal node tree generation module is used to perform one-dimensional transformation on the adaptive grid through Morton code conversion technology to generate a Morton code partition binary tree, and obtain the value range of the input variable based on the Morton code partition binary tree to generate a search internal node tree;
[0038] A target state equation tree generation module is used to generate a local state equation by performing a two-dimensional cubic layout on the adaptive grid, and to construct the local state equation based on the node order of the search internal node tree to generate a target state equation tree;
[0039] The GPU computing module is used to obtain a target index number by searching the search internal node tree, and to index the input variable in the target state equation tree by the target index number to obtain the target variable, thereby completing the calculation and acquisition of the real physical properties of the working fluid.
[0040] In one aspect of the present disclosure, there is provided an electronic device, comprising:
[0041] a memory for storing a computer program product; and
[0042] The processor is used to execute the computer program product stored in the memory, and when the computer program product is executed, the method according to any one of the above items is implemented.
[0043] In one aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method according to any one of the above items is implemented.
[0044] Based on the embodiment of the present disclosure, first, the error of the center point of the initial grid unit is calculated according to the preset input information of the user, and the physical property error value is generated. The physical property error value is determined based on the error tolerance to generate an adaptive grid. After that, the adaptive grid is transformed into one dimension through the Morton code conversion technology to generate a Morton code partition binary tree, and the value range of the input variable is obtained based on the Morton code partition binary tree to generate a search internal node tree. At the same time, the local state equation is generated by performing a two-dimensional cubic layout on the adaptive grid, and the local state equation is constructed based on the node order of the above-mentioned search internal node tree to generate a target state equation tree. Finally, based on the parallel computing capability of the GPU, the target index number is obtained by searching the search internal node tree, and the input variable is indexed in the target state equation tree by the target index number to obtain the target variable, and the calculation and acquisition of the real physical properties of the working fluid are completed. Therefore, the embodiment of the present disclosure realizes the simulation calculation of the real physical properties of large-scale fluids on the GPU through the construction of the tree structure, solves the problem that the GPU needs to traverse when processing queries, and thus reduces the transmission of unnecessary data and the occupation of GPU memory. It has realized parallel query on GPU, improved the computing efficiency of large-scale fluid simulation, and promoted fluid dynamics simulation technology to a higher level.
[0045] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.
[0046] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0048] The present disclosure may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:
[0049] Figure 1 This is a flowchart of a method for calculating the real physical properties of a working fluid based on a tree structure in one embodiment of the method disclosed herein;
[0050] Figure 2 A flowchart of adaptive grid data generation for a tree-structured GPU method for calculating the real physical properties of a working fluid in one embodiment of the method disclosed herein;
[0051] Figure 3 A schematic diagram of establishing a tree structure for a method for calculating the real physical properties of a working fluid based on a tree structure in an embodiment of the method disclosed herein;
[0052] Figure 4A schematic diagram of the structure of a Morton code partitioned binary tree of a tree-structured GPU method for calculating the real physical properties of a working fluid in one embodiment of the method disclosed herein;
[0053] Figure 5 This is a structural block diagram of a tree-structured GPU device for calculating the real physical properties of a working fluid in one embodiment of the method disclosed herein;
[0054] Figure 6 A block diagram of an electronic device according to an embodiment of the method disclosed herein. DETAILED DESCRIPTION
[0055] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0056] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, materials, devices, steps, etc. may be adopted. In other cases, known structures, methods, devices, implementations, materials or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.
[0057] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or these functional entities or parts of functional entities may be implemented in one or more software hardened modules, or these functional entities may be implemented in different networks and / or processor devices and / or microcontroller devices.
[0058] In the embodiment of the present disclosure, a method for calculating the real physical properties of a working fluid based on a GPU of a tree structure is first provided; Figure 1 As shown in , the method for calculating the real physical properties of working fluid based on a tree structure GPU may include the following steps:
[0059] Step S110, calculating the error of the center point of the initial grid unit based on the user preset input information to generate a physical property error value, determining the physical property error value based on the error tolerance, and generating an adaptive grid.
[0060] Step S120, performing one-dimensional transformation on the adaptive grid by using Morton code conversion technology to generate a Morton code partition binary tree, and acquiring the value range of the input variable based on the Morton code partition binary tree to generate a search internal node tree.
[0061] Step S130, generating a local state equation by performing a two-dimensional cubic layout on the adaptive grid, and constructing the local state equation based on the node order of the search internal node tree to generate a target state equation tree.
[0062] Step S140, based on the parallel computing capability of the GPU, the target index number is obtained by searching the search internal node tree, and the input variable is indexed in the target state equation tree by the target index number to obtain the target variable, thereby completing the calculation and acquisition of the real physical properties of the working fluid.
[0063] Next, a tree-structure-based GPU method for calculating the real physical properties of a working fluid in an embodiment of the present disclosure will be further described.
[0064] In step S110, the error of the center point of the initial grid unit can be calculated according to the preset input information of the user to generate a physical property error value, and then the physical property error value is determined based on the error tolerance to generate an adaptive grid.
[0065] In a specific example, if Figure 2 As shown, the user preset input information includes: error tolerance, preset maximum grid splitting depth, physical property lookup table, input variables, etc.
[0066] Based on step S110, using density and internal energy to search for temperature is taken as an example. In the first step, the user defines the working fluid (such as carbon dioxide), defines the input variables as density and internal energy, and establishes a corresponding temperature property search table.
[0067] The second step is to search for uniform data points of the input variables by table lookup method to generate initial grid units. Specifically, the horizontal axis can be set to density and the vertical axis to internal energy, and the range of density and internal energy and the number of points distributed on each axis on the initial grid can be defined at the same time. For example, the density range is set to 100 to 200, the internal energy range is 1e5-2e5, and the number of distributions is 6. Then, the horizontal axis density distribution is 100, 120, 140, 160, 180, 200. The internal energy distribution is 1e5, 1.2e5, 1.4e5, 1.6e5, 1.8e5, 2e5. In this way, twenty-five initial grid units surrounded by four vertex coordinates will be obtained (taking one unit as an example, the density internal energy coordinates are (100, 1e5), (120, 1e5), (100, 1.2e5), (120, 1.2e5)). Together, they constitute a set of initial grids.
[0068] The third step is to search the previously established temperature property lookup table through the table lookup method, so that the corresponding vertex temperature can be obtained according to the vertex coordinates, and the corresponding center temperature can be obtained according to the center coordinates.
[0069] The fourth step is to obtain an interpolated temperature by performing linear interpolation calculation on the four vertex temperatures obtained in the third step;
[0070] The fifth step is to generate the property error value by calculating the difference between the center point target variable and the interpolation target variable. That is, the difference between the center temperature and the interpolation temperature is used as the temperature error value of the center point of the initial grid unit.
[0071] In a specific example, if Figure 2 As shown, the calculated physical property error value is compared with the tolerance input by the user. If the physical property error value is not less than the tolerance input by the user, the initial grid unit is split (the one-split-four principle is adopted in this example) and the center temperature and interpolation temperature of the split grid unit are continued to be calculated to obtain the corresponding physical property error value.
[0072] Until the physical property error values of all global initial grid cells are less than the tolerance input by the user, or the number of splits of the initial grid cells is not less than the preset maximum number of grid splits, all the initial grid cells at this time will form an adaptive grid together.
[0073] In step S120, the adaptive grid may be transformed into one dimension by using a Morton code conversion technique to generate a Morton code partition binary tree, and the value range of the input variable may be obtained based on the Morton code partition binary tree to generate a search internal node tree.
[0074] In a specific example, if Figure 3-Figure 4 As shown, based on the above-mentioned adaptive grid, the center coordinates of each unit in the grid are obtained by taking the average value of the vertex coordinates of each unit (in the example, the horizontal axis is density and the vertical axis is internal energy). After that, the two-dimensional center coordinates are converted into one-dimensional center coordinate serial numbers (i.e., one-dimensional Morton codes) using Morton code conversion technology (represented by 64-bit binary numbers in this patent).
[0075] Since the Morton code is a 64-bit binary number, when the converted one-dimensional center coordinate numbers are sorted from small to large, the position number that is different from the highest bit can be found and used as the split number. In this example, the part that is smaller than the split number is placed in the left subtree, and the part that is larger than the split number is placed in the right subtree. The left and right subtrees are subsequently split and placed in the same way until the final leaf node contains only one number. Take the split of three binary numbers as an example. Figure 4As shown, the first-level segmentation method determines whether the first digit is 0 or 1. If it is 0, it is divided into the left subtree, and if it is 1, it is divided into the right subtree. Subsequently, each bit of the 64-bit binary number contained in the Morton code is judged, and the segmentation method is analogous. In this way, the entire arranged binary tree is the Morton code segmentation binary tree. The reference of the Morton code can optimize the memory layout of the GPU, reduce memory access latency, and greatly improve the search efficiency while ensuring the locality and continuity of data access.
[0076] Because each one-dimensional center coordinate number corresponds to a unit before conversion, the minimum and maximum values of the input variables (density, internal energy) of all units in the subtree can be obtained after sorting the one-dimensional center coordinate numbers, and then their value ranges can be obtained. According to the value range of the input variable, the adaptive grid is constructed on the entire two-dimensional plane through the BVH (Bounding Volume Hierarchy) tree INT (Internal Node Tree), that is, the architecture searches the internal node tree arranged in a one-dimensional array vector. In the process of construction, due to its layer-by-layer arrangement, the left and right indexes are the index numbers of the left and right child nodes in the array (searching the internal node tree), that is, the left and right indexes are the absolute position coordinates in the array.
[0077] In step S130, the local state equations may be generated by performing a two-dimensional cubic layout on the adaptive grid, and the local state equations may be constructed based on the node order of the searched internal node tree to generate a target state equation tree.
[0078] In a specific example, if Figure 2-Figure 3 As shown, in the adaptive grid constructed above, each unit is uniformly interpolated by the table lookup method to obtain interpolation discrete points (interpolation is performed 16 times in this embodiment to obtain 16 discrete points). The interpolation discrete points are arranged in two dimensions and three dimensions by the data-driven fitting method to construct a local state equation (the equation in the embodiment is used to calculate the temperature in the unit by density and internal energy).
[0079] Then, the leaf nodes of the search internal node tree generated above are sorted and constructed to obtain the target state equation tree, so that the local state equation at the corresponding position can be indexed by searching the internal node tree.
[0080] In step S140, based on the parallel computing capability of the GPU, the target index number can be obtained by searching the internal node tree, and the input variable can be indexed in the target state equation tree by the target index number to obtain the target variable, thereby completing the calculation and acquisition of the real physical properties of the working fluid.
[0081] In a specific example, based on the one-dimensional data vector arrangement properties of the search internal node tree and the target state equation tree, the absolute position of the array will be pointed to during the left and right indexing process, so that the data in the transfer process is continuous in address. Therefore, there is no need to traverse, which greatly saves the use of GPU video memory. At the same time, the one-dimensional tree structure is used for searching on the GPU, which also ensures the time complexity of the search process log(n).
[0082] Therefore, when uploading the search internal node tree and the target state equation tree to the GPU, it is only necessary to perform left and right indexing on the search internal node tree and the target state equation tree to generate the corresponding table header address and array range information (array size) to directly upload the continuous data.
[0083] Furthermore, when multiple independent property tables are used simultaneously in an industrial environment (for example, temperature and pressure are needed to find density, and density and internal energy are needed to find temperature), it is only necessary to connect the search internal node trees and target state equation trees contained in the multiple independent property tables, upload them into the GPU together, and record the first address of the corresponding independent property table. When searching, it is only necessary to start the search from the first address of the corresponding independent property table (such as density internal energy to find temperature, start the search from the first address of the search internal node tree constructed by the density temperature table). In this way of searching, only necessary data needs to be stored at the nodes of the search internal node tree and the target state equation tree, which helps to improve the efficiency of GPU search.
[0084] Afterwards, each GPU thread performs independent parallel calculations on the search internal node tree of each independent physical property table, and searches the search internal node tree through the breadth-first algorithm based on the target physical property characteristics obtained by the calculation to find the target index number.
[0085] Finally, the target index number is used in the target state equation tree to obtain the corresponding target state equation. The input variables (density, internal energy) are substituted into the target state equation to obtain the target variable (temperature), thus completing the calculation of the real physical properties of the working fluid.
[0086] It should be noted that, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0087] In addition, in this exemplary embodiment, a tree-structured GPU-based device for calculating the real physical properties of a working fluid is also provided. Figure 5As shown, the tree-structured GPU-based device 500 for calculating the real physical properties of a working medium may include: an adaptive grid generation module 510, a search internal node tree generation module 520, a target state equation tree generation module 530, and a GPU calculation module 540. Among them:
[0088] The adaptive grid generation module 510 is used to generate a physical property error value by calculating the error of the center point of the initial grid unit, and to determine the physical property error value based on the error tolerance to generate an adaptive grid.
[0089] The search internal node tree generation module 520 is used to perform one-dimensional transformation on the adaptive grid through Morton code conversion technology to generate a Morton code partition binary tree, and obtain the value range of the input variable based on the Morton code partition binary tree to generate a search internal node tree.
[0090] The target state equation tree generation module 530 is used to generate local state equations by performing two-dimensional cubic layout on the adaptive grid, and to construct the local state equations based on the node order of the search internal node tree to generate a target state equation tree.
[0091] The GPU computing module 540 is used to obtain a target index number by searching the search internal node tree, and to index the input variable in the target state equation tree by the target index number to obtain the target variable, thereby completing the calculation and acquisition of the real physical properties of the working fluid.
[0092] The tree-structured GPU computing real physical properties device of the embodiment of the present disclosure corresponds to the embodiment of the tree-structured GPU computing real physical properties method of the present disclosure, and the relevant contents can be referenced to each other, which will not be repeated here. The beneficial technical effects corresponding to the tree-structured GPU computing real physical properties device of the embodiment of the present disclosure can refer to the corresponding beneficial technical effects of the above-mentioned corresponding exemplary method part, which will not be repeated here.
[0093] It should be noted that although several modules or units of the GPU computing working fluid real physical property device 500 based on a tree structure are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiment of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0094] Below, reference Figure 6The electronic device according to the embodiment of the present disclosure is described. The electronic device may be any one or both of the first device and the second device, or a stand-alone device independent of them, and the stand-alone device may communicate with the first device and the second device to receive the collected input signals from them.
[0095] Figure 6 A block diagram of an electronic device according to an embodiment of the present disclosure is illustrated.
[0096] like Figure 6 As shown, the electronic device includes one or more processors and memory.
[0097] The processor may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0098] The memory may store one or more computer program products, and the memory may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc. One or more computer program products may be stored on the computer-readable storage medium, and the processor may run the computer program product to implement the various embodiments of the present disclosure described above and / or other desired functions.
[0099] In one example, the electronic device may further include: an input device and an output device, and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0100] In addition, the input device may also include, for example, a keyboard, a mouse, and the like.
[0101] The output device can output various information to the outside, including determined distance information, direction information, etc. The output device can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.
[0102] Of course, to simplify, Figure 6 Only some of the components related to the present disclosure in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device may further include any other appropriate components.
[0103] In addition to the above methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the method according to various embodiments of the present disclosure described in the above part of this specification.
[0104] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0105] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, enables the processor to execute the steps of the method according to various embodiments of the present disclosure described in the above part of this specification.
[0106] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0107] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0108] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0109] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.
[0110] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
[0111] It should also be noted that in the apparatus, device and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0112] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0113] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A tree-structured GPU method for calculating the real physical properties of working fluids, characterized in that: include: Calculating the error of the center point of the initial grid unit based on the user's preset input information to generate a physical property error value, determining the physical property error value based on the error tolerance, and generating an adaptive grid; The adaptive grid is transformed into one dimension by using the Morton code conversion technology to generate a Morton code partition binary tree, and the value range of the input variable is obtained based on the Morton code partition binary tree to generate a search internal node tree; Generate a local state equation by performing a two-dimensional cubic layout on the adaptive grid, and construct the local state equation based on the node order of the search internal node tree to generate a target state equation tree; Based on the parallel computing capability of the GPU, the target index number is obtained by searching the internal node tree, and the input variable is indexed in the target state equation tree by the target index number to obtain the target variable, thereby completing the calculation and acquisition of the real physical properties of the working fluid.
2. The method according to claim 1, characterized in that The user preset input information includes the error tolerance, the preset maximum grid splitting times, the physical property lookup table, and the input variables.
3. The method according to claim 2, characterized in that The error of the initial grid cell center point is calculated based on the user preset input information, including: Performing uniform data point search on the input variable by table lookup method to generate initial grid cells; Searching the physical property lookup table by table lookup method to generate vertex target variables and center point target variables of the initial grid unit; Generate an interpolation target variable by performing linear interpolation calculation on the vertex target variable; The physical property error value is generated by calculating the difference between the central point target variable and the interpolation target variable.
4. The method according to claim 1, characterized in that Also includes: If the physical property error value is less than the error tolerance, the initial grid units are combined to generate an adaptive grid; If the physical property error value is not less than the error tolerance, the number of times the initial grid unit is split is determined; if the number of times the initial grid unit is split is less than the preset maximum number of times the initial grid unit is split, the initial grid unit is split to generate split grid units, and the split grid units are combined to generate an adaptive grid; If the number of times the initial grid unit is split is not less than a preset maximum number of times the grid is split, the initial grid units are combined to generate an adaptive grid.
5. The method according to claim 1, characterized in that The adaptive grid is transformed into one dimension by using the Morton code conversion technology to generate a Morton code partition binary tree, and the value range of the input variable is obtained based on the Morton code partition binary tree to generate a search internal node tree, including: Based on the adaptive grid, the center point coordinates are generated by averaging the vertex coordinates; Performing one-dimensional transformation on the center point coordinates by using Morton code conversion technology to generate a one-dimensional center coordinate serial number, and sorting the one-dimensional center coordinate serial number in a preset order to generate a segmentation serial number; Based on the segmentation sequence number, the one-dimensional center coordinate sequence number is segmented and sorted to generate a Morton code segmentation binary tree; The value range of the input variable is obtained by indexing the leaf nodes of the Morton code partition binary tree with the absolute position coordinates of the input variable; Based on the value range of the input variable, a search internal node tree is generated by constructing a BVH tree for the adaptive grid.
6. The method according to claim 1, characterized in that By performing a two-dimensional cubic layout on the adaptive grid, a local state equation is generated, including: Based on a table lookup method, interpolation discrete points are generated by uniformly interpolating the adaptive grid; Based on the data driven fitting method, the local state equation is generated by performing a two-dimensional cubic layout of the interpolation discrete points.
7. The method according to claim 1, characterized in that By searching the search internal node tree, a target index number is obtained, including: Based on the one-dimensional data vector arrangement property of the search internal node tree and the target state equation tree, the corresponding table head address and array range information are generated by left and right indexing the search internal node tree and the target state equation tree; Based on the first address of the corresponding table and the array range information, the search internal node tree is calculated by the GPU to obtain the target physical property characteristics; Based on the target physical property characteristics, the search internal node tree is searched by a breadth-first algorithm to obtain a target index number.
8. A GPU device for calculating the real physical properties of working fluid based on a tree structure, characterized in that: include: An adaptive grid generation module, used to generate a physical property error value by calculating the error of the center point of the initial grid unit, and to determine the physical property error value based on the error tolerance to generate an adaptive grid; A search internal node tree generation module is used to perform one-dimensional transformation on the adaptive grid through Morton code conversion technology to generate a Morton code partition binary tree, and obtain the value range of the input variable based on the Morton code partition binary tree to generate a search internal node tree; A target state equation tree generation module is used to generate a local state equation by performing a two-dimensional cubic layout on the adaptive grid, and to construct the local state equation based on the node order of the search internal node tree to generate a target state equation tree; The GPU computing module is used to obtain a target index number by searching the search internal node tree, and to index the input variable in the target state equation tree by the target index number to obtain the target variable, thereby completing the calculation and acquisition of the real physical properties of the working fluid.
9. An electronic device, characterized in that: include: A memory for storing a computer program product; A processor is used to execute the computer program product stored in the memory, and when the computer program product is executed, it implements the method described in any one of claims 1 to 7.
10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method described in any one of claims 1 to 7 is implemented.