A GPU-driven interactive large-scale three-dimensional flow field visualization method

By using GPU-driven indirect drawing commands and compute shaders to optimize the distribution and rendering of flow field particles, the problems of streamline occlusion and poor interactivity in three-dimensional flow field visualization are solved, and efficient and dynamic flow field visualization effects are achieved, which is suitable for large-scale and digital twin environments.

CN119693516BActive Publication Date: 2025-10-14ZHEJIANG UNIV

Patent Information

Application Number
CN202411674625.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-10-14
Estimated Expiration
2044-11-21

AI Technical Summary

Technical Problem

Traditional three-dimensional flow field visualization methods have problems such as streamline occlusion, uneven particle distribution, insufficient real-time and interactivity in large-scale and complex scenes. In particular, it is difficult to achieve accurate interaction and dynamic updating of flow field data in a digital twin environment.

Method used

Using GPU-driven indirect drawing commands combined with compute shaders, the distribution of flow field particles is adjusted through depth distribution, feature area matching and randomized weights, the confidence of flow field particles is dynamically adjusted, and variable length streamline trajectories and transparency overlay are combined to achieve efficient rendering and interactive visualization of flow field particles.

Benefits of technology

It improves the rendering efficiency of flow field visualization and the dynamics of streamlines, enhances the expression of flow field characteristics and the interactivity between streamlines and scene objects, supports users' free perspective and real-time interaction, and adapts to changes in complex scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119693516B_ABST
    Figure CN119693516B_ABST
Patent Text Reader

Abstract

The application discloses a GPU-driven interactive large-scale three-dimensional flow field visualization method, comprising the following steps: importing three-dimensional flow field data, creating an indirect drawing command record and a buffer zone related to flow field calculation on a GPU, and generating a directed distance field; calculating and updating each frame of flow field particles, and dispatching a corresponding number of calculation shaders; calculating the target position of the current frame of flow field particles according to the position and motion vector of the last frame of flow field particles; measuring the confidence of the target position of the current frame of flow field particles, dynamically adjusting the distribution of flow field particles according to the confidence, recording the index of flow field particles and the instance number of indirect drawing commands, and recording the trajectory of flow field particles; submitting the indirect drawing command driven by the GPU, performing drawing calling according to the set indirect drawing command buffer zone, and rendering the flow line by using a variable-length flow line trajectory and a transparency superposition mode; and accepting user interactive input and adjusting the visualization parameters, and real-time interactive presenting the flow field change and characteristics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the fields of computer graphics and three-dimensional visualization, and in particular relates to a GPU-driven interactive large-scale three-dimensional flow field visualization method. Background Art

[0002] Three-dimensional flow field visualization plays a vital role in scientific computing, engineering applications, and digital twin scenarios. Flow field visualization technology is widely used to demonstrate the characteristics of real-world flow fields, enabling monitoring and analysis of complex environments. With the deep integration of technologies such as the internet, big data, the Internet of Things, and digital twins, higher requirements are being placed on 3D flow field visualization to meet the needs of dynamic, real-time, and interactive display in complex scenarios.

[0003] Traditional three-dimensional flow field visualization methods mainly include icon method, texture method, streamline placement algorithm based on feature extraction and geometric method based on particle tracking. These methods have their own characteristics: icon method and texture method can intuitively display the flow field, but when dealing with large-scale three-dimensional scenes, their effects are often not ideal due to occlusion problems and limitations in rendering efficiency. For example, the patent application with publication number CN110211207A provides a three-dimensional flow field visualization method based on streamline length accumulation. The streamline placement algorithm based on feature extraction can display the key feature areas of the flow field, but the features are often discontinuous. Placing streamlines based solely on features may lead to uneven streamline distribution, making it difficult to fully display the entire flow field structure. In contrast, the geometric method based on particle tracking performs outstandingly in terms of real-time performance, expressibility and interactivity, and can dynamically display the motion state of flow field streamlines. Therefore, it has become an important development direction in the field of three-dimensional flow field visualization.

[0004] However, particle tracking-based methods still face problems such as streamline occlusion, poor seed point selection, and unnatural streamline flow when visualizing three-dimensional flow fields. These problems often make it difficult to visually distinguish the regional features of the flow field, making it difficult to capture and display the complex features of the flow field. For example, the patent application with publication number CN118411461A provides a method for visualizing ocean currents based on the data structure and trajectory generation strategy of an improved particle system. To address these problems, existing methods include adjusting the depth distribution of flow field particles and generating streamlines through pre-calculated flow field features. In practical applications, especially in large-scale and highly complex scenes, it is necessary to weigh different methods and choose between different visualization effects. Therefore, how to show flow field characteristics while reducing streamline occlusion and maintaining the natural dynamics of streamline visualization remains a major challenge facing three-dimensional flow field visualization.

[0005] In large-scale 3D scenes (such as the Digital Earth and complex digital twin environments), particle tracking-based 3D flow field visualization requires tracking a sufficient number of particles throughout the entire fluid domain to ensure visualization of global flow characteristics. However, excessive particles increase the computational and rendering burden, making it difficult to meet real-time and interactivity requirements using traditional CPU-based computing models. To address this issue, existing methods typically use parallel computing (such as OpenMP) or GPU acceleration (such as CUDA or OpenCL) to improve the computational efficiency of particle tracking algorithms. By distributing the calculation of particle motion trajectories across multiple cores or GPU threads, computation time can be significantly reduced, achieving closer-to-real-time visualization effects. Particles that no longer provide useful information for visualization can be removed, reducing computational and rendering overhead. With the development of GPUs, many new features have emerged, such as hardware ray tracing, mesh shaders, indirect rendering, and compute shaders. Among them, indirect rendering combined with compute pipelines to implement GPU-driven graphics is becoming an important direction for graphics performance optimization.

