A method, device, equipment and storage medium for generating streamlines on aircraft surface

Through the ray method and triangular mesh division technology, the problem of inaccurate flow lines generated on the surface of the unstructured hybrid mesh is solved, and the accurate generation of flow lines on complex mesh is achieved, which improves the accuracy and compatibility of data observation.

CN119227244BActive Publication Date: 2025-02-28CALCULATION AERODYNAMICS INST CHINA AERODYNAMICS RES & DEV CENT
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411731970.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-02-28
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

The prior art has problems of inaccurate position and does not support complex grid styles when generating unstructured hybrid grid surface streamlines, which limits users' accurate observation of multiple types of data.

Method used

The current starting point of the flow line on the aircraft surface is determined by the ray method, and the non-structural mesh is divided into triangular mesh. The position of the new starting point is calculated by plane coordinate mapping and the second-order Longgekuta method, and the integral operation is iterated to generate the final flow line.

Benefits of technology

It realizes accurate generation of streamlines on complex unstructured hybrid mesh surfaces, improves the accuracy and compatibility of data observations, and can handle multiple data formats.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and storage medium for generating streamlines on the surface of an aircraft, and relates to the technical field of flow field visualization, including: determining the current starting point of the streamlines on the surface of the aircraft, dividing the unstructured grid corresponding to the surface of the aircraft to obtain a number of triangular grids; performing plane coordinate mapping on the three-dimensional coordinates of the current starting point based on the triangular grid to obtain plane coordinates, and calculating the position coordinates of the new starting point according to the plane coordinates; determining the target streamline segment through the plane coordinates and the position coordinates, judging the relative position of the target streamline segment and the target triangular grid, and determining the relative position relationship between the new starting point and the target triangular grid according to the judgment result; performing iterative integration operation according to the relative position relationship and the position coordinates of the new starting point, determining all integral points through iterative integration operation, and connecting all integral points to obtain the final streamlines on the surface of the aircraft. The present application realizes the accurate generation of streamlines on the surface of unstructured grids.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of flow field visualization, and in particular to a method, device, equipment and storage medium for generating streamlines on the surface of an aircraft. Background Art

[0002] Scientific visualization is an interdisciplinary and comprehensive scientific research field. Its main application objects are meteorology, medicine, architecture and other disciplines that need to integrate and display abstract data. Its research focuses on the realistic rendering and display of points, lines and surfaces. In some special cases, it also requires dynamic display of data. Scientific visualization itself is not the ultimate goal of scientific research, but an auxiliary tool for many scientific researches. It helps researchers to intuitively understand data features through the operation of data models, intuitively represent abstract data, and assist researchers in completing the processing and analysis of massive data for numerical calculations.

[0003] Flow field visualization is an important branch of scientific computing visualization. It mainly converts the simulation results of computational fluid dynamics into graphics and images to help researchers understand the data and facilitate their analysis of the calculation results. Streamline, as a commonly used flow field visualization method, is widely used in engineering practice because it can intuitively reveal the direction of the flow field. The streamlines generated on the surface of objects such as airplanes and trains are called surface streamlines. They can intuitively show the flow of fluid on the surface of objects such as airplanes and trains, which is of great significance to the design and improvement of the aerodynamic performance of objects.

[0004] Surface streamlines are concerned with the movement of fluid on the surface of an object. They are streamlines drawn on a two-dimensional surface in three-dimensional space. Compared with streamline drawing in three-dimensional space, unstructured grid data faces the challenges of complex data shape surfaces and diverse grid forms, making the drawing of surface streamlines more cumbersome and complex. Current methods have problems such as inaccurate surface streamline generation positions for some unstructured grid type data, and some complex grid styles do not support the generation of surface streamlines, which restricts users from accurately observing various types of data. Therefore, how to accurately generate streamlines on complex unstructured hybrid grid surfaces is an urgent problem to be solved. Summary of the invention

[0005] In view of this, the purpose of the present invention is to provide a method, device, equipment and storage medium for generating streamlines on the surface of an aircraft, which can accurately draw and generate streamlines that are close to the surface of an unstructured hybrid grid. The specific scheme is as follows:

[0006] In a first aspect, the present application discloses a method for generating streamlines on an aircraft surface, comprising:

[0007] Determine the current starting point of the streamline on the aircraft surface based on the ray method, and divide the grid cells of various shapes of the unstructured grid corresponding to the aircraft surface to obtain a plurality of triangular grids;

[0008] Performing plane coordinate mapping on the three-dimensional coordinates of the current starting point based on the triangular mesh to obtain the plane coordinates corresponding to the current starting point, and calculating the position coordinates of a new starting point based on the plane coordinates of the current starting point based on the second-order Runge-Kutta method;

[0009] Determine a target streamline segment by using the plane coordinates and the position coordinates, judge the relative position of the target streamline segment and the target triangular mesh corresponding to the target streamline segment, and determine the relative position relationship between the new starting point and the target triangular mesh according to the corresponding judgment result;

[0010] A corresponding iterative integration operation is performed according to the relative position relationship and the position coordinates of the new starting point, all integration points are determined through the iterative integration operation, and all the integration points are sequentially connected to obtain the final aircraft surface streamlines.

[0011] Optionally, the determining the current starting point of the aircraft surface streamline based on the ray method includes:

[0012] A ray perpendicular to the screen is emitted to the three-dimensional scene corresponding to the aircraft through the screen coordinates, and the object intersection point hit by the corresponding return ray for the first time is determined as the current starting point of the streamline on the surface of the aircraft.

