A High-Quality Surface Mesh Generation Method Based on Local Computation

By performing geometric calculations in local space to generate local optimal triangles, the problem of element distortion and poor triangles caused by the mapping method in surface mesh generation is solved, and efficient and high-quality surface mesh generation is achieved, improving the accuracy and efficiency of CFD numerical calculations.

CN119294307BActive Publication Date: 2025-03-18UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411814390.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-03-18
Estimated Expiration
2044-12-11

AI Technical Summary

Technical Problem

In the prior art, mapping method causes element distortion and difference triangles during the generation of surface grids, making it difficult to directly build a high-quality surface grid in space, affecting the accuracy and efficiency of CFD numerical calculations.

Method used

Using a method based on local calculation method, geometric calculations are performed directly in the local space to generate local optimal triangles, avoid element search and traversal in the global area, and improve grid generation efficiency and quality.

Benefits of technology

It realizes the generation of high-quality surface mesh while ensuring efficiency, which improves the effectiveness of CFD numerical calculations. The grid quality is close to that of a regular triangle, and the efficiency is also improved compared with traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119294307B_ABST
    Figure CN119294307B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of aerospace numerical simulation, and relates to a high-quality surface mesh generation method based on a local calculation method. The present invention first processes the geometric model to obtain the discrete line segments of its directed boundary, and then generates a mesh inward based on this; then establishes a local area of ​​space, and calculates based on this, so that all calculations are concentrated in the local area of ​​space; the use of the local mapping domain ensures that the approximate intersection judgment of triangles in space can be judged, supplemented by α , β and c The coefficient correction is used to enhance the robustness of the method and ensure the high quality of the generated grid; when writing the edge to be generated, a hash function is used to perform a reverse index from the point ID to the edge ID to avoid a large number of set traversal operations and achieve high efficiency. The present invention provides a basis for the high-precision algorithm engineering application of computational fluid dynamics and computational electromagnetics in the fields of automobile manufacturing, shipbuilding industry, and aviation industry.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of aerospace numerical simulation and relates to a high-quality surface mesh generation method based on a local calculation method. Background Art

[0002] In aerospace engineering, computational fluid dynamics (CFD) is a key technology that is widely used in aerodynamic design, performance evaluation and simulation analysis of aircraft. CFD relies on numerical methods to solve the basic equations of fluid dynamics. The effectiveness of this process depends largely on the quality and accuracy of mesh generation. Mesh generation is the process of discretizing complex geometric shapes into computational units in order to perform flow characteristics analysis on discrete control volumes. This process not only needs to consider the complexity of the fluid domain, but also ensure the connectivity and good quality of the mesh to improve the accuracy and stability of the calculation results. Not only the quality of the mesh, but also the efficiency of mesh generation has a great impact on numerical simulation calculations. Therefore, in CFD research, mesh generation is not only the cornerstone of the calculation process, but also a key factor affecting simulation accuracy and efficiency.

[0003] The mesh generation process usually includes geometry processing, surface mesh generation and volume mesh generation, among which surface mesh generation plays a very important role. First, the quality of surface mesh generation determines the quality of the internal 3D volume mesh, and the 3D volume mesh determines the quality of subsequent numerical calculations; second, the surface mesh is closely related to the CAD model, and a large number of nonlinear calculations are involved. To date, the generation of surface mesh still requires repeated experiments, which consumes a lot of time in frequent calls.

[0004] The mainstream mesh generation method currently used is the mapping method. The process is to map the entire surface to a plane to generate a mesh in the plane, and then map the plane mesh back to the surface. However, the back mapping will cause unit distortion and generate unexpected difference triangles. The methods currently used in the mapping method are Delaunay and frontier advancing methods. The Delaunay method has good mathematical properties, but the quality of the initial mesh it automatically generates is poor and it is difficult to meet the standards of numerical calculations. Subsequent quality optimization is required to improve the quality of its initial mesh, which requires a certain amount of time cost; the frontier advancing method generates a higher quality mesh, but its time cost in set traversal and set calculation is high, and it is difficult to build a fully converged algorithm. It is currently difficult for these two methods to directly generate meshes on the surface of space, so surface mesh generation will be limited by the problems of the mapping method itself and will have the disadvantage of poor units.

[0005] Therefore, it is necessary to study an efficient and high-quality surface mesh generation method that can directly construct the surface mesh of the unit in space, while ensuring efficiency and improving the quality of the generated surface mesh, and ultimately realize a high-quality surface mesh generation method. Summary of the invention

