Two-dimensional structure multi-grid adaptive aggregation method and system, medium and computer program product
By dividing odd-layer mesh cells into two new mesh cells in a two-dimensional structure multiple mesh, the difficulty of grid aggregation caused by odd-layer mesh cells is solved, and grid aggregation and dual mesh acceleration are realized , improves the efficiency and flexibility of CFD simulation.
Patent Information
- Application Number
- CN202411392222.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2044-10-08
AI Technical Summary
In computational fluid mechanics, the grid aggregation cannot be performed directly due to odd-layer grid units in two-dimensional structure multiple grids, which hinders the effective implementation of the multiple grid algorithm.
By building a new point column in the coordinate direction of odd-level grid cells, the original one-layer grid cells are divided into two new grid cells, so that the number of grid cells in this direction becomes even, thus satisfying the network Grid aggregation conditions to realize grid aggregation and double grid accelerated calculation.
Simplifies the mesh generation process under complex geometric shapes, improves the mesh quality and scope of application, supports efficient multi-grid acceleration strategies, enhances the flexibility and robustness of the CFD simulation process, and reduces the mesh preparation stage Time and cost.
Smart Images

Figure CN119323191A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computational science and engineering, and is applied to computational fluid dynamics (CFD), and in particular to a two-dimensional structure multi-grid adaptive aggregation method, system, medium and computer program product. Background Art
[0002] Computational Fluid Dynamics (CFD) is an interdisciplinary field that uses computers and numerical algorithms to simulate and analyze fluid dynamics problems, playing an important role in aerospace and other industrial fields. It can help solve key aerodynamic problems in aircraft design, thereby promoting technological progress and innovation.
[0003] In the traditional CFD simulation process, the first step is to mesh the computational domain and discretize the continuous space into a series of grid cells to facilitate numerical solution using the difference equation method. Due to the regularity and orderliness of its node arrangement, structured grids exhibit high accuracy, high efficiency, and good stability, and have relatively low requirements for hardware resources. Therefore, they have been widely used in basic research related to boundary layer flow.
[0004] However, structured grids also have obvious limitations. First, this type of grid has extremely high quality requirements. Once the grid is poorly generated, it may lead to inaccurate calculation results. Second, when faced with complex geometric shapes, the time and labor costs required to build high-quality structural grids increase significantly, which limits its application in dealing with engineering problems with high geometric complexity. In addition, as CFD technology develops towards more complex geometric shapes, ultra-large-scale grids, and multi-physics field coupling, large-scale parallel computing based on high-performance computing platforms has become a necessary condition for achieving efficient simulation. Nevertheless, with the increase in the degree of grid refinement, the local time step decreases, resulting in a significant decrease in the overall calculation convergence speed and an increase in the total calculation time. At the same time, large-scale parallel computing faces another challenge: the processor failure rate increases with the expansion of parallel scale, which in turn affects the reliability of long-running jobs. In order to overcome the above difficulties, accelerated convergence technology becomes crucial.
[0005] As an effective means of accelerating convergence, Multi-Grid (MG) has gradually gained attention in the field of CFD. By performing iteration and interpolation operations between grid layers of different resolutions, MG technology can quickly reduce high- and low-frequency error components and speed up the process of reaching an accurate solution. Among them, the construction of the coarse grid is one of the core links in the entire multi-grid framework, which is directly related to the final acceleration effect.
[0006] What has attracted the attention of those skilled in the art is that when there are an odd number of grid units in a certain coordinate direction, grid aggregation cannot be performed directly, thus hindering the effective implementation of the subsequent multi-grid algorithm. In view of this, how to take appropriate measures to meet the grid aggregation requirements under those specific conditions (such as directions containing an odd number of grid units) has become a research point for those skilled in the art. Summary of the invention
[0007] The purpose of the present invention is to solve the problem that grid aggregation cannot be performed directly due to an odd number of grid units in a two-dimensional structure multi-grid, and therefore a two-dimensional structure multi-grid adaptive aggregation method, system, medium and computer program product are proposed. The present invention selects the coordinate direction with an odd number of grid unit layers, constructs a new point column between two columns of nodes of the first layer of grid units in this direction, and divides the original one layer of grid units into two layers of new grid units according to the grid growth rate, so that the total number of grid unit layers in this direction is an even number, which satisfies the grid aggregation conditions, and realizes the grid aggregation of any single grid of a two-dimensional structure and the double grid acceleration function.
[0008] The present invention adopts the following technical solutions to achieve the purpose:
[0009] A two-dimensional structure multi-grid adaptive aggregation method, the method comprising the following steps:
[0010] S1. Obtaining grid information of a single grid of a two-dimensional structure and determining multiple coordinate directions;
[0011] S2, determining the parity of the number of grid unit layers corresponding to each coordinate direction;
[0012] S3, performing grid adaptive optimization operation for the coordinate direction where the number of grid unit layers is an odd number;
[0013] S4, in the grid adaptive optimization operation, the first layer of grid units extending in the coordinate direction is divided into two layers of new grid units to obtain a two-dimensional structure single block grid after adaptive optimization;
[0014] S5. Perform grid aggregation and double grid acceleration calculation on the newly obtained single-block grid of the two-dimensional structure.
[0015] Specifically, in step S3, for the coordinate direction where the number of grid unit layers is an even number, the grid adaptive optimization operation is not performed, and the grid aggregation and double grid accelerated calculation of step S5 are directly waited.
[0016] Preferably, in step S4, the grid growth rate corresponding to the current coordinate direction is firstly obtained, and the first layer of grid units is divided into two layers of new grid units according to the size of the grid growth rate.
[0017] Preferably, when the first layer of grid units are divided according to the size of the grid growth rate, the grid growth rate is used as reference data, and a new point column is constructed by a distance weighted method based on the distance between the coordinates of adjacent column boundary points of the first layer of grid units arranged along the coordinate direction, and all points in the new point column are connected in sequence; the line connecting all the points in the new point column is used as the dividing line of the first layer of grid units to complete the division of the first layer of grid units.
[0018] Specifically, in step S1, the shape of each grid unit in the two-dimensional structure single block grid is a quadrilateral, and the two-dimensional structure single block grid has two coordinate directions i and j.
[0019] Specifically, in step S2, if the number of grid unit layers corresponding to the two coordinate directions i and j are both even numbers, it is determined that the single grid of the two-dimensional structure meets the conditions for grid aggregation and double grid accelerated calculation, and the grid adaptive optimization operation is not performed, and the grid aggregation and double grid accelerated calculation of step S5 are directly performed.
[0020] Specifically, in step S2, if the number of grid unit layers corresponding to the two coordinate directions i and j is an odd number in at least one coordinate direction, the process proceeds to step S3 to perform a grid adaptive optimization operation.
[0021] The present invention also provides a computer system, including a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the aforementioned two-dimensional structure multi-grid adaptive aggregation method.
[0022] The present invention also provides a computer-readable storage medium on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the steps of the aforementioned two-dimensional structure multi-grid adaptive aggregation method are implemented.
[0023] The present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the aforementioned two-dimensional structure multi-grid adaptive aggregation method when executed by a processor.
[0024] In summary, due to the adoption of this technical solution, the beneficial effects of the present invention are as follows:
[0025] The method of the present invention first identifies the direction to be processed, then constructs a new point column between two columns of nodes of the first layer of grid cells in that direction, and accurately divides the original single-layer grid cells into two layers of new grid cells according to the preset grid growth rate, ensuring that the number of grid cell layers in all coordinate directions is an even number. This not only simplifies the grid generation process under complex geometric shapes, but also significantly improves the quality and applicability of the grid.
[0026] After adopting the method of the present invention, any form of two-dimensional structure single-block grid can meet the basic conditions of grid aggregation, thereby supporting the application of efficient multi-grid acceleration strategies. Specifically, through the effective adjustment of the original grid structure, the problem originally limited by the odd-numbered layers of grid units has been fundamentally solved, which provides a solid foundation for the subsequent use of multi-grid technology to achieve rapid convergence. In addition, by eliminating the dependence on specific grid configurations, the present invention also enhances the flexibility and robustness of the CFD simulation process, which is of great significance for promoting the improvement of CFD simulation efficiency in a large-scale parallel computing environment.
[0027] The application of the method of the present invention can automatically perform the optimization process according to the specific conditions of different grids, and can ensure that the number of grid unit layers in all coordinate directions reaches the ideal state without human intervention, greatly reducing the uncertainty and error caused by human factors. In this way, while ensuring high-precision calculation results, it also greatly reduces the time and cost investment required in the grid preparation stage, especially when facing complex shape designs. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 The schematic diagram briefly describes the overall process of the method of the present invention;
[0029] Figure 2 A schematic diagram of a single grid of a two-dimensional structure in an example of the present invention;
[0030] Figure 3 This is a schematic diagram of the effect of dividing the first layer of grid units in the i direction in an example of the present invention;
[0031] Figure 4 This is a schematic diagram of the effect of dividing the first layer of grid units in the j direction in an example of the present invention;
[0032] Figure 5 A schematic diagram of the grid aggregation effect of a single grid of a two-dimensional structure in an example of the present invention;
[0033] Figure 6 This is a schematic diagram of the mesh when mesh aggregation cannot be performed before optimization in the application;
[0034] Figure 7 This is a schematic diagram of the mesh after optimization and mesh aggregation in the application;
[0035] Figure 8 It is a schematic diagram for comparing the resistance convergence process of double acceleration test in application;
[0036] Fig. 9 Schematic diagram for comparing the residual convergence process of double acceleration test in application. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0038] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. 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.
[0039] Example 1
[0040] A two-dimensional multigrid adaptive aggregation method. Figure 1 The overall process of the method is briefly described in FIG. 1 , which can be viewed simultaneously. The steps of the method are summarized as follows:
[0041] S1. Obtaining grid information of a single grid of a two-dimensional structure and determining multiple coordinate directions;
[0042] S2, determining the parity of the number of grid unit layers corresponding to each coordinate direction;
[0043] S3, performing grid adaptive optimization operation for the coordinate direction where the number of grid unit layers is an odd number;
[0044] S4, in the grid adaptive optimization operation, the first layer of grid units extending in the coordinate direction is divided into two layers of new grid units to obtain a two-dimensional structure single block grid after adaptive optimization;
[0045] S5. Perform grid aggregation and double grid acceleration calculation on the newly obtained single-block grid of the two-dimensional structure.
[0046] In this embodiment, under the framework of the steps of the above method, a specific exemplary two-dimensional structure single block grid is used to describe the implementation process of the above method in detail. As a brief example, each grid unit in the two-dimensional structure single block grid in this embodiment is a quadrilateral. The two-dimensional structure single block grid has two coordinate directions, i and j. Figure 2 's hint.
[0047] First of all, it should be noted that the number of grid unit layers in a two-dimensional structure along the two coordinate directions i and j is either even or odd, and when the total number of grid unit layers is odd, grid aggregation cannot be achieved in the corresponding coordinate direction, which will bring difficulties to the implementation of subsequent multiple acceleration algorithms. Therefore, it is necessary to process the coordinate direction with an odd number of grid unit layers to meet the grid aggregation conditions, thereby realizing grid aggregation and double grid acceleration calculation for any single grid of a two-dimensional structure.
[0048] The basic idea of the above method of this embodiment can be described as follows: first read the grid information, and then judge the total number of grid unit layers in the two coordinate directions i and j in turn. For the coordinate direction with an odd number of grid unit layers, obtain the grid growth rate in the current coordinate direction, and construct a new point column by a distance weighted method based on the distance between the coordinates of the adjacent column boundary points of the first layer of grid units in this direction arranged along the coordinate direction, and divide the first layer of grid units into two new layers of grid units, so that the number of grid unit layers in this coordinate direction is an even number, and the grid unit layers in other coordinate directions that are even numbers are not processed, and finally the number of grid unit layers in each coordinate direction of the two-dimensional structure single block grid is an even number. At this time, the optimized two-dimensional structure single block grid is obtained, which meets the conditions of grid aggregation and double grid accelerated calculation.
[0049] Figure 2 shows a 5×5 two-dimensional structured single-block grid, Figure 2 The numbers in the brackets represent the unit numbers of the first layer of grid units along the i and j coordinate directions. Figure 2 The grid is taken as an example, and the implementation steps of the method are introduced as follows.
[0050] Step 1: Read the grid information of the current grid and obtain the number of grid unit layers of the current grid in the i and j coordinate directions respectively.
[0051] Step 2: Determine whether the current grid can be aggregated, that is, whether the number of grid unit layers in each coordinate direction is an even number. If they are all even numbers, the current grid naturally meets the conditions for grid aggregation and double grid accelerated calculation, and there is no need to perform adaptive grid optimization processing; if there are coordinate directions where the number of grid unit layers is an odd number, the grids in these directions need to be optimized.
[0052] Step 3: Determine the number of grid unit layers in the i direction, by Figure 2 It can be seen that the number of grid unit layers is 5, which does not meet the even number condition, and the grid in this coordinate direction needs to be processed. First, the grid growth rate in this coordinate direction is obtained. This embodiment presets Figure 2 The grid growth rate of the medium grid is 1.2.
[0053] Step 4: For the first layer of grid cells in the i direction, use the grid growth rate as reference data and construct a new point sequence between two nodes by distance weighting. The new point sequence is as follows: Figure 3 As shown by the red dots in Figure 3 All the points in the new point column are connected in sequence, and the red solid line formed divides the first layer of grid cells in the i direction into two new layers of grid cells. Figure 3 The red numbers in the brackets are the newly obtained unit numbers of each grid unit along the i direction after the first layer of grid units in the i direction are divided. At this time, the number of grid unit layers in the i direction is 6, which meets the even number condition.
[0054] It can be further introduced here that the grid growth rate refers to the speed at which the size of adjacent grid cells changes in a given direction, such as the coordinate direction. In some areas, a denser grid may be required (such as where the flow gradient is large), while a sparser grid can be used in other areas. The grid growth rate is usually used to control this change from coarse to fine or from fine to coarse to ensure the accuracy and efficiency of numerical simulation. If the grid grows too fast, it may cause discontinuity or loss of accuracy of the solution; if it grows too slowly, it may lead to excessive computational costs.
[0055] The distance weighting method is a method for determining the location of new nodes, which determines the location of new nodes based on the distance between existing nodes. The location selection of new nodes can be influenced by assigning different weights to different distances, so as to better capture the key features of physical phenomena or ensure the quality of the grid (such as orthogonality, smooth transition, etc.). Therefore, when adjusting the grid density according to a certain grid growth rate, the distance weighting method can help to reasonably place the new nodes, so that the entire grid can match the density change requirements and maintain good grid quality during the optimization process.
[0056] Step 5: Repeat step 3 to determine the number of grid unit layers in the j direction. Figure 2 or Figure 3 It can be seen that the number of grid unit layers is 5, which does not meet the even number condition, and the grid in this coordinate direction needs to be processed. Similarly, the grid growth rate in this coordinate direction is obtained, which is also preset to 1.2.
[0057] Step 6: Repeat step 4 to process the first layer of grid cells in the j direction. Figure 4 As shown in the figure, the blue dots are the newly constructed point series. The points in the point series are connected in sequence. The blue solid lines formed divide the first layer of grid units in the j direction into two new layers of grid units. Figure 4The blue numbers in the brackets are the newly obtained unit numbers of each grid unit along the j direction after the first layer of grid units in the j direction is divided. At this time, the number of grid unit layers in the j direction is 6, which meets the even number condition. So far, the grid optimization process in all coordinate directions has been completed.
[0058] Step 7: Target Figure 4 The optimized 6×6 two-dimensional structure single block grid shown can perform grid aggregation and double grid accelerated calculation. Figure 5 As shown, Figure 5 The black dotted line in the middle is the effect before grid aggregation, the red solid line is the effect after grid aggregation, and the numbers in red brackets represent the new grid unit numbers corresponding to the grid after aggregation.
[0059] Example 2
[0060] Based on Example 1, this example introduces the application of the two-dimensional structure multi-grid adaptive aggregation method. First, the method can be effectively applied to a computer system, which includes a memory, a processor, and a computer program stored in the memory, and the processor executes the computer program to implement the steps of the two-dimensional structure multi-grid adaptive aggregation method.
[0061] Meanwhile, the method may be stored in a computer-readable storage medium, which implements the steps of the two-dimensional structure multi-grid adaptive aggregation method through the computer program / instructions stored thereon when the computer program / instructions are executed by a processor.
[0062] Meanwhile, the method can also be included in a computer program product as a computer program / instruction, and the computer program / instruction, when executed by a processor, implements the steps of the two-dimensional structure multi-grid adaptive aggregation method.
[0063] This embodiment further introduces the above method in Figure 6 and Figure 7 The test conditions of the two-dimensional NACA0012 airfoil example at an attack angle of 15 degrees are shown in the figure. Figure 6 This is a schematic diagram of a grid that cannot be aggregated before grid optimization (the grid has 223 layers of grid units in the i direction and 63 layers of grid units in the j direction); Figure 7 This is an illustration of the effect of a grid optimized using the two-dimensional structure multi-grid adaptive aggregation method (there are 224 layers of grid units in the i direction and 64 layers of grid units in the j direction) after a grid aggregation.
[0064] At the same time, Figure 6 The mesh before optimization shown in the figure is used as a reference. Figure 7 The optimized grid is compared with whether the double grid is used to accelerate the calculation. Figure 8 and Fig. 9 The comparison of the double grid acceleration calculation effect is shown in Figure 2. Figure 6 The mesh before optimization shown in the figure cannot achieve mesh aggregation, so it is impossible to apply double mesh acceleration calculation. Its parameters are recorded as Figure 8 and Fig. 9 The solid red line in (original); and Figure 7 The optimized grid can be successfully used for double grid acceleration calculation, and its parameters are recorded as Figure 8 and Fig. 9 The solid green line in (multigrid_level2).
[0065] from Figure 8 The resistance convergence process and Fig. 9 The residual convergence process can be compared to show that the convergence curve of resistance and residual of the working condition using double grid accelerated calculation drops rapidly, and it has fully converged when the iteration step is about 4000. However, the mesh that is not optimized by the two-dimensional structure multi-grid adaptive aggregation method and cannot use the working condition of double grid accelerated calculation has a relatively slow convergence of resistance and residual, and basically converges when the iteration step is about 9000.
Claims
1. A two-dimensional structure multi-grid adaptive aggregation method, characterized in that: The method comprises the following steps: S1. Obtaining grid information of a single grid of a two-dimensional structure and determining multiple coordinate directions; S2, determining the parity of the number of grid unit layers corresponding to each coordinate direction; S3, performing grid adaptive optimization operation for the coordinate direction where the number of grid unit layers is an odd number; S4, in the grid adaptive optimization operation, the first layer of grid units extending in the coordinate direction is divided into two layers of new grid units to obtain a two-dimensional structure single block grid after adaptive optimization; S5. Perform grid aggregation and double grid acceleration calculation on the newly obtained single-block grid of the two-dimensional structure.
2. The two-dimensional structure multi-grid adaptive aggregation method according to claim 1, characterized in that: In step S3, for the coordinate direction where the number of grid unit layers is an even number, the grid adaptive optimization operation is not performed, and the grid aggregation and double grid accelerated calculation of step S5 are directly waited.
3. The two-dimensional structure multi-grid adaptive aggregation method according to claim 1, characterized in that: In step S4, the grid growth rate corresponding to the current coordinate direction is firstly obtained, and the first layer of grid units is divided into two layers of new grid units according to the size of the grid growth rate.
4. The two-dimensional structure multi-grid adaptive aggregation method according to claim 5, characterized in that: When the first layer of grid units are divided according to the size of the grid growth rate, the grid growth rate is used as reference data, and a new point column is constructed by a distance weighted method according to the distance between the coordinates of the adjacent column boundary points of the first layer of grid units arranged along the coordinate direction, and all the points in the new point column are connected in sequence; the line connecting all the points in the new point column is used as the dividing line of the first layer of grid units to complete the division of the first layer of grid units.
5. The two-dimensional structure multi-grid adaptive aggregation method according to claim 1, characterized in that: In step S1, each grid unit in a two-dimensional structure single block grid is in the shape of a quadrilateral, and the two-dimensional structure single block grid has two coordinate directions i and j.
6. The two-dimensional structure multi-grid adaptive aggregation method according to claim 5, characterized in that: In step S2, if the number of grid unit layers corresponding to the two coordinate directions i and j are both even numbers, it is determined that the single grid of the two-dimensional structure meets the conditions for grid aggregation and double grid accelerated calculation, and the grid adaptive optimization operation is not performed, and the grid aggregation and double grid accelerated calculation of step S5 are directly performed.
7. The two-dimensional structure multi-grid adaptive aggregation method according to claim 6, characterized in that: In step S2, if the number of grid unit layers corresponding to the two coordinate directions i and j is an odd number in at least one coordinate direction, the process proceeds to step S3 to perform a grid adaptive optimization operation.
8. A computer system comprising a memory, a processor, and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the two-dimensional structure multi-grid adaptive aggregation method according to claim 1.
9. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instruction is executed by a processor, the steps of the two-dimensional structure multi-grid adaptive aggregation method according to claim 1 are implemented.
10. A computer program product comprising a computer program / instructions, characterized in that: When the computer program / instruction is executed by a processor, the steps of the two-dimensional structure multi-grid adaptive aggregation method according to claim 1 are implemented.
Citation Information
Patent Citations
Curved surface grid generation method and system based on recursive decomposition, and computer equipment
CN115774968A
Surface structure grid generation method and device
CN117893712A
Configuration management method of automatic test process and readable storage medium
CN118427109A
Multi-working-medium electric propeller optimization method and system
CN118485007A