[0013] Optionally, after emitting a ray perpendicular to the screen to the three-dimensional scene corresponding to the aircraft through the screen coordinates, the method further includes:

[0014] If the return ray does not hit the object, the operation of generating the streamline on the surface of the aircraft is directly terminated.

[0015] Optionally, the grid units of various shapes of the unstructured grid corresponding to the aircraft surface are divided to obtain a plurality of triangular grids, including:

[0016] Performing geometric body surface extraction preprocessing on mesh units of various shapes of the unstructured mesh corresponding to the aircraft surface, or converting each face of each geometric body into a polygon to obtain a corresponding polygonal mesh;

[0017] Sequentially numbering each vertex of the polygonal mesh to determine the sequence number of each vertex;

[0018] The target vertex of the polygonal mesh is determined, and the polygonal mesh is divided based on the target vertex and the sequence number of each vertex to obtain a plurality of triangular meshes.

[0019] Optionally, performing plane coordinate mapping on the three-dimensional coordinates of the current starting point based on the triangular mesh to obtain the plane coordinates corresponding to the current starting point includes:

[0020] Determine a plane rectangular coordinate system based on a three-dimensional coordinate system corresponding to the triangular mesh and an edge of the triangular mesh, and determine a rotation matrix of the mapping based on a unit vector of the plane rectangular coordinate system;

[0021] Determine a transformation matrix between the three-dimensional coordinates of three vertices corresponding to the triangular mesh and the plane coordinates according to the rotation matrix;

[0022] The three-dimensional coordinates of the current starting point are mapped to plane coordinates based on the transformation matrix to obtain the plane coordinates of the current starting point.

[0023] Optionally, judging the relative position of the target streamline segment and a target triangular mesh corresponding to the target streamline segment, and determining the relative position relationship between the new starting point and the target triangular mesh according to the corresponding judgment result, comprises:

[0024] The collinearity between the target streamline segment and the target triangular mesh is excluded by using a rapid exclusion test method, and after the collinearity is excluded, a straddle test method is used to calculate whether the target streamline segment intersects with each mesh edge of the target triangular mesh, and the number of intersections between the target streamline segment and the target triangular mesh is determined according to the corresponding calculation results;

[0025] The relative position relationship between the new starting point and the target triangular mesh is determined according to the number of intersection points.

[0026] Optionally, performing a corresponding iterative integration operation according to the relative position relationship and the position coordinates of the new starting point includes:

[0027] If the new starting point is within the target triangular mesh, the position coordinates of the new starting point are mapped to corresponding three-dimensional coordinates, the new starting point is determined as the current starting point, and the process is jumped again to the step of performing plane coordinate mapping on the three-dimensional coordinates of the current starting point based on the triangular mesh until a preset integral termination condition is met; the preset integral termination condition includes any one or a combination of the number of integral steps being equal to a preset step threshold, the vector velocity of the current starting point being equal to zero, the new starting point being beyond the data boundary and having no adjacent meshes, the number of integrals within the same triangular mesh exceeding a preset value, point coordinate transformation failure, and failure to find adjacent meshes;

[0028] If the new starting point is not within the target triangular mesh, the coordinates of the intersection of the target streamline segment and the target triangular mesh are calculated using the position coordinates of the new starting point and the plane coordinates corresponding to the current starting point, and the coordinates are mapped to corresponding three-dimensional coordinates. The intersection is determined as the current starting point, and the process jumps again to the step of performing plane coordinate mapping of the three-dimensional coordinates of the current starting point based on the triangular mesh until the preset integration termination condition is met.

[0029] In a second aspect, the present application discloses a device for generating streamlines on the surface of an aircraft, comprising:

[0030] A meshing module is used to determine the current starting point of the streamline on the aircraft surface based on the ray method, and to divide the mesh units of various shapes of the unstructured mesh corresponding to the aircraft surface to obtain a plurality of triangular meshes;

[0031] A position coordinate calculation module, used for performing plane coordinate mapping on the three-dimensional coordinates of the current starting point based on the triangular mesh to obtain the plane coordinates corresponding to the current starting point, and calculating the position coordinates of a new starting point based on the plane coordinates of the current starting point based on the second-order Runge-Kutta method;

[0032] A relative position determination module, used for determining a target streamline segment by using the plane coordinates and the position coordinates, determining a relative position between the target streamline segment and a target triangular mesh corresponding to the target streamline segment, and determining a relative position relationship between the new starting point and the target triangular mesh according to a corresponding determination result;

[0033] The streamline generation module is used to perform corresponding iterative integration operations according to the relative position relationship and the position coordinates of the new starting point, determine all integration points through the iterative integration operation, and connect all the integration points in sequence to obtain the final aircraft surface streamlines.

[0034] In a third aspect, the present application discloses an electronic device, comprising:

[0035] Memory, used to store computer programs;

[0036] A processor is used to execute the computer program to implement the aforementioned aircraft surface streamline generation method.

[0037] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned method for generating aircraft surface streamlines.