[0006] In view of the above problems or deficiencies, in order to solve the unit quality problem caused by the mapping method after all mapping calculations, the present invention provides a high-quality surface mesh generation method based on the local calculation method, which can generate high-quality meshes on the model surface while ensuring the mesh generation efficiency by directly performing geometric calculations in the local space and generating local optimal triangles. The improvement of mesh generation efficiency and high-quality meshes enable subsequent CFD numerical calculations to ensure higher effectiveness.

[0007] A method for generating high-quality surface mesh based on a local calculation method comprises the following steps:

[0008] Step 1: Perform geometric processing on the target geometric model: obtain a set of discrete geometric faces on the model surface; and obtain a set of boundary discrete points and a set of boundary directed discrete line segments of each discrete geometric face.

[0009] The coordinate information of all boundary discrete points after the model is discretized is stored in the global point set, and the topological information of the boundary discrete line segments is stored in the global line segment set; and each boundary discrete point is numbered according to the storage order in the global point set, and the point ID is set; each line segment is numbered according to the storage order in the global line segment set, and the line ID is set. Among them, the topological information of the boundary discrete line segments stored in the global line segment set refers to a pair of numbers consisting of the point IDs of the two endpoints of the boundary discrete line segment.

[0010] Step 2: Select a single discrete geometric surface from the set of discrete geometric surfaces on the model surface as the meshing surface for meshing in subsequent steps; the directed discrete line segments on the boundary satisfy the left-hand rule: when facing the line segment direction on the boundary, the left hand is inside the area of ​​the meshing surface.

[0011] The boundary directed discrete line segment set of the current meshing surface is obtained, and the boundary directed discrete line segment set information is assigned to the line segment set to be generated to initialize the line segment set to be generated.

[0012] Step 3, assign the information of the line segment set to be generated to the generated line segment set, update the generated line segment set information, and clear the line segment set to be generated to facilitate subsequent writing; sort the generated line segment set from short to long according to the length of the generated line segments in the set, and select the shortest generated line segment in the sorted generated line segment set as the current generated line segment.

[0013] Step 4: Calculate the ideal point of the current generated line segment and the local information in the local area of ​​space corresponding to the ideal point: local line segment set, local endpoint set, local mapping line segment set and local mapping endpoint set. The ideal point refers to the point on the current discrete geometric surface that can form an equilateral triangle with the current generated line segment. The equilateral triangle is called an ideal triangle, and the line connecting the ideal point and the endpoint of the current generated line segment is called the side of the ideal triangle.

[0014] Among them, the local area of ​​space refers to a cube with the ideal point as the center and a side length of twice the height of the ideal triangle unit; the line segments with endpoints inside this cube are written into the local line segment set, and the two endpoints of the line segment are written into the local endpoint set; the normal plane of the ideal point on the mesh division surface is used as the local mapping calculation plane, and the elements in the local line segment set and the local endpoint set are projected onto the local mapping calculation plane to obtain the local mapping line segment set and the local mapping endpoint set.

[0015] Step 5: Determine whether the ideal point meets the legal conditions:

[0016] If the ideal point meets the legal conditions, it means that the ideal triangle is legal, then the legal ideal point is written into the global point set, and the two sides are written into the line segment set to be generated and the global line segment set.

[0017] Among them, the legal conditions that the ideal point needs to meet include: first inclusion, first intersection, first point proximity and edge proximity. When the ideal triangle satisfies these four sub-conditions at the same time, it is considered that the ideal point meets the legal conditions. The specific meanings of the four sub-conditions are as follows:

[0018] First inclusion: After the ideal triangle is mapped to the local mapping calculation plane, it cannot contain the local mapping endpoint;

[0019] First intersection property: the side of the ideal triangle does not intersect with the local mapping line segment after being mapped to the local mapping calculation plane;

[0020] First point proximity: the distance between the ideal point and the local endpoint is greater than 0.7 times the height of the ideal triangle;

[0021] Edge proximity: The distance between the sides of the ideal triangle and the local line segment is greater than 1 / 3 of the length of the currently generated line segment.

[0022] If the ideal point does not meet the legal conditions, it is necessary to traverse the local endpoint set searched in step 4, and judge the candidate legal conditions for the local endpoints in turn. When the local endpoint meets the candidate legal conditions, write it into the candidate point set; traverse all candidate points, calculate the quality coefficient of the candidate triangle unit generated by the candidate point and the current generated line segment, and select the candidate point with the highest quality coefficient as the optimal selection point, and the corresponding generated triangle unit is the optimal triangle unit; and write the side of the optimal triangle unit into the set of segments to be generated in a directed manner. The side refers to the connecting edge from the optimal selection point to the endpoint of the current generated line segment; if the side is the same edge as the local line segment, it is not written.

