Method, electronic device, and storage medium for calculating fluid flow velocity in a fluid model
By setting polyhedrons or polygons in the fluid model, configuring the flow rate vector, and calculating the flow rate using the flow rate probe and Delaunay triangulation method, the problem of unrealistic water flow in the game is solved, realizing realistic water effect and low performance consumption.
Patent Information
- Application Number
- CN202210703762.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-21
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2042-06-21
AI Technical Summary
The water flow simulation effect in existing games is not realistic, and the existing technology consumes too much performance in electronic games and cannot be practical.
By setting polyhedral or polygon in the fluid model, configuring the flow velocity vector, using the flow velocity probe to construct the polyhedral or polygon, calculating the flow velocity vector at any point, using the Delaunay triangulation method to segment the fluid model, and calculating the flow velocity based on the center of gravity coordinate interpolation.
Realizes realistic water flow effects in video games, reducing computing complexity and hardware performance requirements.
Smart Images

Figure CN115099025B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of game development, and in particular, to a method for calculating fluid flow velocity in a fluid model, an electronic device, a storage medium, and a computer program product. Background Art
[0002] Since the development of electronic games to date, their production has become increasingly exquisite, and the realism of game graphics has become increasingly close to the actual situation, bringing a relatively good user experience to game users. Of course, there are also aspects that are regrettable. For example, in the 3D graphics of games, the simulation effect of water bodies is not yet satisfactory.
[0003] In existing game graphics, the dynamic images of water bodies generally do not well reflect the fluidity characteristics of water bodies. For example, on a relatively calm water surface, the fluctuations of the ripples are usually displayed rather stiffly, and the feeling is not very realistic; or, a leaf falling into the flowing water remains stationary on the water surface and does not flow with the water, which seems to violate common sense.
[0004] Although there are some technologies outside the game field that can finely simulate the appearance of liquid flow, these technologies require a relatively large amount of software and hardware performance. For electronic games, especially large-scale games with multiple players online at the same time, the above technologies are not practical and cannot be applied.
[0005] Therefore, there is an urgent need to propose a water body simulation method that can simulate the water body effect and at the same time adapt to the particularity of the electronic game industry. Summary of the Invention
[0006] In order to solve the above defects and design a simple and effective flow velocity calculation method suitable for the game environment, the present invention proposes a method for calculating fluid flow velocity in a fluid model, the method comprising:
[0007] A preprocessing step of selecting at least a part of the fluid model and setting it as a fluid model to be processed, setting at least one polyhedron or polygon, a set of the at least one polyhedron or polygon enclosing the fluid model to be processed within the set of the at least one polyhedron or polygon, and configuring a flow velocity vector V0 for each vertex of each polyhedron or polygon in the set of the at least one polyhedron or polygon;
[0008] A calculation step of calculating a flow velocity vector Vp of an arbitrary point P within the fluid model to be processed, comprising:
[0009] Determining a first polyhedron or polygon where the arbitrary point P is located according to the coordinate data of the arbitrary point P, and obtaining the coordinate data of each vertex Zi of the first polyhedron or the first polygon, where i is a positive integer for indicating different vertices;
[0010] Obtain the flow velocity vector V0i of each vertex Zi of the first polyhedron or polygon.
[0011] Calculate the centroid coordinate M of the arbitrary point P in the first polyhedron or polygon according to the coordinate data of the arbitrary point P.
[0012] Calculate the flow velocity vector Vp of the arbitrary point P according to the flow velocity vector V0i of each vertex Zi of the first polyhedron or the first polygon and the centroid coordinate M.
[0013] In the above calculation method, the preprocessing step includes:
[0014] Obtain the coordinate data of the fluid model to be processed in the world coordinate system.
[0015] Set a plurality of flow velocity probes, and the probe space surrounded by the flow velocity probes includes the fluid model to be processed.
[0016] Construct at least one polyhedron or polygon with the flow velocity probes as vertices, so that the fluid model to be processed is located inside the at least one polyhedron or polygon.
[0017] Configure the flow velocity vector V0 of the flow velocity probe, and the flow velocity vector V0 indicates the flow velocity and direction of the fluid at the flow velocity probe.
[0018] In the above calculation method, the preprocessing step can be executed multiple times according to requirements, including adjusting the number and position of the flow velocity probes.
[0019] In the above calculation method, in the preprocessing step, the probe space is the smallest convex hull surrounded by a plurality of the flow velocity probes.
[0020] In the above calculation method, if the probe space cannot completely contain the fluid model to be processed, increase the number of the flow velocity probes until the probe space can completely contain the fluid model to be processed. [[ID=z4]]
[0021] In the above calculation method, taking four of the flow velocity probes as a group, divide the probe space into a plurality of tetrahedrons.
[0022] In the above calculation method, use the Delaunay triangulation method to divide the probe space into a plurality of tetrahedrons.
[0023] In the above calculation method, the flow velocity vector V0 is a constant or the flow velocity vector V0 is a variable that changes with time.
[0024] Based on the same inventive concept, the present invention also provides an electronic device, including:
[0025] At least one memory for storing computer instructions;
[0026] At least one processor, which, when executing the computer instructions, implements the method for calculating fluid flow velocity in the fluid model as described above.
[0027] Based on the same inventive concept, the present invention also provides a computer-readable storage medium, in which at least one computer instruction is stored, and the at least one instruction is loaded and executed by a processor to implement the method for calculating fluid flow velocity in the fluid model as described above.
[0028] Based on the same inventive concept, the present invention also provides a computer program product, which includes a computer program / instructions, and when the computer program / instructions are executed by a processor, the method for calculating fluid flow velocity in the fluid model as described above is implemented.
[0029] The present application proposes the present technical solution based on the characteristic that the flow velocity of each point in a steadily flowing fluid does not change with time. Compared with the prior art, the technical solution proposed by the present application uses at least one polyhedron to wrap the fluid model within a selected finite range (for example, the range displayed on the user terminal screen), completely encloses the fluid model inside the at least one polyhedron, sets a flow velocity vector for the vertices of the at least one polyhedron, and then uses the centroid coordinates of the polyhedron as weights and the flow velocity vectors of the vertices of the polyhedron as the reference flow velocities to calculate the flow velocity vector of any point P inside the polyhedron. Thus, the flow velocity of any point can be obtained with only a small amount of calculation, which is more suitable for the application environment of games. On the one hand, if the flow velocities at many locations in the fluid are required (not all points need to be calculated), the above calculation process can be repeatedly executed to obtain the flow velocity vectors of multiple arbitrary points P; on the other hand, if more accurate flow velocity vector data of an arbitrary point P is required, more detailed reference flow velocities can be set by setting more polyhedrons used to wrap the fluid model, so that the flow velocity vector of the arbitrary point P can better reflect the flow details of the fluid.
[0030] In addition, according to the technical solution proposed by the present application, for a fluid that is not in a steady flow state, only the flow velocity vector V0i configured for each vertex Zi needs to be changed. For example, the flow velocity vector V0i can be set as a function that changes with time, and then the flow velocity vector Vp of the same point P calculated at different times is also different. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 Shows a schematic diagram of the basic hardware structure of an electronic device according to some embodiments of the present application;
[0032] Figure 2 FIG. shows a schematic diagram of enclosing a selected section of a fluid model by using multiple triangles in a two-dimensional space according to some embodiments of the present application;
[0033] Figure 3 FIG. shows a schematic diagram of a tetrahedron for enclosing a fluid model in a three-dimensional space according to some embodiments of the present application;
[0034] Figure 4 FIG. shows a flowchart of a method for calculating fluid flow velocity according to some embodiments of the present application. DETAILED DESCRIPTION
[0035] The following specific embodiments illustrate the embodiments of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. Although the description of the present invention will be introduced in conjunction with preferred embodiments, this does not mean that the features of this invention are limited to this embodiment. On the contrary, the purpose of introducing the invention in conjunction with the embodiment is to cover other alternatives or modifications that may be extended based on the claims of the present invention. In order to provide a deep understanding of the present invention, many specific details will be included in the following description. The present invention can also be implemented without these details. In addition, in order to avoid confusing or obscuring the focus of the present invention, some specific details will be omitted in the description. It should be noted that, without conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0036] It should be noted that in this specification, similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings and is defaulted to the same definition.
[0037] As known from the description of the background art, in the dynamic images of games, the display of the dynamic effects of water bodies such as river water and lake water is relatively rigid, and the visual experience of users is not good. Even worse, the objects falling into the water form a "wonder" of staying still in the flowing water because they cannot accurately obtain the water flow velocity. The purpose of the present invention is to improve the mimetic effect of water bodies in dynamic images with high efficiency and low cost.
[0038] The inventive concept of the present invention lies in reasonably dividing the fluid model, setting coordinates and velocity vectors for the vertices of each small piece of space divided. Then, a calculation model is designed based on the set coordinates and velocity vectors to calculate the velocity vector of any point inside this small piece of space. Thus, the flow velocity of any point in the fluid model can be calculated. Since the velocity vector of any point can be calculated, the module for implementing dynamic image processing (generation) can simulate the dynamics of the water flow and the changes of objects in the water affected by the water flow based on this flow velocity vector. Thus, a more realistic effect can be achieved in the display of the dynamic image.
[0039] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0040] The embodiments of the method for calculating the fluid flow velocity in the fluid model provided by the present invention can run on various terminals. For example, the terminal can be an electronic device such as a mobile phone, a computer, a PAD, a server, etc. Figure 1 The basic hardware structure schematic diagram of an electronic device 100 according to some embodiments of the present application is given.
[0041] As Figure 1 shown, the electronic device 100 at least includes a main processor 101 and a storage medium 103. According to different actual usage requirements, the electronic device 100 may further include a coprocessor 102, an I / O unit 104, a network communication unit 105, and some other expansion units 106. The optional nature of the coprocessor 102, the I / O unit 104, the network communication unit 105, and the other expansion units 106 is shown by dotted lines in the figure.
[0042] The main processor 101 and / or the coprocessor 102 are used to execute the computer instructions stored in the storage medium 103 to implement the method proposed by the present invention. The main processor 101 is the control center of the electronic device 100 and is usually a general-purpose processor (for example, CPUs of various Intel series), which can relatively evenly implement logical processing and arithmetic calculations. The main processor 101 connects various parts of the entire electronic device 100 through various interfaces, and realizes various functions of the electronic device 100 by running or executing the software programs stored in the storage medium 103 and calling the data stored in the storage medium 103.
[0043] The coprocessor 102 is usually a dedicated processor (e.g., a user-programmable embedded microprocessor) for implementing a single function. For example, the coprocessor 102 can be a graphics processing unit (GPU), which is dedicated to processing graphics and images. At this time, the main processor 101 does not directly process information related to graphics and images, but provides data from other units to the coprocessor 102 or sends management instructions to the coprocessor 102 to instruct the coprocessor 102 to obtain data from other units. And after the coprocessor 102 finishes processing the data, the main processor 101 receives the processing result from the coprocessor 102 for subsequent other decisions based on the processing result. For different professional fields, the coprocessor 102 can also be a signal processor, a network communication processor, a complex computing processor, etc. Generally, the hardware implementation basis of the coprocessor 102 is a digital signal processing (DSP) chip, or an application specific integrated circuit (ASIC) such as a complex programmable logic device (CPLD) or a field-programmable gate array (FPGA).
[0044] The storage medium 103 can include internal memory and external memory, or can also include volatile memory and non-volatile memory, or can also include magnetic storage devices, solid-state memories, flash memories, floppy disks, hard disks, etc. The storage medium 103 can be used to store an operating system (e.g., which can be executed by the main processor 101) and the data generated during the operation of the operating system, the software program of an application software and the data generated during the operation of the application software, the software program of a dedicated module (e.g., which can be executed by a certain coprocessor 102) and the data generated during the operation of the program. For example, in an embodiment of the present invention, the main processor 101 executes various functional applications and data processing by running a monitoring program stored in the storage medium 103. In some embodiments, the storage medium 103 can also be a remote memory (relative to the general sense of memory) remotely set with respect to the main processor 101, and these remote memories can be connected to the main processor 101 or a certain coprocessor 102 in a network connection manner (e.g., through the network communication device 105). Examples of the above networks include but are not limited to the Internet, enterprise intranets, local area networks, mobile communication networks, and combinations thereof.
[0045] The I / O (Input / Output) unit 104 includes an input device for information and an output device for information, enabling a user to interact with the electronic device 100. The input device can be used to receive input digital or character information, and specifically can include: a keyboard, a mouse, a joystick, a touch input device, or a trackball, etc. The output device can be used to output / display the processing result processed by the electronic device 100, and this processing result can be made based on the information input by the input device. Specifically, the output device can include: a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.
[0046] The network communication unit 105 realizes the communication between the electronic device 100 and various remote devices through a wired / wireless network connection, so that the electronic device 100 can also exchange data with remote devices (for example, the remote memory mentioned above). Alternatively, the electronic device 100 can also realize the connection with the server through the network communication unit 105, so that the electronic device 100 can be used as a part of a large system and interact with the server.
[0047] The other expansion unit 106 includes various peripheral components and their interfaces, enabling the electronic device 100 to interact with various devices. For example, through a Bluetooth interface, it can be connected to a Bluetooth headset, so that the audio played by the electronic device 100 can be received by the Bluetooth headset. Another example is that through a bus interface (such as an RS-485 bus), the electronic device 100 can be connected to some sensors to obtain some monitoring data to assist the electronic device 100 in realizing specific functions. In various embodiments, the other expansion interface 106 can exist alone or be integrated with other components of the electronic device 100. At the same time, the other expansion interface 106 is optional, and its optional nature is indicated by a dashed line in the figure.
[0048] Figure 2 A schematic diagram showing a section of a fluid model surrounded by multiple triangles in a two-dimensional space according to some embodiments of the present application (which can also be understood as how to use multiple triangles to divide the selected fluid model). As mentioned above, the present application intends to obtain a calculation model of the flow velocity at any point in the fluid model by enclosing the fluid model with a set of multiple small spaces. Figure 2It shows a schematic diagram of dividing a selected section of fluid model 1 in a two-dimensional space. In this schematic diagram, flow velocity probes Z1 to Z8 are set, and with the flow velocity probes Z1 to Z8 as the vertices of a triangle, the fluid model 1 is divided into 7 triangular spaces. According to the definition of convex hull in computational geometry (graphics), the convex polygon Z1Z2Z3Z4Z5 encloses every point in the fluid model 1. In the coordinate system and flow velocity vector where the flow velocity probes Z1 to Z8 are set, the flow velocity vector at any point (i.e., the specified coordinate position) inside the convex hull can be calculated through a certain mathematical model.
[0049] By increasing or decreasing the number of flow velocity probes, for example, canceling the Figure 2 flow velocity probe Z8 among them, then the flow velocity probes Z3 and Z7 are directly connected. Then the calculation results of any point P (i.e., the calculation results of the flow velocity vectors of the same arbitrary point P obtained in different convex hulls) will be different, but this does not affect the module for processing the image effect to use the flow velocity vectors of different arbitrary points P to simulate the dynamic effect of the fluid. The difference is only that the dynamic effects are not exactly the same. According to the above description, in a two-dimensional space, at least 3 flow velocity probes can be set to form a triangle, and this triangle encloses a selected section of the flow rate model inside the triangle. According to the coordinates and flow velocity vectors of the above 3 flow velocity probes, the flow velocity vector of any point (with known coordinates) in the selected section of the flow rate model can be calculated. For subsequent situations where the dynamic effect of the fluid needs to be simulated based on this flow velocity vector, setting more flow velocity probes can obtain a more detailed dynamic effect.
[0050] Similarly, in a three-dimensional space, a convex hull can be formed by a set of multiple tetrahedrons, and this convex hull encloses a selected section of the three-dimensional fluid model. In other words, it can also be understood as dividing the three-dimensional fluid model into multiple tetrahedron spaces using multiple tetrahedrons. The number of tetrahedrons set is at least one, and it can also be set to multiple. The more tetrahedrons are set, the more detailed the subsequent fluid dynamic effect can be. However, for an arbitrary point P, only the data of the four vertices (i.e., the flow rate probes) of the tetrahedron are required for its calculation. Therefore, the software and hardware overhead required for the calculation is very small. In practice, usually only calculating a dozen to dozens of arbitrary points can meet the requirements of dynamic display. Therefore, the software and hardware overhead required for adopting the method of dividing the fluid model proposed by the present invention is very small.
[0051] Figure 3One of the tetrahedral spaces Z1Z2Z3Z4 is shown. For an arbitrary point P located inside the tetrahedron Z1Z2Z3Z4, based on the flow velocity vectors of the flow velocity probes at the four vertices of the tetrahedron Z1Z2Z3Z4 being set as V01, V02, V03, and V04 respectively, the flow velocity vector at the arbitrary point P can be calculated by the method of interpolation. For example, according to the positional relationship between the arbitrary point P and the four flow velocity probes, the barycentric coordinates (Barycentric Coordinates) M (M=(m1, m2, m3, m4)) of the arbitrary point P in the tetrahedron Z1Z2Z3Z4 can be calculated, and then the flow velocity vector at the arbitrary point P can be denoted as: Vp = m1×V01 + m2×V02 + m3×V03 + m4×V04.
[0052] The above method of using barycentric coordinates as weights to interpolate and calculate the flow velocity vector of an arbitrary point P is simple and easy to implement. Moreover, for a fluid, the flow velocity (including speed and direction) of an arbitrary point P is affected by other surrounding points (i.e., is associated with other surrounding points), and the closer other points are to the arbitrary point P, the greater the influence on the arbitrary point P. And the barycentric coordinates reflect the weights in terms of distance relationships. Therefore, using barycentric coordinates as the weights for calculating the flow velocity vector conforms to the characteristics of the fluid.
[0053] Next, in combination with Figure 4 the flowchart of the method for calculating the fluid flow velocity proposed according to some embodiments of the present application as shown to fully illustrate the method for calculating the fluid flow velocity.
[0054] Generally speaking, this calculation method includes two steps, namely a preprocessing step S1 and a calculation step S2. The preprocessing step S1 is used to reasonably divide the fluid model. For example, the Delaunay triangulation method is adopted, and a flow velocity vector is set for each vertex after division. The calculation step S2 is used to determine the tetrahedron where the arbitrary point P is located, obtain the corresponding coordinates, and then interpolate and calculate the flow velocity vector of the arbitrary point P according to the positional relationship between the arbitrary point P and the four vertices of the tetrahedron.
[0055] Specifically, in step S11, first, a section of the fluid model is selected. For example, a section of the river currently displayed on the display screen is used as the fluid model to be processed. This part of the fluid model may be a part of the fluid model of the entire river. When the subsequent processing is for dynamically displaying the situation of this section of the river on the display, there is no need to pay attention to the fluid model of the entire river, and only the currently displayed section needs to be processed. In this way, it can also save the time, speed, and storage space occupied by processing data. After selecting the fluid model, the coordinate system in which the model is located can be determined, that is, the coordinates of each point in the model can be determined. For example, in game software, the world coordinate system is usually used to determine the positions of various objects.
[0056] In step S12, multiple flow probes can be set for a selected section of the fluid model, and the flow probes are used to assign a value to the flow vector. When the value assigned to the flow probe is a constant, the value of any point P calculated based on the present invention is also a constant, that is, the dynamics of the river water displayed on the screen is reflected to the user in a stable flow state (calm river water). When the value assigned to the flow probe is a variable (function) that changes with time, the value of any point P calculated based on the present invention is also a variable that changes with time, that is, the dynamics of the river water displayed on the screen is reflected to the user in a constantly changing flow state (turbulent water). Alternatively, when an object falls into the water or a ship travels in the water in the image displayed on the screen, the flow probe associated with the object or ship can temporarily change the flow vector, and the flow vector of any point P associated with the flow probe will also change. Then, the river water displayed on the screen will change due to the influence of the object or ship.
[0057] Step S13, using the multiple velocity probes set in step S12 as vertices, construct at least one polyhedron, so that the fluid model selected in step S11 is located inside a polyhedron, or a set of two or more polyhedrons. For example, at least one polyhedron can be used. Figure 3 The fluid model is surrounded by the tetrahedron shown in FIG. 1 , so that the fluid model is located inside a tetrahedron or a set of two or more tetrahedrons. Preferably, no point is outside the set of tetrahedrons. For example, when using a Figure 3 When the tetrahedron Z1Z2Z3Z4 shown is used to surround the fluid model, the four vertices of the tetrahedron Z1Z2Z3Z4 must be located outside the fluid model (in line with the definition of the convex hull). Since only four flow probes are provided, in this case, the details of the dynamic river water simulated based on the data are relatively rough. When a set of multiple tetrahedrons is used to surround the fluid model, the set of tetrahedrons forms a convex hull that surrounds the fluid model. In other words, the fluid model is divided into multiple tetrahedron spaces by multiple tetrahedrons, and each vertex of each tetrahedron is the flow probe set previously, which means that the coordinates of each of the above vertices can be determined.
[0058] Step S14: configuring the velocity vector V0 of the velocity probe, wherein the velocity vector V0 indicates the velocity of the fluid at the velocity probe. That is, the coordinates and velocity vectors at each vertex of each tetrahedron are known values.
[0059] Step S21, based on the coordinate data of the arbitrary point P, determines the first polyhedron in which the arbitrary point P is located, and obtains the coordinate data of each vertex Zi of the first polyhedron, where i is a positive integer used to indicate different vertices. For example, when the first polyhedron is a tetrahedron, the vertices include Z1, Z2, Z3, and Z4. Since the arbitrary point P is a point in the fluid model, that is, the arbitrary point P must be located in the convex hull formed by the set of multiple (or one) tetrahedrons, it is possible to uniquely determine a tetrahedron (i.e., the first polyhedron).
[0060] In step S22, based on the first polyhedron determined in step S21, the flow vectors V01, V02, V03 and V04 at each vertex Z1, Z2, Z3 and Z4 of the first polyhedron can be obtained, which are determined in step S14.
[0061] Step S23: Calculate the centroid coordinates M (m1, m2, m3, m4) of the arbitrary point P in the first polyhedron.
[0062] Step S24, calculating the velocity vector Vp of the arbitrary point P according to the velocity vectors V01, V02, V03 and V04 of each of the vertices Z1, Z2, Z3 and Z4 of the first polyhedron and the barycentric coordinates M (m1, m2, m3, m4). Figure 3 Description.
[0063] The above-mentioned embodiment utilizes tetrahedral meshes to segment the fluid model. The velocity vector of each point in the fluid model can be obtained by interpolating the velocity vectors of each vertex of a corresponding tetrahedron. The amount of data required for this calculation method is very small. For the selected fluid model, only a few dozen points need to be selected to meet the conventional use requirements (i.e., the velocity field at various locations in the fluid model can be described). Therefore, the overall amount of calculation is still very small, and the requirements for CPU processing power are not high, meeting the requirements of the application scenarios of electronic games. In addition, according to the different requirements for the dynamic effects of the fluid, different numbers of velocity probes (vertices) can be set to meet the requirements. That is, if the requirements for dynamic effects are not high, fewer velocity probes can be set, and if the requirements for dynamic effects are high, more velocity probes can be set. Regardless of the number of velocity probes set, the system overhead is the same for calculating the velocity vector of a point.
[0064] above Figures 2 to 4 The method of setting a collection of polygons or polyhedrons to enclose a fluid model is illustrated using triangles and tetrahedrons as examples. In fact, a collection of other polyhedrons, such as quadrilaterals and pentahedrons, can also be used to enclose the fluid model, and the above method can be used to calculate the flow velocity vector at any point P.
[0065] In addition, it is also worth mentioning that although this embodiment illustrates the method for calculating the flow velocity of each point in the water body by taking river water as an example, it is easy to think that the method for calculating the fluid flow velocity in the fluid model proposed by the present invention can be applied to other object models with fluidity to calculate the flow velocity vector of any point in the model.
[0066] In summary, the present invention simplifies the method for calculating the flow velocity vector of any point in the fluid model by reasonably dividing the fluid model. The software and hardware overhead required by this method is very small and it is very suitable for application in the user terminal of the game.
[0067] In the specification provided herein, a large number of specific details are described. However, it can be understood that the embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures, and technologies are not shown in detail so as not to obscure the understanding of this specification.
[0068] It should be noted that the above sequence of the embodiments of the present invention is only for description and does not represent the superiority or inferiority of the embodiments. And the above specific embodiments of this specification are described. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0069] It should be understood that, in order to streamline the present invention and assist in understanding one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be construed as reflecting the intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected by the claims, the inventive aspects lie in less than all the features of the preceding disclosed single embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into the detailed description, where each claim stands on its own as a separate embodiment of the present invention.
[0070] Those skilled in the art can understand that the modules in the devices in the embodiments can be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and in addition, they can be divided into multiple sub-modules or sub-units or sub-components. Except that at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all the features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all the processes or units of any method or device so disclosed. Unless otherwise explicitly stated, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) can be replaced by an alternative feature that provides the same, equivalent, or similar purpose.
[0071] In addition, those skilled in the art can understand that although some of the embodiments described herein include certain features included in other embodiments rather than other features, the combination of features of different embodiments means that it is within the scope of the present invention and forms different embodiments. For example, in the claims, any one of the claimed embodiments can be used in any combination.
Claims
1. A method for calculating fluid flow velocity in a fluid model, which is used for an electronic device, characterized in that, Including: A preprocessing step, selecting at least a part of the fluid model and setting it as the fluid model to be processed, setting at least one polyhedron or polygon, the set of the at least one polyhedron or polygon enclosing the fluid model to be processed within the set of the at least one polyhedron or polygon, and configuring a flow velocity vector V0 for each vertex of each polyhedron or polygon in the set of the at least one polyhedron or polygon, where the flow velocity vector V0 is a constant or the flow velocity vector V0 is a variable that changes with time; A calculation step, calculating the flow velocity vector Vp of any point P within the fluid model to be processed, including: Determining the first polyhedron or polygon where the any point P is located according to the coordinate data of the any point P, and obtaining the coordinate data of each vertex Zi of the first polyhedron or the first polygon, where i is a positive integer for indicating different vertices; Obtaining the flow velocity vector V0i of each vertex Zi of the first polyhedron or polygon; Calculating the centroid coordinate M of the any point P within the first polyhedron or polygon according to the coordinate data of the any point P; Calculating the flow velocity vector Vp of the any point P according to the flow velocity vector V0i of each vertex Zi of the first polyhedron or the first polygon and the centroid coordinate M.
2. The method according to claim 1, wherein The preprocessing step includes: Obtaining the coordinate data of the fluid model to be processed in the world coordinate system; Setting a plurality of flow velocity probes, where the probe space enclosed by the flow velocity probes includes the fluid model to be processed; Constructing at least one polyhedron or polygon with the flow velocity probes as vertices, such that the fluid model to be processed is located inside the at least one polyhedron or polygon; Configuring the flow velocity vector V0 of the flow velocity probes, where the flow velocity vector V0 indicates the flow velocity and direction of the fluid at the flow velocity probes.
3. The method according to claim 2, wherein The preprocessing step can be executed multiple times according to requirements, including adjusting the number and position of the flow velocity probes.
4. The method according to claim 2 or 3, characterized in that, In the preprocessing step, the probe space is the smallest convex hull enclosed by the plurality of flow velocity probes.
5. The method according to claim 2 or 3, characterized in that If the probe space cannot completely contain the fluid model to be processed, then increase the number of the flow velocity probes until the probe space can completely contain the fluid model to be processed.
6. The method according to claim 2 or 3, characterized in that, Dividing the probe space into a plurality of tetrahedrons with four of the flow velocity probes as a group.
7. The method according to claim 6, characterized in that, Dividing the probe space into a plurality of tetrahedrons by using the Delaunay triangulation method.
8. An electronic device, characterized in that, Including: At least one memory for storing computer instructions; At least one processor, when the at least one processor executes the computer instructions, implementing the method according to any one of claims 1-7.
9. A computer-readable storage medium, characterized in that, At least one computer instruction is stored in the computer-readable storage medium, and the at least one instruction is loaded and executed by a processor to implement the method according to any one of claims 1-7.
10. A computer program product, characterized in that, The computer program product includes a computer program / instructions, and when the computer program / instructions are executed by a processor, implementing the method according to any one of claims 1-7.
Citation Information
Patent Citations
Subsurface flow simulating and predictive analysis method
CN102156779A