[0038] When generating streamlines on the surface of an aircraft, the present application first determines the current starting point of the streamline on the surface of the aircraft based on the ray method, divides the mesh units of various shapes of the unstructured mesh corresponding to the surface of the aircraft to obtain a number of triangular meshes; based on the triangular mesh, the three-dimensional coordinates of the current starting point are mapped to plane coordinates to obtain the plane coordinates corresponding to the current starting point, and the position coordinates of the new starting point are calculated based on the second-order Runge-Kutta method according to the plane coordinates of the current starting point; then the target streamline segment is determined by the plane coordinates and the position coordinates, the relative position of the target streamline segment and the target triangular mesh corresponding to the target streamline segment is judged, and the relative position relationship between the new starting point and the target triangular mesh is determined according to the corresponding judgment result; finally, the corresponding iterative integration operation is performed according to the relative position relationship and the position coordinates of the new starting point, all the integral points are determined by the iterative integration operation, and all the integral points are sequentially connected to obtain the final streamline on the surface of the aircraft. It can be seen that the present application unifies the complex and diverse mesh styles of the unstructured mesh into triangular meshes, so that the present application can process various types of unstructured mesh data, and is also compatible with structured meshes at the same time, has better compatibility, and can process more data formats. The coordinates of the spatial points are mapped from the 3D world coordinate system of the 3D grid to the plane rectangular coordinate system, and the streamline integration is performed in the plane rectangular coordinate system so that the generated streamlines can always remain attached to the surface of the object. And by judging the relative position of the streamline integration point and the triangular grid, the correct direction and accurate positioning of the streamline cross-grid integration are guaranteed, and then the streamlines can be accurately generated on the complex unstructured hybrid grid surface, and vector visualization can be achieved, helping users observe and analyze the flow field motion of the complex configuration surface. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0040] Figure 1 A flow chart of a method for generating streamlines on the surface of an aircraft disclosed in this application;

[0041] Figure 2 A schematic diagram of a mesh triangulation process disclosed in this application;

[0042] Figure 3 A coordinate mapping schematic diagram disclosed in this application;

[0043] Figure 4 A schematic diagram of a line segment intersection method based on mesh edges disclosed in this application;

[0044] Figure 5 This is a schematic structural diagram of a device for generating streamlines on the surface of an aircraft disclosed in the present application;

[0045] Figure 6 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] The current surface streamline generation method has the problem that the surface streamline generation position of some unstructured grid type data is inaccurate, and some complex grid styles do not support the generation of surface streamlines, which restricts users from accurately observing various types of data. In order to solve the above technical problems, the application discloses a method for generating aircraft surface streamlines, which can accurately draw and generate streamlines that are close to the surface of unstructured hybrid grids.

[0048] See also Figure 1 As shown, an embodiment of the present invention discloses a method for generating streamlines on the surface of an aircraft, comprising:

[0049] Step S11: determine the current starting point of the streamline on the aircraft surface based on the ray method, and divide the grid units of various shapes of the unstructured grid corresponding to the aircraft surface to obtain a plurality of triangular grids.

[0050] Streamlines are a common method for flow field visualization. They are used to describe the trajectory of particles flowing under the current flow field state. They can better reveal the direction of the vector field and are the basis for realizing stream strips, flow tubes, flow surfaces and particle animations, as well as the basis for flow field analysis. They have been widely used in engineering practice, for example, in analyzing the changes in typhoons and ocean currents through streamlines. Visualizing surface streamlines can not only clearly observe atmospheric motion, local gas flow on cars and aircraft, but also observe liquid flow in reactors and internal combustion engines, thereby helping researchers optimize the appearance of objects such as cars, airplanes and air intakes, greatly promoting the development of fields such as aviation science.

[0051] In this embodiment, the starting point of the streamline is the position where a section of the streamline begins, and the surface streamline is strictly attached to the surface of the object, so the starting point needs to be guaranteed to be on the surface of the object. The present application emits a ray perpendicular to the screen to the three-dimensional scene corresponding to the aircraft through the screen coordinates, and determines the object intersection point where the corresponding return ray first hits as the current starting point of the surface streamline of the aircraft. In detail, the two-dimensional screen coordinates are determined by manually inputting coordinate information or clicking the mouse, and the two-dimensional screen coordinates are used as input coordinates. A ray perpendicular to the screen is emitted to the three-dimensional scene through the screen coordinates, and the three-dimensional coordinates of the object intersection point P where the return ray first hits are returned. Point P is the starting point of the streamline, usually referred to as a seed point. In addition, if the return ray does not hit any object, it is deemed that the starting point coordinate picking has failed, and the streamline generation is terminated. It should be noted that the surface streamline generation of the present application is not limited to the surface streamlines of aircraft, but can also be the surface streamlines of corresponding three-dimensional unstructured grids such as trains, cars, and high-speed railways.

