A visual semi-automated system for fluid simulation
By constructing a visual semi-simulation system with fluid dynamic reasoning and data processing modules, and utilizing machine learning models and probabilistic modeling, the challenges of high computational complexity and real-time performance in fluid simulation are solved, achieving efficient and real-time fluid simulation effects, which are applicable to fields such as game development and virtual reality.
Patent Information
- Application Number
- CN202311870444.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-12-29
AI Technical Summary
Existing fluid simulation methods are computationally complex and difficult to achieve real-time performance. Boundary conditions and numerical stability are difficult to control. Machine learning models depend on data quality and have limited generalization ability, making them difficult to adapt to complex and ever-changing scenarios.
A visual semi-simulation system for fluid simulation is adopted, including a fluid dynamics reasoning module and a data processing module. A probabilistic model of fluid particles is constructed using a machine learning model. Combined with neural rendering and visual image posterior sub-modules, the computational complexity is reduced and the real-time performance and generalization ability are improved through probabilistic modeling and data sampling.
It achieves efficient and real-time fluid simulation, reduces computational complexity and error accumulation, and enhances the system's adaptability and generalization ability, making it suitable for applications with real-time requirements such as game development and virtual reality.
Smart Images

Figure CN117744534B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer machine learning, and more specifically, to a visual semi-simulation system for fluid simulation. Background Technology
[0002] With the continuous development of computer graphics, numerical computation, and machine learning, fluid simulation, as an important computer simulation technology, is widely used in various fields, such as game development, engineering design, and scientific research. The goal of fluid simulation is to simulate the behavior of fluids in the real world, such as the movement, interaction, and shape changes of liquids and gases.
[0003] Currently, existing fluid simulation methods are mainly based on fundamental physical principles and mathematical equations, such as the Navier-Stokes equations, and simulate fluid behavior through numerical solutions. While these methods can provide highly realistic results in some cases, they suffer from the following drawbacks:
[0004] High computational complexity: Physically based fluid simulation methods typically involve solving complex partial differential equations, such as the Navier-Stokes equations. These equations can require significant computational resources and time in practice, especially when high-resolution or large-scale simulations are needed, where the computational complexity increases dramatically. Due to this high computational complexity, physically based fluid simulation methods often struggle to meet real-time requirements. In applications requiring rapid response, such as gaming or virtual reality, this approach may not be able to meet real-time demands.
[0005] Boundary conditions and numerical stability: Fluid simulation methods based on physical principles may face challenges in setting boundary conditions and maintaining numerical stability. Incorrect boundary conditions or numerical instability can lead to inaccurate or unstable simulation results.
[0006] Difficult to optimize: Since the equations of physical principles are usually nonlinear and coupled, the application of optimization algorithms and techniques in these methods may be relatively difficult, resulting in a complex and time-consuming optimization process.
[0007] Existing fluid simulation methods also propose a deterministic fluid simulation model based on machine learning, which has the following drawbacks:
[0008] Data requirements: Training machine learning models requires a large amount of fluid particle motion data. If the data quality is low or insufficient, it may affect the accuracy of predictions.
[0009] Error accumulation: Machine learning models may accumulate errors during the prediction process, causing the results to deviate from reality over a long period of simulation.
[0010] Limited generalization ability: Deterministic models rely heavily on accurate physical properties as input, making them difficult to adapt to complex and ever-changing scenarios, and also difficult to simulate complex fluid behavior or multiphase flow, often resulting in poor approximation. Furthermore, these implementations are primarily based on computer simulation data, lacking real-world experimental data, which limits their approximation capabilities. Summary of the Invention
[0011] In view of the shortcomings of the prior art, the purpose of this invention is to provide a visual semi-simulation system for fluid simulation.
[0012] According to one aspect of the present invention, a visual semi-simulation system for fluid simulation is provided, comprising a fluid dynamics reasoning module and a data processing module;
[0013] The fluid dynamic reasoning module utilizes a machine learning model to learn and analyze the motion and interaction of fluid particles under different conditions, constructs a probabilistic model of fluid particles to predict the position of fluid particles, and performs fluid simulation.
[0014] The data processing module processes and manages fluid simulation-related data, supporting the normal operation of the fluid dynamic reasoning module.
[0015] Preferably, the fluid dynamic reasoning module includes:
[0016] The fluid particle probabilistic model pre-training submodule trains a fluid particle probabilistic model based on the fluid particle dataset. This model can infer and output the latent variables for the next time step and output the fluid particle distribution for the next time step.
[0017] The neural rendering submodule trains a neural renderer based on the fluid particle dataset. The input of the neural renderer is the fluid particle distribution output by the fluid particle probabilistic model pre-training submodule, and the output is the rendered image corresponding to the fluid particle distribution.
[0018] The visual image posterior submodule combines the fluid particle probabilistic model pre-training submodule and the neural rendering submodule. Based on visual image supervision, it optimizes the distribution of latent variables, so that the output of the fluid particle probabilistic model can be accurately adapted to the scene.
[0019] Preferably, in the fluid particle probabilistic model pre-training submodule,
[0020] Features were extracted from a fluid particle dataset using sequential convolutions.
[0021] For the extracted features, the weighted aggregation of adjacent features is used to predict particle features in a smooth and continuous manner;
[0022] Using two independent gated loop units, all features are summarized and the distribution of latent features is inferred, with the following formula:
[0023] a priori:
[0024] Posterior: z t ~GRU ξ (CConv(z t-1 ,x t ))
[0025] Among them, prior and posterior latent variables and Z t The x values are derived from different Gaussian distributions and are all initialized to 0. t-1 Let x be the state before time t. t Let z be the current state at time t. t-1 Let be the latent variable before time t. To predict latent variables, ψ is the physical prior learning network, and ξ is the future particle state posterior estimation network.
[0026] The particle transfer subunit T under this submodule θ Continuous convolution is used to sample the latent variable Z from the inferred latent variable distribution. t As input, the state x before time t t-1 and the corresponding latent variable z in the future t Predict the particle position at the next time step. The formula is:
[0027]
[0028] Preferably, the neural rendering submodule trains an MLP network, denoted as... Combine input (e) x ,e d ) and x are mapped to volume density σ and color c;
[0029] Its rendering mechanism formula is expressed as:
[0030] e x and e d These represent viewpoint-independent encoding and viewpoint-related encoding, respectively. x is defined the same as in the neural radiation field, representing the sampling point.
[0031] Preferably, the final rendering result is represented by C(r) in the neural radiation field, where r represents the pixel color, and the loss function optimized during the training of the final renderer module is expressed as:
[0032]
[0033] Where R(P) is the set of rays taken from camera position P. This indicates the color of the rendered pixel.
[0034] Preferably, in the visual image posterior submodule, the latent variable is defined as a Gaussian distribution for stable training, that is, a Gaussian distribution N with trainable parameters is appended to each particle i, and at each time step, the Gaussian distribution of the particle is sampled to obtain the posterior Gaussian distribution based on the visual scene. And repeat this process over time.
[0035] Preferably, the training process of the fluid particle probabilistic model includes:
[0036] Fixed particle transfer subunit T θ and neural renderer Parameters;
[0037] By reducing the Gaussian distribution of samples from the neural renderer The distance to the generated Gaussian distribution is used to fit particle properties of the current visual scene, employing particle transfer subunit T. θ To perform inferences about the dynamics of fluid particles;
[0038] The loss function for training is designed as follows:
[0039]
[0040] Where R(p) is the set of rays taken from camera position P. This represents the pixel color output by the renderer, specifically RGB three-channel in the implementation. C(r,t) represents the posterior pixel color of the real image, and β is a hyperparameter. This represents the particle distribution inferred from a particle model trained on a visual posterior basis. This represents the particle distribution output by the pre-trained probabilistic particle model. This indicates the calculation of the KL divergence between two distributions;
[0041] By fine-tuning the physical prior learning network ψ using the loss function, it is embedded into the probabilistic model of fluid particles and directly used to infer new dynamic scenarios with the same fluid properties but different initial states.
[0042] Preferably, there is a simulation data generation submodule, which generates a fluid particle dataset and provides it to the fluid dynamics inference module as input to the fluid particle probabilistic model pre-training submodule.
[0043] The real fluid data acquisition submodule collects real dynamic and static image data of the fluid and provides it to the enhanced fluid dynamics inference module to improve the adaptability of the machine learning model.
[0044] The data visualization submodule, based on data collected by the real fluid data acquisition submodule, verifies the accuracy and reliability of the fluid simulation results of the fluid particle probabilistic model in the fluid dynamic reasoning module.
[0045] Preferably, the simulation data generation submodule, based on the basic control equations of fluid dynamics, simulates the motion and interaction of particles in a fluid, and generates simulation data containing fluid particle motion information by running simulations in different scenarios;
[0046] After the particle motion data is generated, this particle data is converted into a mesh, transforming the discrete fluid particle position information into a continuous mesh representation; for the mesh data, rendering is performed to realize the rendering of simulation data.
[0047] Preferably, the data visualization submodule compares the output data of the fluid particle probabilistic model with the experimental data collected by the real fluid data acquisition submodule, retains the position and velocity information of the fluid particles at each moment, and converts it into a data storage format that meets the visualization requirements, and demonstrates the particle dynamics in the visualization interface.
[0048] Compared with the prior art, the embodiments of the present invention have at least one of the following beneficial effects:
[0049] The visual semi-simulation system for fluid simulation in this embodiment of the invention has high computational efficiency. Traditional methods require a large amount of computational resources and time to solve complex mathematical equations, while this embodiment of the invention reduces the burden of actual simulation calculations through prediction by machine learning models, thereby improving computational efficiency.
[0050] The visual semi-simulation system for fluid simulation in this embodiment of the invention has real-time performance advantages. In scenarios requiring real-time fluid simulation, machine learning-based methods can generate fluid behavior more quickly, enabling the system to respond to external inputs more promptly. This can enhance the user's interactive experience in practical applications.
[0051] This invention provides a visual semi-simulation system for fluid simulation, which possesses high adaptability and generalization ability. Through learning from machine learning models, the system can grasp patterns of fluid behavior from large amounts of data, thus maintaining stable simulation results under different scenarios and conditions. Compared to other machine learning algorithms applied to fluid simulation, this system employs probabilistic modeling, enabling it to exhibit strong generalization ability even in environments where fluid properties and other conditions are difficult to measure.
[0052] This invention provides a visual semi-simulation system for fluid simulation that can reduce error accumulation. The system employs probabilistic modeling, sampling from a distribution, and experimental results show that it reduces accumulated error compared to some existing machine learning models. Attached Figure Description
[0053] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0054] Figure 1 This is a schematic diagram of a visual semi-simulation system framework for fluid simulation according to one embodiment of the present invention;
[0055] Figure 2 This is a flowchart illustrating the implementation of the fluid dynamic reasoning module in a preferred embodiment of the present invention.
[0056] Figure 3 This is a preferred embodiment of the fluid particle visualization interface of the present invention. Detailed Implementation
[0057] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention. These all fall within the scope of protection of the present invention.
[0058] This invention provides an embodiment, such as Figure 1 As shown, a visual semi-simulation system for fluid simulation includes a fluid dynamics inference module and a data processing module. The fluid dynamics inference module utilizes a machine learning model to learn and analyze the motion and interaction of fluid particles under different conditions, constructing a probabilistic model of fluid particles to predict their positions and perform fluid simulation. The data processing module processes and manages fluid simulation-related data, supporting the normal operation of the fluid dynamics inference module.
[0059] This embodiment can reduce computational complexity and resource requirements while ensuring simulation effectiveness, giving the entire simulation system advantages in real-time performance and scalability.
[0060] In a preferred embodiment of the present invention, a preferred structure for a fluid dynamics inference module is provided. This fluid dynamics inference module is a key component of the system. By introducing machine learning technology, it provides a highly efficient, real-time, and generalizable fluid simulation model. Furthermore, this model has the ability to infer some fluid properties that are not easily observed directly by observing only a sequence of three-dimensional visual images. This enables the simulation of fluid dynamics to be better implemented in various application scenarios, thereby achieving a semi-simulation of fluid dynamics.
[0061] like Figure 2 As shown, the complete training process of the fluid dynamics inference module includes: pre-training of a probabilistic inference model in the fluid particle space, posterior optimization in the visual image space, transfer learning from the visual image space to the fluid particle space, and simulation of new scenes using the optimized fluid particle inference model. Therefore, the fluid dynamics inference module can be divided into three sub-modules: a pre-training sub-module for the probabilistic fluid particle model, which trains a probabilistic fluid particle model based on a fluid particle dataset, capable of predicting future latent variables; a neural rendering sub-module, which trains a neural renderer based on the fluid particle dataset, enhancing the rendering results of sampling points, with the fluid particle distribution output by the pre-training sub-module as input, and outputting the rendered image corresponding to that distribution; and a posterior visual image module, which combines the pre-training sub-module and the neural rendering sub-module, optimizing the latent variable distribution through visual image supervision, making the output of the probabilistic fluid particle model more accurately adaptable to a specific scene.
[0062] The overall fluid dynamics reasoning module comprises four network components: a probabilistic particle transformation module parameterized by θ, a physical prior learning network (ψ), a future particle state posterior estimation network (ξ), and a neural renderer (φ). The complete technical solution of this module will be described below based on each network component, and the same notation will be used in the formulas below.
[0063] In a preferred embodiment, a preferred structure for the pre-training submodule of the probabilistic fluid particle model is provided.
[0064] In this submodule, a probabilistic model for fluid particles is jointly trained on a dataset of fluid particles with various physical properties. Specifically, this module uses continuous convolutions for feature extraction and employs weighted aggregation of adjacent features to predict particle features in a smooth and continuous manner. Subsequent steps in this module use two independent GRUs (Gate Recurrent Units) to summarize the extracted convolutional features and infer the distribution of latent features. Prior and posterior latent variables are also considered. and Z t The data are derived from different Gaussian distributions and are all initialized to 0. The overall model can be expressed as:
[0065] a priori:
[0066] Posterior: z t ~GRU ξ (CConv(z t-1 ,x t ))
[0067] For the particle transfer subunit T in the pre-training submodule of the fluid particle probabilistic model θ Another continuous convolution is used to sample the latent variable Z from the inferred latent variable distribution. t As input. Particle transfer subunit T θ The state x before time t t-1 Predicting the corresponding latent variables for the future. Since the latent variables have already captured the uncertainty, the fluid particle position at the next time step is inferred using the sampled latent variables. The inference process can be described by the following expression:
[0068] This indicates the predicted position of the fluid particle at the next moment.
[0069] In a preferred embodiment, a preferred structure for a neural rendering submodule is provided. This submodule is primarily used to render fluid particles predicted by the pre-trained fluid particle probabilistic model submodule. It is assumed that the viewpoint-independent volume density and viewpoint-dependent color of the sampling points should depend on the geometric properties in their 3D neighborhood. An MLP is trained, denoted as R. φ Combined input (e) x ,e d ) and x i Mapped to volume density and color. The rendering mechanism can be represented by the following formula:
[0070]
[0071] In this context, the parameters of the MLP are shared across different time steps throughout the dynamic scene. In the above equation, e... x and e d These represent view-independent encoding and view-dependent encoding, respectively. `x` is defined the same as in neural radiation fields, representing a sampling point. Compared to previous neural rendering methods, this module excludes the location of sampling points from the input of the rendering network (i.e., the sampling point itself does not belong to the fluid particle; only the fluid particles in its given neighborhood are considered to obtain the implicit properties of the sampling point). This enhances the relationships between fluids.
[0072] Furthermore, the final rendering result is usually represented by C(r) in the neural radiation field, which represents the pixel color; This represents the pixels being rendered. The loss function optimized during the final renderer module training can be expressed as follows:
[0073]
[0074] Where R(p) is the set of rays taken from the camera position P.
[0075] In a preferred embodiment, a preferred structure for the visual image posterior submodule is provided. This submodule optimizes the latent variable distribution by combining the neural rendering submodule with the particle probabilistic model pre-training submodule. In practice, to ensure training stability, the latent variables can be defined as Gaussian distributions, i.e., a Gaussian distribution N with trainable parameters is appended to each particle i. At each time step, the Gaussian distribution of the particles is sampled to obtain the posterior Gaussian distribution based on the visual scene. And repeat this process over time.
[0076] Specifically, during the operation, the fixed particle transfer subunit T θ The parameters of the neural renderer (φ) are optimized, with only the latent variables being variable. A loss function is used to fine-tune the pre-trained probabilistic particle model, which is expressed as follows:
[0077]
[0078] By reducing the Gaussian distribution of samples from the neural renderer The distance from the generated Gaussian distribution is used to process the current visual scene, and the particle transfer subunit T mentioned earlier is still used during the final inference. θ The loss function for this training step is expressed as:
[0079]
[0080] R(P) is the set of rays taken from the camera position P. This represents the pixel color output by the renderer, specifically RGB three-channel in the implementation. C(r,t) represents the posterior pixel color of the real image, and β is a hyperparameter. This represents the particle distribution inferred from a particle model trained on a visual posterior basis. This represents the particle distribution output by the pre-trained probabilistic particle model. This indicates the calculation of the Kullback-Leibler divergence between two distributions.
[0081] By fine-tuning the physical prior learning network (ψ), it can be embedded into a probabilistic model of fluid particles to directly generate new dynamic scenes with the same fluid properties but different initial states.
[0082] The above embodiments use machine learning models to predict the motion and interactions of fluid particles, thereby constructing a probabilistic system to simulate fluid behavior. This method aims to reduce the complexity of simulation calculations, improve computational efficiency to meet real-time requirements, and achieve more realistic and lifelike fluid effects in real-time applications such as game development and virtual reality.
[0083] In a preferred embodiment of the present invention, a preferred structure for the data processing module is provided, mainly comprising three sub-modules: a simulation data generation sub-module, a real fluid data acquisition sub-module, and a data visualization sub-module. The simulation data generation sub-module generates a fluid particle dataset, which is provided to the fluid dynamics inference module as input to the fluid particle probabilistic model pre-training sub-module. The real fluid data acquisition sub-module acquires real dynamic and static image data of the fluid, which is provided to the enhanced fluid dynamics inference module to improve the adaptability of the machine learning model. The data visualization sub-module verifies the accuracy and reliability of the model rendering results based on the data acquired by the real fluid data acquisition sub-module.
[0084] This data processing module not only implements a complete simulation data processing flow, but also constructs a complete real-world fluid data acquisition device to complete the acquisition and experimentation of real fluid data. This is something that most previous machine learning models have failed to achieve. The specific details will be introduced in each embodiment.
[0085] In a preferred embodiment, a preferred configuration of a simulation data generation submodule is provided. The simulation data generated by the simulation data generation submodule is mainly used for pre-training of a probabilistic fluid particle model. The simulation data generation submodule includes two steps: first, generating particle data; second, converting the particle data into mesh data for rendering.
[0086] Step 1: Generating particle data, specifically through SplishSplash. SplishSplash is an advanced fluid simulation engine capable of simulating the motion of fluid particles. The simulation data generation submodule uses the SplishSplash engine, based on the fundamental governing equations of fluid dynamics, to simulate the motion and interactions of particles in a fluid. By running SplishSplash simulations in different scenarios, simulation data containing information about the motion of fluid particles can be generated. Compared to fluid data from real-world scenarios, simulation data is easier to generate; therefore, this method generates a larger amount of data. In some specific embodiments, during the model training process, a total of 600 fluid data points, each 4 seconds long and 50 frames per second, were generated as input for the pre-training of the probabilistic fluid particle model.
[0087] In addition to achieving high-precision fluid dynamics simulation, this probabilistic fluid particle model can also infer fluid properties by using image observations as input and designing probabilistic and latent spaces. Therefore, the simulation data generation submodule needs to implement fluid rendering tasks to serve as data for the model rendering stage. Thus, after generating particle motion data, the second step involves converting this particle data into a mesh, transforming discrete fluid particle position information into a continuous mesh representation. For mesh data, this module performs Blender rendering, importing the converted particle data mesh into Blender software. Blender is a powerful 3D modeling and rendering software capable of high-quality rendering effects; this module utilizes this software to render the simulation data. In Blender, the simulation data generation submodule uses appropriate rendering settings to render the particle data mesh, transforming it into a realistic fluid scene. This simulation data is then used to train and test the inverse rendering model within the model, verifying its ability to infer fluid properties from visual observations.
[0088] In a preferred embodiment, a preferred configuration is provided for a real fluid data acquisition submodule. This submodule acquires real dynamic and static image data of the fluid using various devices, such as three fixed-position high-speed cameras and common, easily portable imaging equipment. This data provides the entire system with realistic fluid behavior samples from sparse to relatively dense perspectives, enhancing the adaptability of the machine learning model.
[0089] Specifically, in this embodiment, the workflow of this module is as follows:
[0090] Equipment Deployment and Setup: By fixing three high-speed cameras at different positions, dynamic video data acquisition of fluids from multiple perspectives can be achieved. Furthermore, common, easily portable shooting devices, such as smartphones or digital cameras, are used to obtain more flexible shooting angles and scenes.
[0091] Fluid scenario preparation: In the fluid simulation scenario, appropriate experimental conditions and fluid motion are set to ensure the diversity and representativeness of real-world data. This may involve many variable conditions such as different flow velocities and different container shapes.
[0092] Dynamic image acquisition: Using a high-speed camera at a fixed position, high-speed dynamic images of fluid motion are captured. High-speed shooting allows for the capture of the rapid trajectories of fluid particles over a short period, providing fluid dynamic data with a sparse perspective.
[0093] Static image acquisition: Using common imaging equipment, capture static images of the fluid to obtain initial static state data. These images provide relatively dense static fluid data from multiple perspectives, enabling rapid experimentation using mature camera calibration methods to train and test the performance of inverse rendering models in static scenes.
[0094] Data preprocessing: The acquired image data may contain noise, illumination variations, and other factors, requiring preprocessing such as noise reduction and color correction. Furthermore, the overall solution employs NeRF (Neural Reflection Free) to decouple reflected and transmitted light, effectively reducing the impact of strong reflected light in the existing data.
[0095] Data fusion and preparation: Dynamic and static image data collected from different devices will be fused to create a diverse dataset. The dataset will be divided into training, validation, and test sets to provide data support for the training and evaluation of machine learning models.
[0096] The real fluid data acquisition module in this embodiment can capture the diversity and complexity of real fluid behavior, thereby making the machine learning model more generalizable and realistic, and further improving the quality and realism of fluid simulation.
[0097] In a preferred embodiment, a preferred configuration of a data visualization submodule is provided. This submodule is used to verify the accuracy and reliability of the model rendering results. It compares the fluid particle inference data generated by the model with experimental data and visualizes the data, enabling a qualitative assessment of the model's effectiveness.
[0098] Specifically, such as Figure 3 As shown, the data visualization submodule is implemented using the Mayavi library. Its main function is to preprocess the data, retain the position and velocity information of the fluid particles at various moments, and convert it into the npz data storage format that meets visualization requirements. This allows the particle dynamics to be demonstrated in the visualization interface. Within the visualization interface, various parameters such as the display scale, playback frame rate, and particle velocity scale can be adjusted to intuitively examine the model's inference performance.
[0099] The above embodiments, by fully utilizing a large amount of fluid particle data, break through the limitations of traditional fluid simulation methods, providing better adaptability and generalization capabilities, enabling the system to maintain stable and accurate simulation results under different conditions and scenarios. At the same time, the embodiments of this invention also aim to solve the difficulties that physics-based fluid simulation methods may encounter in handling complex fluid behaviors and multiphase flows, thereby expanding the application scope of fluid simulation methods.
[0100] In one specific embodiment of the present invention, fluid simulation is applied to the field of virtual reality (VR) development, where developers strive to create realistic virtual worlds that include fluid dynamics. However, traditional physics-based fluid simulation methods often struggle to achieve real-time fluid effects in virtual reality. The visual semi-simulation system for fluid simulation provided by this invention achieves this goal by implementing the following steps:
[0101] Data Acquisition and Preprocessing: Developers collect fluid particle motion data from multiple virtual scenes, considering different virtual environments and conditions, such as swimming in water and liquid flow. This data undergoes preprocessing to ensure data quality and consistency.
[0102] Machine learning model simulation: Developed for virtual reality, this model can predict the future state of fluid particles based on initial input from the virtual environment. Using data collected from the virtual scene, the model makes predictions to accurately simulate the dynamics of fluids in the virtual environment, such as waves and liquid movement. In the virtual reality environment, users can interact with virtual fluids, such as manipulating fluid behavior through gestures or controllers. By inputting the state of fluid particles in the current virtual environment, the machine learning model infers and predicts, generating virtual fluid effects.
[0103] Virtual Reality Presentation: Through virtual reality devices, such as head-mounted displays, users can experience fluid effects in a virtual world. They can observe, feel, and interact with virtual fluids, gaining a more immersive and realistic experience.
[0104] Through the above implementation, virtual reality developers can achieve realistic fluid effects in virtual reality environments, creating a more authentic virtual experience for users. The technical solution of this invention enables fluid behavior in virtual reality to dynamically change according to user interaction, providing a more highly interactive and immersive experience. This example demonstrates how to achieve semi-simulated fluid effects in virtual reality development using the technical solution in this embodiment of the invention.
[0105] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various modifications or variations within the scope of the claims, which do not affect the essence of the present invention. The above preferred features can be used in any combination without conflict.
Claims
1. A visual semi-simulation system for fluid simulation, characterized in that, Includes a fluid dynamics reasoning module and a data processing module; The fluid dynamic reasoning module utilizes a machine learning model to learn and analyze the motion and interaction of fluid particles under different conditions, constructs a probabilistic model of fluid particles to predict the position of fluid particles, and performs fluid simulation. The data processing module processes and manages fluid simulation-related data, supporting the normal operation of the fluid dynamic reasoning module. The fluid dynamic reasoning module includes: The fluid particle probabilistic model pre-training submodule trains a fluid particle probabilistic model based on the fluid particle dataset. This model can infer and output the latent variables for the next time step and output the fluid particle distribution for the next time step. The neural rendering submodule trains a neural renderer based on the fluid particle dataset. The input of the neural renderer is the fluid particle distribution output by the fluid particle probabilistic model pre-training submodule, and the output is the rendered image corresponding to the fluid particle distribution. The visual image posterior submodule combines the fluid particle probabilistic model pre-training submodule and the neural rendering submodule. Based on visual image supervision, it optimizes the distribution of latent variables so that the output of the fluid particle probabilistic model can be accurately adapted to the scene. In the fluid particle probabilistic model pre-training submodule Features were extracted from a fluid particle dataset using sequential convolutions. For the extracted features, the weighted aggregation of adjacent features is used to predict particle features in a smooth and continuous manner; Using two independent gated loop units, all features are summarized and the distribution of latent features is inferred, with the following formula: a priori: ; Posterior: ; Among them, prior and posterior latent variables and All data are derived from different Gaussian distributions and initialized to 0. The state before time t. Let t be the current state. Let be the latent variable before time t. To predict latent variables, ψ is the physical prior learning network, and ξ is the future particle state posterior estimation network. The particle transfer subunit T under this submodule θ Continuous convolution is used to sample latent variables from the inferred latent variable distribution. As input, the state x before time t t 1 and the corresponding latent variables of the future Predict the particle position at the next time step. Its formula is: 。 2. The visual semi-simulation system for fluid simulation according to claim 1, characterized in that, The neural rendering submodule trains an MLP network, denoted as... Combined input (e) x ,e d ) and x mapped to volume density and color ; Its rendering mechanism formula is expressed as: ; e x and e d These represent viewpoint-independent encoding and viewpoint-related encoding, respectively. x is defined the same as in the neural radiation field, representing the sampling point.
3. The visual semi-simulation system for fluid simulation according to claim 2, characterized in that, The final rendering result is shown in the neural radiation field. The value represents pixel color, and the loss function optimized during the training of the final renderer module is used for this purpose. Represented as: ; Where R(P) is the set of rays taken from camera position P. This indicates the color of the rendered pixel.
4. The visual semi-simulation system for fluid simulation according to claim 2, characterized in that, In the visual image posterior submodule, the latent variable is defined as a Gaussian distribution for stable training. Specifically, a Gaussian distribution N with trainable parameters is appended to each particle i. At each time step, the Gaussian distribution of the particle is sampled to obtain the posterior Gaussian distribution based on the visual scene. And repeat this process over time.
5. A visual semi-simulation system for fluid simulation according to claim 4, characterized in that, The training process of the fluid particle probabilistic model includes: Fixed particle transfer subunit T θ and neural renderer Parameters; By reducing the Gaussian distribution of samples from the neural renderer The distance to the generated Gaussian distribution is used to fit particle properties of the current visual scene, employing particle transfer subunit T. θ To perform inferences about the dynamics of fluid particles; The loss function for training is designed as follows: ; Where R(p) is the set of rays taken from camera position P. This represents the pixel color output by the renderer; in the specific implementation, it uses RGB three channels. This represents the pixel color of the visual posterior, i.e., the real image. For hyperparameters, This represents the particle distribution inferred from a particle model trained on a visual posterior basis. This represents the particle distribution output by the pre-trained probabilistic particle model. This indicates the calculation of the KL divergence between two distributions; By fine-tuning the physical prior learning network ψ using the loss function, it is embedded into the probabilistic model of fluid particles and directly used to infer new dynamic scenarios with the same fluid properties but different initial states.
6. The visual semi-simulation system for fluid simulation according to claim 1, characterized in that, The data processing module includes: The simulation data generation submodule generates a fluid particle dataset, which is provided to the fluid dynamics inference module as input to the fluid particle probabilistic model pre-training submodule. The real fluid data acquisition submodule collects real dynamic and static image data of the fluid and provides it to the enhanced fluid dynamics inference module to improve the adaptability of the machine learning model. The data visualization submodule, based on data collected by the real fluid data acquisition submodule, verifies the accuracy and reliability of the fluid simulation results of the fluid particle probabilistic model in the fluid dynamic reasoning module.
7. A visual semi-simulation system for fluid simulation according to claim 6, characterized in that, The simulation data generation submodule, based on the basic control equations of fluid dynamics, simulates the motion and interaction of particles in a fluid. By running simulations in different scenarios, it generates simulation data containing information about the motion of fluid particles. After the particle motion data is generated, this particle data is converted into a mesh, transforming the discrete fluid particle position information into a continuous mesh representation; the mesh-formatted data is then rendered to realize the rendering of the simulation data.
8. A visual semi-simulation system for fluid simulation according to claim 7, characterized in that, The data visualization submodule compares the output data of the fluid particle probabilistic model with the experimental data collected by the real fluid data acquisition submodule, retains the position and velocity information of the fluid particles at each moment, and converts it into a data storage format that meets the visualization requirements, and demonstrates the particle dynamics in the visualization interface.
Citation Information
Patent Citations
Intelligent simulation algorithm matching method for three-dimensional dynamic fluid
CN103294850A
IISPH fluid simulation calculation method based on LSTM neural network
CN114896913A