[0023] The candidate legal conditions that the local endpoint needs to meet include: second inclusion, second intersection, second point proximity, and unit positivity. The new triangle unit generated by connecting the local endpoint with the current generated line segment is called a pending triangle unit. When the pending triangle unit meets these four sub-conditions at the same time, the local endpoint meets the candidate legal conditions. The specific meanings of the four sub-conditions are as follows:

[0024] Second inclusion: after the undetermined triangle unit is mapped to the local mapping calculation plane, the local mapping endpoint is not included;

[0025] Second intersection property: the side corresponding to the undetermined triangle unit does not intersect with the local mapping line segment after being mapped to the local mapping calculation plane;

[0026] Second point proximity: the distance between the side corresponding to the undetermined triangle unit and the local endpoint is greater than 1 / 3 of the length of the currently generated line segment;

[0027] Unit positivity: The directed area of ​​the pending triangle unit is positive.

[0028] The candidate legal condition uses point proximity to ensure the quality of the generated grid and the convergence of the method of the present invention.

[0029] The completion of step 6 and step 5 means that the current generated line segment has completed the grid unit generation. The shortest generated line segment that has not completed the grid unit generation in the sorted generated line segment set is selected as the current generated line segment, and steps 4 to 5 are repeated until the sorted generated line segment set is traversed.

[0030] Determine whether the line segment set to be generated is empty. If the line segment set to be generated is not empty, it means that the meshing of the meshing surface is not completed, and return to step 3 to continue meshing. Until the line segment set to be generated is empty, it means that the meshing of the meshing surface is completed.

[0031] Step 7: Select the next discrete geometric surface in the discrete geometric surface set as the current meshing surface, and repeat steps 2 to 6 until the meshing of all discrete geometric surfaces in the discrete geometric surface set is completed.

[0032] Furthermore, when detecting whether the side edge of the optimal triangle unit and the local line segment are the same edge in step 5, a hash function is used to perform reverse indexing from the point ID pair to the edge ID to reduce the search time cost.

[0033] The present invention establishes a local area of ​​space with the ideal point of a single generated line segment, and calculates based on this local area of ​​space, which includes a local mapping calculation plane of the ideal point, so that the calculation of the generated line segment is all concentrated in the local area of ​​space, which avoids the time cost of a large number of element search traversals placed in the global area to a certain extent, and generates the best quality triangles in the local area of ​​space, ensuring the high quality of the generated grid unit. The traditional mapping method maps the entire discrete geometric surface to the grid generation method in the parameter space, which is slightly inferior in terms of grid quality and cannot better meet the high-precision grid requirements of CFD numerical calculations. The average quality of the grid generated by the method of the present invention is almost close to 1 of the regular triangle, which is not only outstanding in grid quality, but also in efficiency because the algorithm concentrates the overall calculation content in the local area of ​​space, and uses design means such as hash functions to reduce the search time cost when the local and global searches are connected, so the method of the present invention is still improved in time efficiency compared with the traditional method.

[0034] In summary, based on the traditional algorithm, the present invention mainly generates grids by calculating the local area of ​​space, and finally realizes a complete and efficient surface grid generation method; it provides a basis for the high-precision algorithm engineering application of computational fluid dynamics and computational electromagnetics in the fields of automobile manufacturing, civil engineering, environmental engineering, shipbuilding industry and aviation industry, and helps the interpretation, understanding of theory, experiment and design of related industries. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 is a flow chart of the present invention;

[0036] Figure 2 is a three-dimensional model diagram of an embodiment;

[0037] Figure 3 It is a grid diagram divided by the present invention under the grid number of 1w order of magnitude;

[0038] Figure 4 This is a mesh diagram of 10,000 meshes divided by the meshing tool MeshSim of Simmetrix.

[0039] Figure 5This is the quality distribution of the meshes divided by the present invention and MeshSim respectively under the condition of 200w mesh numbers;

[0040] Figure 6 It is the average mesh quality comparison between the present invention and MeshSim under different mesh numbers;

[0041] Figure 7 This is a comparison of the time taken for meshing between the present invention and MeshSim under different numbers of meshes. DETAILED DESCRIPTION

[0042] The technical solution and implementation effects of the present invention are described in detail below with reference to the accompanying drawings and embodiments.

