Background
Along with the development of CAE simulation and the increase of application demands, the complex curved surface model needs to be subjected to simulation analysis in the fields of automobiles, aerospace, ships and the like. Complex curved surfaces generally comprise a plurality of sub-curved surfaces, and often comprise a large number of geometric features such as micro-patches, narrow side lines and the like, and the existence of the features can lead to the significant reduction of grid generation quality, cause the problems of local grid distortion, uneven density distribution and the like, and further influence the precision and reliability of engineering simulation. To address this challenge, the prior art has mainly employed two types of methods, geometry reconstruction and discrete grid parameterization.
The geometric reconstruction method is to splice the sub-surfaces into a single continuous curved surface through curve surface re-fitting and Boolean operation, and selectively reserve or inhibit the side lines to form a topological ring. The core flow comprises geometric stitching, surface trimming, global parameterization and grid mapping. However, the method relies on high-precision surface fitting and complex boolean operations, which not only has high calculation cost, but also is easy to introduce geometric errors in the reconstruction process. In addition, excessive suppression of small features may lead to loss of key geometric details, reducing the fidelity of the model. More seriously, the method has strong dependence on manual intervention, is difficult to realize the automatic treatment of large-scale complex curved surfaces, and greatly limits the engineering application efficiency.
The discrete grid parameterization method realizes grid generation by dispersing the sub-faces into triangular grids and constructing a unified parameter space. The method avoids the geometric reconstruction step, but is difficult to balance the grid density of the key area and the overall calculation efficiency due to lack of a dynamic size field regulation mechanism. In addition, when the generated grid is reversely mapped back to the physical space, the grid is often deviated from the original curved surface due to lack of geometric information, so that the grid is not attached.
In general, the prior art is generally faced with multiple contradictions between geometric operational complexity, parametric spatial fusion efficiency, and grid fit. While the geometric reconstruction method can ensure geometric integrity, the geometric reconstruction method has the cost of high calculation cost and low automation degree, and the discrete parameterization method simplifies geometric operation and is limited by the defects of parameter space quality and size field control. On the premise of not depending on complex CAD operation, the realization of efficient fusion of multi-sub-surface parameter space, accurate regulation and control of dynamic size field and strict adherence of grids becomes a technical problem to be broken through in the field of complex curved surface grid generation.
Disclosure of Invention
Aiming at the limitations of the prior art, the invention provides a complex surface grid generation method based on virtual topology construction, parameter space fusion and dynamic size field regulation, which aims to solve the problems of complex geometric operation, difficult parameter space fusion, insufficient grid uniformity, insufficient body pasting and the like in complex surface grid subdivision and realize efficient and high-precision surface grid generation. The invention adopts the following technical scheme to achieve the purpose:
a curved surface grid generating method based on discrete grid parameterization comprises the following steps:
S1, performing triangular mesh pre-dissection on the original curved surface geometry, and using the triangular mesh pre-dissection for the background mesh parameterized by the discrete mesh. While suppressing non-critical geometric features (such as feature lines on the elongated surface and geometric vertices on the C1 continuous small-scale edges) to construct a virtual geometric topology based on a discrete grid.
S2, mapping the discrete triangular grid map from a physical space (x, y, z) to a two-dimensional parameter space (u, v) by adopting a Least Square Conformal Mapping (LSCM) algorithm, ensuring low distortion of the parameter space and realizing seamless combination of multi-sub-surface parameter domains.
S3, introducing a grid size field regulation mechanism for guaranteeing the uniformity of the physical space grid. And calculating curved surface infinitesimal from the physical space to the parameter space, and reversely correcting the size of the parameter space grid, so that the grid mapped back to the physical space can adapt to curvature change of the curved surface. Based on the grid size field, delaunay triangulation is adopted to complete grid subdivision in a two-dimensional parameter space.
S4, establishing a dual projection correction mechanism. Firstly, judging the unique pre-dissected background grid serial number of the generated grid node on the parameter space, and recording the serial number of the background grid subordinate to the geometric surface patch. And mapping each node from the parameter space to the parameter space of the CAD geometric surface through linear interpolation, and then analyzing and calculating the physical space coordinates of the node through a CAD curved surface parameter equation to ensure that the final grid is strictly attached to the geometric surface.
Further, in step S1, the pre-split meshes may be split by using a geometric curvature adaptive split algorithm, a small-size mesh is used in a high curvature area, and a large-size mesh is used in a flat area, so as to improve geometric accuracy of the pre-split meshes, reduce the number of the pre-split meshes as much as possible, and reduce the calculation amount of discrete mesh parameterization in step S2. Wherein, the pre-dissected grid is only used for approximating the original analysis geometry and constructing parameter space, and does not require grid quality, so that a grid quality improvement algorithm can be omitted to reduce calculation time.
Further, in step S1, the virtual topology may be constructed by selectively automatically suppressing the points and edges using the geometric continuity condition. And similarly, the geometric continuity judgment is carried out on the common node of all the connected sides, and the point is restrained if the geometric continuity condition is met. Suppression and geometric features that need to be preserved can also be specified manually. The reserved edges also need to be passed to subsequent steps as line units.
Further, in step S2, the geometric areas that need to be combined are collected together to make grid discrete parameterization, and the outer ring of the parameterized pre-split grid needs to be guaranteed to have no selfing and no large curvature change, so that parameterized grids are guaranteed to have no overlapping, and parameterization failure is caused.
Further, in step S3, the line without suppression is split first, and added as a constraint to the Delaunay triangulation process. The density of the insertion points needs to be adjusted according to the mesh size field during the insertion point process of Delaunay triangulation. The grid generation in this step may also use other triangulation algorithms such as AFT (advanced wavefront method) -Delaunay, or use a method of combining units after the triangle grid generation to convert into a quadrilateral hybrid grid.
Further, in step S4, it is necessary to determine whether the node is in which pre-split mesh triangle, and the AABB tree may be used to reduce the space, so as to greatly reduce the number of times of determining the node and the triangle mesh, and improve the computing efficiency of dual projection. The interpolation of the subsequent nodes and the CAD geometric calculation process are completely independent, and parallel calculation acceleration can be adopted.
In summary, due to the adoption of the technical scheme, the method and the device for generating the high-quality curved surface mesh have the advantages that the method and the device have remarkable universality, flexibility, high efficiency and usability when the complex curved surface mesh subdivision problem is solved, and a high-quality curved surface mesh generation solution is provided for engineering simulation calculation. 3. The dual mapping mechanism effectively eliminates parameterized mapping errors, so that the final grid is tightly attached to the original curved surface. 4. The method is suitable for complex curved surface structures such as aeroengine blades, automobile bodies, ship shells and the like, and supports the rapid grid generation requirement of large-scale engineering simulation.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the invention, as presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Example 1
A curved surface grid generating method based on discrete grid parameterization, the overall content of which can be referred to in the schematic of FIG. 1, and the steps of which can be summarized as follows
S1, performing triangular mesh pre-dissection on the original curved surface geometry, and using the triangular mesh pre-dissection for the background mesh parameterized by the discrete mesh. And simultaneously suppressing non-critical geometric features, and constructing a virtual geometric topology based on the discrete grid.
S2, mapping the discrete triangular grid map from a physical space (x, y, z) to a two-dimensional parameter space (u, v) by adopting a Least Square Conformal Mapping (LSCM) algorithm, ensuring low distortion of the parameter space and realizing seamless combination of multi-sub-surface parameter domains.
S3, calculating a grid size field by using curved surface micro elements from a physical space to a parameter space, and completing grid subdivision in a two-dimensional parameter space based on Delaunay triangulation.
S4, mapping the parameter space nodes to a physical space through a double projection correction mechanism.
The details of the method in each step will be described through the detailed method flow.
1. And performing triangular mesh pre-dissection on the original curved surface geometry, and using the triangular mesh pre-dissection for the background mesh parameterized by the discrete mesh. In this embodiment, the geometric features that do not satisfy the continuity condition are automatically suppressed, and a virtual geometric topology based on a discrete grid is constructed. The method specifically comprises the following sub-steps:
S101, triangular mesh pre-dissection, namely, performing dissection on the original curved surface geometry by adopting a geometric curvature self-adaptive dissection algorithm, and encrypting the mesh in a high curvature area. Wherein the surface mesh generation is to perform mesh generation on the parameter space (p, q) of the CAD geometrical curved surface, and record the node coordinates on the parameter space (p, q) of each sub-surface i. Node information, face unit information (node ID, face ID), line unit information (node ID, line ID) on the physical space (x, y, z) of the entire model are recorded.
S102, establishing a virtual topology, namely automatically restraining points and edges by adopting geometric continuity conditions, and constructing the virtual topology. And judging the topology of all the points and faces in the model, inhibiting the internal edges and faces of the sub-faces, and judging the common points and faces. The geometric continuity judgment is carried out on the common edge of all the adjacent surfaces, namely the common edge is sampled independently, and the normal direction of the adjacent surface at the sampling point is calculated、The criterion used in this embodiment is(2 DEG tolerance) if all sampling points meet the condition, suppressing the edge, and likewise, judging geometric continuity at the common node of all connected edges, namely calculating tangential directions of adjacent lines at the common point、The criterion used in this embodiment is(2 Deg. tolerance) and if the condition is met, suppressing the point. All edges that need to be kept are marked at their line cell information.
2. Mapping a discrete triangular mesh map from a physical space (x, y, z) to a two-dimensional parameter space (u, v) using a Least Squares Conformal Mapping (LSCM) algorithm, comprising the following sub-steps:
S201, calculating free edges, namely, introducing a pre-split grid in a physical space, and traversing the free edges of the grid calculation grid. Traversing free edge nodes, sequentially arranging the free edge nodes into a chain, finding two points with the largest arc length distance on the chain, and respectively restricting the two points as constraint points to be (0, 0) and (1, 0) points under a parameter space (u, v).
S202, calculating node parameter space coordinates, namely constructing conformal free energy through Dirichlet energy and area to minimize the conformal free energy and establishing a linear algebraic equation set. And solving a linear algebraic equation set under constraint to obtain parameter space coordinate values of all nodes, and completing conformal mapping of the discrete triangular grids to obtain the pre-dissected grids on the two-dimensional parameter space.
3. The grid size field is calculated, grid subdivision in a two-dimensional parameter space is completed based on Delaunay triangulation, and the method specifically comprises the following sub-steps:
s301, calculating a grid size field, namely circulating surface units of the pre-split grid, and calculating curved surface microelements Wherein. Within a triangular unitIs a constant and can be calculated by physical space and parameter space coordinates. Averaging connected units at a nodeCan be calculated to obtain. The value of the grid size field at the node isWhere D is the global grid size.
S302, line repartitioning, namely reading pre-dissected grid line information, and after the inhibition edge is eliminated, reconstructing the ring by using the rest discrete wire grids. And under the parameter space, completing one-dimensional repartition of the wire mesh by using the mesh size field, and taking the one-dimensional repartition as the constraint of two-dimensional mesh subdivision.
S303, performing surface subdivision, namely performing grid subdivision on a parameter space by adopting a Constraint Delaunay Triangulation (CDT) algorithm according to the grid size field and the grid subdivision region insertion point in the parameter space.
4. Establishing a corresponding relation between a new generation node and a pre-dissection grid, and mapping the parameter space node to a physical space through a double projection correction mechanism, wherein the method specifically comprises the following sub-steps:
S401, searching grids to which the nodes belong, namely firstly establishing an AABB tree for pre-split grids under a parameter space. And then circulating the node generated by the re-subdivision, and rapidly screening the node neighborhood by utilizing the AABB tree. And (3) rapidly judging the pre-split grids in the adjacent area through the bounding box, and accurately judging whether the points are in the pre-split grids through an area method. Thereby establishing a one-to-one correspondence of nodes to the pre-split grid.
And S402, parameter space projection, namely circularly utilizing linear interpolation to project the coordinates of the discrete parameter space (u, v) to the original CAD curved surface parameter space (p, q) for all nodes. The coordinates of the nodes in the discrete parameter space are obtained as (u 0,v0), the coordinates of the three nodes corresponding to the pre-split grid are obtained as (u 1,v1)、(u2,v2)、(u3,v3), and the coordinates of the three nodes corresponding to the pre-split grid are obtained as (p 1,q1)、(p2,q2)、(p3,q3) in the original CAD curved surface parameter space. The coordinates (p 0,q0) of the node under the original CAD curved surface parameter space after linear interpolation can be calculated as follows:
S403, physical space projection, namely inquiring the curved surface corresponding to the pre-split grid ObtainingAnd (3) substituting the parameter space coordinate (p 0,q0) obtained by linear interpolation into the equation, wherein the physical space coordinate (x 0,y0,z0) of the point is tightly attached to the original geometric surface.
Example 2
Based on the embodiment 1, the geometric model of the ship hull shell surface mesh subdivision is demonstrated by adopting the ship hull shell surface mesh subdivision, and the geometric model is shown in fig. 2.
First, a pre-meshing mesh size of 800 is designated, mesh pre-meshing of the geometric model is completed, and mesh meshing results are shown in fig. 3. In this embodiment, all common points and common edges within the model are suppressed. The whole pre-dissected grid information is used as input to be transmitted into the next link.
Discrete parameterization of the pre-split grid is then completed by adopting the LSCM, and the result after parameterization is shown in FIG. 4.
On the basis of parameterized pre-meshing grids, designating the global meshing size as 2000, and calculating a grid size field. And adopting a Constraint Delaunay Triangulation (CDT) algorithm to complete meshing on a parameter space. The mesh dissection results are shown in fig. 5.
And establishing a one-to-one correspondence relationship between the grid nodes after re-dissection and the nodes of the pre-dissection grid and the pre-dissection grid. Through a dual projection correction mechanism, firstly, the parameter space nodes are linearly interpolated to form curved surface parameter spaces of original CAD geometrical surfaces, and then, the parameter space nodes are mapped to physical spaces through a curved surface parameterization equation. The final grid result is shown in fig. 6.