[0052] After determining the current starting point of the streamline on the aircraft surface, since the grid type of the unstructured grid data can contain various types of shapes at the same time, there is no fixed association between the data grids. Compared with the structured grid, it is more free, detailed and flexible in data expression, but it also requires more complex and large storage to represent the connection relationship between the grids. Therefore, the present application searches for the grid number CellID where the starting point is located through the storage relationship of the unstructured grid, so as to facilitate the subsequent use of CellID to find the adjacent grid information after the streamline crosses the grid. In addition, the unstructured grid is usually composed of a plurality of data blocks, each of which has its own grid information. In order to represent the uniqueness of the grid, it is also necessary to find the data block number BlockID where the grid is located, so as to facilitate the subsequent use of BlockID to find the information of the adjacent data block after the streamline crosses the data block. And since the unstructured grid may contain grids of various shapes at the same time, such as polygons such as triangles and quadrilaterals or geometric bodies such as tetrahedrons and hexahedrons, the present application adopts a unified triangulation method for processing. The mesh units of various shapes of the unstructured mesh corresponding to the aircraft surface are preprocessed for geometric body surface extraction, or each face of each geometric body is converted into a polygon to obtain the corresponding polygonal mesh; the vertices of the polygonal mesh are numbered sequentially to determine the sequence number of each vertex; the target vertices of the polygonal mesh are determined, and the polygonal mesh is divided based on the target vertices and the sequence numbers of each vertex to obtain a number of triangular meshes. Specifically, for the geometric body, the geometric body surface extraction preprocessing is first performed, or each face of each geometric body is processed separately to convert it into a polygon. Taking the heptagonal mesh as an example, if Figure 2As shown in the figure, according to the data storage style of the unstructured grid, the serial numbers of all grid vertices are numbered in clockwise or counterclockwise direction. Each vertex P has a unique serial number PointID, which can be obtained from the storage relationship of the unstructured grid. According to PointID, all key information of the current vertex can be found, such as vector information such as coordinate position and speed. Take vertex P1 as one of the vertices of the triangle, and select vertex P in order. N and vertex P N+1 The smallest triangular mesh unit is formed. Repeating this process, the N-sided mesh can be divided into N-2 triangles, achieving unified triangulation of any polygon. Since the actual number of meshes increases after division, it is necessary to introduce SubCellID to uniquely identify the current triangular mesh, that is, Figure 2 The numbers ①, ②, ③, etc. are used to mark the mesh units. So far, the division of mesh units of various shapes has been completed, and several triangular meshes have been obtained.

[0053] Step S12: performing plane coordinate mapping on the three-dimensional coordinates of the current starting point based on the triangular mesh to obtain the plane coordinates corresponding to the current starting point, and calculating the position coordinates of the new starting point based on the second-order Runge-Kutta method according to the plane coordinates of the current starting point.

[0054] In this embodiment, the present application performs plane coordinate mapping on the three-dimensional coordinates of the current starting point. First, it is necessary to determine the plane rectangular coordinate system based on the three-dimensional coordinate system corresponding to the triangular mesh and the edges of the triangular mesh, and determine the mapping rotation matrix based on the unit vector of the plane rectangular coordinate system; determine the transformation matrix between the three-dimensional coordinates of the three vertices corresponding to the triangular mesh and the plane coordinates according to the rotation matrix; and perform plane coordinate mapping on the three-dimensional coordinates of the current starting point based on the transformation matrix to obtain the plane coordinates of the current starting point. The specific mapping is as follows: Figure 3 As shown, the three-dimensional coordinate system O—XYZ is converted into a plane rectangular coordinate system O'—X' Y' Z' with the triangle vertex A as point O. Let the three vertices of the triangle mesh be A, B, and C in the O—XYZ coordinate system, and the coordinates of the three vertices be (x i ,y i , z i ), and the velocity vector V at the vertex i is i , v i , w i ), after mapping, the coordinate system of O'-X' Y' Z' is A', B', C', and the coordinates of the three vertices are (x i ',y i ', z i '), the velocity vector V at the vertex i ' is (u i ',v i ',w i'). It is stipulated that the axis OX is in the same direction as AB, the axis ON is the normal vector of the triangle, and the axis OY is the result of the cross product of OX and ON. The unit vector of the O'—X' Y' Z' coordinate system is , , The rotation matrix of the projection , then according to , so we can get the transformation matrix that maps O—XYZ to O'—X' Y' Z' . By the transformation matrix M, any point after mapping . Then by , we can calculate the intermediate coefficient abc= ; In this way, we can get the coefficients a, b, c, and then use The velocity vector at any point in the triangular mesh unit can be fitted and calculated, where x, y are the coordinates of the point in O'-X' Y' Z'. According to the above method, the mapping of the coordinates of any point in the grid and the velocity vector can be completed to achieve the purpose of coordinate transformation. In this way, the plane coordinates corresponding to the current starting point can be obtained. It should be pointed out that the mapping of the three-dimensional coordinate system to the two-dimensional plane rectangular coordinate system is not limited to the above method, and the Jacobian matrix mapping method can also be used for conversion. The method of using coordinate mapping to project the space to the plane to calculate the streamline can not only ensure that the streamline is on the object surface, but also reduce the intermediate calculation amount and improve the calculation efficiency compared to directly solving in the three-dimensional coordinate system.

[0055] After determining the plane coordinates of the current starting point, that is, after determining the starting point O of the single integration, the coordinates of the next integration point P are calculated using the second-order Runge-Kutta integration.

[0056] Step S13, determining a target streamline segment by using the plane coordinates and the position coordinates, judging the relative position of the target streamline segment and the target triangular mesh corresponding to the target streamline segment, and determining the relative position relationship between the new starting point and the target triangular mesh according to the corresponding judgment result.