[0006] In addition to visualization and performance issues, using fixed-resolution flow field data for visualization in large-scale 3D scenes can lead to unrealistic interactions between streamlines and scene objects due to the insufficient precision of the flow field data from a microscopic ground perspective. This can cause streamlines to penetrate solid obstacles or scene boundaries, a phenomenon particularly pronounced in complex, multi-layered scenes. When 3D flow field visualization is combined with digital twin applications, the dynamic and ever-changing nature of the digital twin environment requires flow field visualization methods to flexibly adapt to environmental changes, updating and adjusting flow field data in real time. However, fixed-resolution flow field data struggles to meet this requirement, resulting in the inability of flow field visualization to effectively interact with the digital twin environment in complex scenes. For example, when scene objects or the environment change, the insufficient precision of the flow field data can cause streamline trajectories in low-precision areas to mismatch their real-world physical behavior, thus affecting the consistency and accuracy of the visualization.

[0007] In summary, three-dimensional flow field visualization has widespread applications in scientific computing, engineering applications, and digital twin scenarios. With the development of related technologies and the increasing demand for complex scenarios, the requirements for real-time, dynamic, and interactive performance are also increasing. Particle tracking-based visualization methods have advantages in interactivity and dynamics, but they still face challenges in rendering efficiency and streamline distribution, especially in large-scale scenarios. In addition, flow field visualization based on fixed-resolution data is difficult to achieve interaction with the changing digital twin environment, and the microscopic ground perspective can easily lead to inconsistent visualization effects. Therefore, exploring more efficient visualization methods to improve the effect, adaptability, and interactivity of three-dimensional flow field visualization, combining adaptive analysis of flow field characteristics with real-time user interaction mechanisms, will be the key to improving flow field visualization. This will provide a real-time, accurate, and interactive solution for three-dimensional flow field visualization in large-scale scenarios and complex applications such as digital twins. Summary of the Invention

[0008] The present invention aims to provide an interactive large-scale three-dimensional flow field visualization method based on GPU drive to solve the various problems mentioned in the background technology.

[0009] The specific technical solutions of the present invention are as follows:

[0010] A GPU-driven interactive large-scale 3D flow field visualization method, including:

[0011] Import 3D flow field data, create indirect rendering command records and flow field calculation-related buffers on the GPU, and generate signed distance fields for static objects in the scene;

[0012] Calculate and update the flow field particles for each frame. The calculation rate is determined by the ratio of the latitude and longitude range of the viewing angle to the latitude and longitude range covered by the flow field data, and the corresponding number of compute shaders are dispatched. The target position of the flow field particles in the current frame is calculated based on the position and motion vector of the flow field particles in the previous frame.

[0013] The confidence level of the target position of the flow field particles in this frame is measured by depth distribution, feature area matching and randomized weights. The distribution of flow field particles is dynamically adjusted according to the confidence level. The flow field particle index and the number of instances of the indirect drawing command are recorded, and the flow field particle trajectory is recorded.

[0014] The GPU drives indirect drawing command submission, makes drawing calls based on the set indirect drawing command buffer, and renders streamlines using variable length streamline trajectories and transparency overlays.

[0015] Accept user interactive input and adjust visualization parameters to interactively display flow field changes and characteristics in real time.

[0016] This invention leverages the new features of the GPU, using it to directly drive the generation and submission of indirect drawing commands. This, combined with compute shaders, enables efficient updating and rendering of flow field particles on the GPU. This optimization enables the system to efficiently compute large numbers of flow field particles within each frame. In contrast, in traditional rendering pipelines, the CPU is responsible for generating and submitting each drawing command, a process that not only increases the CPU burden but also generates a large amount of data transfer between the CPU and GPU, leading to performance bottlenecks.

[0017] This invention writes and sets the parameters of indirect drawing commands within the compute shader, eliminating the CPU overhead of recording and submitting drawing commands, reducing the number of submitted draw calls, and significantly improving the efficiency of flow field particle rendering. This optimization strategy is particularly suitable for large-scale 3D flow field visualization scenarios, ensuring smooth visualization even in large-scale scenes. Because these performance optimization measures significantly improve system efficiency, they also reserve sufficient computing resources for the complex calculation steps subsequently added to enhance visualization effects.

[0018] When using the visualization system built using this method, users can freely move the perspective to observe the three-dimensional flow field from multiple angles, including high-altitude perspective, ground perspective, and inside or outside the flow field. This free perspective design allows users to gain an in-depth understanding of the internal structure and motion characteristics of the flow field from different observation angles. In addition, the visualization system built using this method supports users to adjust various visualization and calculation parameters in real time through an interactive interface, allowing users to fine-tune the flow field performance according to actual needs, achieving more efficient and accurate visualization analysis.

[0019] Preferably, the imported three-dimensional flow field data is initialized, specifically: importing the three-dimensional flow field data and uploading it to the GPU to become a three-dimensional texture; creating a flow field particle information buffer, a visible particle index buffer, an indirect drawing command buffer and a particle trajectory buffer; generating a signed distance field for static objects in the scene.

[0020] Preferably, when calculating and updating the flow field particles for each frame, the number of flow field particles that need to be calculated for this frame is determined based on the calculation rate and the upper limit of the number of flow field particles, the flow field particles that need to be calculated are evenly divided into thread groups and the corresponding number of compute shaders are dispatched to calculate and update the flow field particles.

