Method and apparatus for determining fluid volume fraction
By determining the positional relationship between the target grid cell and the fluid phase interface in the grid model, and using random point generation and mean square error adjustment methods, the problem of low accuracy in fluid volume proportion calculation is solved, and higher accuracy in fluid volume proportion calculation is achieved.
Patent Information
- Application Number
- CN202411966634.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2044-12-30
AI Technical Summary
Traditional methods for determining fluid volume fraction have low accuracy when simulating immiscible multiphase fluids.
By determining the position information of the target grid cell in the grid model, and based on the relationship between the position and the fluid phase interface, the fluid volume ratio is calculated using a preset fluid volume ratio strategy. This includes generating random points and determining their positions within the grid cell and the fluid phase interface, and adjusting the number of random points using the mean square error value to improve accuracy.
This improves the accuracy of fluid volume percentage calculation and ensures the accuracy of positional relationships, thereby enhancing the accuracy of fluid volume percentage calculation.
Smart Images

Figure CN119783380B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of fluid volume technology, and in particular to a method and apparatus for determining the fluid volume ratio. Background Technology
[0002] In computational fluid dynamics (CFD) simulations of immiscible multiphase fluids, the volume fraction of fluid (VOF) method is widely used to capture moving interfaces. The actual fluid distribution is replaced by the volume fraction of the phase within discrete mesh cells, and the tortuous phase interface is approximated by small planes within each mesh cell. The VOF method captures moving interfaces between fluids by calculating the transport of planes along with the fluid.
[0003] However, traditional methods for determining fluid volume percentage suffer from low accuracy. Summary of the Invention
[0004] Therefore, it is necessary to provide a method and apparatus for determining fluid volume ratio that can improve the accuracy of fluid volume ratio determination, in order to address the aforementioned technical problems.
[0005] In a first aspect, this application provides a method for determining the volume percentage of a fluid, comprising:
[0006] Determine the location information of the target mesh element in the mesh model; the mesh model includes multiple mesh elements;
[0007] The positional relationship between the target mesh element and the fluid phase interface is determined based on the position information;
[0008] When the positional relationship is such that the target grid cell intersects with the fluid phase interface, the fluid volume ratio in the target grid cell is determined according to a preset fluid volume ratio strategy.
[0009] In one embodiment, determining the fluid volume percentage in the target mesh cell according to a preset fluid volume percentage strategy includes:
[0010] Multiple random points are generated according to a preset random point generation component, and the coordinate information of the multiple random points is determined according to a preset coordinate determination logic.
[0011] Based on the coordinate information of the multiple random points and the preset mesh side relationship formula, it is determined whether the multiple random points are located within the target mesh cell; the mesh side relationship formula is determined based on the position information of multiple mesh cells in the mesh model;
[0012] Based on the coordinate information of the multiple random points and the preset fluid phase interface relationship, determine whether the multiple random points are located within the fluid phase interface;
[0013] Determine a first number of random points located within the target grid cell, and a second number of random points located within the target grid cell and within the fluid phase interface;
[0014] The fluid volume percentage in the target grid cell is determined based on the first quantity and the second quantity.
[0015] In one embodiment, determining the fluid volume percentage in the target grid cell based on the first quantity and the second quantity includes:
[0016] The ratio of the second quantity to the first quantity is determined as the initial fluid volume percentage in the target grid cell;
[0017] Determine the initial fluid volume percentage, the first quantity, and the second quantity, and then determine the mean square error value.
[0018] If the mean square error is less than a preset threshold, the initial fluid volume percentage is determined as the fluid volume percentage; if the mean square error is greater than or equal to the preset threshold, the process returns to the step of generating multiple random points according to the preset random point generation component.
[0019] In one embodiment, the positional relationship includes positional information of each vertex in the target mesh cell, and determining the positional relationship between the target mesh cell and the fluid phase interface based on the positional information includes:
[0020] Substitute the position information of each vertex in the target mesh cell into the preset relational formula corresponding to the fluid phase interface to determine the positional relationship between each vertex of the target mesh cell and the fluid phase interface;
[0021] The positional relationship between the target mesh cell and the fluid phase interface is determined based on the positional relationship between each vertex in the target mesh cell and the fluid phase interface.
[0022] In one embodiment, determining the positional relationship between the target mesh cell and the fluid interface based on the positional relationship between each vertex in the target mesh cell and the fluid interface includes:
[0023] If all vertices in the target mesh cell are located outside the fluid phase interface, then the target mesh cell is determined to be located outside the fluid phase interface.
[0024] If all vertices in the target mesh cell are located within the fluid phase interface, then the target mesh cell is determined to be located within the fluid phase interface.
[0025] If the target mesh cell includes vertices located outside the fluid phase interface and vertices located inside the fluid phase interface, then the target mesh cell is determined to intersect with the fluid phase interface.
[0026] In one embodiment, the method further includes:
[0027] If the positional relationship is such that the target grid cell is located outside the fluid phase interface, then the fluid volume ratio in the target grid cell is determined to be a first value;
[0028] If the positional relationship is such that the target grid cell is located within the fluid phase interface, then the fluid volume percentage in the target grid cell is determined to be the second value.
[0029] Secondly, this application also provides an apparatus for determining the volume percentage of a fluid, comprising:
[0030] The first determining module is used to determine the position information of the target mesh element in the mesh model; the mesh model includes multiple mesh elements;
[0031] The second determining module is used to determine the positional relationship between the target grid cell and the fluid phase interface based on the position information;
[0032] The third determining module is used to determine the fluid volume percentage in the target mesh cell according to a preset fluid volume percentage strategy when the positional relationship is such that the target mesh cell intersects with the fluid phase interface.
[0033] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0034] Determine the location information of the target mesh element in the mesh model; the mesh model includes multiple mesh elements;
[0035] The positional relationship between the target mesh element and the fluid phase interface is determined based on the position information;
[0036] When the positional relationship is such that the target grid cell intersects with the fluid phase interface, the fluid volume ratio in the target grid cell is determined according to a preset fluid volume ratio strategy.
[0037] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0038] Determine the location information of the target mesh element in the mesh model; the mesh model includes multiple mesh elements;
[0039] The positional relationship between the target mesh element and the fluid phase interface is determined based on the position information;
[0040] When the positional relationship is such that the target grid cell intersects with the fluid phase interface, the fluid volume ratio in the target grid cell is determined according to a preset fluid volume ratio strategy.
[0041] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0042] Determine the location information of the target mesh element in the mesh model; the mesh model includes multiple mesh elements;
[0043] The positional relationship between the target mesh element and the fluid phase interface is determined based on the position information;
[0044] When the positional relationship is such that the target grid cell intersects with the fluid phase interface, the fluid volume ratio in the target grid cell is determined according to a preset fluid volume ratio strategy.
[0045] The aforementioned method and apparatus for determining fluid volume percentage determine the positional information of a target mesh cell within a mesh model. The mesh model includes multiple mesh cells. Based on the positional information, the positional relationship between the target mesh cell and the fluid interface is determined. If the positional relationship is such that the target mesh cell intersects with the fluid interface, the fluid volume percentage within the target mesh cell is determined according to a preset fluid volume percentage strategy. By first determining the positional relationship between the target mesh cell and the fluid interface, and then determining the fluid volume percentage within the target mesh cell based on this relationship, the accuracy of the fluid volume percentage is improved. Furthermore, since the positional relationship is determined based on the positional information of the target mesh cell within the mesh model, the positional relationship is more accurate, further enhancing the accuracy of the fluid volume percentage. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0047] Figure 1 This is a diagram illustrating the application environment of a method for determining the fluid volume ratio in one embodiment.
[0048] Figure 2 This is a flowchart illustrating a method for determining the fluid volume percentage in one embodiment;
[0049] Figure 3 This is a flowchart illustrating the method for determining the fluid volume percentage in another embodiment;
[0050] Figure 4 This is a flowchart illustrating the method for determining the fluid volume percentage in another embodiment;
[0051] Figure 5 This is a flowchart illustrating the method for determining the fluid volume percentage in another embodiment;
[0052] Figure 6 This is a flowchart illustrating the method for determining the fluid volume percentage in another embodiment;
[0053] Figure 7 This is a schematic diagram of the topology of a target mesh cell in one embodiment;
[0054] Figure 8 This is a schematic diagram illustrating the determination of the positional relationship between a random point and a target grid cell in one embodiment;
[0055] Figure 9 This is a flowchart illustrating the method for determining the fluid volume percentage in another embodiment;
[0056] Figure 10 This is a flowchart illustrating the method for determining the fluid volume percentage in another embodiment;
[0057] Figure 11 This is a structural block diagram of a device for determining the fluid volume percentage in one embodiment. Detailed Implementation
[0058] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0059] The method for determining the fluid volume ratio provided in this application embodiment can be applied to, for example, Figure 1 The application environment shown. The computer device can be a terminal, and its internal structure diagram can be as follows. Figure 1As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements a method for determining the volume percentage of a fluid. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0060] Those skilled in the art will understand that Figure 1 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0061] In one embodiment, such as Figure 2 As shown, a method for determining the fluid volume ratio is provided, which can be applied to... Figure 1 Taking the terminal in the example, the explanation includes:
[0062] S201, Determine the location information of the target mesh element in the mesh model; the mesh model includes multiple mesh elements.
[0063] The position information of the target mesh element in the mesh model can be the coordinate information of the target mesh element in the network model.
[0064] In this embodiment of the application, the terminal obtains a mesh model of the fluid volume ratio to be determined. The mesh model includes multiple mesh cells. Each mesh cell and its vertices are traversed level by level to obtain the position information of multiple mesh cells in the network model. Furthermore, the topological relationships between mesh cells and mesh vertices, mesh cells and mesh sides, and mesh sides and mesh vertices can be improved based on the position information of multiple mesh cells.
[0065] In the embodiments of this application, the target mesh cell can be any mesh cell in the mesh model. After determining the fluid volume ratio of the target mesh cell, any mesh cell that has not been determined for fluid volume ratio can be used as the target mesh cell, thereby determining the fluid volume ratio of all mesh cells in the mesh model.
[0066] S202, determine the positional relationship between the target mesh element and the fluid phase interface based on the position information.
[0067] The positional relationship between the target mesh element and the fluid phase interface includes the target mesh element being located inside the fluid phase interface, the target mesh element being located inside or outside the fluid phase interface, and the target mesh element intersecting with the fluid phase interface.
[0068] In this embodiment of the application, the position information of the target grid cell may include multiple coordinate information of the target grid cell, and the positional relationship between the target grid cell and the fluid phase interface is determined based on the multiple coordinate information.
[0069] As an optional implementation, a preset coordinate range can be set in advance. When the number of coordinates within the preset coordinate range is greater than or equal to a first value, the target mesh unit is determined to be located within the fluid phase interface. When the number of coordinates within the preset coordinate range is less than the first value but greater than a second value, the target mesh unit is determined to intersect with the fluid phase interface. When the number of coordinates within the preset coordinate range is less than the second value, the target mesh unit is determined to be located inside or outside the fluid phase interface.
[0070] S203, when the target grid cell intersects with the fluid phase interface, the fluid volume ratio in the target grid cell is determined according to the preset fluid volume ratio strategy.
[0071] In this embodiment, if the target mesh cell intersects with the fluid interface, it is necessary to further determine the fluid volume in the target mesh cell to determine the fluid volume ratio in the target mesh cell. Optionally, the fluid volume in the target mesh cell can be determined using a preset simulation component.
[0072] As an optional implementation, the correspondence between positional relationships and fluid volume ratios can be preset, thereby determining the fluid volume ratio in the target grid cell based on the positional relationship between the target grid cell and the fluid phase interface.
[0073] As another alternative implementation, the positional relationship between the target grid cell and the fluid phase interface can be input into a trained neural network model for analysis, and the fluid volume percentage in the target grid cell can be output.
[0074] In the aforementioned method for determining fluid volume percentage, the positional information of the target mesh element within the mesh model is determined. The mesh model includes multiple mesh elements. Based on the positional information, the positional relationship between the target mesh element and the fluid interface is determined. If the positional relationship is such that the target mesh element intersects with the fluid interface, the fluid volume percentage within the target mesh element is determined according to a preset fluid volume percentage strategy. First, the positional relationship between the target mesh element and the fluid interface is determined, and then the fluid volume percentage within the target mesh element is determined based on this relationship. This improves the accuracy of the fluid volume percentage determination. Furthermore, since the positional relationship is determined based on the positional information of the target mesh element within the mesh model, the positional relationship is more accurate, further enhancing the accuracy of the fluid volume percentage determination.
[0075] In one embodiment, one implementation of the above-described S203 is provided, such as... Figure 3 As shown, the above-mentioned "determining the fluid volume percentage in the target mesh cell according to the preset fluid volume percentage strategy" includes:
[0076] S301, generate multiple random points according to the preset random point generation component, and determine the coordinate information of the multiple random points according to the preset coordinate determination logic.
[0077] In this embodiment, the vertices of the mesh cells are traversed to determine the minimum and maximum values (x, y, z) of the vertex coordinates along the X, Y, and Z directions. min y min z min x max y max and z max To construct the circumscribed cuboid of the grid cells, a random point P is generated within the circumscribed cuboid using a uniformly distributed random number generator. The coordinates of P are determined as shown in Equation 2.
[0078]
[0079] Where is a uniformly distributed random function; is the maximum value of the random function; and the subscripts and represent the maximum and minimum coordinates along the i-th direction, respectively.
[0080] S302, based on the coordinate information of multiple random points and the preset mesh side relationship formula, determine whether multiple random points are located within the target mesh cell; the mesh side relationship formula is determined based on the position information of multiple mesh cells in the mesh model.
[0081] In the embodiments of this application, such as Figure 4 The diagram shows the positional relationship of random points relative to grid cells. The preset grid side relationship can be expressed as shown in Equation 3:
[0082]
[0083] in, It is a vector that starts from the center C of the grid cell and ends at the center point F of the side of the grid. It is a vector that starts from the center C of the grid cell and ends at a random point P.
[0084] Optional, such as Figure 5 As shown in Equation 4, the center of the mesh cell is obtained by averaging the coordinates of all vertices of the mesh cell; the center of the mesh side is obtained by averaging the coordinates of all vertices of the mesh side as shown in Equation 5; and the unit normal vector of the mesh side is obtained by the cross product of any two non-collinear vectors located within the mesh side as shown in Equation 6.
[0085]
[0086] In the formula, the subscript i takes values of 1, 2, and 3, representing the x, y, and z directions respectively; x c,i x represents the coordinates of the center point of the grid cell; F,i x represents the center coordinates of the side of the grid; Nj,i N represents the coordinates of the grid vertex; N is the number of vertices contained in the grid cell; N F The number of vertices included on the side of the mesh; For any mesh side normal; and It is a vector on the side of the mesh, starting from mesh vertex N2 and ending at N3 and N6. Here, N2, N3, and N6 can be any three adjacent vertices on any side of the mesh.
[0087] S303, based on the coordinate information of multiple random points and the preset fluid phase interface relationship, determines whether multiple random points are located within the fluid phase interface.
[0088] In this embodiment of the application, the preset fluid phase interface relationship is as shown in Equation 1 above. The edge locking information of multiple random points is substituted into the fluid phase interface relationship at one time. If the random point is located on the phase interface, Φ(x,y,z)=0; if the random point is located inside the fluid phase interface, Φ(x,y,z)<0; if the random point is located outside the fluid phase interface, Φ(x,y,z)>0.
[0089] S304, determine a first number of random points located within the target grid cell, and a second number of random points located within the target grid cell and within the fluid phase interface.
[0090] In this embodiment of the application, a first quantity is obtained based on the determination results of whether multiple random points are located within the target grid cell in the above steps; and a second quantity is obtained based on the determination results of whether multiple random points are located within the target grid cell in the above steps and the determination results of whether multiple random points are located within the fluid phase interface in the above steps.
[0091] S305, determine the fluid volume percentage in the target grid cell based on the first quantity and the second quantity.
[0092] In this embodiment of the application, the first quantity and the second quantity can be substituted into a preset volume ratio formula to determine the fluid volume ratio in the target grid cell; 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 cell.
[0093] In the above application embodiments, it is determined whether the random point is located within the target grid cell and whether the random point is located within the fluid phase interface, thereby determining the fluid volume ratio in the target grid cell based on the first quantity and the second quantity. The accuracy of the fluid volume ratio in the target grid cell is improved by optimizing the determination process.
[0094] In one embodiment, one implementation of the above-described S305 is provided, such as... Figure 6 As shown, the above-mentioned "determining the fluid volume percentage in the target grid cell based on the first and second quantities" includes:
[0095] S401, the ratio of the second quantity to the first quantity is determined as the initial fluid volume percentage in the target grid cell.
[0096] In this embodiment of the application, the first quantity can be represented as I1, the second quantity can be represented as I2, and the ratio of the first quantity to the second quantity is determined. This ratio is used as the initial fluid volume percentage in the target mesh cell, where E is the initial fluid volume percentage.
[0097] S402, determine the initial fluid volume ratio, and determine the root mean square error of the first and second quantities.
[0098] In this embodiment of the application, the mean square error can be determined as shown in Equation 7, which determines the relationship between the mean square error and the preset threshold.
[0099]
[0100] S403, if the mean square error is less than the preset threshold, the initial fluid volume ratio is determined as the fluid volume ratio; if the mean square error is greater than or equal to the preset threshold, the process returns to the step of generating multiple random points according to the preset random point generation component.
[0101] In this embodiment, if the mean square error is less than a preset threshold, the initial fluid volume percentage is determined as the fluid volume percentage; if the mean square error is greater than or equal to the preset threshold, the number of random points is small, and the process returns to the step of generating multiple random points according to the preset random point generation component, increasing the number of random points, and determining the fluid volume percentage based on the increased number of random points.
[0102] In the above application embodiments, the mean square error value is used to determine whether it is necessary to continue to increase the number of random points in order to ensure that the amount of data for determining the fluid volume ratio is sufficient, thereby improving the accuracy of the fluid volume ratio in the target grid cell.
[0103] In one embodiment, one implementation of the above-described S202 is provided, such as... Figure 7 As shown, the positional relationship includes the positional information of each vertex in the target mesh cell. The above-mentioned "determining the positional relationship between the target mesh cell and the fluid phase interface based on the positional information" includes:
[0104] S501, Substitute the position information of each vertex in the target mesh element into the preset relational formula corresponding to the fluid phase interface to determine the positional relationship between each vertex of the target mesh element and the fluid phase interface.
[0105] The position information of each vertex in the target mesh cell can be the coordinate information of each vertex in the mesh model.
[0106] In this embodiment of the application, the preset relationship corresponding to the fluid phase interface can be as shown in Equation 1:
[0107] Φ(x,y,z)=Ax 2 +By 2 +Cz 2 +Dxy+Exz+Fyz+Gx+Hy+Iz+J (Formula 1)
[0108] Where A, B, C, D, E, F, G, H, I, and J are constants. x, y, and z are the coordinate information of the vertices.
[0109] In this embodiment of the application, the coordinate information of the vertex is input into a preset relation. If the vertex is located on the phase interface, Φ(x,y,z)=0; if the vertex is located inside the fluid phase interface, Φ(x,y,z)<0; if the vertex is located outside the fluid phase interface, Φ(x,y,z)>0.
[0110] S502, determine the positional relationship between the target mesh element and the fluid phase interface based on the positional relationship between each vertex in the target mesh element and the fluid phase interface.
[0111] As an optional implementation, a first number of vertices located on the fluid phase interface is determined, a second number of vertices located within the fluid phase interface is determined, and a third number of vertices located outside the fluid phase interface is determined. Further, the maximum value among the first, second, and third numbers is determined. If the maximum value is the first number, the target mesh cell intersects with the fluid phase interface; if the maximum value is the second number, the target mesh cell is located within the fluid phase interface; and if the maximum value is the third number, the target mesh cell is located outside the fluid phase interface.
[0112] Optional, such as Figure 8 As shown, the above-mentioned "determining the positional relationship between the target mesh element and the fluid phase interface based on the positional relationship between each vertex in the target mesh element and the fluid phase interface" includes:
[0113] S601, if all vertices in the target mesh element are located outside the fluid phase interface, then the target mesh element is determined to be located outside the fluid phase interface.
[0114] S602, if all vertices in the target mesh element are located within the fluid phase interface, then the target mesh element is determined to be located within the fluid phase interface.
[0115] S603, if the target mesh element includes vertices located outside the fluid phase interface and vertices located inside the fluid phase interface, then the target mesh element is determined to intersect with the fluid phase interface.
[0116] In the embodiments of this application, if all vertices in the target mesh unit are located outside the fluid phase interface, then the entire target mesh unit is located outside the fluid phase interface, that is, the positional relationship between the target mesh unit and the fluid phase interface is that the target mesh unit is located outside the fluid phase interface; if all vertices in the target mesh unit are located inside the fluid phase interface, then the entire target mesh unit is located inside the fluid phase interface, that is, the positional relationship between the target mesh unit and the fluid phase interface is that the target mesh unit is located inside the fluid phase interface; if the target mesh unit includes vertices located outside the fluid phase interface and vertices located inside the fluid phase interface, then the target mesh unit has both a portion inside the fluid phase interface and a portion outside the fluid phase interface, that is, the positional relationship between the target mesh unit and the fluid phase interface is that the target mesh unit intersects with the fluid phase interface.
[0117] In the above application embodiments, the positional relationship between each vertex in the target mesh cell and the fluid phase interface is determined based on the positional information of each vertex in the target mesh cell and the preset relational formula. Thus, the positional relationship between the target mesh cell and the fluid phase interface is determined based on the positional relationship between each vertex in the target mesh cell and the fluid phase interface, making the positional relationship between the target mesh cell and the fluid phase interface more accurate and rigorous.
[0118] In one embodiment, such as Figure 9 As shown, the method for determining the fluid volume ratio described above also includes:
[0119] S204, if the positional relationship is that the target mesh element is located outside the fluid phase interface, then the fluid volume ratio in the target mesh element is determined to be the first value.
[0120] In the embodiments of this application, the first value can be 0. If the positional relationship is that the target grid cell is located outside the fluid phase interface, then there is no fluid material in the target grid cell, and the fluid volume ratio in the target grid cell is 0, which can be expressed as fluid volume fraction α = 0.
[0121] S205, if the positional relationship is that the target mesh element is located within the fluid phase interface, then the fluid volume ratio in the target mesh element is determined to be the second value.
[0122] In the embodiments of this application, the first value can be 1. If the positional relationship is that the target grid cell is located within the fluid phase interface, then all the target grid cell is fluid material, and the fluid volume ratio in the target grid cell is 1, which can be expressed as fluid volume fraction α = 1.
[0123] In the above-mentioned embodiments, the fluid volume ratio in the target grid cell is determined based on the different positional relationships between the target grid cell and the fluid phase interface, thereby improving the accuracy of the determined fluid volume ratio.
[0124] In one embodiment, a complete method for determining the fluid volume percentage is also provided, such as... Figure 10 As shown, it includes:
[0125] S1, determine the location information of the target mesh element in the mesh model; the mesh model includes multiple mesh elements;
[0126] S2, substitute the position information of each vertex in the target mesh cell into the preset relational formula corresponding to the fluid phase interface to determine the positional relationship between each vertex of the target mesh cell and the fluid phase interface.
[0127] S3, if all vertices in the target mesh element are located outside the fluid phase interface, then the target mesh element is determined to be located outside the fluid phase interface.
[0128] S4. If all vertices in the target mesh element are located within the fluid phase interface, then the target mesh element is determined to be located within the fluid phase interface.
[0129] S5. If the target mesh element includes vertices located outside the fluid phase interface and vertices located inside the fluid phase interface, then the target mesh element is determined to intersect with the fluid phase interface.
[0130] S6. If the positional relationship is that the target grid cell is located outside the fluid phase interface, then the fluid volume ratio in the target grid cell is determined to be the first value.
[0131] S7, If the positional relationship is that the target mesh element is located within the fluid phase interface, then the fluid volume ratio in the target mesh element is determined to be the second value;
[0132] S8. If the target mesh element intersects with the fluid phase interface, then execute S9-S15.
[0133] S9 generates multiple random points according to a preset random point generation component, and determines the coordinate information of the multiple random points according to a preset coordinate determination logic.
[0134] S10, based on the coordinate information of multiple random points and the preset mesh side relationship formula, determine whether multiple random points are located within the target mesh cell; the mesh side relationship formula is determined based on the position information of multiple mesh cells in the mesh model.
[0135] S11, based on the coordinate information of multiple random points and the preset fluid phase interface relationship, determine whether the multiple random points are located within the fluid phase interface.
[0136] S12, determine a first number of random points located within the target grid cell, and a second number of random points located within the target grid cell and within the fluid phase interface.
[0137] S13, the ratio of the second quantity to the first quantity is determined as the initial fluid volume percentage in the target grid cell.
[0138] S14, determine the initial fluid volume ratio, and determine the root mean square error of the first and second quantities.
[0139] S15, if the mean square error is less than the preset threshold, the initial fluid volume ratio is determined as the fluid volume ratio; if the mean square error is greater than or equal to the preset threshold, the process returns to the step of generating multiple random points according to the preset random point generation component.
[0140] In the aforementioned method for determining fluid volume percentage, the positional information of the target mesh element within the mesh model is determined. The mesh model includes multiple mesh elements. Based on the positional information, the positional relationship between the target mesh element and the fluid interface is determined. If the positional relationship is such that the target mesh element intersects with the fluid interface, the fluid volume percentage within the target mesh element is determined according to a preset fluid volume percentage strategy. First, the positional relationship between the target mesh element and the fluid interface is determined, and then the fluid volume percentage within the target mesh element is determined based on this relationship. This improves the accuracy of the fluid volume percentage determination. Furthermore, since the positional relationship is determined based on the positional information of the target mesh element within the mesh model, the positional relationship is more accurate, further enhancing the accuracy of the fluid volume percentage determination.
[0141] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0142] Based on the same inventive concept, this application also provides a fluid volume ratio determination apparatus for implementing the fluid volume ratio determination method described above. The solution provided by this apparatus is similar to the solution described in the above method; therefore, the specific limitations in one or more embodiments of the fluid volume ratio determination apparatus provided below can be found in the limitations of the fluid volume ratio determination method described above, and will not be repeated here.
[0143] In one embodiment, such as Figure 11 As shown, a device for determining the volume ratio of a fluid is provided, comprising: a first determining module 10, a second determining module 11, and a third determining module 12, wherein:
[0144] The first determining module 10 is used to determine the position information of the target mesh element in the mesh model; the mesh model includes multiple mesh elements.
[0145] The second determining module 11 is used to determine the positional relationship between the target grid cell and the fluid phase interface based on the position information;
[0146] The third determining module 12 is used to determine the fluid volume ratio in the target grid cell according to a preset fluid volume ratio strategy when the positional relationship is that the target grid cell intersects with the fluid phase interface.
[0147] In one embodiment, the third determining module 12 includes: a generating unit, a first determining unit, a second determining unit, a third determining unit, and a fourth determining unit, wherein:
[0148] The generation unit is used to generate multiple random points according to a preset random point generation component, and to determine the coordinate information of the multiple random points according to a preset coordinate determination logic.
[0149] The first determining unit is used to determine whether multiple random points are located within the target grid cell based on the coordinate information of multiple random points and a preset grid side relationship formula; the grid side relationship formula is determined based on the position information of multiple grid cells in the grid model.
[0150] The second determining unit is used to determine whether multiple random points are located within the fluid phase interface based on the coordinate information of multiple random points and the preset fluid phase interface relationship.
[0151] The third determining unit is used to determine a first number of random points located within the target grid cell and a second number of random points located within the target grid cell and within the fluid phase interface.
[0152] The fourth determining unit is used to determine the fluid volume ratio in the target grid cell based on the first quantity and the second quantity.
[0153] In one embodiment, the fourth determining unit is specifically used to determine the ratio of the second quantity to the first quantity as the initial fluid volume percentage in the target grid cell; determine the initial fluid volume percentage, the first quantity, and the second quantity to determine the mean square error; if the mean square error is less than a preset threshold, then determine the initial fluid volume percentage as the fluid volume percentage; if the mean square error is greater than or equal to the preset threshold, then return to the step of generating multiple random points according to the preset random point generation component.
[0154] In one embodiment, the second determining module 11 includes: a fifth determining unit and a sixth determining unit, wherein:
[0155] The fifth determining unit is used to substitute the position information of each vertex in the target mesh unit into the preset relational formula corresponding to the fluid phase interface to determine the positional relationship between each vertex in the target mesh unit and the fluid phase interface.
[0156] The sixth determining unit is used to determine the positional relationship between the target mesh element and the fluid phase interface based on the positional relationship between each vertex in the target mesh element and the fluid phase interface.
[0157] In one embodiment, the second determining unit is specifically configured to determine that the target mesh unit is located outside the fluid phase interface if all vertices in the target mesh unit are located outside the fluid phase interface; determine that the target mesh unit is located inside the fluid phase interface if all vertices in the target mesh unit are located inside the fluid phase interface; and determine that the target mesh unit intersects with the fluid phase interface if the target mesh unit includes vertices located outside the fluid phase interface and vertices located inside the fluid phase interface.
[0158] In one embodiment, the above-mentioned fluid volume ratio determination device further includes: a third determination module and a fourth determination module, wherein:
[0159] The third determining module is used to determine the fluid volume ratio in the target grid cell as a first value when the target grid cell is located outside the fluid phase interface.
[0160] The fourth determining module is used to determine the fluid volume ratio in the target grid cell as a second value when the target grid cell is located within the fluid phase interface.
[0161] Each module in the aforementioned fluid volume percentage determination device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0162] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0163] Determine the location information of the target mesh element in the mesh model; the mesh model includes multiple mesh elements;
[0164] Determine the positional relationship between the target grid cell and the fluid phase interface based on the location information;
[0165] When the target grid cell intersects with the fluid phase interface, the fluid volume ratio in the target grid cell is determined according to a preset fluid volume ratio strategy.
[0166] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0167] Multiple random points are generated based on a preset random point generation component, and the coordinate information of the multiple random points is determined based on a preset coordinate determination logic.
[0168] Based on the coordinate information of multiple random points and the preset mesh side relationship formula, it is determined whether the multiple random points are located within the target mesh cell; the mesh side relationship formula is determined based on the position information of multiple mesh cells in the mesh model.
[0169] Based on the coordinate information of multiple random points and the preset fluid phase interface relationship, determine whether the multiple random points are located within the fluid phase interface;
[0170] Determine a first number of random points located within the target grid cell, and a second number of random points located within the target grid cell and within the fluid phase interface;
[0171] The fluid volume percentage in the target grid cell is determined based on the first and second quantities.
[0172] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0173] The ratio of the second quantity to the first quantity is determined as the initial fluid volume percentage in the target grid cell;
[0174] Determine the initial fluid volume percentage, and determine the root mean square error value for the first and second quantities;
[0175] If the mean square error is less than the preset threshold, the initial fluid volume percentage is determined as the fluid volume percentage; if the mean square error is greater than or equal to the preset threshold, the process returns to the step of generating multiple random points according to the preset random point generation component.
[0176] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0177] Substitute the position information of each vertex in the target mesh cell into the preset relational formula corresponding to the fluid phase interface to determine the positional relationship between each vertex of the target mesh cell and the fluid phase interface;
[0178] The positional relationship between the target mesh element and the fluid phase interface is determined based on the positional relationship between each vertex in the target mesh element and the fluid phase interface.
[0179] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0180] If all vertices in the target mesh element are located outside the fluid phase interface, then the target mesh element is determined to be located outside the fluid phase interface.
[0181] If all vertices in the target mesh element are located within the fluid phase interface, then the target mesh element is determined to be located within the fluid phase interface.
[0182] If the target mesh element includes vertices located outside the fluid phase interface and vertices located inside the fluid phase interface, then the target mesh element is determined to intersect with the fluid phase interface.
[0183] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0184] If the target mesh element is located outside the fluid phase interface, then the fluid volume percentage in the target mesh element is determined to be the first value.
[0185] If the target grid cell is located within the fluid phase interface, then the fluid volume percentage in the target grid cell is determined to be the second value.
[0186] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0187] Determine the location information of the target mesh element in the mesh model; the mesh model includes multiple mesh elements;
[0188] Determine the positional relationship between the target grid cell and the fluid phase interface based on the location information;
[0189] When the target grid cell intersects with the fluid phase interface, the fluid volume ratio in the target grid cell is determined according to a preset fluid volume ratio strategy.
[0190] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0191] Multiple random points are generated based on a preset random point generation component, and the coordinate information of the multiple random points is determined based on a preset coordinate determination logic.
[0192] Based on the coordinate information of multiple random points and the preset mesh side relationship formula, it is determined whether the multiple random points are located within the target mesh cell; the mesh side relationship formula is determined based on the position information of multiple mesh cells in the mesh model.
[0193] Based on the coordinate information of multiple random points and the preset fluid phase interface relationship, determine whether the multiple random points are located within the fluid phase interface;
[0194] Determine a first number of random points located within the target grid cell, and a second number of random points located within the target grid cell and within the fluid phase interface;
[0195] The fluid volume percentage in the target grid cell is determined based on the first and second quantities.
[0196] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0197] The ratio of the second quantity to the first quantity is determined as the initial fluid volume percentage in the target grid cell;
[0198] Determine the initial fluid volume percentage, and determine the root mean square error value for the first and second quantities;
[0199] If the mean square error is less than the preset threshold, the initial fluid volume percentage is determined as the fluid volume percentage; if the mean square error is greater than or equal to the preset threshold, the process returns to the step of generating multiple random points according to the preset random point generation component.
[0200] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0201] Substitute the position information of each vertex in the target mesh cell into the preset relational formula corresponding to the fluid phase interface to determine the positional relationship between each vertex of the target mesh cell and the fluid phase interface;
[0202] The positional relationship between the target mesh element and the fluid phase interface is determined based on the positional relationship between each vertex in the target mesh element and the fluid phase interface.
[0203] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0204] If all vertices in the target mesh element are located outside the fluid phase interface, then the target mesh element is determined to be located outside the fluid phase interface.
[0205] If all vertices in the target mesh element are located within the fluid phase interface, then the target mesh element is determined to be located within the fluid phase interface.
[0206] If the target mesh element includes vertices located outside the fluid phase interface and vertices located inside the fluid phase interface, then the target mesh element is determined to intersect with the fluid phase interface.
[0207] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0208] If the target mesh element is located outside the fluid phase interface, then the fluid volume percentage in the target mesh element is determined to be the first value.
[0209] If the target grid cell is located within the fluid phase interface, then the fluid volume percentage in the target grid cell is determined to be the second value.
[0210] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0211] Determine the location information of the target mesh element in the mesh model; the mesh model includes multiple mesh elements;
[0212] Determine the positional relationship between the target grid cell and the fluid phase interface based on the location information;
[0213] When the target grid cell intersects with the fluid phase interface, the fluid volume ratio in the target grid cell is determined according to a preset fluid volume ratio strategy.
[0214] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0215] Multiple random points are generated based on a preset random point generation component, and the coordinate information of the multiple random points is determined based on a preset coordinate determination logic.
[0216] Based on the coordinate information of multiple random points and the preset mesh side relationship formula, it is determined whether the multiple random points are located within the target mesh cell; the mesh side relationship formula is determined based on the position information of multiple mesh cells in the mesh model.
[0217] Based on the coordinate information of multiple random points and the preset fluid phase interface relationship, determine whether the multiple random points are located within the fluid phase interface;
[0218] Determine a first number of random points located within the target grid cell, and a second number of random points located within the target grid cell and within the fluid phase interface;
[0219] The fluid volume percentage in the target grid cell is determined based on the first and second quantities.
[0220] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0221] The ratio of the second quantity to the first quantity is determined as the initial fluid volume percentage in the target grid cell;
[0222] Determine the initial fluid volume percentage, and determine the root mean square error value for the first and second quantities;
[0223] If the mean square error is less than the preset threshold, the initial fluid volume percentage is determined as the fluid volume percentage; if the mean square error is greater than or equal to the preset threshold, the process returns to the step of generating multiple random points according to the preset random point generation component.
[0224] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0225] Substitute the position information of each vertex in the target mesh cell into the preset relational formula corresponding to the fluid phase interface to determine the positional relationship between each vertex of the target mesh cell and the fluid phase interface;
[0226] The positional relationship between the target mesh element and the fluid phase interface is determined based on the positional relationship between each vertex in the target mesh element and the fluid phase interface.
[0227] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0228] If all vertices in the target mesh element are located outside the fluid phase interface, then the target mesh element is determined to be located outside the fluid phase interface.
[0229] If all vertices in the target mesh element are located within the fluid phase interface, then the target mesh element is determined to be located within the fluid phase interface.
[0230] If the target mesh element includes vertices located outside the fluid phase interface and vertices located inside the fluid phase interface, then the target mesh element is determined to intersect with the fluid phase interface.
[0231] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0232] If the target mesh element is located outside the fluid phase interface, then the fluid volume percentage in the target mesh element is determined to be the first value.
[0233] If the target grid cell is located within the fluid phase interface, then the fluid volume percentage in the target grid cell is determined to be the second value.
[0234] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this 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. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0235] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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.
[0236] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for determining the volume percentage of a fluid, characterized in that, The method includes: Determine the location information of the target mesh element in the mesh model; the mesh model includes multiple mesh elements; The positional relationship between the target mesh element and the fluid phase interface is determined based on the position information; When the positional relationship is such that the target mesh cell intersects with the fluid phase interface, multiple random points are generated according to a preset random point generation component, and the coordinate information of the multiple random points is determined according to a preset coordinate determination logic. Based on the coordinate information of the multiple random points and the preset mesh side relationship formula, it is determined whether the multiple random points are located within the target mesh cell; the mesh side relationship formula is determined based on the position information of multiple mesh cells in the mesh model; Based on the coordinate information of the multiple random points and the preset fluid phase interface relationship, determine whether the multiple random points are located within the fluid phase interface; Determine a first number of random points located within the target grid cell, and a second number of random points located within the target grid cell and within the fluid phase interface; The fluid volume percentage in the target grid cell is determined based on the first quantity and the second quantity.
2. The method according to claim 1, characterized in that, Determining the fluid volume percentage in the target grid cell based on the first quantity and the second quantity includes: The ratio of the second quantity to the first quantity is determined as the initial fluid volume percentage in the target grid cell; Determine the initial fluid volume percentage, the first quantity, and the second quantity, and then determine the mean square error value. If the mean square error is less than a preset threshold, the initial fluid volume percentage is determined as the fluid volume percentage; if the mean square error is greater than or equal to the preset threshold, the process returns to the step of generating multiple random points according to the preset random point generation component.
3. The method according to claim 1, characterized in that, The positional relationship includes the positional information of each vertex in the target mesh cell, and determining the positional relationship between the target mesh cell and the fluid phase interface based on the positional information includes: Substitute the position information of each vertex in the target mesh cell into the preset relational formula corresponding to the fluid phase interface to determine the positional relationship between each vertex of the target mesh cell and the fluid phase interface; The positional relationship between the target mesh cell and the fluid phase interface is determined based on the positional relationship between each vertex in the target mesh cell and the fluid phase interface.
4. The method according to claim 3, characterized in that, Determining the positional relationship between the target mesh cell and the fluid phase interface based on the positional relationship between each vertex in the target mesh cell and the fluid phase interface includes: If all vertices in the target mesh cell are located outside the fluid phase interface, then the target mesh cell is determined to be located outside the fluid phase interface. If all vertices in the target mesh cell are located within the fluid phase interface, then the target mesh cell is determined to be located within the fluid phase interface. If the target mesh cell includes vertices located outside the fluid phase interface and vertices located inside the fluid phase interface, then the target mesh cell is determined to intersect with the fluid phase interface.
5. The method according to any one of claims 1-4, characterized in that, The method further includes: If the positional relationship is such that the target grid cell is located outside the fluid phase interface, then the fluid volume ratio in the target grid cell is determined to be a first value; If the positional relationship is such that the target grid cell is located within the fluid phase interface, then the fluid volume percentage in the target grid cell is determined to be the second value.
6. The method according to claim 1, characterized in that, The relationship between the mesh sides is: in, It is a vector that starts from the center C of the grid cell and ends at the center point F of the side of the grid. It is a vector that starts from the center C of the grid cell and ends at the random point P; Let be the normal vector of the side surface of the mesh.
7. The method according to claim 3, characterized in that, The preset relationship corresponding to the fluid phase interface is: Where A, B, C, D, E, F, G, H, I, and J are constants, and x, y, and z are the coordinate information of the vertices.
8. The method according to claim 7, characterized in that, Substituting the positional information of each vertex in the target mesh cell into the preset relational formula corresponding to the fluid phase interface, the positional relationship between each vertex of the target mesh cell and the fluid phase interface is determined, including: The coordinate information of each vertex is input into the preset relation. If the vertex is located on the fluid phase interface, If the vertex is located within the fluid phase interface, If the vertex is located outside the fluid phase interface, .
9. A device for determining the volume ratio of a fluid, characterized in that, The device includes: The first determining module is used to determine the position information of the target mesh element in the mesh model; the mesh model includes multiple mesh elements; The second determining module is used to determine the positional relationship between the target grid cell and the fluid phase interface based on the position information; The third determining module is configured to: generate multiple random points according to a preset random point generation component when the positional relationship is such that the target grid cell intersects with the fluid phase interface; determine the coordinate information of the multiple random points according to a preset coordinate determination logic; determine whether the multiple random points are located within the target grid cell according to the coordinate information of the multiple random points and a preset grid side relationship formula; the grid side relationship formula is determined based on the positional information of multiple grid cells in the grid model; determine whether the multiple random points are located within the fluid phase interface according to the coordinate information of the multiple random points and the preset fluid phase interface relationship formula; determine a first number of random points located within the target grid cell and a second number of random points located within the target grid cell and within the fluid phase interface; and determine the fluid volume percentage in the target grid cell according to the first number and the second number.
Citation Information
Patent Citations
Three-phase fluid filling simulation method, electronic equipment and computer storage medium
CN118278305A
Method of Simulation of Moving Interfaces using Geometry-Aware Volume of Fluid Method
US20150242545A1