[0057] In this embodiment, two points OP are connected to obtain a streamline, that is, the target streamline segment is determined by plane coordinates and position coordinates. The relative position of the new streamline and the current triangular mesh is judged by the line segment intersection method based on the mesh edge. The present application uses a fast exclusion test method to exclude the collinearity of the target streamline segment and the target triangular mesh. After the collinearity is excluded, the straddle test method is used to calculate whether the target streamline segment intersects with each mesh edge of the target triangular mesh, and the number of intersections between the target streamline segment and the target triangular mesh is determined according to the corresponding calculation results; the relative position relationship between the new starting point and the target triangular mesh is determined according to the number of intersections. The number of intersections between the new streamline and the three mesh edges of the triangular mesh is calculated respectively. First, the classic fast exclusion test method is used to exclude the collinearity, and then the classic straddle test method is used to calculate whether the streamline intersects with each mesh edge. When it is confirmed that the streamline intersects with a certain mesh edge, the specific coordinates of the intersection are obtained by combining the expression equations of the streamline OP and the mesh edge. The number of intersections is counted after the intersection with each mesh edge is calculated. Then determine the relationship between the intersection point and the grid position and handle the following situations: Figure 4 As shown, the new integration point P is located in the grid as P A , located at the mesh vertex is P B , located outside the grid is P C , so if the number of intersections is 0: by calculating , if e1, e2, e3 are all greater than 0, then P A The point is inside the triangle mesh. In this case, point O is inside the triangle mesh and there is no intersection point Q. If the number of intersection points is 1: P C Point is outside the triangle mesh, point O is inside the triangle mesh, and the intersection point Q is on the edge of the triangle mesh. If the number of intersection points is 2: P B The point is on the vertex of the triangle mesh, and the intersection point Q is P. B Point. Thus, the relative position relationship between the new starting point and the target triangular mesh is determined, thereby ensuring the correct direction and accurate positioning of the streamline cross-mesh integration. In addition, other methods can be used to determine the position relationship between the point and the triangular mesh, such as the distance angle method between the point and the edge, the difference multiplication method, etc.

[0058] Step S14, performing corresponding iterative integration operations according to the relative position relationship and the position coordinates of the new starting point, determining all integration points through the iterative integration operations, and sequentially connecting all the integration points to obtain final aircraft surface streamlines.

[0059] In this embodiment, after the relative position relationship between the new starting point and the target triangular mesh is determined, a corresponding iterative integration operation is performed according to the relative position relationship and the position coordinates of the new starting point. In this process, if the new starting point is within the target triangular mesh, the position coordinates of the new starting point are mapped to corresponding three-dimensional coordinates, the new starting point is determined as the current starting point, and the process is re-jumped to the step of performing plane coordinate mapping on the three-dimensional coordinates of the current starting point based on the triangular mesh until a preset integration termination condition is met; the preset integration termination condition includes any one or a combination of the following: the number of integration steps is equal to a preset step threshold, the vector velocity of the current starting point is equal to zero, the new starting point exceeds the data boundary and has no adjacent meshes, the number of integrations within the same triangular mesh exceeds a preset value, the point coordinate transformation fails, and the search for adjacent meshes fails; if the new starting point is not within the target triangular mesh, the coordinates of the intersection of the target streamline segment and the target triangular mesh are calculated using the position coordinates of the new starting point and the plane coordinates corresponding to the current starting point, and the coordinates are mapped to corresponding three-dimensional coordinates, the intersection is determined as the current starting point, and the process is re-jumped to the step of performing plane coordinate mapping on the three-dimensional coordinates of the current starting point based on the triangular mesh until the preset integration termination condition is met. Finally, all the integration points in the iterative process are connected in sequence to obtain a surface streamline generated by the starting seed point.

[0060] In summary, when generating streamlines on the aircraft surface, the present application first determines the current starting point of the aircraft surface streamline based on the ray method, divides the grid units of various shapes of the unstructured grid corresponding to the aircraft surface to obtain a number of triangular grids; based on the triangular grid, performs plane coordinate mapping on the three-dimensional coordinates of the current starting point to obtain the plane coordinates corresponding to the current starting point, and calculates the position coordinates of the new starting point based on the second-order Runge-Kutta method according to the plane coordinates of the current starting point; then determines the target streamline segment through the plane coordinates and the position coordinates, judges the relative position of the target streamline segment and the target triangular grid corresponding to the target streamline segment, and determines the relative position relationship between the new starting point and the target triangular grid according to the corresponding judgment result; finally, performs a corresponding iterative integration operation according to the relative position relationship and the position coordinates of the new starting point, determines all the integral points through the iterative integration operation, and sequentially connects all the integral points to obtain the final aircraft surface streamlines. It can be seen that this application unifies the complex and diverse grid styles of unstructured grids into triangular grids, so that this application can process various types of unstructured grid data, and is also compatible with structured grids, has better compatibility, and can process more data formats. The coordinates of the spatial point are mapped from the three-dimensional world coordinate system of the three-dimensional grid to the plane rectangular coordinate system, and streamline integration is performed in the plane rectangular coordinate system so that the generated streamlines can always remain attached to the surface of the object. And by judging the relative position of the streamline integration point and the triangular grid, the correct direction and accurate positioning of the streamline cross-grid integration are guaranteed, so that streamlines can be accurately generated on the complex unstructured hybrid grid surface, and vector visualization can be achieved, helping users observe and analyze the flow field motion on the surface of complex configurations.

[0061] Based on the previous embodiment, it can be seen that after obtaining the relative position relationship between the new starting point and the target triangle mesh, the application will perform corresponding iterative integration operations according to the relative position relationship and the position coordinates of the new starting point. Next, the iterative integration operations under different relative position relationships will be described in detail.

[0062] If the new starting point P is within the triangular mesh, based on the previous embodiment, it can be seen that the new integral point P is located within the mesh. A Therefore, with the current grid as the range, P AThe point is used as the starting point of the integration for the next iterative integration, that is, the position coordinates of the new starting point are mapped to the corresponding three-dimensional coordinates, the new starting point is determined as the current starting point, and the step of performing plane coordinate mapping on the three-dimensional coordinates of the current starting point based on the triangular mesh is re-judged until the preset integration termination condition is met. It should be noted that before the next mesh is iteratively integrated, the judgment conditions for the possible termination of the streamline integration (the preset integration termination condition) include but are not limited to the number of integration steps reaching the input value, the vector velocity of the current integration point is 0, the next integration point exceeds the data boundary, there is no adjacent mesh, the number of integrations in the same mesh exceeds the preset upper limit, the point coordinate transformation fails, and the search for adjacent meshes fails. As long as any of the above situations occurs, the streamline integration operation will be terminated immediately.