[0021] Preferably, different calculation and update strategies are adopted according to the life cycle of the flow field particles: the corresponding flow field particle information is obtained according to the thread identifier, and for the flow field particles marked as destroyed in the previous frame, the target position of the flow field particles is generated using random numbers or low-discrepancy sequences; for other flow field particles, the flow field particle motion vector is calculated using a numerical integration method, and the target position of the flow field particles in this frame is calculated in combination with the position of the previous frame.

[0022] Preferably, when simulation calculation is enabled and the target position of the flow field particles is not regenerated for this frame, a simulated three-dimensional flow field is created around the viewing angle to calculate its velocity vector and recalculate the target position of the flow field particles for this frame, specifically including:

[0023] Use the displacement of the current frame of view to reversely offset the flow field data;

[0024] querying the signed distance field to obtain the distance between the flow field simulation grid position and the surface of the scene object, and identifying the flow field position with a distance less than zero as an internal obstacle;

[0025] The motion vectors of flow field particles are calculated using numerical integration method and added to the flow field simulation grids of all non-internal obstacles as the source flow of flow field simulation calculation;

[0026] Perform fluid simulations and solve them using compute shaders that iterate the simulated mesh in parallel;

[0027] The velocities of the grid points marked as internal obstacles are set to zero, and the velocities of the fluid simulation grid points on the obstacle surface are adjusted to be parallel to the obstacle surface;

[0028] According to the distance between the flow field simulation grid position and the surface of the scene object, the simulation and real speeds are linearly mixed to recalculate the target position of the flow field particles in this frame.

[0029] During the flow field visualization process, this method incorporates an optional simulation calculation phase for areas with insufficient flow field data accuracy and variable three-dimensional twin scenes, improving the interactivity and visualization consistency between flow field streamlines and scene objects. This simulation calculation phase uses a grid-based fluid simulation method to calculate the velocity vector changes in the flow field to simulate the interactive performance of the flow field and scene objects. This simulation method not only improves the visualization consistency of areas with low-precision flow field data, but also enhances the interactivity between the flow field and real scene objects in the digital twin environment. It expands the three-dimensional flow field visualization method to applications that combine virtual and real, and improves the scalability of the visualization method.

[0030] Preferably, the confidence of the target position of the flow field particles is calculated through depth distribution, feature area matching and randomized weights, the life cycle of the flow field particles is dynamically adjusted according to the confidence, and the target distribution of the flow field particles is adjusted; for flow field particles whose confidence is greater than the trust threshold set by the user, their index is written to the visible particle buffer in the compute shader, and the indirect drawing command instance count is increased; for particles that do not meet the confidence requirements or are too far away from the viewing cone, they are marked as destroyed, and the remaining particles are reset to alive; the trajectory count is calculated using the modulo of the frame number and the maximum streamline trajectory length, and the flow field particle position is written to the trajectory buffer.

[0031] Preferably, the method for calculating confidence using feature items is as follows:

[0032] Depth distribution: The depth of the viewing cone is divided from near to far. The upper limit of the number of flow field particles in each depth layer is calculated based on the number of flow field particles that need to be calculated in this frame. The farther the depth layer is from the viewing angle, the lower the upper limit of the flow field particles. The confidence of its depth distribution is calculated based on the proportion of flow field particles that exceed the upper limit of the depth layer.

[0033] Feature area matching: Based on one or more flow field features selected by the user, the area of ​​matching features in the flow field is pre-calculated by feature extraction, and the matching confidence of the feature area is calculated according to the distance between the flow field particles and the feature area;

[0034] Randomization weight: Combining the flow field motion characteristics with random numbers, the confidence of the randomization weight is calculated based on the motion vector of the flow field particles and the random number.

[0035] Preferably, the confidence calculated from the three feature items is calculated by weighted mixing to obtain the confidence of the flow field particles. If it is lower than the confidence threshold, it is marked as destroyed and regenerated in the next frame.

[0036] In order to solve the common problems of streamline stacking and insufficient expression of feature areas in three-dimensional flow field visualization, the present invention evaluates the confidence of flow field particles based on three feature items: depth distribution, feature area matching, and randomized weight. It also performs depth analysis on the position of flow field particles in the viewing cone and dynamically adjusts the depth distribution of particles according to changes in viewing angle, thereby avoiding excessive accumulation of streamlines at the same depth layer. This adaptive depth distribution adjustment method can effectively reduce streamline occlusion, allowing users to more clearly see the flow characteristics of different depth layers when observing the flow field. By pre-calculating the feature areas of the flow field and performing feature matching calculations on the actual positions of the flow field particles, the flow field characteristics of the feature areas can be highlighted. This strategy not only improves the expression effect of the flow field, but also enhances the directionality of visualization by highlighting key areas. The present invention also uses a weight adjustment method based on random numbers or low-difference sequences to moderately randomize the motion parameters of the particles, thereby breaking the monotonicity of the particle positions as a whole, making the streamline distribution more natural and the flow field characteristics richer.

[0037] Preferably, the algorithm for submitting indirect drawing commands driven by the GPU is as follows: the GPU submits drawing calls based on the instance count of the indirect drawing command buffer, and the entire process is driven by the GPU, avoiding the overhead of data transmission from the CPU to the GPU; when rendering, the pixel shader obtains the flow field particle index according to the instance label, and then obtains the particle motion vector and position information according to the flow field particle index for drawing; variable-length streamline trajectory drawing calculates the trajectory index through the frame number, and takes out the corresponding trajectory point from the buffer for drawing.