[0043] A high-quality surface mesh generation method based on local calculation method, such as Figure 1 As shown, the following steps are included:

[0044] Step 1: geometrically process the target geometric model: obtain a set of discrete geometric faces on the model surface; and obtain a set of boundary discrete points and a set of boundary directed discrete line segments of each discrete geometric face. The model used in this embodiment is as follows: Figure 2 shown.

[0045] All the discrete boundary points of the model after discretization are stored in the global point set Φ in order vertex , the topological information of the discrete boundary segments is stored in the global segment set Φ edge ; and number each discrete boundary point according to the storage order in the global point set, and set the point ID; number each line segment according to the storage order in the global line segment set, and set the line ID. Among them, the topological information of the discrete boundary line segment stored in the global line segment set refers to a pair of numbers consisting of the point IDs of the two endpoints of the discrete boundary line segment. The coordinate information of the point can be queried from the global point set through the point ID, and the line segment topological information stored in the global line segment set can be queried through the line segment ID. These ID information will improve the efficiency of subsequent set traversal and search.

[0046] Step 2: Select a single discrete geometric surface from the set of discrete geometric surfaces on the model surface as the meshing surface for meshing in subsequent steps; the directed discrete line segments on the boundary satisfy the left-hand rule: when facing the line segment direction on the boundary, the left hand is inside the area of ​​the meshing surface.

[0047] The boundary directed discrete line segment set of the current meshing surface is obtained, and the boundary directed discrete line segment set information is assigned to the line segment set to be generated to initialize the line segment set to be generated.

[0048] Since the boundary discrete line segment information is stored by line segment ID, the boundary directed discrete line segment ID set is called , the topological information of the line segment itself needs to be in Φ edge However, the direction of the same line segment is inconsistent in different faces, so it is necessary to determine the winding direction of each face separately. If the edge is reversed, it is necessary to find the direction of Φ on the current face. edge The topological information of the corresponding line segment in is reversed. The line segment set to be generated is recorded as , when assigning the boundary directed discrete line segment set information, only the assignment operation needs to be performed.

[0049] Step 3, assign the information of the line segment set to be generated to the generated line segment set, update the generated line segment set information, and clear the line segment set to be generated to facilitate subsequent writing; sort the generated line segment set from short to long according to the length of the generated line segments in the set, and select the shortest generated line segment in the sorted generated line segment set as the current generated line segment.

[0050] The generated line segment set is denoted as , and Both sets only record the ID information of the edge. edge When recording line segments in the process, it is necessary to record whether the line segments are to be generated in the line segments themselves to help the subsequent program flow. When the set of line segments to be generated is cleared in step 3, the information of the cleared line segments to be generated needs to be initialized, because in this step these line segments are converted into generated line segments to generate the mesh of the current layer.

[0051] Step 4: Calculate the ideal point of the currently generated line segment and the local information in the local area of ​​space corresponding to the ideal point: the local line segment set, the local endpoint set, the local mapping line segment set and the local mapping endpoint set.

[0052] In this step, the first thing to do is to calculate the spatial points of the currently generated line segment so that the newly generated spatial points can be connected to the currently generated line segment to form an equilateral triangle.

[0053] Let the current generated line segment be v c , denote its two end points as point A and point B, denote the midpoint of AB as point S, denote the ideal space point calculated by AB as P, then the space coordinates of point P can be obtained by the following formula:

[0054] (1)

[0055] in,

[0056] (2)

[0057] (3)

[0058] (4)

[0059] Among them, r is the displacement vector of each point relative to the origin, the subscript is the space vector pointing from the origin to the corresponding point; size is the size value at a given point, n is the normal vector at a point on the current meshing surface, the space calculation point corresponding to the ideal point is the midpoint calculated by the weighted average of the two endpoints of the current generated line segment with the size value as the starting point of advancement, and the calculated t is the advancement direction. Advance in this direction The distance, finally get the coordinates of the space point P; size A is the size of point A, size B is the size of point B, n A is the normal vector of point A on the current meshing surface, n B is the normal vector of point B on the current meshing surface.

[0060] Then, point P in space is projected onto the current meshing surface. The current mainstream projection method is orthogonal projection, which is used to find the point closest to the current meshing surface. This embodiment uses the 3D geometric modeling engine ACIS of Spatial Technology to calculate the point closest to point P on the surface. This point is recorded as the ideal point P. idl .