[0063] In addition, if the new starting point P is not in the triangle mesh: transform the calculated coordinates of the intersection point Q back to the 3D world coordinates and save all its information. Since the intersection point Q must be on a certain mesh edge, the distance between Q and the two end points of the mesh edge can also be calculated respectively, and the coordinates of the intersection point Q are calculated according to the distance weight. Assume that the endpoints of the mesh edge are A(X A , Y A , Z A ) and B(X B , Y B , Z B ), calculate the distance between the intersection point Q and AB respectively Dis QA and Dis QB , then the three-dimensional world coordinates of Q (X Q , Y Q , Z Q )= After that, record point Q as a point on the streamline, and search for the adjacent grid based on the grid edge where point Q is located. If the current data block contains the grid edge, the current grid number is CellID, and the grid number set containing A and B is searched through the vertex PointID as S. A , S B , then the adjacent grid .by The grid is the range, and point Q is the starting point for the next iteration of integration. If the grid edge endpoint contains Figure 2 As shown in P1, point P is still within the CellID grid, and SubCellID is searched and updated as the range, with point Q as the starting point of integration for the next iterative integration, that is, the intersection is determined as the current starting point, and the step of performing plane coordinate mapping of the three-dimensional coordinates of the current starting point based on the triangular mesh is jumped again until the preset integration termination condition is met.

[0064] If the current data block does not contain the grid edge, it is necessary to retrieve all data blocks according to the data block number BlockID where the grid is located, search for all data blocks containing point Q according to the world coordinates of point Q, find the adjacent data block containing point Q after eliminating the current data block, and re-search for BlockID2 and CellID2 related to the starting point of integration, use BlockID2 as the current data block number, the CellID2 grid as the range, and point Q as the starting point of integration for the next iterative integration. That is, the intersection is determined as the current starting point, and jumps back to the step of performing plane coordinate mapping of the three-dimensional coordinates of the current starting point based on the triangular grid until the preset integration termination condition is met. If no adjacent data blocks are found, it is deemed that the search for adjacent grids has failed.

[0065] In this way, the present application maps and transforms between the overall three-dimensional world coordinates and the local two-dimensional calculation coordinates of the triangular mesh, ensuring that the surface streamlines are strictly attached to the surface of the object during the calculation process. At the same time, in the logic of the end judgment of the numerical integration, the end condition of the numerical integration is set to reduce the number of meaningless calculations and improve the calculation speed.

[0066] See also Figure 5 As shown, an embodiment of the present invention discloses a device for generating streamlines on the surface of an aircraft, comprising:

[0067] A meshing module 11 is used to determine the current starting point of the streamline on the aircraft surface based on the ray method, and to divide the mesh units of various shapes of the unstructured mesh corresponding to the aircraft surface to obtain a plurality of triangular meshes;

[0068] A position coordinate calculation module 12 is used to perform plane coordinate mapping on the three-dimensional coordinates of the current starting point based on the triangular mesh to obtain the plane coordinates corresponding to the current starting point, and calculate the position coordinates of a new starting point based on the plane coordinates of the current starting point based on the second-order Runge-Kutta method;

[0069] A relative position determination module 13 is used to determine a target streamline segment by using the plane coordinates and the position coordinates, determine the relative position of the target streamline segment and the target triangular mesh corresponding to the target streamline segment, and determine the relative position relationship between the new starting point and the target triangular mesh according to the corresponding determination result;

[0070] The streamline generation module 14 is used to perform corresponding iterative integration operations according to the relative position relationship and the position coordinates of the new starting point, determine all integration points through the iterative integration operations, and sequentially connect all the integration points to obtain the final aircraft surface streamlines.

[0071] It can be seen that this application unifies the complex and diverse grid styles of unstructured grids into triangular grids, so that this application can process various types of unstructured grid data, and is also compatible with structured grids, has better compatibility, and can process more data formats. The coordinates of the spatial point are mapped from the three-dimensional world coordinate system of the three-dimensional grid to the plane rectangular coordinate system, and streamline integration is performed in the plane rectangular coordinate system so that the generated streamlines can always remain attached to the surface of the object. And by judging the relative position of the streamline integration point and the triangular grid, the correct direction and accurate positioning of the streamline cross-grid integration are guaranteed, so that streamlines can be accurately generated on the complex unstructured hybrid grid surface, and vector visualization can be achieved, helping users observe and analyze the flow field motion on the surface of complex configurations.

[0072] In some specific embodiments, the grid division module 11 may specifically include:

[0073] The current starting point determination unit is used to emit a ray perpendicular to the screen to the three-dimensional scene corresponding to the aircraft through the screen coordinates, and determine the object intersection point first hit by the corresponding return ray as the current starting point of the streamline on the aircraft surface.

[0074] In some specific embodiments, the device may further include:

[0075] The termination module is used to directly terminate the generation operation of the aircraft surface streamline if the return ray does not hit the object.

[0076] In some specific embodiments, the grid division module 11 may specifically include:

[0077] A geometric body conversion unit, used for performing geometric body surface extraction preprocessing on mesh units of various shapes of the unstructured mesh corresponding to the aircraft surface, or converting each face of each geometric body into a polygon to obtain a corresponding polygonal mesh;