[0038] The beneficial effects of the present invention are: dynamically adjusting the distribution of flow field particles according to feature items and confidence mechanisms, which can effectively reduce streamline occlusion and stacking, focus on expressing flow field characteristics, and improve the dynamics of streamline movement; through optional simulation calculation stages, the interaction between streamlines and scene objects in low-precision areas of flow field data is displayed, and the visualization method is extended to applications such as digital twins, thereby improving the scalability of the visualization system; GPU-driven flow field visualization is achieved through indirect rendering methods combined with computational shaders, which can dynamically display flow field characteristics in real time at a high frame rate; users can freely adjust the viewing angle and adjust visualization parameters in real time, which is convenient for users to observe and analyze three-dimensional flow fields from multiple angles, thereby providing strong technical support for flow field visualization in various applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A flowchart of a GPU-driven interactive large-scale three-dimensional flow field visualization method provided in an embodiment of the present invention.

[0040] Figure 2 A schematic diagram of a large-scale three-dimensional flow field visualization provided by an embodiment of the present invention.

[0041] Figure 3 A flow field visualization diagram for simulation calculations provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0042] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0043] This embodiment provides a GPU-driven interactive large-scale three-dimensional flow field visualization method, including:

[0044] Import 3D flow field data, create indirect rendering command records and flow field calculation-related buffers on the GPU, and generate signed distance fields for static objects in the scene;

[0045] Calculate and update the flow field particles for each frame. The calculation rate is determined by the ratio of the latitude and longitude range of the viewing angle to the latitude and longitude range covered by the flow field data, and the corresponding number of compute shaders are dispatched. The target position of the flow field particles in the current frame is calculated based on the position and motion vector of the flow field particles in the previous frame.

[0046] The confidence level of the target position of the flow field particles in this frame is measured by depth distribution, feature area matching and randomized weights. The distribution of flow field particles is dynamically adjusted according to the confidence level. The flow field particle index and the number of instances of the indirect drawing command are recorded, and the flow field particle trajectory is recorded.

[0047] The GPU drives indirect drawing command submission, makes drawing calls based on the set indirect drawing command buffer, and renders streamlines using variable length streamline trajectories and transparency overlays.

[0048] Accept user interactive input and adjust visualization parameters to interactively display flow field changes and characteristics in real time.

[0049] The following is combined with Figure 1-3 The specific steps of the GPU-driven interactive large-scale three-dimensional flow field visualization method in this embodiment are described in detail:

[0050] Step S1: Import 3D flow field data, create indirect rendering command records and flow field calculation-related buffers on the GPU, and generate signed distance fields for static objects in the scene.

[0051] In step S1, the three-dimensional flow field data is first initialized. The flow field data can be loaded using formats such as NetCDF (NC) or JSON and transferred to a GPU 3D texture for subsequent sampling and interpolation calculations. To create a signed distance field for static objects in the scene, the spatial extent and resolution of the signed distance field are first determined. Typically, this extent is the bounding box of the entire scene. Next, the mesh data of all static objects in the scene is traversed, their triangular or polygonal surfaces are extracted, and an acceleration structure (such as a BVH or KD-Tree) is constructed for these geometries to accelerate distance queries from points to the nearest surface. When generating the SDF data, each point on a three-dimensional grid is traversed, and the acceleration structure is used to quickly calculate the distance to the nearest geometric surface. The sign of the distance of each grid point is determined by its location (inside or outside the object): positive values ​​outside the object and negative values ​​inside the object. These calculation results are then stored as a 3D texture, forming a complete SDF data structure. To optimize subsequent query processes, the SDF data is mipmapped to generate multiple levels of resolution, each representing distance field data of varying precision. Once generated, the SDF data is uploaded to the GPU and stored as a 3D texture. An appropriate texture sampling mode (such as linear sampling) is set to ensure smooth distance values ​​in subsequent calculations. Subsequently, multiple GPU buffers are created, including a flow field particle information buffer, a visible particle index buffer, an indirect drawing command buffer, and a streamline trajectory buffer. By managing, recording, and utilizing these buffers on the GPU, latency is minimized and overall performance is improved.

[0052] Step S2: Calculate and update the flow field particles. The calculation rate is determined by the ratio of the latitude and longitude range of the viewing angle to the latitude and longitude range covered by the flow field data, and a corresponding number of compute shaders are dispatched. For flow field particles marked as destroyed in the previous frame, the target position of the flow field particles is generated using a random number or low-discrepancy sequence. For other flow field particles, the motion vector of the flow field particle is calculated using a numerical integration method. The target position of the flow field particle in the current frame is obtained based on the position of the flow field particle in the previous frame and the calculated motion vector.

[0053] Step S2 is the calculation and update process of the flow field particles for each frame. This method dynamically adjusts the number of calculated particles based on the viewing angle information and selects different calculation methods based on the life cycle of the flow field particles to ensure efficient calculation while maintaining the flow field visualization effect and rendering quality. Specifically, it includes:

[0054] Step S21 dynamically calculates the calculation rate of flow field particles based on the current viewing angle information. Specifically, the latitude and longitude range visible from the viewing angle is obtained, and its proportion to the latitude and longitude range covered by the entire flow field data is calculated as the calculation rate for this frame update. The number of flow field particles that need to be calculated for this frame is determined based on the calculation rate and the upper limit of the number of flow field particles. The flow field particles that need to be calculated are evenly divided into thread groups and a corresponding number of compute shaders are dispatched to calculate and update the flow field particles. The lower limit of the number of compute shaders dispatched is set by a fixed value.