[0061] Take the ideal point P idl The local area of ​​space is constructed as the center, and the local area of ​​space is set to be P idl The cube area with h as the search depth and P as the center idl is the base point of the local mapping plane, and P is calculated on the current meshing surface. idl Normal vector at point n pl As the normal vector of the local mapping plane, the local mapping calculation plane is constructed.

[0062] Writing the global area (global point set and global line segment set) into the local area of ​​space requires searching and traversing the global area. The line segments whose endpoints are in the local area of ​​space are written into the local line segment set, and the endpoints of the line segments are written into the local endpoint set. In order to avoid a large amount of search costs, a visible line segment set is set here. As the basis for the search,

[0063] (5)

[0064] The line segment set to be generated And generate a set of line segments Combined into a set of visible line segments ,exist Searching in the middle can avoid the dramatic increase in time cost caused by the increase in density to a certain extent. In general, The visible line segment set is convergent, but if there is a separate line in the model so that the unit encounters the separate line on the model surface from behind when it is generated, it will lead to non-convergence. At this time, the visible line segment set is merged into the boundary directed discrete line segment set , modified to ;

[0065] (6)

[0066] The local endpoint set and the local segment set are collectively referred to as ,Will After all the local line segments in the local mapping plane are mapped to the local mapping plane, the local mapping endpoint set and the local mapping line segment set recorded on the local mapping plane are collectively referred to as ; For subsequent search traversal, it is necessary to record in the point The mapping ID of the mapping point in the .map is only used in the local area of ​​the space of the current generated segment each time, so it does not need to be initialized frequently. Even if it is reused, the mapping ID information corresponding to the point is still updated here.

[0067] Step 5: Determine whether the ideal point meets the legal conditions: If the ideal point meets the legal conditions, it means that the ideal triangle is legal, then the legal ideal point is written into the global point set, and the two sides are written into the line segment set to be generated and the global line segment set.

[0068] For the ideal point P idl The legal conditions for detection are as follows:

[0069] First inclusion: After the ideal triangle is mapped to the local mapping calculation plane, it cannot be included The local mapping endpoint in ;

[0070] First intersection: The sides of the ideal triangle are mapped to the local mapping calculation plane and do not intersect The local mapping line segments in intersect;

[0071] The first point is proximity: There are no local endpoints and ideal points P idl The distance is less than d m ;

[0072] Edge Proximity: There is no local line segment and ideal point P in idl The distance is less than S t .

[0073] Among them, when judging the first inclusion, only the situation on the plane is considered here. The three points of the triangle are recorded as D, E, and F, and the point to be detected is recorded as point G. When the following three conditions are met at the same time, the point is inside the triangle.

[0074] (7)

[0075] (8)

[0076] (9)

[0077] Points D, E, F, and G are the current generated line segment v c End points A, B, ideal point P idl , and the spatial points that need to be determined, these four points are in the mapping domain So in step 4, it is mentioned that the spatial point needs to store the ID information of the mapping point, which is convenient for searching here; and n pl Compute the plane normal for local mapping.

[0078] When judging the first intersection, just like judging the first inclusion, the coordinates of the corresponding points in the mapping domain are found from the points where the space segments need to be judged, and the intersection judgment is placed on the plane. When on the plane, the two line segments are respectively recorded as line segment HI and line segment JK. The line segments intersect when the following two conditions are met at the same time:

[0079] (10)

[0080] (11)

[0081] When judging the proximity of a point, a proximity threshold d is given. m , calculate the local area All points in the idl When all distances are greater than a given threshold, the point proximity requirement is met.

[0082] (12)

[0083] in,

[0084] (13)

[0085] The α value here should ideally be 1, but in order to ensure the convergence of the program and to avoid unexpected units during the grid generation process, the α value is generally set to around 0.8. The α value of this embodiment is 0.7.

[0086] When determining the proximity of an edge, a value S based on the length of the currently generated edge is givent , defined as follows,

[0087] (14)

[0088] The length value here is the current generated line segment v c The length of the triangle is used for calculation. Ideally, the β value should be 2, but this will cause non-convergence when some generated units meet. However, in order to ensure the quality of generating new triangles, the β value needs to be set as small as possible. In this embodiment, the β value used is 3.

[0089] But when the ideal point meets the legal conditions, the ideal point P idl Write Φ as the new point vertex , and then write the two newly generated sides into Φ according to the storage location number. edge , also numbered according to the storage location. Write the directed line segment ID into In the example above, Φ edge The line segments stored in the _{i} ...

