A method for quickly loading visualization data of a flow field
Through the combination of multi-threaded programming and VTK system, the problems of slow loading speed and low rendering efficiency of flow field grid data are solved, and the rapid, accurate and intuitive visualization of flow field grid data is achieved, improving the efficiency of user experience and flow field analysis.
Patent Information
- Application Number
- CN202510459244.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-04-14
AI Technical Summary
In the traditional flow field visualization method, the flow field grid data is slowly loading and low rendering efficiency, resulting in slow response speed and even lag and freezing, making it difficult to achieve real-time switching and display complex flow field structures.
Using multi-threaded programming technology and VTK system, flow field grid data is imported and normalized, physical features are extracted and stored, graphical user interface and flow field loading are decoupled, and flow field analysis is realized using the VTK system for visual display and interaction.
It significantly improves the processing efficiency and user experience of flow field grid data, realizes smooth flow field display and real-time switching, provides high-definition flow field view, reduces computing resource dependence, and improves the friendliness and intuitiveness of the user interface.
Smart Images

Figure CN119987901B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of flow field visualization, and particularly relates to a method for quickly loading flow field visualization data. Background Art
[0002] Flow field visualization technology is to transform the physical characteristics of the flow field into visible images or animations through specific processing methods, so as to intuitively display the flow field conditions. This technology can visually observe the movement of fluids around the aircraft model, including the distribution states and dynamic changes of a series of key physical quantities such as velocity, pressure, and temperature, so as to more deeply understand the laws of fluid motion. Currently, a core challenge in the field of flow field visualization is to quickly and accurately draw and render flow field grid data, and at the same time achieve real-time switching of flow field cloud maps corresponding to different physical quantities, so as to help users visually observe complex flow field structures.
[0003] Currently, there are mainly two major typical methods in the field of flow field visualization. One is the physical experiment method, which makes the physical information (such as velocity, pressure, temperature, etc.) in the flow field visible or measurable by introducing external media or applying energy in the flow field, so as to achieve an intuitive display of the flow field. The physical experiment method usually requires a large investment in experimental equipment and material resources, resulting in high costs, and is limited by experimental conditions, such as the ranges of conditions such as temperature, pressure, and flow rate are limited, and in the actual measurement process, due to the fact that the measurement area may be difficult to reach, or the installation and use of sensors will cause certain disturbances to the flow field, which may cause relatively large visualization errors. Another important method for flow field visualization is the flow field numerical simulation method, which uses advanced computer technology and numerical calculation methods to obtain the numerical solution of the flow field by solving the basic equations in the flow field (such as the Navier-Stokes equation, Euler equation, etc.). Further, these numerical solutions will be cleverly transformed into intuitive visual images or animations. This method not only has lower costs and faster operation speeds compared to the physical experiment method, but also can simulate various extreme conditions, comprehensively cover the calculation area, and provide detailed flow field visualization data.
[0004] However, in the process of converting high-precision numerical simulation data into visual images or animations by traditional flow field numerical simulation methods, these data are often unable to be efficiently processed and displayed, resulting in slow response speeds and even crashes. In addition, the grid data also presents a high degree of complexity and diversity, including structured grids, unstructured grids, and Cartesian grids, etc. The diversity and complexity of these grid types pose great challenges to visualization. Summary of the Invention
[0005] The object of the present invention is: to solve the above problems, a fast flow field visualization data loading method is provided, which is expected to improve the problem that the traditional flow field numerical simulation method has low efficiency in processing flow field grid data and slow loading during the conversion of high-precision numerical simulation data into visual images or animations.
[0006] The technical solution adopted by the present invention is as follows: aiming at the problems of slow flow field loading speed and low grid and flow field rendering efficiency, a fast flow field visualization data loading method is proposed by effectively using the processor resources through a multi-threaded method. The method includes the following steps:
[0007] Import the flow field grid data, initialize the flow field grid data, and normalize the flow field grid data;
[0008] Extract the flow field features. According to the properties of each flow field, extract the physical features of the flow field through multi-threaded programming technology, and store the extracted physical features;
[0009] Decouple the graphical user interface from the flow field loading, and separate the data loading and the graphical user interface GUI through multi-threaded programming technology; draw and visualize the grid and the flow field, and visually display the grid data through the VTK system;
[0010] Realize the interaction between the user and the 3D (three-dimensional space) visualization scene through the VTK system;
[0011] Conduct flow field analysis based on the visualization results.
[0012] Further, the initialization of the flow field grid data includes the following steps:
[0013] Read in the flow field grid data to generate control parameters, generate an initial grid according to the control parameters, and establish the connection relationship of the initial grid;
[0014] Input the initial grid into the flow field solving algorithm to generate a data set containing flow field information.
[0015] Further, aiming at the complexity and diversity of the grid data, to ensure that the data between different grids can correspond to each other, the normalization process of the flow field grid data includes: verifying the input flow field grid data, adaptively identifying and analyzing different types of grid data, and unifying the flow field type, the number of nodes, the number of elements, and the key parameter information of the grid boundary in the grid.
[0016] Further, the decoupling of the graphical user interface includes:
[0017] Establish the correspondence between the grid data unit and the geometric primitive;
[0018] Establish a mapping relationship between physical quantities and geometric attributes, where the physical quantities include pressure and temperature, and the geometric attributes include the visual characteristics of geometric primitives;
[0019] According to the mapping relationship, establish a connection relationship for the generated geometric primitives, and convert the geometric primitives into image data through the VTK system.
[0020] The connection relationship not only ensures the logical consistency between the primitives, but also provides the necessary evidence for subsequent drawing and display.
[0021] Furthermore, the conversion of the geometric primitives into image data through the VTK system specifically includes:
[0022] Use the VTK system to read the mesh data into the data structure of the VTK system, and at the same time use multi-threaded programming technology to read different mesh data and store it;
[0023] Generate corresponding geometric primitives according to the mesh data, and the geometric primitives are used to represent the structure and flow field characteristics of the mesh in three-dimensional space;
[0024] Map the geometric primitives to the rendering engine of the VTK system and perform rendering;
[0025] Rendering requires setting rendering parameters such as light sources, cameras, materials, etc., and selecting appropriate visual attributes such as colors and transparencies to represent the physical phenomena and characteristics of the flow field.
[0026] Convert the geometric primitives into image data through the VTK system, and represent the distribution of physical quantities in the flow field through color coding technology, construct a color mapping system, and use different colors to represent different data values.
[0027] It should be noted that for the problems of slow flow field loading speed and low rendering efficiency of the mesh and flow field, a multi-threaded strategy is adopted to more effectively utilize the processor resources. It ensures that even when processing large-scale mesh and flow field mesh data sets, the system can still run smoothly, significantly reducing the dependence on computing resources.
[0028] Second, when loading large-scale mesh and flow field mesh data, phenomena such as lag, blockage, and freezing occur in the user interface. Adopt a multi-threaded strategy to distinguish the graphical user interface (GUI) from the flow field loading, and use the flow field loading process for background tasks, effectively avoiding the lag, blockage, and freezing phenomena of the GUI interface, and further improving the fluency and response speed of the user experience.
[0029] The geometric primitives accurately reflect the numerical characteristics of the flow field for subsequent graphic drawing.
[0030] The VTK system (visualization toolkit) is an existing visualization tool library.
[0031] Furthermore, in the color mapping system, users can adjust color mapping, transparency, and viewing angle parameters through the VTK system.
[0032] Regarding the problem that the visualization flow field switching causes reloading, resulting in low efficiency. The multi-threaded method is used to load different flow fields simultaneously, and the flow field grid data is stored during the loading process, so that there is no need to reload the flow field grid data again when the flow field is switched, greatly improving the user's fluency. At the same time, it supports users to adjust visualization parameters (such as color mapping, transparency, viewing angle, etc.) in real time, allowing users to dynamically track the changes of the flow field, so as to obtain more in-depth and comprehensive insights.
[0033] Furthermore, the interaction between the user and the 3D visualization scene implemented through the VTK system includes:
[0034] The interaction between the user and the 3D visualization scene is carried out through the interaction tools in the VTK system. The functions of the interaction tools include translation, rotation, zoom in, zoom out, and mirroring. At the same time, the grid data is interactively switched, enabling users to switch and view different flow field grid data without reloading the data.
[0035] In view of the poor visualization effect in the traditional flow field visualization process, the powerful graphics rendering and interaction functions provided by the visualization tool library (VTK) are fully utilized. The quality of visualization is greatly improved, not only making the flow field grid data more vivid and intuitive, but also ensuring the friendliness and intuitiveness of the user interface, thus bringing a more fluent and pleasant visualization experience to users.
[0036] Furthermore, the specific flow field analysis according to the visualization results includes: using the visualization results for flow field analysis. If problems are found in the numerical simulation process, record the problems in time and give feedback.
[0037] In summary, due to the adoption of the above technical solutions, the beneficial effects of the present invention are:
[0038] 1. Through the multi-threaded programming method, it is possible to capture and analyze the flow field grid data more quickly and accurately; and it breaks through the limitations of traditional flow field visualization technology, significantly improving the efficiency of flow field grid data processing;
[0039] 2. Utilizing the powerful rendering and interaction capabilities of VTK, it realizes high-definition flow field display and real-time switching of flow field views, bringing a more fluent and immersive visualization experience to users;
[0040] 3. It can easily and quickly switch between different flow field views, enabling a comprehensive control of the flow field without complex operation steps. This not only improves the user's work efficiency but also reduces the usage threshold, providing strong visualization support for fields such as scientific research, engineering design, and numerical simulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 is the flowchart of the method of the present invention;
[0042] Figure 2 is the schematic diagram of the initial Cartesian grid of the embodiment of the present invention;
[0043] Figure 3 is the schematic diagram of the visualization result of different flow field grid data. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0044] The present invention will be described in detail below with reference to the accompanying drawings.
[0045] In order to make the objectives, technical solutions and advantages of the present invention more clear and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0046] As Figure 1 shown, a method for quickly loading visualization data of a flow field, the method includes the following steps:
[0047] Import the flow field grid data, initialize the flow field grid data, and normalize the flow field grid data; the initialization of the flow field grid data includes the following steps:
[0048] Read in the flow field grid data to generate control parameters, generate an initial grid according to the control parameters, and establish the connection relationship of the initial grid;
[0049] Input the initial grid into the flow field solving algorithm to generate a data set containing flow field information.
[0050] The normalization process of the flow field grid data includes: verifying the input flow field grid data, adaptively identifying and analyzing different types of grid data, and unifying the flow field type, the number of nodes, the number of elements, and the key parameter information of the grid boundary in the grid.
[0051] Extract the flow field features, extract the physical features of the flow field through multi-threaded programming technology, and store the extracted physical features;
[0052] Decouple the graphical user interface from the flow field loading, and separate the data loading and the graphical user interface GUI through multi-threaded programming technology; for grid and flow field drawing and visualization, visualize the grid data through the VTK system; for pre-loading and fast switching of flow fields, during the flow field loading process, preprocess and store all the flow field grid data contained in the grid, so that when the user switches the flow field, there is no need to reload; uniformly process different types of grid data, automatically identify and analyze the grid data type, and classify and unify the input flow field grid data.
[0053] The decoupled graphical user interface includes:
[0054] Establish the correspondence between grid data units and geometric primitives;
[0055] Establish the mapping relationship between physical quantities and geometric attributes, where the physical quantities include pressure and temperature, and the geometric attributes include the visual characteristics of geometric primitives;
[0056] According to the mapping relationship, establish the connection relationship for the generated geometric primitives, and convert the geometric primitives into image data through the VTK system.
[0057] The conversion of geometric primitives into image data through the VTK system specifically includes:
[0058] Use the VTK system to read the grid data into the data structure of the VTK system, and at the same time use multi-threaded programming technology to read different grid data and store them;
[0059] Generate corresponding geometric primitives according to the grid data, and the geometric primitives are used to represent the structure and flow field characteristics of the grid in three-dimensional space;
[0060] Map the geometric primitives to the rendering engine of the VTK system and perform rendering;
[0061] Convert the geometric primitives into image data through the VTK system, and represent the distribution of physical quantities in the flow field through color coding technology, construct a color mapping system, and use different colors to represent different data values.
[0062] In the color mapping system, the user can adjust the color mapping, transparency, and viewing angle parameters through the VTK system.
[0063] Realize the interaction between the user and the 3D visualization scene through the VTK system;
[0064] The realization of the interaction between the user and the 3D visualization scene through the VTK system includes:
[0065] The interaction between the user and the 3D visualization scene is carried out through the interaction tools in the VTK system. The functions of the interaction tools include translation, rotation, zooming in, zooming out, and mirroring. At the same time, the mesh data is interactively switched, enabling the user to switch and view different flow field mesh data without reloading the data.
[0066] Perform flow field analysis based on the visualization results. The specific steps of performing flow field analysis based on the visualization results include: using the visualization results for flow field analysis, and if problems are found in the numerical simulation process, record the problems in time and give feedback.
[0067] Embodiment
[0068] As Figure 2 shown, in this embodiment, Cartesian grids are taken as an example, but this method is also applicable to other grids (structured and unstructured grids).
[0069] Step S100, import the initial Cartesian grid and flow field mesh data. The generation process of the initial Cartesian grid and flow field mesh data is as follows: 1) Read in the model geometry data and mesh generation control parameters; 2) Generate an initial uniform grid according to the control parameters, establish the connection relationship of the initial grid cells, and finally generate the initial Cartesian grid data, as Figure 1 ; 3) Input the generated initial Cartesian grid into the flow field solving algorithm, and after a series of complex calculation processes, a data set containing rich flow field information is finally generated.
[0070] Step S200, data normalization. Strictly verify the input geometry data and flow field mesh data to ensure the accuracy and consistency of the data. Any inaccuracy or inconsistency in the data may cause errors in the final results.
[0071] Step S300, flow field feature extraction. Extract different types of representative information (such as force field information such as pressure and velocity) from the normalized flow field mesh data to better understand and analyze the flow structure and behavior.
[0072] Step S400, data mapping and geometric primitive generation. Convert numerical data into intuitive geometric data, that is, construct the geometric representation of the data. This usually involves mapping the flow field mesh data into geometric primitives such as points, lines, and surfaces. Specifically, first, establish the correspondence between Cartesian grid cells and geometric primitives. Each Cartesian grid cell can correspond to a geometric primitive such as a point or a small cube, so as to realize the spatial presentation of numerical data. The size and shape of the Cartesian grid cells can determine the size and shape of the geometric primitives. Second, establish the mapping relationship between physical quantities and geometric attributes, and map physical information such as pressure or temperature into visual features such as the color depth and transparency of geometric primitives, so as to realize the intuitive visualization expression of flow field characteristics.
[0073] Step S500, Grid and Flow Field Plotting and Visualization. Use VTK to visually display the generated Cartesian grid. Convert the geometric primitives corresponding to the Cartesian grid cells into image data to intuitively display the physical phenomena and characteristics of the flow field. The specific steps are as follows:
[0074] 1) First, read the generated Cartesian grid data (such as the coordinates of grid points, connection information of grid cells, etc.) into the data structure of VTK. At the same time, use multi-threaded programming technology to efficiently read different flow field grid data and store them. This usually involves converting the original data format into a format supported by VTK, such as vtkPolyData, vtkDataSet, etc.
[0075] 2) Generate corresponding geometric primitives according to the grid data, such as points, lines, surfaces, etc. These geometric primitives will be used to represent the structure of the grid and the characteristics of the flow field in three-dimensional space.
[0076] 3) Map the geometric primitives to the rendering engine of VTK and perform rendering. Among them, rendering parameters such as light sources, cameras, and materials need to be set, and appropriate visual attributes such as colors and transparencies are selected to represent the physical phenomena and characteristics of the flow field.
[0077] 4) Represent the distribution of physical quantities such as pressure and temperature in the flow field through color coding technology. Different colors can represent different data values, thus constructing a clear and intuitive color mapping system. Through this ingenious correspondence between colors and data values, the subtle differences in various physical characteristics in the flow field are vividly displayed, and the overall situation and local details of the flow field can be accurately captured. As shown in the schematic diagram of the visualization results of different flow field grid data, where U, V, and W represent the velocity fields in the x, y, and z directions respectively, PO represents density, CP represents pressure coefficient, and MACH represents Mach number. Figure 3 As shown in the schematic diagram of the visualization results of different flow field grid data, where U, V, and W represent the velocity fields in the x, y, and z directions respectively, PO represents density, CP represents pressure coefficient, and MACH represents Mach number.
[0078] Step S600, Human-Computer Interaction. Use the interaction tools provided by VTK to implement the interaction functions between the user and the 3D visualization scene (including translation, rotation, zooming in, zooming out, and mirroring, etc.). At the same time, perform interactive switching on the stored Cartesian grid flow field grid data, allowing the user to easily switch and view different flow field grid data without reloading the data.
[0079] Step S700, Result Analysis. Use the visualization results for flow field analysis, such as evaluating the correctness and rationality of numerical calculation methods and insight into the complex physical laws in the flow field. If problems are found in the numerical simulation process, such as data anomalies, algorithm defects, etc., feedback needs to be given in a timely manner. According to the feedback problems, improve and optimize the numerical simulation method and visualization process to improve accuracy and efficiency.
[0080] Based on a three-dimensional Cartesian grid and the Visualization Toolkit (VTK), a fast method for loading flow field visualization data is proposed. By extracting the features of the input Cartesian grid and the physical characteristics of the flow field, corresponding geometric primitives are generated. VTK is used to map the generated primitives onto the three-dimensional Cartesian grid. This process involves the geometric transformation and color coding techniques of VTK to ensure that the physical properties of the flow field (such as velocity, pressure, temperature, etc.) can be accurately represented in three-dimensional space. Through dynamic mapping, the distribution and changes of the flow field grid data on the grid can be observed in real time. Using multi-threading technology, the physical characteristics of the flow field are extracted and stored, and real-time switching is achieved through the interactive technology of VTK, realizing the fast, accurate, and intuitive visualization of the flow field grid data.
[0081] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims
1. A method for quickly loading flow field visualization data, characterized in that, The method includes the following steps: Import the flow field grid data, initialize the flow field grid data, and normalize the flow field grid data; Extract the flow field features, extract the physical features of the flow field through multi-threaded programming technology, and store the extracted physical features; Decouple the graphical user interface from the flow field loading, separate the data loading and the graphical user interface GUI through multi-threaded programming technology; draw and visualize the grid and the flow field, and visually display the grid data through the VTK system; the decoupled graphical user interface includes: Establish the correspondence between the grid data unit and the geometric primitive; Establish the mapping relationship between the physical quantity and the geometric attribute, where the physical quantity includes pressure and temperature, and the geometric attribute includes the visual features of the geometric primitive; According to the mapping relationship, establish the connection relationship for the generated geometric primitives, and convert the geometric primitives into image data through the VTK system; The conversion of the geometric primitive into image data through the VTK system specifically includes: Use the VTK system to read the grid data into the data structure of the VTK system, and at the same time use multi-threaded programming technology to read different grid data and store them; Generate corresponding geometric primitives according to the grid data, and the geometric primitives are used to represent the structure and flow field features of the grid in three-dimensional space; Map the geometric primitives to the rendering engine of the VTK system and perform rendering; Convert the geometric primitives into image data through the VTK system, and represent the distribution of physical quantities in the flow field through color coding technology, construct a color mapping system, and use different colors to represent different data values; Realize the interaction between the user and the 3D visualization scene through the VTK system; Conduct flow field analysis according to the visualization results.
2. The fast flow field visualization data loading method according to claim 1, wherein, Initializing the flow field grid data includes the following steps: Read in the flow field grid data to generate control parameters, generate the initial grid according to the control parameters, and establish the connection relationship of the initial grid; Input the initial grid into the flow field solving algorithm to generate a data set containing flow field information.
3. A fast flow field visualization data loading method according to claim 1, characterized in that, The normalization process of the flow field grid data includes: verifying the input flow field grid data, adaptively identifying and analyzing different types of grid data, and unifying the flow field type, the number of nodes, the number of elements, and the key parameter information of the grid boundary in the grid.
4. A method for quickly loading visualization data of a flow field according to claim 1, characterized in that, In the color mapping system, the user can adjust the color mapping, transparency, and viewing angle parameters through the VTK system.
5. A method for quickly loading visualization data of a flow field according to claim 1, characterized in that The realization of the interaction between the user and the 3D visualization scene through the VTK system includes: Conduct the interaction between the user and the 3D visualization scene through the interaction tools in the VTK system, and the functions of the interaction tools include translation, rotation, zoom in, zoom out, and mirroring. At the same time, the grid data is interactively switched, enabling the user to switch and view different flow field grid data without reloading the data.
6. A method for quickly loading visualization data of a flow field according to claim 1, characterized in that, The specific flow field analysis according to the visualization results includes: using the visualization results for flow field analysis, and if problems are found in the numerical simulation process, record the problems in time and give feedback.
Citation Information
Patent Citations
Streamline visualization parallel acceleration method based on process parallelism
CN115344383A
Unsteady flow field data processing method and device, electronic equipment and storage medium
CN116629162A