[0055] Step S22: For the flow field particles marked as destroyed in the previous frame, their positions are regenerated in the current frame by means of random numbers or low-discrepancy sequences. For other flow field particles, the motion vector is calculated using a numerical integration method. The available numerical integration methods include but are not limited to the Euler method, the fourth-order Runge-Kutta method, etc. The appropriate method is selected according to the complexity and accuracy requirements of the flow field. The calculated motion vector is multiplied by the scaling factor and added to the position of the previous frame as the target position of the flow field particle in the current frame.

[0056] Step S3: If simulation calculation is enabled and the flow field particle target position is not newly generated for this frame, a simulated 3D flow field is created at the viewpoint for calculation. This includes reverse offset, setting internal obstacles, adding source flow, fluid simulation, setting obstacle interaction, and smoothing the transition between the simulation and the real velocity vector. The simulated calculation results are used to recalculate the flow field particle target position for this frame, replacing the target position calculated in step S2, and participating in subsequent calculations.

[0057] When simulation calculation is enabled and the target position of the flow field particles is not regenerated for this frame, a simulated three-dimensional flow field is created around the viewer to calculate its velocity vector. The simulation method is mainly a grid-based stable fluid solution method. This method is suitable for stable fluid solvers for real-time simulation. It ensures the realistic appearance of the fluid while taking into account computational efficiency. It is very suitable for application scenarios that require real-time interaction, such as computer graphics and game development. The specific steps of the simulation calculation stage of this method include reverse offset, setting internal obstacles, adding source flow, fluid simulation, setting obstacle interaction, and smooth transition simulation and real velocity vector, including:

[0058] Step S31 , reverse offset, moves the simulated flow field along with the viewing angle, and reversely offsets the flow field data using the displacement of the viewing angle in each frame.

[0059] Step S32, set internal obstacles, iterate all simulated flow field grid points in parallel in the GPU's compute shader, query the pre-generated scene object SDF value at each grid point, if the value is less than or equal to 0, it means that the grid point is inside the scene object, and the grid point position is marked as an internal obstacle.

[0060] Step S33, add source flow, iterate all simulated flow field grid points in parallel in the GPU's compute shader, and at each grid point, query whether it is identified as an internal obstacle by step S32. For non-internal obstacle grid points, sample real three-dimensional flow field data and use numerical integration method to calculate the flow field particle motion vector of the grid point, and multiply the motion vector by the scaling factor to add it as the source flow.

[0061] Step S34: Fluid simulation. This fluid simulation method is based on the Navier-Stokes equations, the core equations in fluid mechanics. To balance visualization and real-time requirements, this method uses a simplified and stabilized solution to ensure a balance between computational efficiency and visual quality. The simulation process primarily includes three steps: diffusion, advection, and projection. Each step has been optimized to meet the fluid simulation requirements of real-time application scenarios. This step also includes steps S341, S342, and S343.

[0062] Step S341, the physical significance of the diffusion step is to simulate the homogenization process of substances (such as heat, concentration or velocity). In fluid simulation, diffusion causes substances in high-concentration areas to gradually spread to low-concentration areas, thus tending to equilibrium. This process reflects the spatial distribution and diffusion of substances and energy caused by molecular motion in nature. It is an important step to ensure that the simulation results are closer to the real fluid behavior both visually and physically. The diffusion step is solved using the Gauss-Seidel iteration method, and its calculation method is:

[0063]

[0064] Where u represents the velocity component in the flow field, i, j, k are the three-dimensional grid indices, and a = Δt·diff·N 3 Δt represents the time step, which is the interval between each update in the simulation process. It determines the amount of time the fluid advances during each calculation and is usually set small enough to ensure simulation stability. diff represents the diffusion coefficient, which describes the rate of velocity diffusion in the fluid and is determined by the physical object being simulated. N is the resolution of the three-dimensional grid. In this method, the resolution is set to 128 to balance simulation effect and computational efficiency. Numerical iterative methods require setting the number of iterations. This method, balancing simulation effect and computational efficiency, chooses 30 iterations.

[0065] Step S342: The advection process represents the transport of material by the fluid due to its own velocity field (velocity vector). That is, the material or properties (such as temperature and density) within the fluid change with the position of the fluid during the flow process. The velocity field itself will also change due to the influence of advection, and the velocity vector will be updated with the position of the fluid, thus forming a more complex flow pattern. In actual calculations, three-dimensional advection can be achieved through the reverse tracking method. Based on the three-dimensional velocity field, the starting position of a grid point at the previous time step is calculated, and then the value of the point is interpolated. The numerical implementation formula is:

[0066] u[i, j, k] = Interpolate(u prev ,ivΔt·v x [i, j, k], j - Δt·v y [i, j, k], k-Δt·v z [i, j, k])

[0067] Where Δt is the time step, v x , v y , v z They are the components of the velocity field in the x, y, and z directions respectively, Interpolate(u prev , a, b, c) represents a three-dimensional interpolation of the values ​​at index a, b, and c in the last iteration of u.

[0068] The physical significance of the projection step, step S343, is to ensure that the fluid velocity field remains incompressible, that is, to satisfy the fluid continuity equation and eliminate sources or sinks within the fluid. This process adjusts the velocity field to eliminate divergence, simulating the conservation of flow and vortex structures found in real fluids. This is a key step in achieving physically realistic fluid behavior and ensuring that the simulation adheres to the fundamental laws of fluid mechanics.