[0090] If the ideal point does not meet the legal conditions, it is necessary to traverse the local endpoint set found in step 4, and judge the local endpoints for the candidate legal conditions in turn. When the local endpoint meets the candidate legal conditions, write it into the candidate point set; traverse each point in the candidate point set, calculate the quality coefficient of the triangle unit generated by the candidate point and the current generated line segment, and select the candidate point that can generate the optimal triangle unit as the optimal selection point. Write the new unit information generated by connecting the optimal selection point and the current generated line segment, and write the newly generated side edge in a directed manner into the line segment set to be generated.

[0091] When the ideal point P idl If it is illegal, you need to Search for candidate points in the When local When the points in meet the following four conditions, the candidate point set can be written :

[0092] Second inclusion: Mapping the undetermined triangle unit to the local mapping calculation plane After the middle, the local mapping endpoint is not included;

[0093] Second intersection: The side corresponding to the undetermined triangular unit is mapped to the local mapping calculation plane and does not intersect The local mapping line segments intersect;

[0094] The second point is proximity: There is no undetermined triangle element whose side corresponding to the local endpoint is less than S t .

[0095] Cell positivity: The directed area of ​​the pending triangular cell is such that the dot product of the normal vector of the current meshing surface is positive.

[0096] Traverse the candidate point set , calculate the quality coefficient Q of the candidate triangle unit, take the candidate point corresponding to the maximum Q value as the final optimal selection point, and regard the three points of the triangle as ABC respectively. The definition of Q is as follows:

[0097] (15)

[0098] Where γ is the mass attenuation coefficient, which is defined as follows,

[0099] (16)

[0100] in,

[0101] (17)

[0102] Where l is the length of the line segment corresponding to the subscript. The meaning of the γ coefficient is as follows: first, to avoid selecting a larger grid when selecting candidate points, which will cause other grid sizes to be very small and generate a narrow and long grid; second, to avoid selecting points that pass over closer points to select farther points when the front edge advances and meets to generate edges that are several times the length of the grid edge. These edges are usually not recognized by subsequent invalidation operations, resulting in non-convergence of the algorithm. The present invention avoids the occurrence of the above two situations by setting the mass attenuation coefficient γ.

[0103] After successfully obtaining the optimal selection point, perform the write operation of the optimal triangle unit side; determine whether the side already exists in the global line segment set. If it does, mark the side as an invalid frontier and do not participate in subsequent advancement operations; if it does not exist, write Φ edge And number them according to the position, and write the written side ID into the set of line segments to be generated. .

[0104] The completion of step 6 and step 5 means that the current generated line segment has completed the grid unit generation. The shortest generated line segment that has not completed the grid unit generation in the sorted generated line segment set is selected as the current generated line segment, and steps 4 to 5 are repeated until the sorted generated line segment set is traversed.

[0105] Determine whether the line segment set to be generated is empty. If the line segment set to be generated is not empty, it means that the meshing of the meshing surface is not completed, and return to step 3 to continue meshing. Until the line segment set to be generated is empty, it means that the meshing of the meshing surface is completed.

[0106] Step 7: Select the next discrete geometric surface in the discrete geometric surface set as the current meshing surface, and repeat steps 2 to 6 until the meshing of all discrete geometric surfaces is completed.

[0107] After the mesh is generated, the triangle quality calculation is performed on all the generated triangular units. In the calculation formula (15), the Q value of γ correction is not required. The highest unit quality coefficient here is 1, which is an equilateral triangle. The lower the quality coefficient, the worse the unit mesh quality.

[0108] In the process of generating and writing side edges after searching for points, in order to avoid a large number of traversals of existing sets, it is necessary to generate a reverse index from a set of numbers of endpoint IDs to their corresponding edge IDs. The method used by the present invention is to first construct a hash function that maps a Combo structure consisting of two point IDs to the edge ID, and use a data structure map to store all point-to-edge indexes. The time complexity of each search is O (1), which greatly reduces the efficiency loss caused by traversal and ultimately achieves high efficiency of the algorithm.