[0078] A vertex numbering unit, used for sequentially numbering each vertex of the polygonal mesh to determine the sequence number of each vertex;

[0079] The mesh division unit is used to determine the target vertex of the polygonal mesh, and divide the polygonal mesh based on the target vertex and the sequence number of each vertex to obtain a plurality of triangular meshes.

[0080] In some specific embodiments, the position coordinate calculation module 12 may specifically include:

[0081] A rotation matrix determining unit, used to determine a plane rectangular coordinate system based on a three-dimensional coordinate system corresponding to the triangular mesh and an edge of the triangular mesh, and to determine a mapped rotation matrix based on a unit vector of the plane rectangular coordinate system;

[0082] A transformation matrix determining unit, used to determine a transformation matrix between the three-dimensional coordinates of three vertices corresponding to the triangular mesh and the plane coordinates according to the rotation matrix;

[0083] The plane coordinate acquisition unit is used to perform plane coordinate mapping on the three-dimensional coordinates of the current starting point based on the transformation matrix to obtain the plane coordinates of the current starting point.

[0084] In some specific embodiments, the relative position determination module 13 may specifically include:

[0085] an intersection number determination unit, for eliminating the collinearity between the target streamline segment and the target triangular mesh by using a rapid exclusion test method, and after eliminating the collinearity, calculating whether the target streamline segment intersects with each mesh edge of the target triangular mesh by using a straddle test method, and determining the number of intersections between the target streamline segment and the target triangular mesh according to the corresponding calculation results;

[0086] A relative position relationship determining unit is used to determine the relative position relationship between the new starting point and the target triangular mesh according to the number of intersection points.

[0087] In some specific embodiments, the streamline generation module 14 may specifically include:

[0088] a first iterative integration operation unit, for mapping the position coordinates of the new starting point into corresponding three-dimensional coordinates if the new starting point is within the target triangular mesh, determining the new starting point as the current starting point, and re-jumping to the step of performing plane coordinate mapping on the three-dimensional coordinates of the current starting point based on the triangular mesh until a preset integration termination condition is met; the preset integration termination condition includes any one or a combination of the following: the number of integration steps is equal to a preset step threshold, the vector velocity of the current starting point is equal to zero, the new starting point exceeds the data boundary and has no adjacent meshes, the number of integrations within the same triangular mesh exceeds a preset value, the point coordinate transformation fails, and the search for adjacent meshes fails;

[0089] The second iterative integration operation unit is used to calculate the coordinates of the intersection of the target streamline segment and the target triangular mesh through the position coordinates of the new starting point and the plane coordinates corresponding to the current starting point if the new starting point is not within the target triangular mesh, and map the coordinates into corresponding three-dimensional coordinates, determine the intersection as the current starting point, and jump again to the step of performing plane coordinate mapping of the three-dimensional coordinates of the current starting point based on the triangular mesh until the preset integration termination condition is met.

[0090] Furthermore, the present application also discloses an electronic device. Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.

[0091] Figure 6 The present invention provides a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the method for generating streamlines on the aircraft surface disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0092] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0093] In addition, the memory 22 as a carrier for storing resources may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be temporary storage or permanent storage.

[0094] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, and can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the aircraft surface streamline generation method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include computer programs that can be used to complete other specific tasks.

[0095] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned disclosed method for generating streamlines on the aircraft surface is implemented. The specific steps of the method can be referred to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.

[0096] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0097] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0098] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0099] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0100] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for generating streamlines on an aircraft surface, characterized in that: include: Determine the current starting point of the streamline on the aircraft surface based on the ray method, and divide the grid cells of various shapes of the unstructured grid corresponding to the aircraft surface to obtain a plurality of triangular grids; Performing plane coordinate mapping on the three-dimensional coordinates of the current starting point based on the triangular mesh to obtain the plane coordinates corresponding to the current starting point, and calculating the position coordinates of a new starting point based on the plane coordinates of the current starting point based on the second-order Runge-Kutta method; Determine a target streamline segment by using the plane coordinates and the position coordinates, judge the relative position of the target streamline segment and the target triangular mesh corresponding to the target streamline segment, and determine the relative position relationship between the new starting point and the target triangular mesh according to the corresponding judgment result; Performing a corresponding iterative integration operation according to the relative position relationship and the position coordinates of the new starting point, determining all integration points through the iterative integration operation, and sequentially connecting all the integration points to obtain a final aircraft surface streamline; The corresponding iterative integration operation is performed according to the relative position relationship and the position coordinates of the new starting point, including: If the new starting point is within the target triangular mesh, the position coordinates of the new starting point are mapped to corresponding three-dimensional coordinates, the new starting point is determined as the current starting point, and the process is jumped again to the step of performing plane coordinate mapping on the three-dimensional coordinates of the current starting point based on the triangular mesh until a preset integral termination condition is met; the preset integral termination condition includes any one or a combination of the number of integral steps being equal to a preset step threshold, the vector velocity of the current starting point being equal to zero, the new starting point being beyond the data boundary and having no adjacent meshes, the number of integrals within the same triangular mesh exceeding a preset value, point coordinate transformation failure, and failure to find adjacent meshes; If the new starting point is not within the target triangular mesh, the coordinates of the intersection of the target streamline segment and the target triangular mesh are calculated using the position coordinates of the new starting point and the plane coordinates corresponding to the current starting point, and the coordinates are mapped to corresponding three-dimensional coordinates. The intersection is determined as the current starting point, and the process jumps again to the step of performing plane coordinate mapping of the three-dimensional coordinates of the current starting point based on the triangular mesh until the preset integration termination condition is met.