[0069] The numerical calculation method of the projection step is divided into three parts. The first part is to calculate the divergence: Where h is the grid spacing. The second part is to solve the pressure field using the Gauss-Seidel method or other iterative solvers: This process requires multiple iterations until convergence. This method balances simulation effect and computational efficiency, and selects 30 iterations. The third part is to adjust the velocity field and update each component of the velocity field according to the pressure field obtained in the second part.

[0070] Step S35, setting the obstacle interaction. In order to simulate the interaction effect between the flow field and the internal obstacles, it is necessary to set the boundary conditions: on the grid cells occupied by the obstacles, the velocity is set to zero to ensure that the fluid cannot pass through the obstacles. For the fluid cells on the obstacle surface, its velocity is adjusted to be parallel to the obstacle surface, so as to achieve the effect of fluid flowing around the obstacle, ensuring that the fluid follows the principle of impenetrability when encountering an obstacle, that is, there is no flow inside the obstacle, and maintains a certain velocity boundary condition on the obstacle surface, thereby improving the realism and accuracy of the simulation.

[0071] Step S36 smoothly transitions the simulated and real velocity vectors. Based on the distance between the simulated flow field grid points and the scene object surface, linear interpolation is performed between the motion vectors obtained by numerically integrating the sampled real flow field data and the motion vectors obtained by the simulation. The simulated result is used to recalculate the target position of the flow field particles in the current frame, replacing the target position calculated in step S22, and participating in the calculations in subsequent steps.

[0072] Step S4: Measure the confidence of the target position of the flow field particles in this frame through three feature items: depth distribution, feature area matching, and randomization weight. Dynamically adjust the flow field particle distribution according to the confidence, record the flow field particle index and the number of instances of the indirect drawing command, and record the flow field particle trajectory.

[0073] In order to ensure the visualization effect of the three-dimensional flow field, the position distribution of the particles should be as close as possible to the characteristic area of ​​the flow field, while avoiding excessive stacking and occlusion of streamlines to avoid affecting the observation of the flow field characteristics. It is also necessary to ensure the fluidity of the flow field particles. Therefore, the present invention uses three feature items to measure the confidence of the flow field particles. The three feature items are depth distribution, feature area matching and randomization weight, which specifically include:

[0074] Step S41: for the depth distribution item, the viewing cone is divided into N depth layers. i is the depth layer number, d i is the starting point of each depth layer, d beginIt is the starting point of the depth division, which is generally the near plane of the viewing cone. When the near plane depth value exceeds the maximum height of the flow field data range, the maximum height of the flow field data range is used as the depth starting point. end The end point of the depth division is usually the far plane of the viewing cone. Similar to the starting point, when the depth of the far plane layer exceeds the minimum height of the flow field data range, the minimum height of the flow field data is used as the end point of the depth division. The number of particles is allocated according to the exponential decrease from near to far depth layers. The number of particles accommodated in each layer is different. The depth layer closer to the camera can accommodate more particles, and the depth layer far away from the camera can accommodate a lower upper limit on the number of particles. The specific allocation method is: P i is the number of particles assigned to the i-th layer, P total It is the total number of particles dispatched in the current frame. This value is obtained by multiplying the calculation rate by the upper limit of the number of particles. p is an exponential parameter used to control the distribution of the number of particles. A larger p value makes the particle density of nearby layers greater.

[0075] The calculation method of the depth distribution confidence obtained according to the frustum stratification and particle number distribution is:

[0076]

[0077] Among them, C i is the confidence level of the depth distribution term of the flow field particle i, and its value range belongs to [0,1], n i is the number of flow field particles in the depth layer where the particle is located, n max The upper limit of the number of particles in this depth layer is set. After exceeding this number, the confidence begins to decrease. Using the depth distribution item confidence can prioritize the distribution of particles to depth layers closer to the viewer, improving the visual details nearby and reducing the visual stacking in the distance.

[0078] Step S42: For the feature region matching item, taking vortex as an example, firstly, the vortex detection algorithm is used to output the vortex position, impact size and intensity and other information. The feature region matching confidence calculation method of the flow field particle is: C i is the confidence level of the feature region matching item of flow field particle i, ranging from 0 to 1, d i is the Euclidean distance between flow field particle i and the nearest vortex center, and σ is the influence range of the vortex. The confidence level given by this formula can ensure that the closer the particle is to the vortex, the higher its confidence level can be considered. Conversely, the farther the distance, the lower the confidence level, so that the flow field particles are more likely to be distributed near the feature area selected by the user, highlighting the characteristics of the flow field.

[0079] Step S43, for the randomized weight term, in order to express the flow in the flow field, the present application introduces the combination of particle motion vector and random weight, according to the motion vector of the particle and the random number to determine the confidence of the flow field particle, C i For the confidence of the randomized weight term of the flow field particle i, |v i | is the modulus of the velocity of the particle, v max is the maximum value of the flow field particle velocity, r i is the random number of the i-th particle, ranging from [0, 1], and the confidence measured by the random weight term can ensure the naturalness and dynamics of the particle distribution.

[0080] Step S44, for the confidence of the depth distribution, the feature region matching and the randomized weight, the final confidence is obtained by mixing calculation, when mixing multiple confidence terms, linear mixing method can be used, Where C mix is the mixed confidence, C i is the confidence value corresponding to the i-th feature term, w i is the weight value corresponding to the feature term, and the user can set the weight of different feature terms. If the mixed confidence is less than the trust threshold set by the user, the particle is identified as destroyed.