[0109] After the mesh is generated, the same standard model library missile model is meshed using the meshing tool MeshSim from Simmetrix: Figure 3 It is a grid diagram divided into 1w grid numbers in the embodiment of the present invention; Figure 4 This is a mesh diagram of 10,000 meshes divided by the meshing tool MeshSim of Simmetrix. Then the performance of the two algorithms is compared at the level of 1 million to 5 million: Figure 5 As shown, the proportion of grids with different quality coefficients to the total grid for these two methods with 2 million grids is given. It can be seen that most of the MeshSim grid quality distribution is above 0.9, and the grid quality is relatively high, but the grid quality of the present invention is mostly between 0.98 and 1, and they are all equilateral triangles or approximate equilateral triangles. Figure 6 This is a comparison of the average mesh quality of the present invention and MeshSim under different mesh numbers. It can be intuitively seen that the average mesh quality of the present invention is above 0.99, surpassing the quality of the MeshSim mesh under various mesh numbers; Figure 7 The figure is a comparison of the time taken for meshing of the present invention and MeshSim under different numbers of meshes. It can be seen that in the case of high-quality meshes, the efficiency of the present invention is still improved by about 10% compared with the MeshSim meshing algorithm at 500w meshes. The mesh quality and efficiency of the present invention are higher than those of the existing MeshSim meshing algorithm, which shows that the present invention provides an efficient method for generating high-quality surface meshes.

[0110] It can be seen from the above embodiments that the present invention first processes the geometric model to obtain the discrete line segments of its directed boundary, and then generates a grid inward based on this; then establishes a local area of ​​space, and calculates based on this, so that all calculations are concentrated in the local area of ​​space; uses a local mapping domain to ensure the approximate intersection judgment of triangles in space, and uses α, β and γ coefficient corrections and other means to enhance the robustness of the method and ensure the high quality of the generated grid; in the process of writing the edge to be generated, a hash function is used to perform a reverse index from the point ID to the edge ID, thereby avoiding a large number of set traversal operations to achieve high efficiency. The present invention provides a basis for the high-precision algorithm engineering application of computational fluid dynamics and computational electromagnetics in the fields of automobile manufacturing, shipbuilding industry and aviation industry.

Claims

1. A high-quality surface mesh generation method based on local calculation method, characterized in that: The following steps are involved: Step 1: geometrically process the target geometric model: obtain a set of discrete geometric faces on the model surface; and obtain a set of boundary discrete points and a set of boundary directed discrete line segments of each discrete geometric face; The coordinate information of all the discrete boundary points after the model is discretized is stored in the global point set, and the topological information of the discrete boundary line segments is stored in the global line segment set; and each discrete boundary point is numbered according to the storage order in the global point set, and the point ID is set; each line segment is numbered according to the storage order in the global line segment set, and the line ID is set; wherein the topological information of the discrete boundary line segments stored in the global line segment set refers to a pair of numbers consisting of the point IDs of the two endpoints of the discrete boundary line segments; Step 2: Select a single discrete geometric surface from the discrete geometric surface set of the model surface as the meshing surface, and perform meshing in the subsequent steps; the directed discrete line segment on the boundary satisfies the left-hand rule: when facing the line segment direction on the boundary, the left hand is inside the area of ​​the meshing surface; Obtain the boundary directed discrete line segment set of the current meshing surface, and assign the boundary directed discrete line segment set information to the line segment set to be generated, so as to initialize the line segment set to be generated; Step 3, assigning the to-be-generated line segment set information to the generated line segment set, updating the generated line segment set information, and clearing the to-be-generated line segment set; sorting the generated line segment set from short to long according to the lengths of the generated line segments in the set, and selecting the shortest generated line segment in the sorted generated line segment set as the current generated line segment; Step 4, calculate the ideal point of the current generated line segment, and the local information in the local area of ​​space corresponding to the ideal point: the local line segment set, the local endpoint set, the local mapping line segment set and the local mapping endpoint set; the ideal point refers to the point on the current discrete geometric surface that can form an equilateral triangle with the current generated line segment. The equilateral triangle is called an ideal triangle, and the line connecting the ideal point and the endpoint of the current generated line segment is called the side of the ideal triangle; The local area of ​​space refers to a cube with the ideal point as the center and a side length of twice the height of the ideal triangle; the line segment with endpoints inside the cube is written into the local line segment set, and the two endpoints of the line segment are written into the local endpoint set; the normal plane of the ideal point on the meshing surface is used as the local mapping calculation plane, and the elements in the local line segment set and the local endpoint set are projected onto the local mapping calculation plane to obtain the local mapping line segment set and the local mapping endpoint set; Step 5: Determine whether the ideal point meets the legal conditions: If the ideal point meets the legal conditions, it means that the ideal triangle is legal, then the legal ideal point is written into the global point set, and the two sides are written into the line segment set to be generated and the global line segment set in a directed manner; Among them, the legal conditions that the ideal point needs to meet include: first inclusion, first intersection, first point proximity and edge proximity. When the ideal triangle satisfies these four sub-conditions at the same time, it is considered that the ideal point meets the legal conditions. The specific meanings of the four sub-conditions are as follows: First inclusion: After the ideal triangle is mapped to the local mapping calculation plane, it cannot contain the local mapping endpoint; First intersection property: the side of the ideal triangle does not intersect with the local mapping line segment after being mapped to the local mapping calculation plane; First point proximity: the distance between the ideal point and the local endpoint is greater than 0.7 times the height of the ideal triangle; Edge proximity: The distance between the ideal point and the local line segment is greater than 1 / 3 of the length of the currently generated line segment; If the ideal point does not meet the legal conditions, it is necessary to traverse the local endpoint set searched in step 4, and judge the candidate legal conditions for the local endpoints in turn. When the local endpoint meets the candidate legal conditions, write it into the candidate point set; traverse all candidate points, calculate the quality coefficient of the candidate triangle unit generated by the candidate point and the current generated line segment, and select the candidate point with the highest quality coefficient of the generated triangle unit as the optimal selection point, and the corresponding generated triangle unit is the optimal triangle unit; and write the side of the optimal triangle unit into the set of segments to be generated in a directed manner. The side refers to the connecting edge from the optimal selection point to the endpoint of the current generated line segment; if the side is the same edge as the local line segment, it is not written; The candidate legal conditions that the local endpoint needs to meet include: second inclusion, second intersection, second point proximity, and unit positivity. The new triangle unit generated by connecting the local endpoint with the current generated line segment is called a pending triangle unit. When the pending triangle unit meets these four sub-conditions at the same time, the local endpoint meets the candidate legal conditions. The specific meanings of the four sub-conditions are as follows: Second inclusion: after the undetermined triangle unit is mapped to the local mapping calculation plane, the local mapping endpoint is not included; Second intersection property: the side corresponding to the undetermined triangle unit does not intersect with the local mapping line segment after being mapped to the local mapping calculation plane; Second point proximity: the distance between the side corresponding to the undetermined triangle unit and the local endpoint is greater than 1 / 3 of the length of the currently generated line segment; Unit positivity: The directed area of ​​the undetermined triangular unit is positive; The completion of step 6 and step 5 means that the current generated line segment has completed the grid unit generation, and the shortest generated line segment that has not completed the grid unit generation in the sorted generated line segment set is selected as the current generated line segment, and steps 4 to 5 are repeated until the sorted generated line segment set is traversed; Determine whether the set of line segments to be generated is empty. If the set of line segments to be generated is not empty, it means that the meshing of the meshing surface is not completed, and return to step 3 to continue meshing; until the set of line segments to be generated is empty; Step 7: Select the next discrete geometric surface in the discrete geometric surface set as the current meshing surface, and repeat steps 2 to 6 until the meshing of all discrete geometric surfaces in the discrete geometric surface set is completed.

