Fluid mechanics solution method and system based on visual priors and physical constraints
By combining visual priors and physical constraints in computer graphics, the limitations of complex fluid shape reconstruction problems are solved, and high-quality three-dimensional fluid flow effect reconstruction and accurate simulation of fluid physical behavior are achieved.
Patent Information
- Application Number
- CN202410923284.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-07-10
AI Technical Summary
Existing visual prior models and pure physical constraint methods have limitations in dealing with complex fluid shape reconstruction problems, such as inaccurate reconstruction results, high computational resource requirements, long time-consuming and difficult to accurately reflect the physical behavior of the actual fluid.
The fluid mechanics solution method based on visual priors and physical constraints is adopted to reconstruct the monocular fluid picture through the graph attention network model. Combined with point cloud processing and dynamic solver, the position and velocity field information of the fluid point cloud particles are calculated, and physical constraints such as incompressible constraints are introduced to optimize the prediction results of the fluid motion trajectory.
High-quality three-dimensional fluid flow effect reconstruction in complex boundary scenarios is achieved, and the process is stable, the visual effect is close to or even beyond the simulation effect, simplifying the fluid shape reconstruction process, and improving physical authenticity and computing efficiency.
Smart Images

Figure CN118607414B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer graphics fluid simulation, and in particular to a fluid mechanics solution method and system based on visual priors and physical constraints. Background Art
[0002] In the field of computer graphics and visual computing, especially in application scenarios such as film and television special effects, virtual reality, and engineering simulation, accurately reconstructing the three-dimensional fluid flow effect of complex fluid shapes on arbitrary solid boundaries is crucial to achieving high-quality visual effects and accurate physical simulation. Traditionally, such problems are mainly solved by visual prior models, which usually reconstruct three-dimensional fluid particles through two-dimensional image information captured by a monocular camera combined with image processing technology.
[0003] The workflow of the visual prior model usually covers the following key steps: first, a two-dimensional image of the fluid is captured using a monocular camera; second, the edge and shape features of the fluid are extracted through an image processing algorithm; finally, based on these two-dimensional features, they are converted into the distribution of three-dimensional fluid particles through a specific algorithm. However, this approach has significant technical challenges and limitations. On the one hand, due to the limitation of two-dimensional image information, the lack of depth information may lead to inaccurate reconstruction results; on the other hand, complex image processing and optimization algorithms have high requirements for computing resources and are time-consuming. In addition, due to the lack of in-depth consideration of physical laws, the three-dimensional fluid model reconstructed by this method is often difficult to accurately reflect the physical behavior of the actual fluid.
[0004] To overcome the above shortcomings, researchers have proposed a hybrid model that combines physical constraints. As an important means of expression in computer graphics, physical constraints ensure that the fluid flow process conforms to specific physical laws by introducing physical constraint equations. For example, by applying incompressible constraints, the physical phenomenon of constant density of fluid in a specific volume can be simulated, thereby improving the physical reality of the simulation process. However, methods that rely solely on physical constraints still face the challenge of low accuracy in predicting fluid behavior under complex boundary conditions.
[0005] In summary, existing visual prior models and purely physical constraint methods have limitations when dealing with complex fluid shape reconstruction problems. Summary of the invention
[0006] In order to solve the above technical problems existing in the prior art, the embodiment of the present invention provides a fluid mechanics solution method and system based on visual priors and physical constraints. The technical solution is as follows:
[0007] On the one hand, a fluid mechanics solution method based on visual priors and physical constraints is provided, the method comprising: reconstructing a monocular fluid image based on a graph attention network model to obtain three-dimensional fluid point cloud particles; filtering and surface smoothing the three-dimensional fluid point cloud particles based on a point cloud processing method to obtain processed fluid point cloud particles; calculating the position information of each particle in the fluid point cloud particles, and reconstructing the velocity field information of the processed fluid point cloud particles based on the position information; taking the position information, the velocity field information and the preset viscosity information as input, and inputting them into a dynamics solver with physical constraints to obtain the fluid motion trajectory prediction result of the processed fluid point cloud particles; the preset viscosity information is the viscosity information of the processed fluid point cloud particles.
[0008] Furthermore, the graph attention network model includes an attribute extraction module and a deformation module; based on the graph attention network model, the monocular fluid image is reconstructed to obtain three-dimensional fluid point cloud particles, including: extracting shape information and global semantic information in the monocular fluid image based on the attribute extraction module; based on the deformation module, embedding the shape information and the global semantic information into the initial sparse point cloud sphere to reconstruct the three-dimensional fluid point cloud particles.
[0009] Furthermore, the three-dimensional fluid point cloud particles are filtered and surface smoothed based on a point cloud processing method, including: filtering and surface smoothing the three-dimensional fluid point cloud particles based on least squares fitting in a local area around the three-dimensional fluid point cloud particles.
[0010] Furthermore, the method also includes: building a multi-layer prediction model based on a continuous convolution operator; iteratively optimizing the multi-layer prediction model based on an energy model, and introducing an incompressible constraint in position-based fluid mechanics to replace the update step size during the iterative optimization process to obtain the dynamic solver with physical constraints.
[0011] Furthermore, the multi-layer prediction model includes a fluid-solid feature extraction network and a feature propagation network; wherein the fluid-solid feature extraction network is used to extract fluid-solid features; the fluid-solid features include interactions between fluid particles and interactions between fluid particles and solid particles; the feature propagation network is used to perform multi-level feature learning based on the fluid-solid features, aggregate global particle information, and output position updates.
[0012] On the other hand, a fluid mechanics solution system based on visual priors and physical constraints is also provided, the system comprising: a reconstruction module, a preprocessing module, a calculation module and a prediction module; wherein the reconstruction module is used to reconstruct a monocular fluid image based on a graph attention network model to obtain three-dimensional fluid point cloud particles; the preprocessing module is used to filter and smooth the surface of the three-dimensional fluid point cloud particles based on a point cloud processing method to obtain processed fluid point cloud particles; the calculation module is used to calculate the position information of each particle in the fluid point cloud particles, and reconstruct the velocity field information of the processed fluid point cloud particles based on the position information; the prediction module is used to take the position information, the velocity field information and the preset viscosity information as input, and input them into a dynamic solver with physical constraints to obtain the fluid motion trajectory prediction result of the processed fluid point cloud particles; the preset viscosity information is the viscosity information of the processed fluid point cloud particles.
[0013] Furthermore, the graph attention network model includes an attribute extraction module and a deformation module; the reconstruction module is also used to: extract shape information and global semantic information in the monocular fluid image based on the attribute extraction module; embed the shape information and the global semantic information into the initial sparse point cloud sphere based on the deformation module, and reconstruct the three-dimensional fluid point cloud particles.
[0014] Furthermore, the system also includes: an optimization module, which is used to: build a multi-layer prediction model based on a continuous convolution operator; iteratively optimize the multi-layer prediction model based on an energy model, and introduce an incompressible constraint in position-based fluid mechanics to replace the update step size during the iterative optimization process to obtain the dynamic solver with physical constraints.
[0015] On the other hand, an electronic device is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method provided in the embodiment of the present invention when executing the computer program.
[0016] On the other hand, a computer-readable storage medium is provided, in which a program code is stored. The program code can be called by a processor to execute the method provided in the embodiment of the present invention.
[0017] The embodiment of the present invention provides a fluid mechanics solution method and system based on visual priors and physical constraints. By training the model on the data obtained by simulation, it can then use multiple frames of monocular fluid flow images as input to reconstruct the fluid flow effect, and can be used in different complex boundary scenes. This method has the advantages of stable process and visualization effect close to or even exceeding the simulation effect, which can help realize the three-dimensional fluid flow effect of complex fluid shapes on any solid boundary. The process is simple and rapid, and has great artistic and application value. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 is a flow chart of a fluid mechanics solution method based on visual priors and physical constraints provided by an embodiment of the present invention;
[0020] Figure 2 It is a schematic diagram of the overall structure of a multi-layer prediction model based on a continuous convolution operator provided by an embodiment of the present invention;
[0021] Figure 3 is a schematic diagram of the structure of a dynamics solver with physical constraints provided by an embodiment of the present invention;
[0022] Figure 4 is a schematic diagram of a reconstruction result of a square fluid water block provided by an embodiment of the present invention;
[0023] Figure 5 This is a schematic diagram of a complex boundary cube fluid flow effect simulation provided by an embodiment of the present invention;
[0024] Figure 6 It is a schematic diagram of a fluid mechanics solution system based on visual priors and physical constraints provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0025] The technical solution of the present invention is described below in conjunction with the accompanying drawings.
[0026] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present the concept in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.
[0027] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0028] Embodiment 1
[0029] Figure 1 FIG. 1 is a flow chart of a fluid mechanics solution method based on visual priors and physical constraints according to an embodiment of the present invention. Figure 1 As shown, the method specifically comprises the following steps:
[0030] Step S102, reconstructing the monocular fluid image based on the graph attention network model to obtain three-dimensional fluid point cloud particles.
[0031] Step S104 , filtering and surface smoothing are performed on the three-dimensional fluid point cloud particles based on a point cloud processing method to obtain processed fluid point cloud particles.
[0032] Step S106, calculating the position information of each particle in the fluid point cloud particles, and reconstructing the velocity field information of the fluid point cloud particles after processing based on the position information.
[0033] Step S108, taking the position information, velocity field information and preset viscosity information as input, inputting them into a dynamics solver with physical constraints, and obtaining the fluid motion trajectory prediction result of the processed fluid point cloud particles; the preset viscosity information is the viscosity information of the processed fluid point cloud particles.
[0034] Specifically, the graph attention network model includes an attribute extraction module and a deformation module. Step S102 also includes the following steps:
[0035] Step S1021, extracting shape information and global semantic information from the monocular fluid image based on the attribute extraction module;
[0036] Step S1022: embed the shape information and global semantic information into the initial sparse point cloud sphere based on the deformation module to reconstruct the three-dimensional fluid point cloud particles.
[0037] Specifically, embedding the global semantic information extracted by the attribute extraction module into the initial sparse point cloud sphere can provide clear and detailed guiding semantic attributes for the 3D point cloud reconstruction decoder, thereby helping the model to more accurately predict the overall shape and detailed structure of the fluid. The deformation module uses the shape information and global semantic information encoded by the attribute extraction module to guide the initial sparse point cloud sphere to transform into the 3D fluid shape corresponding to the 2D image.
[0038] Specifically, step S104 also includes: filtering and surface smoothing the three-dimensional fluid point cloud particles based on least squares fitting in the local area around the three-dimensional fluid point cloud particles. This process can effectively smooth the point cloud data and improve the quality, so that a more realistic fluid flow effect can be obtained in the subsequent fluid simulation.
[0039] Specifically, using the Moving Least Squares (MLS) algorithm, by applying least squares fitting to the local area around the rough fluid point cloud, the point cloud data can be effectively smoothed and its quality can be improved, so that a more realistic fluid flow effect can be obtained in the subsequent fluid simulation.
[0040] The basic idea of the MLS method is to perform a local surface fitting for each point and its neighborhood. This local surface is usually obtained by minimizing the weighted least squares error, where the weight reflects the distance from each point in the neighborhood to the target point, that is, the closer the point is, the greater the influence on the surface fitting.
[0041] For a point in the point cloud , the point set in its neighborhood can be expressed as ,in ,in is the number of points in the neighborhood. The goal of the MLS method is to find a local surface , it is at point For all neighboring points in the neighborhood All have the smallest weighted squared difference:
[0042]
[0043] in is a weight function, usually a distance-based function such as a Gaussian function , is the standard deviation, which controls the size of the Gaussian function neighborhood. In this section, we use high-order polynomials to fit the local surface .
[0044] Specifically, in step S106, the Hungarian algorithm is used to solve the optimal matching problem of the weighted bipartite graph, and the BFS or DFS algorithm is used to complete the allocation task at the lowest cost within polynomial time.
[0045] Specifically, calculate the velocity field:
[0046] After obtaining the fluid position, the shortest distance matching algorithm is used to calculate the velocity of the fluid point cloud. The basic algorithm idea is as follows:
[0047] There are two sets of point cloud distribution and ,in and are the points in the three-dimensional space corresponding to two consecutive frames, and are the number of points in the two groups of point clouds. Every point in turn up The closest point , to calculate the displacement (velocity) between these matching pairs.
[0048] for Every point in , calculate its All points The distance between , and then find the minimum distance corresponding to , The calculation method is as follows:
[0049]
[0050] in, Yes and The Euclidean distance between .
[0051] Considering Multiple points in may be associated with the same The closest distance, when and The number of point cloud particles is consistent, that is hour, There will be unmatched points in the graph, which is very unreasonable and inconsistent with physical laws in inferring fluid velocity. Therefore, the present invention uses the Hungarian algorithm to solve the optimal matching problem of weighted bipartite graphs. The problem of finding the shortest distance matching pair is regarded as an allocation problem, and the BFS or DFS algorithm is used to complete the allocation problem in polynomial time with the lowest cost.
[0052] Once for each Found the nearest , the displacement vector can be calculated based on the index subscript of the nearest particle Since a fixed time step is used, the velocity of each particle can be obtained by dividing the position difference by the fixed time step. And considering that in the initial flow stage of the fluid, its velocity is only affected by the initial velocity and the final effect of gravity, during the free fall process, the velocity of each particle should be the same, so the average velocity of each fluid particle is calculated As the common speed of all particles, it is more in line with the laws of physics and has better visual effects.
[0053] Specifically, the method provided in the embodiment of the present invention further includes the following steps:
[0054] A multi-layer prediction model is built based on a continuous convolution operator; specifically, the multi-layer prediction model includes a fluid-solid feature extraction network and a feature propagation network; wherein,
[0055] Fluid-solid feature extraction network, used to extract fluid-solid features; fluid-solid features include the interaction between fluid particles and the interaction between fluid particles and solid particles;
[0056] The feature propagation network is used to perform multi-level feature learning based on fluid-solid features, aggregate global particle information, and output position updates.
[0057] The multi-layer prediction model is iteratively optimized based on the energy model. In the iterative optimization process, the incompressible constraint in position-based fluid mechanics is introduced to replace the update step size to obtain a dynamic solver with physical constraints.
[0058] Specifically, energy-based models aim to capture dependencies by associating each configuration of variables with a scalar energy value (i.e., a measure of compatibility). Inference involves setting values for observed variables and finding values for other variables that minimize energy. The learning process involves finding an energy function that associates lower energy values with correct values of the variables and higher energy values with incorrect values. The process can be described as the following optimization process:
[0059]
[0060] For the model , which contains two variables ,in is the input of the model and is an observed variable is the output of the model, which is an answer. The smaller it is, the lower the energy is and the more correct it is. The larger the value, the greater the energy, which is not correct. can be viewed as an energy model that outputs a scalar for evaluating categories of “good or bad”.
[0061] Energy models can often be represented using iterative reasoning, usually expressed as repeated application of neural network operators To generate a solution .
[0062]
[0063] The final prediction In continuous application step The output obtained after that. Generally speaking, a single step The prediction can usually be expressed as the following formula:
[0064]
[0065] in, is the step size for each gradient descent step. We iterate the above equation until is the local minimum of the energy landscape, that is , adding additional iteration steps barely changes The energy value of In simple tasks such as image generation and classification, It can be a manually selected constant suitable for the current task, which will not change dynamically during the iterative training process. However, for fluid prediction tasks, the fluid itself is a three-dimensional prediction task, which is higher in dimension than image-related tasks. In addition, due to the complex fluid dynamics behind the fluid, the complex constraints that need to be satisfied are also difficult to guarantee. However, after studying PBD (Position Based Dynamics), a more physical formula that can satisfy the conservation of fluid density can be derived from the basic formula of PBD. The calculation method of .
[0066] Preferably, the incompressible constraint comprises a density constraint of the particles.
[0067] Specifically, in PBD, in order to ensure the conservation of particle density during the simulation, a nonlinear constraint system needs to be solved to ensure that each particle is constrained. All constraints imposed on each particle are modeled as functions of the particle position and the positions of its neighbors. The function of The density constraints for each particle are defined using the following equation of state:
[0068]
[0069] in, is the residual density, Given by the standard SPH density estimator:
[0070]
[0071] And consider that all particles have equal mass and remove this mass term in subsequent equations . The kernel function term The Poly6 kernel function is usually used for density estimation, or the Spiky kernel function is used for gradient calculation.
[0072] In PBD, the main goal is to find a particle position correction that satisfies the following constraints: :
[0073]
[0074] A series of Newton steps along the constrained gradient yields the following formula:
[0075]
[0076]
[0077] From the above formula, we can get Calculation method:
[0078]
[0079] Since the constraint function is nonlinear and has a vanishing gradient at the smooth kernel boundary, the denominator in the above equation can lead to instability when the particles are close to separation. It is possible to regularize the constraints using a mixed constraint force (CFM). The idea of CFM is to soften the constraints by mixing some of the constraint force back into the constraint function. In the case of PBD, the constraint formula becomes:
[0080]
[0081] in, is a user-specified relaxation parameter that is constant during the simulation. Therefore, the scaling factor Now it is:
[0082]
[0083] Model the physical motion trajectory of a particle in discrete time intervals as a series of states ,in It may contain characteristics of system elements, such as position, instantaneous velocity, mass, etc. For a dynamic scene describing a physical process, the information of a point is usually attached to time. For a fluid motion system, a simulator should usually review the flow conditions of the fluid in the past history, that is, , recorded as .
[0084] Updater mechanism usage Update the current state to the next state: ,use The new speed represented by the current position and speed.
[0085] Combining the energy model with incompressible physical constraints, the forward calculation process of the model is modeled as an implicit iterative method of fluid dynamics. ,in It is a scalar that represents the energy of the entire fluid flow scene and is used to measure whether it is the best state of fluid motion. The smaller c is, the better. The prediction process using this method can be modeled as the following optimization problem:
[0086]
[0087] Table 1 Energy iteration algorithm with physical constraints
[0088]
[0089] Figure 2 is a schematic diagram of the overall structure of a multi-layer prediction model based on a continuous convolution operator provided according to an embodiment of the present invention, Figure 3 It is a schematic diagram of the structure of a dynamics solver with physical constraints provided according to an embodiment of the present invention.
[0090] like Figure 2 and Figure 3 As shown in the figure, a multi-level prediction model is built using a continuous convolution operator. The model consists of two parts: a fluid-solid feature extraction network and a feature propagation network. The fluid-solid feature extraction network is mainly used to extract the interaction between fluid particles and the interaction between fluid particles and solid particles, thereby improving the prediction effect by ensuring that the fluid-solid interaction and boundary processing are correctly performed during prediction. The feature propagation network mainly performs multi-level feature learning on the extracted fluid-solid features, aggregates global particle information, and finally outputs the position update;
[0091] The multi-level prediction model is iteratively optimized based on the energy model, which outputs a scalar energy value, optimizes the target according to the iterative equation, and introduces the incompressible constraint in position-based fluid dynamics to replace the update step to ensure the effectiveness of the network.
[0092] In order to verify the effectiveness of the method provided by the embodiment of the present invention, the results of the three-dimensional fluid flow simulation from the image sequence are verified. A square fluid water block and a boundary solid with complex obstacles are selected to verify the model effect. First, the reconstruction result on the square fluid water block is displayed, and the result has been optimized by the dynamics-guided reasoning module. Figure 4 FIG. 1 is a schematic diagram of a reconstruction result of a square fluid water block provided according to an embodiment of the present invention. Figure 4 As shown in the figure, the complex solid boundary used in the obstacle is also shown in the figure, where the first line of the picture is a sequence of fluid flow pictures, and the second line is its optimized reconstruction result. From the visualization effect, the shape of the fluid is well maintained, and the predicted particle arrangement is also relatively neat.
[0093] Figure 5 The figure is a schematic diagram of a complex boundary cube fluid flow effect simulation provided according to an embodiment of the present invention. The particle velocity field is estimated using a dynamics-guided reasoning module, and then a continuous convolution solver with physical constraints is used to predict the fluid flow. The result is shown in Figure 5 As shown, the fluid flow rendering results from the 35th frame to the 225th frame are shown, and the fluid-solid interaction changes from very intense to calm. In order to better show the most intense motion effect of fluid-solid interaction, the first row is displayed at intervals of 10 frames. It can be seen that even in the case of the most intense fluid-solid interaction, there is no situation where fluid particles penetrate the solid boundary, indicating that the constraints imposed on the particles in this paper have worked, and the whole process is also very physical and intuitive. In the second row, at intervals of 30 frames, the kinetic energy of fluid particles gradually decreases in the collision and gradually returns to calm as the fluid-solid interaction occurs. In this process, since the obstacles in the solid boundary are all smooth surfaces, the fluid particles will gradually slide from the two plates and fall to the bottom.
[0094] From the above description, it can be seen that the embodiment of the present invention provides a fluid mechanics solution method and system based on visual priors and physical constraints. By training the model on the data obtained by simulation, it can then use multiple frames of monocular fluid flow images as input to reconstruct the fluid flow effect, and can be used in different complex boundary scenes. This method has the advantages of stable process and visualization effect close to or even exceeding the simulation effect, which can help realize the three-dimensional fluid flow effect of complex fluid shapes on any solid boundary. The process is simple and rapid, and has great artistic and application value.
[0095] Embodiment 2
[0096] Figure 6 Schematic diagram of a fluid mechanics solution system based on visual priors and physical constraints provided according to an embodiment of the present invention. Figure 6As shown, the system includes: a reconstruction module 10, a preprocessing module 20, a calculation module 30 and a prediction module 40.
[0097] Specifically, the reconstruction module 10 is used to reconstruct the monocular fluid image based on the graph attention network model to obtain three-dimensional fluid point cloud particles;
[0098] A preprocessing module 20 is used to filter and smooth the surface of three-dimensional fluid point cloud particles based on a point cloud processing method to obtain processed fluid point cloud particles;
[0099] A calculation module 30, used to calculate the position information of each particle in the fluid point cloud particles, and reconstruct the velocity field information of the fluid point cloud particles after processing based on the position information;
[0100] The prediction module 40 is used to take the position information, velocity field information and preset viscosity information as input, and input them into a dynamic solver with physical constraints to obtain the fluid motion trajectory prediction result of the processed fluid point cloud particles; the preset viscosity information is the viscosity information of the processed fluid point cloud particles.
[0101] Specifically, the graph attention network model includes an attribute extraction module and a deformation module; the reconstruction module 10 is also used for:
[0102] Extract shape information and global semantic information from monocular fluid images based on the attribute extraction module;
[0103] Based on the deformation module, shape information and global semantic information are embedded into the initial sparse point cloud sphere to reconstruct three-dimensional fluid point cloud particles.
[0104] Specifically, the preprocessing module 20 is further used to perform filtering and surface smoothing on the three-dimensional fluid point cloud particles based on least squares fitting in the local area around the three-dimensional fluid point cloud particles.
[0105] Specifically, Figure 6 As shown, the system further includes: an optimization module 50, which is used to:
[0106] Build a multi-layer prediction model based on continuous convolution operators;
[0107] The multi-layer prediction model is iteratively optimized based on the energy model. In the iterative optimization process, the incompressible constraint in position-based fluid mechanics is introduced to replace the update step size to obtain a dynamic solver with physical constraints.
[0108] Specifically, the multi-layer prediction model includes a fluid-solid feature extraction network and a feature propagation network;
[0109] Fluid-solid feature extraction network, used to extract fluid-solid features; fluid-solid features include the interaction between fluid particles and the interaction between fluid particles and solid particles;
[0110] The feature propagation network is used to perform multi-level feature learning based on fluid-solid features, aggregate global particle information, and output position updates.
[0111] An embodiment of the present invention further provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method provided in the embodiment of the present invention when executing the computer program.
[0112] The embodiment of the present invention further provides a computer-readable storage medium, in which a program code is stored. The program code can be called by a processor to execute the method provided by the embodiment of the present invention.
[0113] It should be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0114] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0115] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0116] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0117] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0118] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0119] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0120] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0121] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0122] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A fluid mechanics solution method based on visual priors and physical constraints, characterized in that: The method comprises: Based on the graph attention network model, the monocular fluid image is reconstructed to obtain three-dimensional fluid point cloud particles; Based on the point cloud processing method, filtering and surface smoothing are performed on the three-dimensional fluid point cloud particles to obtain processed fluid point cloud particles; Calculating the position information of each particle in the fluid point cloud particles, and reconstructing the velocity field information of the processed fluid point cloud particles based on the position information; wherein, Calculating the velocity field includes: Suppose there are two sets of point cloud distribution P = {p1, p2, ..., p n } and Q = {q1, q2, ..., q m }, where p i and q j are the points in the three-dimensional space corresponding to two consecutive frames, n and m are the number of points in the two sets of point clouds; For every point p in P i , calculate its intersection with all points q in Q j The distance d(p i ,q j ), find the q corresponding to the shortest distance j , that is, q min ; Among them, the problem of finding the shortest distance matching pair is regarded as an allocation problem, and the BFS or DFS algorithm is used to complete the allocation problem in polynomial time with the lowest cost; For each p i Found the nearest q min Then, the displacement vector Δp is calculated according to the index subscript of the nearest particle. i =q min -p i Since a fixed time step is used, the velocity v on each particle is obtained by dividing the position difference by the fixed time step. i ; Calculate the mean velocity of each fluid particle as the velocity common to all particles; The position information, the velocity field information and the preset viscosity information are input as inputs to a dynamics solver with physical constraints to obtain a prediction result of the fluid motion trajectory of the fluid point cloud particles after the processing; the preset viscosity information is the viscosity information of the fluid point cloud particles after the processing; Wherein, the method further comprises: Build a multi-layer prediction model based on continuous convolution operators; The multi-layer prediction model is iteratively optimized based on the energy model, and the incompressible constraint in position-based fluid mechanics is introduced to replace the update step size during the iterative optimization process to obtain the dynamic solver with physical constraints; wherein, the forward calculation process of the model is modeled as an implicit iterative method of fluid dynamics by combining the energy model with the incompressible physical constraints. Among them, f c is the prediction model; c is a scalar, which represents the energy of the entire fluid flow scene and is used to measure whether it is the best motion state of the fluid. The smaller c is, the better. The prediction process using this method is modeled as the following optimization problem: Wherein, the multi-layer prediction model includes a fluid-solid feature extraction network and a feature propagation network; wherein, The fluid-solid feature extraction network is used to extract fluid-solid features; the fluid-solid features include interactions between fluid particles and interactions between fluid particles and solid particles; The feature propagation network is used to perform multi-level feature learning based on the fluid-solid features, aggregate global particle information, and output position updates.
2. The method according to claim 1, characterized in that The graph attention network model includes an attribute extraction module and a deformation module; Based on the graph attention network model, the monocular fluid image is reconstructed to obtain three-dimensional fluid point cloud particles, including: Extracting shape information and global semantic information from the monocular fluid image based on the attribute extraction module; The shape information and the global semantic information are embedded into an initial sparse point cloud sphere based on the deformation module to reconstruct the three-dimensional fluid point cloud particles.
3. The method according to claim 1, characterized in that The method based on point cloud processing performs filtering and surface smoothing on the three-dimensional fluid point cloud particles, including: Based on the least squares fitting in the local area around the three-dimensional fluid point cloud particles, the three-dimensional fluid point cloud particles are filtered and the surface is smoothed.
4. A fluid mechanics solution system based on visual priors and physical constraints, characterized in that: The system includes: a reconstruction module, a preprocessing module, a calculation module and a prediction module; wherein, The reconstruction module is used to reconstruct the monocular fluid image based on the graph attention network model to obtain three-dimensional fluid point cloud particles; The preprocessing module is used to filter and smooth the surface of the three-dimensional fluid point cloud particles based on a point cloud processing method to obtain processed fluid point cloud particles; The calculation module is used to calculate the position information of each particle in the fluid point cloud particles, and reconstruct the velocity field information of the processed fluid point cloud particles based on the position information; wherein, Calculating the velocity field includes: Suppose there are two sets of point cloud distribution P = {p1, p2, ..., p n } and Q = {q1, q2, ..., q m }, where p i and q j are the points in the three-dimensional space corresponding to two consecutive frames, n and m are the number of points in the two sets of point clouds; For every point p in P i , calculate its intersection with all points q in Q j The distance d(p i ,q j ), find the q corresponding to the shortest distance j , that is, q min ; Among them, the problem of finding the shortest distance matching pair is regarded as an allocation problem, and the BFS or DFS algorithm is used to complete the allocation problem in polynomial time with the lowest cost; For each p i Found the nearest q min Then, the displacement vector Δp is calculated according to the index subscript of the nearest particle. i =q min -p i Since a fixed time step is used, the velocity v on each particle is obtained by dividing the position difference by the fixed time step. i ; Calculate the mean velocity of each fluid particle as the velocity common to all particles; The prediction module is used to input the position information, the velocity field information and the preset viscosity information as inputs into a dynamics solver with physical constraints to obtain a prediction result of the fluid motion trajectory of the fluid point cloud particles after the processing; the preset viscosity information is the viscosity information of the fluid point cloud particles after the processing; The system further comprises an optimization module, which is used to: Build a multi-layer prediction model based on continuous convolution operators; The multi-layer prediction model is iteratively optimized based on the energy model, and the incompressible constraint in position-based fluid mechanics is introduced to replace the update step size during the iterative optimization process to obtain the dynamic solver with physical constraints; wherein, the forward calculation process of the model is modeled as an implicit iterative method of fluid dynamics by combining the energy model with the incompressible physical constraints. Among them, f c is the prediction model; c is a scalar, which represents the energy of the entire fluid flow scene and is used to measure whether it is the best motion state of the fluid. The smaller c is, the better. The prediction process using this method is modeled as the following optimization problem: Wherein, the multi-layer prediction model includes a fluid-solid feature extraction network and a feature propagation network; wherein, The fluid-solid feature extraction network is used to extract fluid-solid features; the fluid-solid features include interactions between fluid particles and interactions between fluid particles and solid particles; The feature propagation network is used to perform multi-level feature learning based on the fluid-solid features, aggregate global particle information, and output position updates.
5. The system according to claim 4, characterized in that The graph attention network model includes an attribute extraction module and a deformation module; the reconstruction module is also used for: Extracting shape information and global semantic information from the monocular fluid image based on the attribute extraction module; The shape information and the global semantic information are embedded into an initial sparse point cloud sphere based on the deformation module to reconstruct the three-dimensional fluid point cloud particles.
6. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 3 when executing the computer program.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Fluid-solid interaction simulation method based on video reconstruction and SPH model
CN106446425A
Viscous incompressible fluid simulation method based on SPH
CN111104753A