[0081] Step S45, processing the flow field particles, for the flow field particles meeting the trust threshold set by the user, according to the view volume space information, the particles are removed, for the flow field particles not in the vicinity of the view volume space, the index is written into the visible particle index buffer, and the drawing instance count in the indirect drawing command buffer is increased; the position of the flow field particle before updating is written into the corresponding position of the trajectory buffer as the basis for subsequent variable length flow line trajectory drawing.

[0082] Step S5: submit the indirect drawing command through the GPU driver, call the drawing according to the indirect drawing command buffer set in step S2), and render the flow line using the variable length flow line trajectory and the transparency superposition method.

[0083] The GPU-driven indirect rendering method is combined with a calculation pipeline to efficiently render and update the stream line particles. In step S45), the indirect rendering command buffer is written and set by a calculation shader. The total number of stream field particles that need to be rendered each frame is recorded in the indirect rendering command buffer. The GPU generates a rendering call according to the content of the buffer and directly submits it to the rendering pipeline, so that the rendering command is executed by the GPU throughout the process. This strategy eliminates the process of generating and submitting rendering commands by the CPU in the traditional rendering pipeline, greatly reduces the data transmission demand from the CPU to the GPU, and thus improves the rendering efficiency of the system. In the rendering stage, the pixel shader obtains the particle index from the index buffer based on the instance index, and then obtains the motion vector and position information of the stream field particle from the particle information buffer based on the particle index to perform rendering.

[0084] For variable-length stream line trajectory rendering, the application adopts a dynamic length calculation method based on frame number. The trajectory index to be recorded is obtained by taking the total number of trajectories modulo the current frame number each frame. In the rendering stage, the number of instances of the rendering call is obtained by multiplying the trajectory length by the total number of visible stream field particles. In the pixel shader, the corresponding trajectory count is calculated based on the instance index, and then the position of the stream field particle recorded in the previous frame update is obtained from the particle trajectory buffer based on the trajectory count and the visible stream field particle index. For long-tailed stream lines, a transparency decay method is used for rendering, that is, the transparency is multiplied by a decay coefficient. The longer the trajectory, the lower the partial transparency. This method ensures the flexibility of display and adjustment of stream line particle trajectories and avoids redundant calculations in stream field data processing. In addition, to further optimize the rendering efficiency in large-scale scenes, the application improves the performance by dividing the calculation process of the stream line particles into frames.

[0085] Step S6: Accepting user interaction input and adjusting the visualization parameters, real-time interactive display of stream field changes and characteristics, repeating steps S2) to S6) each frame.

[0086] The application supports real-time interactive parameter setting by users, and adjusts the stream field calculation and visualization parameters through an interactive interface. The visualization system implemented by the method can receive user input and adjust the stream field characteristics in real time. Users can interact with the stream field by setting parameters and observe the stream field changes in real time.

[0087] The application supports users to freely move the camera, real-time interactive setting control flow field calculation and rendering of multiple parameters, which are transmitted to the calculation shader in real time to update the calculation and rendering logic of the flow field visualization. During each frame rendering cycle, the system adjusts the life cycle and motion characteristics of the flow field particles according to the user's perspective information and parameter settings, for example, when calculating the position and trajectory of the flow field particles, the flow field characteristics and confidence weight set by the user are dynamically updated. If the user adjusts the upper limit number of flow field particles, the system will automatically redistribute the thread group of particle calculation and regenerate the flow field particle distribution mode that meets the user's settings in the next frame update. For the evaluation of the flow field particle confidence, the application is based on three feature items of depth distribution, feature region matching and randomization weight, and users can freely set the weights of these features through the interface, select different feature regions, and observe the performance of particle distribution and feature regions in real time and make adjustments to ensure that the flow field particles meet the user's observation expectations and perspective requirements in vision. At the same time, the application supports real-time enabling of simulation calculation function, which realizes the interactive performance of flow line motion trajectory and object by creating a simulation flow field and performing simulation calculation on its velocity vector. Users can turn on or off simulation calculation through the interactive interface and adjust parameters such as source flow scaling factor and diffusion coefficient in real time to simulate the more realistic interaction effect of flow lines and objects. This method significantly enhances the scalability of large-scale three-dimensional flow field visualization and the user's interactive experience in the three-dimensional flow field visualization scene, and simulation calculation can be used to display the interaction of flow lines and scene objects in low-precision areas of flow field data, ensuring the consistency of flow field motion characteristics in macro and micro perspectives.

[0088] Through the above specific implementation method, the application can efficiently and dynamically visualize large-scale three-dimensional flow field calculation and rendering, improve the efficiency and visualization effect of large-scale three-dimensional flow field visualization, enhance the interaction effect of flow field and scene objects through switchable simulation calculation steps, enhance the scalability of the visualization method, and users can adjust the visualization parameters of the flow field and view the flow field changes in real time, improving the interactivity of flow field visualization.

[0089] The above description is only a preferred embodiment of the application and is not intended to limit the application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the application shall be included in the protection scope of the application.

Claims