2. The method for generating high-quality surface mesh based on local calculation method as claimed in claim 1, characterized in that: When detecting whether the side edge of the optimal triangle unit and the local line segment are the same edge in step 5, a hash function is used to perform reverse indexing from the point ID pair to the edge ID.

3. The high-quality surface mesh generation method based on local calculation method as claimed in claim 1, characterized in that: The specific calculation method of the ideal point in step 4 is: Let the current generated line segment be v c , denote its two end points as point A and point B, denote the midpoint of AB as point S, denote the ideal space point calculated from AB as P, then the space coordinates of point P can be obtained by the following formula: in, Among them, r is the displacement vector of each point relative to the origin, the subscript is the space vector pointing from the origin to the corresponding point; size is the size value at a given point, n is the normal vector at a point on the current meshing surface, the space calculation point corresponding to the ideal point is the midpoint calculated by the weighted average of the two endpoints of the current generated line segment with the size value as the starting point of advancement, and the calculated t is the advancement direction. Advance in this direction The distance, finally get the coordinates of the space point P; size A is the size value of point A, size B is the size of point B, n A is the normal vector of point A on the current meshing surface, n B is the normal vector of point B on the current meshing surface; Then the point P in space is projected onto the current meshing surface to find the point closest to the current meshing surface. This point is recorded as the ideal point P. idl .

4. The high-quality surface mesh generation method based on local calculation method as claimed in claim 3, characterized in that: The spatial point P is the point closest to the surface and is calculated using ACIS.

Citation Information

Patent Citations

  • Full-automatic quadrilateral boundary layer grid generation method based on rigid mapping

    CN116563490A

  • Two-dimensional triangular mesh division method for adaptive mesh density adjustment

    CN116912453A