2. The method for generating aircraft surface streamlines according to claim 1, characterized in that: The method of determining the current starting point of the streamline on the aircraft surface based on the ray method includes: A ray perpendicular to the screen is emitted to the three-dimensional scene corresponding to the aircraft through the screen coordinates, and the object intersection point hit by the corresponding return ray for the first time is determined as the current starting point of the streamline on the surface of the aircraft.

3. The method for generating aircraft surface streamlines according to claim 2, characterized in that: After emitting a ray perpendicular to the screen to the three-dimensional scene corresponding to the aircraft through the screen coordinates, the method further includes: If the return ray does not hit the object, the operation of generating the streamline on the surface of the aircraft is directly terminated.

4. The method for generating aircraft surface streamlines according to claim 1, characterized in that: The grid units of various shapes of the unstructured grid corresponding to the aircraft surface are divided to obtain a plurality of triangular grids, including: Performing geometric body surface extraction preprocessing on mesh units of various shapes of the unstructured mesh corresponding to the aircraft surface, or converting each face of each geometric body into a polygon to obtain a corresponding polygonal mesh; Sequentially numbering each vertex of the polygonal mesh to determine the sequence number of each vertex; The target vertex of the polygonal mesh is determined, and the polygonal mesh is divided based on the target vertex and the sequence number of each vertex to obtain a plurality of triangular meshes.

5. The method for generating aircraft surface streamlines according to claim 1, characterized in that: The performing plane coordinate mapping on the three-dimensional coordinates of the current starting point based on the triangular mesh to obtain the plane coordinates corresponding to the current starting point includes: Determine a plane rectangular coordinate system based on a three-dimensional coordinate system corresponding to the triangular mesh and an edge of the triangular mesh, and determine a rotation matrix of the mapping based on a unit vector of the plane rectangular coordinate system; Determine a transformation matrix between the three-dimensional coordinates of three vertices corresponding to the triangular mesh and the plane coordinates according to the rotation matrix; The three-dimensional coordinates of the current starting point are mapped to plane coordinates based on the transformation matrix to obtain the plane coordinates of the current starting point.

6. The method for generating aircraft surface streamlines according to any one of claims 1 to 5, characterized in that: The step of judging the relative position of the target streamline segment and the target triangular mesh corresponding to the target streamline segment, and determining the relative position relationship between the new starting point and the target triangular mesh according to the corresponding judgment result, comprises: The collinearity between the target streamline segment and the target triangular mesh is excluded by using a rapid exclusion test method, and after the collinearity is excluded, a straddle test method is used to calculate whether the target streamline segment intersects with each mesh edge of the target triangular mesh, and the number of intersections between the target streamline segment and the target triangular mesh is determined according to the corresponding calculation results; The relative position relationship between the new starting point and the target triangular mesh is determined according to the number of intersection points.

7. A device for generating streamlines on the surface of an aircraft, characterized in that: include: A meshing module is used to determine the current starting point of the streamline on the aircraft surface based on the ray method, and to divide the mesh units of various shapes of the unstructured mesh corresponding to the aircraft surface to obtain a plurality of triangular meshes; A position coordinate calculation module, used for performing plane coordinate mapping on the three-dimensional coordinates of the current starting point based on the triangular mesh to obtain the plane coordinates corresponding to the current starting point, and calculating the position coordinates of a new starting point based on the plane coordinates of the current starting point based on the second-order Runge-Kutta method; A relative position determination module, used for determining a target streamline segment by using the plane coordinates and the position coordinates, determining a relative position between the target streamline segment and a target triangular mesh corresponding to the target streamline segment, and determining a relative position relationship between the new starting point and the target triangular mesh according to a corresponding determination result; A streamline generation module, configured to perform a corresponding iterative integration operation according to the relative position relationship and the position coordinates of the new starting point, determine all integration points through the iterative integration operation, and sequentially connect all the integration points to obtain a final aircraft surface streamline; The streamline generation module comprises: a first iterative integration operation unit, for mapping the position coordinates of the new starting point into corresponding three-dimensional coordinates if the new starting point is within the target triangular mesh, determining the new starting point as the current starting point, and re-jumping to the step of performing plane coordinate mapping on the three-dimensional coordinates of the current starting point based on the triangular mesh until a preset integration termination condition is met; the preset integration termination condition includes any one or a combination of the following: the number of integration steps is equal to a preset step threshold, the vector velocity of the current starting point is equal to zero, the new starting point exceeds the data boundary and has no adjacent meshes, the number of integrations within the same triangular mesh exceeds a preset value, the point coordinate transformation fails, and the search for adjacent meshes fails; The second iterative integration operation unit is used to calculate the coordinates of the intersection of the target streamline segment and the target triangular mesh through the position coordinates of the new starting point and the plane coordinates corresponding to the current starting point if the new starting point is not within the target triangular mesh, and map the coordinates into corresponding three-dimensional coordinates, determine the intersection as the current starting point, and jump again to the step of performing plane coordinate mapping of the three-dimensional coordinates of the current starting point based on the triangular mesh until the preset integration termination condition is met.

8. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the method for generating aircraft surface streamlines according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the method for generating aircraft surface streamlines as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Three-dimensional streamline dynamic visualization algorithm facing irregular ocean flow field data

    CN104658027A

  • Aircraft surface leading edge attachment line area extraction method

    CN113642267A