1. A GPU-driven interactive large-scale three-dimensional flow field visualization method, characterized in that: include: Import 3D flow field data, create indirect rendering command records and flow field calculation-related buffers on the GPU, and generate signed distance fields for static objects in the scene; Calculate and update the flow field particles for each frame. The calculation rate is determined by the ratio of the longitude and latitude range of the viewing angle to the longitude and latitude range covered by the flow field data, and the corresponding number of compute shaders are dispatched. Calculate the target position of the flow field particles in this frame based on the position and motion vector of the flow field particles in the previous frame; The confidence level of the target position of the flow field particles in this frame is measured by depth distribution, feature area matching and randomized weights. The distribution of flow field particles is dynamically adjusted according to the confidence level. The flow field particle index and the number of instances of the indirect drawing command are recorded, and the flow field particle trajectory is recorded. The method for calculating the confidence using feature items is as follows: Depth distribution: the depth of the viewing cone is divided from near to far, and the upper limit of the number of flow field particles in each depth layer is calculated according to the number of flow field particles that need to be calculated in this frame. The farther the depth layer is from the viewing angle, the lower the upper limit of the flow field particles. The confidence of the depth distribution is calculated according to the proportion of flow field particles exceeding the upper limit of the depth level; Feature area matching: based on one or more flow field features selected by the user, the area of ​​matching features in the flow field is pre-calculated by feature extraction, and the confidence of the feature area matching is calculated according to the distance between the flow field particles and the feature area; Randomization weight: combining the flow field motion characteristics and random numbers, and calculating the confidence of the randomization weight according to the motion vector of the flow field particles and the random number; The confidence calculated by the three feature items is calculated through weighted mixing to obtain the confidence of the flow field particles. If it is lower than the confidence threshold, it is marked as destroyed and regenerated in the next frame; The GPU drives indirect drawing command submission, makes drawing calls based on the set indirect drawing command buffer, and renders streamlines using variable length streamline trajectories and transparency overlays. Accept user interactive input and adjust visualization parameters to interactively display flow field changes and characteristics in real time.

2. The GPU-driven interactive large-scale three-dimensional flow field visualization method according to claim 1, characterized in that: Initialize the imported 3D flow field data, specifically: import the 3D flow field data and upload it to the GPU as a 3D texture; create a flow field particle information buffer, a visible particle index buffer, an indirect drawing command buffer, and a particle trajectory buffer; generate a signed distance field for static objects in the scene.

3. The GPU-driven interactive large-scale three-dimensional flow field visualization method according to claim 1, characterized in that: When calculating and updating the flow field particles for each frame, the number of flow field particles that need to be calculated for this frame is determined based on the calculation rate and the upper limit of the number of flow field particles. The flow field particles that need to be calculated are evenly divided into thread groups and the corresponding number of compute shaders are dispatched to calculate and update the flow field particles.

4. The GPU-driven interactive large-scale three-dimensional flow field visualization method according to claim 3, characterized in that: Different calculation and update strategies are adopted according to the life cycle of flow field particles: Obtain the corresponding flow field particle information according to the thread identifier. For the flow field particles marked as destroyed in the previous frame, use random numbers or low-discrepancy sequences to generate the target positions of the flow field particles. For other flow field particles, the numerical integration method is used to calculate the flow field particle motion vector, and the target position of the flow field particle in this frame is calculated in combination with the position of the previous frame.

5. The GPU-driven interactive large-scale three-dimensional flow field visualization method according to claim 1, characterized in that: When simulation calculation is enabled and the target position of the flow field particles is not regenerated for this frame, a simulated three-dimensional flow field is created around the view angle to calculate its velocity vector and recalculate the target position of the flow field particles for this frame. Specifically, the following steps are performed: Use the displacement of the current frame of view to reversely offset the flow field data; querying the signed distance field to obtain the distance between the flow field simulation grid position and the surface of the scene object, and identifying the flow field position with a distance less than zero as an internal obstacle; The motion vectors of flow field particles are calculated using numerical integration method and added to the flow field simulation grids of all non-internal obstacles as the source flow of flow field simulation calculation; Perform fluid simulations and solve them using compute shaders that iterate the simulated mesh in parallel; The velocities of the grid points marked as internal obstacles are set to zero, and the velocities of the fluid simulation grid points on the obstacle surface are adjusted to be parallel to the obstacle surface; According to the distance between the flow field simulation grid position and the surface of the scene object, the simulation and real speeds are linearly mixed to recalculate the target position of the flow field particles in this frame.

6. The GPU-driven interactive large-scale three-dimensional flow field visualization method according to claim 1, characterized in that: The confidence of the target position of the flow field particles is calculated through depth distribution, feature area matching and randomized weights. The life cycle of the flow field particles is dynamically adjusted according to the confidence, and the target distribution of the flow field particles is adjusted. For flow field particles whose confidence is greater than the trust threshold set by the user, their index is written to the visible particle buffer in the compute shader, and the indirect drawing command instance count is increased. For particles that do not meet the confidence requirements or are too far away from the view frustum, they are marked as destroyed, and the remaining particles are reset to alive. The trajectory count is calculated by taking the modulus of the frame number and the maximum streamline trajectory length, and the flow field particle position is written to the trajectory buffer.

7. The GPU-driven interactive large-scale three-dimensional flow field visualization method according to claim 1, characterized in that: The specific algorithm for submitting indirect drawing commands driven by the GPU is as follows: The GPU submits drawing calls based on the instance count of the indirect drawing command buffer, and is driven entirely by the GPU, avoiding the overhead of data transmission from the CPU to the GPU; when rendering, the pixel shader obtains the flow field particle index based on the instance label, and then obtains the particle motion vector and position information based on the flow field particle index for drawing; variable-length streamline trajectory drawing calculates the trajectory index through the frame number and takes the corresponding trajectory point from the buffer for drawing.

Citation Information

Patent Citations

  • Ocean current visualization method based on data structure and trajectory generation strategy of improved particle system

    CN118411461A

  • GPU-based interactive ocean three-dimensional flow field dynamic visual algorithm

    CN104867186A

  • Three-dimensional flow field visualization method based on streamline length accumulation

    CN110211207A

Cited By

  • Butterfly valve digital twin flow field dynamic visualization monitoring method

    CN122366247A