A Two-Dimensional Structure Multiple Grid Adaptive Aggregation Method, System, Medium and Computer Program Product
By distributing odd-layer grid cells into two-layer new grid cells in a two-dimensional structure multiple grid, the difficulty of grid aggregation caused by odd-layer grid cells is solved, efficient grid aggregation and dual grid acceleration are achieved, and the flexibility and efficiency of CFD simulation are improved.
Patent Information
- Application Number
- CN202411392222.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2044-10-08
AI Technical Summary
In two-dimensional structure multiple grids, the grid aggregation cannot be performed directly due to odd-layer grid cells, which hinders the effective implementation of the multiple grid algorithm.
By constructing a new point column in the coordinate direction where the number of grid cell layers is odd and dividing the first layer of grid cells into two new grid cells, the number of grid cell layers in all coordinate directions is even, satisfying the grid aggregation conditions.
Mesh aggregation and dual mesh acceleration of arbitrary two-dimensional structure single-block grids are realized, which improves the grid quality and scope of application, enhances the flexibility and robustness of CFD simulation, and reduces the grid preparation time and cost.
Smart Images

Figure CN119323191B_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). Specifically, it relates to a two-dimensional structured multi-grid adaptive aggregation method, system, medium, and computer program product. Background Art
[0002] Computational Fluid Dynamics (CFD), as an interdisciplinary field, conducts simulation analysis on fluid mechanics problems through computers and numerical algorithms, playing an important role in industrial fields such as aerospace. It can help solve key aerodynamic problems in aircraft design, thus promoting technological progress and innovation.
[0003] In the traditional CFD simulation process, the first step is to perform grid division on the computational domain, discretizing the continuous space into a series of grid cells to facilitate numerical solution using the finite difference equation method. Due to the regularity and orderliness of the node arrangement of structured grids, they exhibit high precision, high efficiency, and good stability, and have relatively low requirements for hardware resources. Therefore, they are widely used in basic research related to boundary layer flow and the like.
[0004] However, structured grids also have obvious limitations. First, this type of grid has extremely high quality requirements. Once the grid generation is poor, it may lead to inaccurate calculation results. Second, when faced with complex geometric shapes, the time and labor costs required to construct high-quality structured grids increase significantly, which limits their 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 grid refinement level, the local time step size decreases, resulting in a significant reduction in the overall calculation convergence speed and an increase in the total calculation time. At the same time, large-scale parallel computing also faces another challenge: the failure rate of processors increases with the expansion of the parallel scale, which in turn affects the reliability of long-running jobs. To overcome the above problems, acceleration convergence technology becomes crucial.
[0005] Multi-Grid (MG), as an effective acceleration convergence means, has gradually received attention in the CFD field. By performing iterative and interpolation operations between grid layers with different resolutions, the MG technology can quickly reduce high- and low-frequency error components and accelerate the speed of reaching the exact solution. Among them, the construction of the coarse grid is one of the core links in the entire multi-grid framework, directly related to the quality of 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 dividing the first-layer grid cells according to the grid growth rate, using the grid growth rate as reference data, based on the distances between the coordinates of the adjacent column boundary points of the first-layer grid cells arranged along the coordinate directions, constructing a new point sequence by distance weighting, and connecting all the points in the new point sequence in sequence; taking the connection line of all the points in the new point sequence as the dividing line of the first-layer grid cells, and completing the division of the first-layer grid cells.
[0018] Specifically, in step S1, the shape of each grid cell in the two-dimensional structured single-block grid is a quadrilateral, and the two-dimensional structured single-block grid has two coordinate directions, i and j.
[0019] Specifically, in step S2, if the number of grid cell layers corresponding to each of the two coordinate directions i and j is an even number, it is determined that the two-dimensional structured single-block grid satisfies the conditions for grid aggregation and two-grid acceleration calculation, and the grid adaptive optimization operation is not performed, and directly proceed to the grid aggregation and two-grid acceleration calculation in step S5.
[0020] Specifically, in step S2, if at least one of the number of grid cell layers corresponding to the two coordinate directions i and j is an odd number, proceed to step S3 and perform the grid adaptive optimization operation.
[0021] The present invention also provides a computer system, including a memory, a processor, and a computer program stored on the memory, and the processor executes the computer program to implement the steps of the foregoing two-dimensional structured multi-grid adaptive aggregation method.
[0022] The present invention also provides a computer-readable storage medium, on which a computer program / instructions is stored, and when the computer program / instructions is executed by a processor, the steps of the foregoing two-dimensional structured multi-grid adaptive aggregation method are implemented.
[0023] The present invention also provides a computer program product, including a computer program / instructions, and when the computer program / instructions is executed by a processor, the steps of the foregoing two-dimensional structured multi-grid adaptive aggregation method are implemented.
[0024] In summary, due to the adoption of the present 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 sequence between two columns of nodes of the first-layer grid cells in this direction, and accurately divides the original single-layer grid cells into two 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 application range 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] Figure 9 Schematic diagram for comparing the residual convergence process of double acceleration test in application. DETAILED DESCRIPTION
[0037] To make the objectives, 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 with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and illustrated herein 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 drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.
[0039] Embodiment 1
[0040] A two-dimensional structure multi-grid adaptive aggregation method Figure 1 The overall process of this method is briefly described, and for synchronous reference, the general steps of this method are as follows:
[0041] S1. Obtain the grid information of the two-dimensional structure single-block grid and determine multiple coordinate directions;
[0042] S2. Judge the parity of the number of grid cell layers corresponding to each coordinate direction;
[0043] S3. For the coordinate direction with an odd number of grid cell layers, perform grid adaptive optimization operations;
[0044] S4. In the grid adaptive optimization operation, divide the first-layer grid cells extending in the coordinate direction into two new grid cells to obtain the two-dimensional structure single-block grid after adaptive optimization;
[0045] S5. Perform grid aggregation and two-grid acceleration calculation on the newly obtained two-dimensional structure single-block grid.
[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 introduce the implementation process of the above method in detail. As a brief example, the shape of each grid cell in the two-dimensional structure single-block grid in this embodiment is a quadrilateral, and this two-dimensional structure single-block grid has two coordinate directions, i and j, for reference, see Figure 2 for the schematic illustration.
[0047] First of all, it should be noted that since there are two cases of even and odd numbers of grid cell layers in the two coordinate directions of i and j for the two-dimensional structured single-block grid, when the total number of grid cell 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 cell layers to make it meet the grid aggregation conditions, so as to realize grid aggregation and two-grid acceleration calculation for any two-dimensional structured single-block grid.
[0048] The basic idea of the above method in this embodiment can be described as follows: First, read the grid information, and then sequentially judge the total number of grid cell layers in the two coordinate directions of i and j. For the coordinate direction with an odd number of grid cell layers, obtain the grid growth rate in the current coordinate direction. Based on the distance between the coordinates of adjacent column boundary points arranged along the coordinate direction of the first-layer grid cells in this direction, construct a new point sequence by distance weighting, and divide the first-layer grid cells into two new grid cells, so that the number of grid cell layers in this coordinate direction is even, while the number of grid cell layers in other coordinate directions that are originally even remains unchanged. Finally, the number of grid cell layers in each coordinate direction of the two-dimensional structured single-block grid is even. At this time, the optimized two-dimensional structured single-block grid is obtained, which meets the conditions of grid aggregation and two-grid acceleration calculation.
[0049] Figure 2 A 5×5 two-dimensional structured single-block grid is shown. Figure 2 The numbers in the brackets represent the cell numbers of the first-layer grid cells in the i and j coordinate directions. Taking the Figure 2 grid as an example, the implementation process steps of the method are introduced as follows.
[0050] Step 1: Read the grid information of the current grid, and respectively obtain the number of grid cell layers in the two coordinate directions of i and j of the current grid.
[0051] Step 2: Judge whether the current grid can perform grid aggregation, that is, whether the number of grid cell layers in each coordinate direction is even. If they are all even, the current grid naturally meets the conditions of grid aggregation and two-grid acceleration calculation, and no adaptive grid optimization processing is required; if there are coordinate directions with an odd number of grid cell layers, the grids in these directions need to be optimized.
[0052] Step 3: Judge the number of grid cell layers in the i direction. As Figure 2 shows, the number of grid cell layers is 5, which does not meet the even condition, and the grid in this coordinate direction needs to be processed. First, obtain the grid growth rate in this coordinate direction. In this embodiment, the Figure 2 grid growth rate of the grid is preset to 1.2.
[0053] Step 4: For the first layer of grid cells in the i - direction, using the grid growth rate as reference data, construct a new point sequence between two nodes through distance - weighted method. The new point sequence is as shown by Figure 3 the red dots in. Connect all the points in the new point sequence in Figure 3 in sequence. The formed red solid line divides the first layer of grid cells in the i - direction into two new layers of grid cells. Figure 3 The red numbers in brackets in are the newly obtained cell numbers of each grid cell along the i - direction after the first layer of grid cells in the i - direction are divided. At this time, the number of grid cell layers in the i - direction is 6, meeting the even condition.
[0054] Here, it can be further introduced that the grid growth rate refers to the speed of change in the size of adjacent grid cells in a given direction, such as a coordinate direction. In some areas, denser grids may be required (such as where the flow gradient is large), while in other areas, sparser grids can be used. 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 simulations. If the grid grows too fast, it may lead to discontinuous solutions or a decrease in accuracy; if it grows too slowly, it may result in too high a computational cost.
[0055] The distance - weighted method is a method for determining the positions of new nodes. It determines the positions of new nodes based on the distances between existing nodes. By assigning different weights to different distances, the position selection of new nodes can be affected, 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, using the distance - weighted method can help place new nodes reasonably, so that the entire grid not only meets the density change requirements during the optimization process but also maintains good grid quality.
[0056] Step 5: Repeat Step 3 to judge the number of grid cell layers in the j - direction. From Figure 2 or Figure 3 it can be seen that the number of grid cell layers is 5, which does not meet the even condition, and the grid in this coordinate direction needs to be processed. Similarly, obtain the grid growth rate in this coordinate direction, 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. As shown in Figure 4 the blue dots are the newly constructed point sequence. Connect the points in the point sequence in sequence. The formed blue solid line divides the first layer of grid cells in the j - direction into two new layers of grid cells. 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 andFigure 9 Schematic comparison of the accelerated calculation effect of the dual grid. Since Figure 6 the grid before optimization shown cannot achieve grid aggregation, and thus cannot apply the dual grid accelerated calculation. Its parameter record is Figure 8 and Figure 9 the red solid line (original) in Figure 7 while the optimized grid can smoothly adopt the dual grid accelerated calculation. Its parameter record is Figure 8 and Figure 9 the green solid line (multigrid_level2) in
[0065] From Figure 8 the drag convergence history of Figure 9 and the residual convergence history of , it can be seen by comparison that for the working condition with the dual grid accelerated calculation, the convergence curves of its drag and residual drop rapidly and are completely converged when the iteration step is about 4000 steps. For the grid that has not been optimized by the two-dimensional structured multigrid adaptive aggregation method and cannot adopt the dual grid accelerated calculation, the convergence of its drag and residual is relatively slow and is basically converged when the iteration step is about 9000 steps.
Claims
1. A two-dimensional structure multiple grid adaptive aggregation method, characterized in that The method includes the following steps: S1. Obtain the grid information of the two-dimensional structured single-block grid and determine multiple coordinate directions; S2. Judge the parity of the number of grid cell layers corresponding to each coordinate direction; S3. For the coordinate directions with an odd number of grid cell layers, perform grid adaptive optimization operations; S4. In the grid adaptive optimization operation, divide the first layer of grid cells extending along the coordinate direction into two new layers of grid cells to obtain the two-dimensional structured single-block grid after adaptive optimization; S5. Perform grid aggregation and two-grid acceleration calculation on the newly obtained two-dimensional structured single-block grid; In step S4, first obtain the grid growth rate corresponding to the current coordinate direction, and divide the first layer of grid cells into two new layers of grid cells according to the magnitude of the grid growth rate; When dividing the first layer of grid cells according to the magnitude of the grid growth rate, use the grid growth rate as reference data, and based on the distances between the coordinates of the adjacent column boundary points of the first layer of grid cells arranged along the coordinate direction, construct a new point sequence by distance weighting, and connect all the points in the new point sequence in sequence; take the connection line of all the points in the new point sequence as the dissection line of the first layer of grid cells to complete the dissection of the first layer of grid cells.
2. The two-dimensional structure multiple grid adaptive aggregation method according to claim 1, wherein: In step S3, for the coordinate directions with an even number of grid cell layers, do not perform grid adaptive optimization operations, and directly wait for the grid aggregation and two-grid acceleration calculation in step S5.
3. The two-dimensional structure multiple grid adaptive aggregation method according to claim 1, wherein: In step S1, the shape of each grid cell in the two-dimensional structured single-block grid is a quadrilateral, and the two-dimensional structured single-block grid has two coordinate directions, i and j.
4. The two-dimensional structured multi-grid adaptive aggregation method according to claim 3, wherein: In step S2, if the number of grid cell layers corresponding to both the i and j coordinate directions are even, it is determined that the two-dimensional structured single-block grid meets the conditions for grid aggregation and two-grid acceleration calculation, do not perform grid adaptive optimization operations, and directly perform the grid aggregation and two-grid acceleration calculation in step S5.
5. The two-dimensional structure multi-grid adaptive aggregation method according to claim 4, characterized in that: In step S2, if among the number of grid cell layers corresponding to the i and j coordinate directions, at least one coordinate direction has an odd number of grid cell layers, enter step S3 and perform grid adaptive optimization operations.
6. A computer system, comprising a memory, a processor, and a computer program stored on the memory, characterized in that: The processor executes the computer program to implement the steps of the two-dimensional structured multi-grid adaptive aggregation method described in claim 1.
7. A computer-readable storage medium having computer programs / instructions stored thereon, characterized in that: When the computer program / instructions are executed by the processor, the steps of the two-dimensional structured multi-grid adaptive aggregation method described in claim 1 are implemented.
8. A computer program product comprising a computer program / instructions, characterized in that: When the computer program / instructions are executed by the processor, the steps of the two-dimensional structured multi-grid adaptive aggregation method described in 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