Fluid volume ratio determination method and device, computer equipment and storage medium
In the method of determining the fluid volume ratio, the positional relationship between the target grid unit and the fluid phase interface is determined, and methods such as random point generation and mean square difference value judgment are used to solve the problem of low accuracy in the traditional method, and higher accuracy and more rigorous fluid motion interface capture are achieved.
Patent Information
- Application Number
- CN202411966634.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-12-30
AI Technical Summary
The traditional method of determining the volume ratio of fluid is relatively low in accuracy, making it difficult to accurately capture changes in the fluid motion interface.
By determining the positional relationship between the target grid element and the fluid phase interface, and using methods such as random point generation and mean square difference value judgment, the fluid volume ratio is accurately calculated based on the preset fluid volume ratio strategy.
It improves the accuracy of the proportion of fluid volume, enhances the ability to capture the fluid motion interface, and ensures more accurate and rigorous calculation of the proportion of fluid volume.
Smart Images

Figure CN119783380A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of fluid volume technology, and in particular to a method, device, computer equipment and storage medium for determining a fluid volume ratio. Background Art
[0002] When using Computational Fluid Dynamics (CFD) technology to simulate immiscible multiphase fluids, the fluid volume fraction method VOF is widely used to capture moving interfaces. The actual fluid distribution is replaced by the phase volume fraction in the discrete grid unit, and the curved phase interface is approximated by small planes in each grid unit. The VOF method captures the moving interface between fluids by calculating the transport of the plane with the fluid.
[0003] However, the traditional method for determining the fluid volume ratio has the problem of low accuracy. Summary of the invention
[0004] Based on this, it is necessary to provide a method, device, computer equipment and storage medium for determining the fluid volume ratio that can improve the accuracy of the fluid volume ratio in order to address the above technical problems.
[0005] In a first aspect, the present application provides a method for determining a fluid volume ratio, comprising:
[0006] Determine the position information of the target grid unit in the grid model; the grid model includes a plurality of grid units;
[0007] Determine the positional relationship between the target grid unit and the fluid interface according to the position information;
[0008] In a case where the positional relationship is that the target grid unit intersects the fluid interface, the fluid volume proportion in the target grid unit is determined according to a preset fluid volume proportion strategy.
[0009] In one embodiment, determining the fluid volume proportion in the target grid unit according to a preset fluid volume proportion strategy includes:
[0010] Generate a plurality of random points according to a preset random point generation component, and determine coordinate information of the plurality of random points according to a preset coordinate determination logic;
[0011] Determining whether the plurality of random points are located within the target grid unit according to the coordinate information of the plurality of random points and a preset grid side relational expression; the grid side relational expression is determined according to the position information of the plurality of grid units in the grid model;
[0012] Determining whether the plurality of random points are located within the fluid interface according to the coordinate information of the plurality of random points and a preset fluid interface relationship equation;
[0013] determining a first number of random points within the target grid cell and a second number of random points within the target grid cell and within the fluid phase interface;
[0014] The volume percentage of the fluid in the target grid unit is determined according to the first quantity and the second quantity.
[0015] In one embodiment, determining the fluid volume ratio in the target grid unit according to the first quantity and the second quantity includes:
[0016] Determine a ratio of the second quantity to the first quantity as an initial fluid volume ratio in the target grid unit;
[0017] Determine the initial fluid volume percentage, the first quantity, and the second quantity to determine a mean square error value;
[0018] If the mean square error value is less than a preset threshold, the initial fluid volume proportion is determined as the fluid volume proportion; if the mean square error value is greater than or equal to the preset threshold, the step of generating multiple random points according to a preset random point generation component is returned to execute.
[0019] In one embodiment, the positional relationship includes position information of each vertex in the target grid unit, and determining the positional relationship between the target grid unit and the fluid interface according to the position information includes:
[0020] Substituting the position information of each vertex in the target grid unit into a preset relationship corresponding to the fluid phase interface to determine the position relationship between each vertex in the target grid unit and the fluid phase interface;
[0021] The positional relationship between the target grid unit and the fluid interface is determined according to the positional relationship between each vertex in the target grid unit and the fluid interface.
[0022] In one embodiment, determining the positional relationship between the target grid unit and the fluid interface according to the positional relationship between each vertex in the target grid unit and the fluid interface includes:
[0023] If all vertices in the target grid unit are located outside the fluid phase interface, then determining that the target grid unit is located outside the fluid phase interface;
[0024] If all vertices in the target grid unit are located within the fluid phase interface, then determining that the target grid unit is located within the fluid phase interface;
[0025] If the target grid unit includes vertices located outside the fluid phase interface and vertices located inside the fluid phase interface, it is determined that the target grid unit intersects the fluid phase interface.
[0026] In one embodiment, the method further comprises:
[0027] If the positional relationship is that the target grid unit is located outside the fluid phase interface, determining the fluid volume ratio in the target grid unit to be a first value;
[0028] If the positional relationship is that the target grid unit is located within the fluid phase interface, the fluid volume percentage in the target grid unit is determined to be a second value.
[0029] In a second aspect, the present application further provides a device for determining a fluid volume ratio, comprising:
[0030] A first determination module is used to determine the position information of the target grid unit in the grid model; the grid model includes a plurality of grid units;
[0031] A second determination module is used to determine the positional relationship between the target grid unit and the fluid interface according to the position information;
[0032] The third determination module is used to determine the fluid volume proportion in the target grid unit according to a preset fluid volume proportion strategy when the position relationship is that the target grid unit intersects the fluid interface.
[0033] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0034] Determine the position information of the target grid unit in the grid model; the grid model includes a plurality of grid units;
[0035] Determine the positional relationship between the target grid unit and the fluid interface according to the position information;
[0036] In a case where the positional relationship is that the target grid unit intersects the fluid interface, the fluid volume proportion in the target grid unit is determined according to a preset fluid volume proportion strategy.
[0037] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0038] Determine the position information of the target grid unit in the grid model; the grid model includes a plurality of grid units;
[0039] Determine the positional relationship between the target grid unit and the fluid interface according to the position information;
[0040] In a case where the positional relationship is that the target grid unit intersects the fluid interface, the fluid volume proportion in the target grid unit is determined according to a preset fluid volume proportion strategy.
[0041] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0042] Determine the position information of the target grid unit in the grid model; the grid model includes a plurality of grid units;
[0043] Determine the positional relationship between the target grid unit and the fluid interface according to the position information;
[0044] In a case where the positional relationship is that the target grid unit intersects the fluid interface, the fluid volume proportion in the target grid unit is determined according to a preset fluid volume proportion strategy.
[0045] The above-mentioned method, device, computer equipment and storage medium for determining the fluid volume percentage determine the position information of the target grid unit in the grid model, the grid model includes multiple grid units, and the position relationship between the target grid unit and the fluid interface is determined according to the position information. When the position relationship is that the target grid unit and the fluid interface intersect, the fluid volume percentage in the target grid unit is determined according to the preset fluid volume percentage strategy. The position relationship between the target grid unit and the fluid interface is first determined, and then the fluid volume percentage in the target grid unit is determined according to the position relationship, which improves the accuracy of the fluid volume percentage, and because the position relationship is determined according to the position information of the target grid unit in the grid model, the position relationship is more accurate, further improving the accuracy of the fluid volume percentage. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 A diagram of an application environment of a method for determining a fluid volume ratio in one embodiment;
[0048] Figure 2 is a flow chart of a method for determining a fluid volume ratio in one embodiment;
[0049] Figure 3 is a flow chart of a method for determining a fluid volume ratio in another embodiment;
[0050] Figure 4 is a flow chart of a method for determining a fluid volume ratio in another embodiment;
[0051] Figure 5 is a flow chart of a method for determining a fluid volume ratio in another embodiment;
[0052] Figure 6 is a flow chart of a method for determining a fluid volume ratio in another embodiment;
[0053] Figure 7 is a schematic diagram of a topological structure of a target grid unit in one embodiment;
[0054] Figure 8 A schematic diagram of determining the position relationship of a random point relative to a target grid unit in one embodiment;
[0055] Fig. 9 is a flow chart of a method for determining a fluid volume ratio in another embodiment;
[0056] Fig.10 is a flow chart of a method for determining a fluid volume ratio in another embodiment;
[0057] Fig.11 4 is a structural block diagram of a device for determining a fluid volume ratio in an embodiment. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0059] The method for determining the fluid volume ratio provided in the embodiment of the present application can be applied to the following examples: Figure 1 In the application environment shown in FIG. 1 , the computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 1 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a method for determining the volume proportion of a fluid is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0060] Those skilled in the art will understand that Figure 1 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0061] In one embodiment, Figure 2 As shown, a method for determining the volume ratio of a fluid is provided, and the method is applied to Figure 1 The following is an example of a terminal in the example, including:
[0062] S201, determining the position information of the target grid unit in the grid model; the grid model includes a plurality of grid units.
[0063] The position information of the target grid unit in the grid model may be the coordinate information of the target grid unit in the network model.
[0064] In an embodiment of the present application, the terminal obtains a grid model of the fluid volume ratio to be determined, the grid model including multiple grid units, traverses each grid unit and the grid vertices of each grid unit step by step, and obtains the position information of multiple grid units in the network model. Furthermore, the topological relationship between the grid unit and the grid vertex, the grid unit and the grid side, and the grid side and the grid vertex can be improved according to the position information of the multiple grid units.
[0065] In an embodiment of the present application, the target grid unit can be any grid unit in the grid model. After the fluid volume ratio of the target grid unit is determined, any grid unit that has not been determined for the fluid volume ratio can be used as the target grid unit to determine the fluid volume ratio corresponding to all grid units in the grid model.
[0066] S202, determining a positional relationship between a target grid unit and a fluid interface according to the position information.
[0067] The positional relationship between the target grid unit and the fluid phase interface includes that the target grid unit is located within the fluid phase interface, the target grid unit is located inside and outside the fluid phase interface, and the target grid unit intersects with the fluid phase interface.
[0068] In an embodiment of the present application, the position information of the target grid unit may include a plurality of coordinate information in the target grid unit, and the positional relationship between the target grid unit and the fluid interface is determined according to the plurality of coordinate information.
[0069] As an optional implementation, a preset coordinate range can be set in advance. When the number of coordinates in the preset coordinate range among multiple coordinate information is greater than or equal to a first value, it is determined that the target grid unit is located within the fluid phase interface; when the number of coordinates in the preset coordinate range among multiple coordinate information is less than the first value and greater than a second value, it is determined that the target grid unit intersects with the fluid phase interface; when the number of coordinates in the preset coordinate range among multiple coordinate information is less than the second value, it is determined that the target grid unit is located inside and outside the fluid phase interface.
[0070] S203: When the position relationship is that the target grid unit intersects with the fluid interface, determine the fluid volume proportion in the target grid unit according to a preset fluid volume proportion strategy.
[0071] In the embodiment of the present application, if the target grid unit intersects with the fluid interface, it is necessary to further determine the fluid volume in the target grid unit, thereby determining the fluid volume ratio in the target grid unit. Optionally, the fluid volume in the target grid unit can be determined by a preset simulation component.
[0072] As an optional implementation, a correspondence between the positional relationship and the fluid volume percentage may be preset, so that the fluid volume percentage in the target grid unit is determined by using the correspondence according to the positional relationship between the target grid unit and the fluid interface.
[0073] As another optional implementation, the positional relationship between the target grid unit and the fluid interface may be input into a trained neural network model for analysis, and the volume percentage of the fluid in the target grid unit may be output.
[0074] In the above method for determining the fluid volume percentage, the position information of the target grid unit in the grid model is determined, and the grid model includes multiple grid units. The positional relationship between the target grid unit and the fluid interface is determined based on the position information. When the positional relationship is that the target grid unit and the fluid interface intersect, the fluid volume percentage in the target grid unit is determined based on a preset fluid volume percentage strategy. The positional relationship between the target grid unit and the fluid interface is first determined, and then the fluid volume percentage in the target grid unit is determined based on the positional relationship, which improves the accuracy of the fluid volume percentage. Since the positional relationship is determined based on the positional information of the target grid unit in the grid model, the positional relationship is more accurate, further improving the accuracy of the fluid volume percentage.
[0075] In one embodiment, an implementation of the above S203 is provided, such as Figure 3 As shown, the above “determining the fluid volume proportion in the target grid unit according to the preset fluid volume proportion strategy” includes:
[0076] S301, generating a plurality of random points according to a preset random point generation component, and determining coordinate information of the plurality of random points according to a preset coordinate determination logic.
[0077] In the embodiment of the present application, the grid unit vertices are traversed to determine the minimum and maximum values of the vertex coordinates along the X, Y, and Z directions ( , , , , and ), construct the circumscribed cuboid of the grid unit, and further, use a uniformly distributed random number generator to generate random points in the circumscribed cuboid , its coordinate determination formula is shown in formula 2:
[0078] (Formula 2)
[0079] Among them, is a uniformly distributed random function; is the maximum value of the random function; the subscripts and represent the maximum and minimum values of the coordinates along the i direction respectively.
[0080] S302, determining whether the multiple random points are located in the target grid unit according to the coordinate information of the multiple random points and a preset grid side relationship formula; the grid side relationship formula is determined according to the position information of the multiple grid units in the grid model.
[0081] In the embodiments of the present application, Figure 4 The figure shows the relationship between the position of the random point and the grid unit. The preset grid side relationship can be shown as formula 3:
[0082] (Formula 3)
[0083] in, It is a vector starting from the center of the grid unit C and ending at the center point F of the grid side; It is a vector starting from the center of the grid cell C and ending at the random point P.
[0084] Optional, such as Figure 5 As shown, the center of the grid unit is obtained by averaging the coordinates of all vertices of the grid unit as shown in Formula 4, the center of the grid side is obtained by averaging all vertices of the grid side as shown in Formula 5, and the unit normal vector of the grid side is obtained by the cross product of any two non-collinear vectors located in the grid side as shown in Formula 6:
[0085] (Formula 4)
[0086] (Formula 5)
[0087] (Formula 6)
[0088] In the formula, the superscript The values are 1, 2, and 3, which represent the x, y, and z directions respectively; is the coordinate of the center point of the grid unit; is the center coordinate of the grid side; are the mesh vertex coordinates; The number of all vertices contained in the mesh cell; Contains all vertex counts for the mesh sides; is the side normal of any mesh; and Is the mesh side with mesh vertices As a starting point, and The vector here , and Can be any three adjacent vertices on any side of the mesh.
[0089] S303: Determine whether the multiple random points are located within the fluid interface according to the coordinate information of the multiple random points and a preset fluid interface relationship equation.
[0090] In the embodiment of the present application, the preset fluid interface relationship is shown in the above formula 1, and the locking information of multiple random points is substituted into the fluid interface relationship at one time. If the random point is located on the interface, ; If the random point is located within the fluid interface, ; If the random point is outside the fluid phase interface, .
[0091] S304, determining a first number of random points located in the target grid unit and a second number of random points located in the target grid unit and in the fluid phase interface.
[0092] In an embodiment of the present application, a first quantity is obtained according to the determination result of determining whether multiple random points are located in the target grid unit in the above steps; and a second quantity is obtained according to the determination result of determining whether multiple random points are located in the target grid unit in the above steps and according to the determination result of determining whether multiple random points are located in the fluid phase interface in the above steps.
[0093] S305: Determine the volume percentage of the fluid in the target grid unit according to the first quantity and the second quantity.
[0094] In an embodiment of the present application, the first quantity and the second quantity can be substituted into a preset volume ratio relationship to determine the fluid volume ratio in the target grid unit; or, the first quantity and the second quantity can be input into a trained parameter prediction model to determine the fluid volume ratio in the target grid unit.
[0095] In the above-mentioned application embodiment, it is determined whether the random point is located in the target grid unit and whether the random point is located in the fluid phase interface, respectively, so as to determine the fluid volume proportion in the target grid unit according to the first quantity and the second quantity, and the accuracy of the fluid volume proportion in the target grid unit is improved by optimizing the determination process.
[0096] In one embodiment, an implementation of the above S305 is provided, such as Figure 6 As shown, the above “determining the fluid volume proportion in the target grid unit according to the first quantity and the second quantity” includes:
[0097] S401: Determine a ratio of the second quantity to the first quantity as an initial fluid volume ratio in a target grid unit.
[0098] In the embodiment of the present application, the first quantity can be expressed as , the second quantity can be expressed as , determine the ratio of the first quantity to the second quantity , and use this ratio as the initial fluid volume ratio in the target grid unit, where E is the initial fluid volume ratio.
[0099] S402, determining the initial fluid volume ratio, the first quantity and the second quantity to determine the mean square error value.
[0100] In the embodiment of the present application, the mean square error value can be as shown in Formula 7 to determine the size relationship between the mean square error value and the preset threshold.
[0101] (Formula 7)
[0102] S403, if the mean square error value is less than the preset threshold, the initial fluid volume proportion is determined as the fluid volume proportion; if the mean square error value is greater than or equal to the preset threshold, return to execute the step of generating multiple random points according to the preset random point generation component.
[0103] In an embodiment of the present application, if the mean square error value is less than a preset threshold, the initial fluid volume proportion is determined as the fluid volume proportion; if the mean square error value is greater than or equal to the preset threshold, the number of random points is small, and the process returns to execute the step of generating multiple random points according to a preset random point generation component, increases the number of random points, and determines the fluid volume proportion based on the increased number of random points.
[0104] In the above application embodiment, whether it is necessary to continue to increase the number of random points is determined based on the mean square error value to ensure the amount of data for determining the fluid volume percentage, thereby improving the accuracy of the fluid volume percentage in the target grid unit.
[0105] In one embodiment, an implementation of the above S202 is provided, such as Figure 7 As shown, the positional relationship includes the positional information of each vertex in the target grid unit, and the above “determining the positional relationship between the target grid unit and the fluid interface according to the positional information” includes:
[0106] S501, substituting the position information of each vertex in the target grid unit into a preset relationship formula corresponding to the fluid phase interface to determine the position relationship between each vertex in the target grid unit and the fluid phase interface.
[0107] The position information of each vertex in the target grid unit may be the coordinate information of each vertex in the grid model.
[0108] In the embodiment of the present application, the preset relationship corresponding to the fluid phase interface can be shown as Formula 1:
[0109] (Formula 1)
[0110] Among them, A, B, C, D, E, F, G, H, I and J are constants. x, y, z are the coordinate information of the vertex.
[0111] In the embodiment of the present application, the coordinate information of the vertex is input into the preset relationship. If the vertex is located on the interface, ; If the vertex is located within the fluid interface, ; If the vertex is outside the fluid interface, .
[0112] S502, determining the positional relationship between the target grid unit and the fluid interface according to the positional relationship between each vertex in the target grid unit and the fluid interface.
[0113] As an optional implementation, a first number of vertices located on the fluid interface is determined, a second number of vertices located within the fluid interface is determined, and a third number of vertices located outside the fluid interface is determined. Further, a maximum value among the first number, the second number, and the third number is determined, and if the maximum value is the first number, the target grid unit intersects the fluid interface; if the maximum value is the second number, the target grid unit is located within the fluid interface; if the maximum value is the third number, the target grid unit is located outside the fluid interface.
[0114] Optional, such as Figure 8 As shown, the above “determining the positional relationship between the target grid unit and the fluid interface according to the positional relationship between each vertex in the target grid unit and the fluid interface” includes:
[0115] S601: If all vertices in the target mesh unit are located outside the fluid phase interface, it is determined that the target mesh unit is located outside the fluid phase interface.
[0116] S602: If all vertices in the target mesh unit are located within the fluid phase interface, it is determined that the target mesh unit is located within the fluid phase interface.
[0117] S603: If the target grid unit includes vertices located outside the fluid phase interface and vertices located inside the fluid phase interface, it is determined that the target grid unit intersects with the fluid phase interface.
[0118] In an embodiment of the present application, if all vertices in the target grid unit are located outside the fluid phase interface, then the target grid unit as a whole is located outside the fluid phase interface, that is, the positional relationship between the target grid unit and the fluid phase interface is that the target grid unit is located outside the fluid phase interface; if all vertices in the target grid unit are located inside the fluid phase interface, then the target grid unit as a whole is located inside the fluid phase interface, that is, the positional relationship between the target grid unit and the fluid phase interface is that the target grid unit is located inside the fluid phase interface; if the target grid unit includes vertices located outside the fluid phase interface and vertices located inside the fluid phase interface, then the target grid unit has both a part located inside the fluid phase interface and a part located outside the fluid phase interface, that is, the positional relationship between the target grid unit and the fluid phase interface is that the target grid unit intersects with the fluid interface.
[0119] In the above-mentioned application embodiment, the positional relationship between each vertex in the target grid unit and the fluid phase interface is determined according to the position information of each vertex in the target grid unit and the preset relationship formula, so that the positional relationship between the target grid unit and the fluid phase interface is determined according to the positional relationship between each vertex in the target grid unit and the fluid phase interface, making the positional relationship between the target grid unit and the fluid phase interface more accurate and rigorous.
[0120] In one embodiment, Fig. 9 As shown, the above method for determining the volume ratio of the fluid further includes:
[0121] S204: If the positional relationship is that the target grid unit is located outside the fluid phase interface, determine that the fluid volume ratio in the target grid unit is a first value.
[0122] In the embodiment of the present application, the first value may be 0. If the position relationship is that the target grid unit is located outside the fluid phase interface, there is no fluid substance in the target grid unit, and the fluid volume fraction in the target grid unit is 0, which can be expressed as the fluid volume fraction .
[0123] S205: If the positional relationship is that the target grid unit is located within the fluid phase interface, determine that the fluid volume ratio in the target grid unit is a second value.
[0124] In the embodiment of the present application, the first value may be 1. If the position relationship is that the target grid unit is located within the fluid phase interface, the target grid unit is entirely filled with fluid matter, and the fluid volume fraction in the target grid unit is 1, which can be expressed as the fluid volume fraction .
[0125] In the above application embodiment, the volume percentage of the fluid in the target grid unit is determined according to the different positional relationships between the target grid unit and the fluid interface, thereby improving the accuracy of the determined volume percentage of the fluid.
[0126] In one embodiment, a complete method for determining the volume percentage of a fluid is also provided, such as Fig.10 As shown, including:
[0127] S1, determining the position information of the target grid unit in the grid model; the grid model includes multiple grid units;
[0128] S2, substituting the position information of each vertex in the target grid unit into a preset relationship corresponding to the fluid phase interface to determine the position relationship between each vertex in the target grid unit and the fluid phase interface.
[0129] S3: If all vertices in the target grid unit are located outside the fluid phase interface, it is determined that the target grid unit is located outside the fluid phase interface.
[0130] S4: If all vertices in the target grid unit are located within the fluid phase interface, it is determined that the target grid unit is located within the fluid phase interface.
[0131] S5: If the target grid unit includes vertices located outside the fluid phase interface and vertices located inside the fluid phase interface, it is determined that the target grid unit intersects the fluid phase interface.
[0132] S6: If the positional relationship is that the target grid unit is located outside the fluid phase interface, determine that the fluid volume ratio in the target grid unit is a first value.
[0133] S7, if the positional relationship is that the target grid unit is located within the fluid phase interface, determining the fluid volume ratio in the target grid unit to be a second value;
[0134] S8, if the target grid cell intersects with the fluid phase interface, execute S9-S15.
[0135] S9, generating a plurality of random points according to a preset random point generation component, and determining coordinate information of the plurality of random points according to a preset coordinate determination logic.
[0136] S10, determining whether the multiple random points are located in the target grid unit according to the coordinate information of the multiple random points and a preset grid side relational expression; the grid side relational expression is determined according to the position information of the multiple grid units in the grid model.
[0137] S11, determining whether the plurality of random points are located within the fluid interface according to the coordinate information of the plurality of random points and a preset fluid interface relationship equation.
[0138] S12, determining a first number of random points located in the target grid unit and a second number of random points located in the target grid unit and in the fluid phase interface.
[0139] S13, determining the ratio of the second quantity to the first quantity as the initial fluid volume ratio in the target grid unit.
[0140] S14, determining the initial fluid volume ratio, the first quantity and the second quantity to determine the mean square error value.
[0141] S15, if the mean square error value is less than the preset threshold, the initial fluid volume proportion is determined as the fluid volume proportion; if the mean square error value is greater than or equal to the preset threshold, return to execute the step of generating multiple random points according to the preset random point generation component.
[0142] In the above method for determining the fluid volume percentage, the position information of the target grid unit in the grid model is determined, and the grid model includes multiple grid units. The positional relationship between the target grid unit and the fluid interface is determined based on the position information. When the positional relationship is that the target grid unit and the fluid interface intersect, the fluid volume percentage in the target grid unit is determined based on a preset fluid volume percentage strategy. The positional relationship between the target grid unit and the fluid interface is first determined, and then the fluid volume percentage in the target grid unit is determined based on the positional relationship, which improves the accuracy of the fluid volume percentage. Since the positional relationship is determined based on the positional information of the target grid unit in the grid model, the positional relationship is more accurate, further improving the accuracy of the fluid volume percentage.
[0143] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0144] Based on the same inventive concept, the embodiment of the present application also provides a device for determining the fluid volume ratio for implementing the method for determining the fluid volume ratio involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of one or more devices for determining the fluid volume ratio provided below can refer to the limitations of the method for determining the fluid volume ratio above, and will not be repeated here.
[0145] In one embodiment, Fig.11As shown, a device for determining a fluid volume ratio is provided, comprising: a first determining module 10, a second determining module 11 and a third determining module 12, wherein:
[0146] A first determination module 10 is used to determine the position information of the target grid unit in the grid model; the grid model includes a plurality of grid units;
[0147] A second determination module 11 is used to determine the positional relationship between the target grid unit and the fluid interface according to the position information;
[0148] The third determination module 12 is used to determine the fluid volume proportion in the target grid unit according to a preset fluid volume proportion strategy when the position relationship is that the target grid unit intersects the fluid interface.
[0149] In one embodiment, the third determination module 12 includes: a generation unit, a first determination unit, a second determination unit, a third determination unit and a fourth determination unit, wherein:
[0150] The generating unit is used to generate a plurality of random points according to a preset random point generating component, and determine the coordinate information of the plurality of random points according to a preset coordinate determining logic.
[0151] The first determination unit is used to determine whether multiple random points are located in a target grid unit based on coordinate information of the multiple random points and a preset grid side relationship formula; the grid side relationship formula is determined based on position information of multiple grid units in the grid model.
[0152] The second determination unit is used to determine whether the plurality of random points are located within the fluid phase interface according to the coordinate information of the plurality of random points and a preset fluid phase interface relationship equation.
[0153] The third determining unit is used to determine a first number of random points located in the target grid unit and a second number of random points located in the target grid unit and in the fluid phase interface.
[0154] The fourth determining unit is used to determine the volume proportion of the fluid in the target grid unit according to the first quantity and the second quantity.
[0155] In one embodiment, the fourth determination unit is specifically used to determine the ratio of the second quantity to the first quantity as the initial fluid volume proportion in the target grid unit; determine the initial fluid volume proportion, the first quantity, and the second quantity to determine the mean square error value; if the mean square error value is less than a preset threshold, the initial fluid volume proportion is determined as the fluid volume proportion; if the mean square error value is greater than or equal to the preset threshold, return to execute the step of generating multiple random points according to the preset random point generation component.
[0156] In one embodiment, the second determining module 11 includes: a fifth determining unit and a sixth determining unit, wherein:
[0157] The fifth determining unit is used to substitute the position information of each vertex in the target grid unit into a preset relationship corresponding to the fluid phase interface to determine the position relationship between each vertex in the target grid unit and the fluid phase interface.
[0158] The sixth determining unit is used to determine the positional relationship between the target grid unit and the fluid interface according to the positional relationship between each vertex in the target grid unit and the fluid interface.
[0159] In one embodiment, the above-mentioned second determination unit is specifically used to determine that the target grid unit is located outside the fluid phase interface if all vertices in the target grid unit are located outside the fluid phase interface; if all vertices in the target grid unit are located inside the fluid phase interface, then determine that the target grid unit is located inside the fluid phase interface; if the target grid unit includes vertices located outside the fluid phase interface and vertices located inside the fluid phase interface, then determine that the target grid unit intersects with the fluid phase interface.
[0160] In one embodiment, the above-mentioned device for determining the fluid volume ratio further includes: a third determination module and a fourth determination module, wherein:
[0161] The third determination module is used to determine that the volume ratio of the fluid in the target grid unit is a first value when the target grid unit is located outside the fluid phase interface.
[0162] The fourth determination module is used to determine that the volume ratio of the fluid in the target grid unit is a second value when the target grid unit is located within the fluid phase interface.
[0163] Each module in the above-mentioned fluid volume ratio determination device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0164] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0165] Determine the position information of the target grid unit in the grid model; the grid model includes multiple grid units;
[0166] Determine the positional relationship between the target grid unit and the fluid interface according to the position information;
[0167] When the positional relationship is that the target grid unit intersects the fluid interface, the fluid volume proportion in the target grid unit is determined according to a preset fluid volume proportion strategy.
[0168] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0169] Generate multiple random points according to a preset random point generation component, and determine coordinate information of the multiple random points according to a preset coordinate determination logic;
[0170] Determine whether the multiple random points are located in the target grid unit according to the coordinate information of the multiple random points and a preset grid side relational expression; the grid side relational expression is determined according to the position information of the multiple grid units in the grid model;
[0171] Determining whether the multiple random points are located within the fluid interface according to the coordinate information of the multiple random points and a preset fluid interface relationship formula;
[0172] determining a first number of random points within the target grid cell and a second number of random points within the target grid cell and within the fluid phase interface;
[0173] The volume ratio of the fluid in the target grid unit is determined according to the first quantity and the second quantity.
[0174] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0175] Determine the ratio of the second quantity to the first quantity as the initial fluid volume ratio in the target grid cell;
[0176] Determine the initial fluid volume percentage, the first quantity, and the second quantity to determine a mean square error value;
[0177] If the mean square error value is less than the preset threshold, the initial fluid volume proportion is determined as the fluid volume proportion; if the mean square error value is greater than or equal to the preset threshold, the step of generating multiple random points according to the preset random point generation component is returned to execute.
[0178] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0179] Substituting the position information of each vertex in the target grid unit into a preset relationship corresponding to the fluid phase interface to determine the position relationship between each vertex in the target grid unit and the fluid phase interface;
[0180] According to the positional relationship between each vertex in the target grid unit and the fluid interface, the positional relationship between the target grid unit and the fluid interface is determined.
[0181] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0182] If all vertices in the target grid cell are located outside the fluid phase interface, it is determined that the target grid cell is located outside the fluid phase interface;
[0183] If all vertices in the target grid cell are located within the fluid phase interface, it is determined that the target grid cell is located within the fluid phase interface;
[0184] If the target grid cell includes vertices located outside the fluid phase interface and vertices located inside the fluid phase interface, it is determined that the target grid cell intersects the fluid phase interface.
[0185] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0186] If the positional relationship is that the target grid unit is located outside the fluid phase interface, determining the fluid volume ratio in the target grid unit to be a first value;
[0187] If the positional relationship is that the target grid unit is located within the fluid phase interface, the fluid volume ratio in the target grid unit is determined to be a second value.
[0188] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0189] Determine the position information of the target grid unit in the grid model; the grid model includes multiple grid units;
[0190] Determine the positional relationship between the target grid unit and the fluid interface according to the position information;
[0191] When the positional relationship is that the target grid unit intersects the fluid interface, the fluid volume proportion in the target grid unit is determined according to a preset fluid volume proportion strategy.
[0192] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0193] Generate multiple random points according to a preset random point generation component, and determine coordinate information of the multiple random points according to a preset coordinate determination logic;
[0194] Determine whether the multiple random points are located in the target grid unit according to the coordinate information of the multiple random points and a preset grid side relational expression; the grid side relational expression is determined according to the position information of the multiple grid units in the grid model;
[0195] Determining whether the multiple random points are located within the fluid interface according to the coordinate information of the multiple random points and a preset fluid interface relationship formula;
[0196] determining a first number of random points within the target grid cell and a second number of random points within the target grid cell and within the fluid phase interface;
[0197] The volume ratio of the fluid in the target grid unit is determined according to the first quantity and the second quantity.
[0198] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0199] Determine the ratio of the second quantity to the first quantity as the initial fluid volume ratio in the target grid cell;
[0200] Determine the initial fluid volume percentage, the first quantity, and the second quantity to determine a mean square error value;
[0201] If the mean square error value is less than the preset threshold, the initial fluid volume proportion is determined as the fluid volume proportion; if the mean square error value is greater than or equal to the preset threshold, the step of generating multiple random points according to the preset random point generation component is returned to execute.
[0202] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0203] Substituting the position information of each vertex in the target grid unit into a preset relationship corresponding to the fluid phase interface to determine the position relationship between each vertex in the target grid unit and the fluid phase interface;
[0204] According to the positional relationship between each vertex in the target grid unit and the fluid interface, the positional relationship between the target grid unit and the fluid interface is determined.
[0205] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0206] If all vertices in the target grid cell are located outside the fluid phase interface, it is determined that the target grid cell is located outside the fluid phase interface;
[0207] If all vertices in the target grid cell are located within the fluid phase interface, it is determined that the target grid cell is located within the fluid phase interface;
[0208] If the target grid cell includes vertices located outside the fluid phase interface and vertices located inside the fluid phase interface, it is determined that the target grid cell intersects the fluid phase interface.
[0209] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0210] If the positional relationship is that the target grid unit is located outside the fluid phase interface, determining the fluid volume ratio in the target grid unit to be a first value;
[0211] If the positional relationship is that the target grid unit is located within the fluid phase interface, the fluid volume ratio in the target grid unit is determined to be a second value.
[0212] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0213] Determine the position information of the target grid unit in the grid model; the grid model includes multiple grid units;
[0214] Determine the positional relationship between the target grid unit and the fluid interface according to the position information;
[0215] When the positional relationship is that the target grid unit intersects the fluid interface, the fluid volume proportion in the target grid unit is determined according to a preset fluid volume proportion strategy.
[0216] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0217] Generate multiple random points according to a preset random point generation component, and determine coordinate information of the multiple random points according to a preset coordinate determination logic;
[0218] Determine whether the multiple random points are located in the target grid unit according to the coordinate information of the multiple random points and a preset grid side relational expression; the grid side relational expression is determined according to the position information of the multiple grid units in the grid model;
[0219] Determining whether the multiple random points are located within the fluid interface according to the coordinate information of the multiple random points and a preset fluid interface relationship formula;
[0220] determining a first number of random points within the target grid cell and a second number of random points within the target grid cell and within the fluid phase interface;
[0221] The volume ratio of the fluid in the target grid unit is determined according to the first quantity and the second quantity.
[0222] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0223] Determine the ratio of the second quantity to the first quantity as the initial fluid volume ratio in the target grid cell;
[0224] Determine the initial fluid volume percentage, the first quantity, and the second quantity to determine a mean square error value;
[0225] If the mean square error value is less than the preset threshold, the initial fluid volume proportion is determined as the fluid volume proportion; if the mean square error value is greater than or equal to the preset threshold, the step of generating multiple random points according to the preset random point generation component is returned to execute.
[0226] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0227] Substituting the position information of each vertex in the target grid unit into a preset relationship corresponding to the fluid phase interface to determine the position relationship between each vertex in the target grid unit and the fluid phase interface;
[0228] According to the positional relationship between each vertex in the target grid unit and the fluid interface, the positional relationship between the target grid unit and the fluid interface is determined.
[0229] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0230] If all vertices in the target grid cell are located outside the fluid phase interface, it is determined that the target grid cell is located outside the fluid phase interface;
[0231] If all vertices in the target grid cell are located within the fluid phase interface, it is determined that the target grid cell is located within the fluid phase interface;
[0232] If the target grid cell includes vertices located outside the fluid phase interface and vertices located inside the fluid phase interface, it is determined that the target grid cell intersects the fluid phase interface.
[0233] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0234] If the positional relationship is that the target grid unit is located outside the fluid phase interface, determining the fluid volume ratio in the target grid unit to be a first value;
[0235] If the positional relationship is that the target grid unit is located within the fluid phase interface, the fluid volume ratio in the target grid unit is determined to be a second value.
[0236] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0237] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0238] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for determining a fluid volume ratio, characterized in that: The method comprises: Determine the position information of the target grid unit in the grid model; the grid model includes a plurality of grid units; Determine the positional relationship between the target grid unit and the fluid interface according to the position information; In a case where the positional relationship is that the target grid unit intersects the fluid interface, the fluid volume proportion in the target grid unit is determined according to a preset fluid volume proportion strategy.
2. The method according to claim 1, characterized in that: The determining the fluid volume proportion in the target grid unit according to a preset fluid volume proportion strategy includes: Generate a plurality of random points according to a preset random point generation component, and determine coordinate information of the plurality of random points according to a preset coordinate determination logic; Determining whether the plurality of random points are located within the target grid unit according to the coordinate information of the plurality of random points and a preset grid side relational expression; the grid side relational expression is determined according to the position information of the plurality of grid units in the grid model; Determining whether the plurality of random points are located within the fluid interface according to the coordinate information of the plurality of random points and a preset fluid interface relationship equation; determining a first number of random points within the target grid cell and a second number of random points within the target grid cell and within the fluid phase interface; The volume percentage of the fluid in the target grid unit is determined according to the first quantity and the second quantity.
3. The method according to claim 2, characterized in that The step of determining the fluid volume ratio in the target grid unit according to the first quantity and the second quantity includes: Determine a ratio of the second quantity to the first quantity as an initial fluid volume ratio in the target grid unit; Determine the initial fluid volume percentage, the first quantity, and the second quantity to determine a mean square error value; If the mean square error value is less than a preset threshold, the initial fluid volume proportion is determined as the fluid volume proportion; if the mean square error value is greater than or equal to the preset threshold, the step of generating multiple random points according to a preset random point generation component is returned to execute.
4. The method according to claim 1, characterized in that The positional relationship includes positional information of each vertex in the target grid unit, and determining the positional relationship between the target grid unit and the fluid interface according to the positional information includes: Substituting the position information of each vertex in the target grid unit into a preset relationship corresponding to the fluid phase interface to determine the position relationship between each vertex in the target grid unit and the fluid phase interface; The positional relationship between the target grid unit and the fluid interface is determined according to the positional relationship between each vertex in the target grid unit and the fluid interface.
5. The method according to claim 4, characterized in that The determining the positional relationship between the target grid unit and the fluid interface according to the positional relationship between each vertex in the target grid unit and the fluid interface comprises: If all vertices in the target grid unit are located outside the fluid phase interface, then determining that the target grid unit is located outside the fluid phase interface; If all vertices in the target grid unit are located within the fluid phase interface, then determining that the target grid unit is located within the fluid phase interface; If the target grid unit includes vertices located outside the fluid phase interface and vertices located inside the fluid phase interface, it is determined that the target grid unit intersects the fluid phase interface.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: If the positional relationship is that the target grid unit is located outside the fluid phase interface, determining the fluid volume ratio in the target grid unit to be a first value; If the positional relationship is that the target grid unit is located within the fluid phase interface, the fluid volume percentage in the target grid unit is determined to be a second value.
7. A device for determining a fluid volume ratio, characterized in that: The device comprises: A first determination module is used to determine the position information of the target grid unit in the grid model; the grid model includes a plurality of grid units; A second determination module is used to determine the positional relationship between the target grid unit and the fluid interface according to the position information; The third determination module is used to determine the fluid volume proportion in the target grid unit according to a preset fluid volume proportion strategy when the position relationship is that the target grid unit intersects the fluid interface.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Method and device for determining grid for fluid calculation
CN118114580A
Three-phase fluid filling simulation method, electronic equipment and computer storage medium
CN118278305A
N-phase interface tracking method utilizing unique enumeration of microgrid cells
US20050182603A1
Method of Simulation of Moving Interfaces using Geometry-Aware Volume of Fluid Method
US20150242545A1