Method for Rapidly and Automatically Generating Structured Multilayer and Multiblock Nested Background Cartesian Grids

By generating structured multi-layer multi-block nested background Cartesian mesh, the problem of complex appearance grid generation is solved, and the accuracy and efficiency of numerical simulation of computational fluid mechanics is improved. It is suitable for CFD/RBD coupling solution.

CN115719045BActive Publication Date: 2025-07-22NORTHWESTERN POLYTECHNICAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211565444.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-07
Publication Date
2025-07-22
Estimated Expiration
2042-12-07

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently generate high-quality structured meshes, especially structured nested meshes with complex appearances, which affects the accuracy and efficiency of numerical simulation of computational fluid mechanics. In addition, traditional Cartesian meshes have poor adaptability and are difficult to cope with complex flow problems and CFD/RBD coupling solutions.

Method used

The rapid automatic generation method of structured multi-layer multi-block nested background Cartesian mesh is adopted. By inputting the surface mesh file and a small number of parameters of the three-dimensional geometry, the multi-layer background mesh is nested layer by layer, and the mesh cluster is constructed in combination with building blocks to generate high-quality structured multi-layer multi-block nested background Cartesian mesh.

Benefits of technology

It realizes efficient and automated generation of high-quality structured multi-layer multi-block nested background Cartesian mesh, simplifies the grid generation process, reduces memory usage, and facilitates large-scale parallel computing. It is suitable for CFD/RBD coupled numerical simulation and grid adaptive numerical simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115719045B_ABST
    Figure CN115719045B_ABST
Patent Text Reader

Abstract

The present invention provides a method for quickly and automatically generating a structured multi-layer and multi-block nested background Cartesian grid, comprising the following steps: inputting a surface grid file of a three-dimensional geometric body and determining basic parameters; estimating the number of background grid levels; constructing an initial geometric bounding box that completely encloses the three-dimensional geometric body at least; optimizing the initial geometric bounding box to obtain an optimized geometric bounding box; forming a background grid nested layer by layer in a building-block manner; dividing the grid block by block and outputting a structured multi-layer and multi-block nested background Cartesian grid. The present invention can achieve the efficient and automatic generation of a high-quality structured multi-layer and multi-block background Cartesian grid only relying on a small number of input parameters and simple surface grid information. The grid generation process is simple and efficient, easy to be programmed, has low memory occupancy, and is convenient for large-scale parallelization, providing a good basis for realizing CFD coupled with RBD numerical simulation or grid adaptive numerical simulation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of numerical simulation of computational fluid dynamics, and particularly relates to a method for rapidly and automatically generating a structured multi-layer and multi-block nested background Cartesian grid. Background Technique

[0002] Mesh generation technology plays an extremely important role in CFD (Computational Fluid Dynamics). During the CFD numerical simulation process, mesh generation often occupies 60% of the man-hour consumption of the entire calculation process. The quality of the mesh directly affects the accuracy of the calculation results. At the same time, the engineering applications of high-precision and high-resolution formats are gradually increasing, putting forward higher requirements for the mesh quality. With the increasing complexity of CFD applications, people have gradually realized that the limitations of mesh generation seriously restrict the numerical simulation ability of complex shapes.

[0003] Structured grids have a simple data structure and high computational efficiency. The finite difference method using structured grids to discretize physical space can also apply high-order numerical formats, thereby realizing high-precision CFD numerical simulation. However, it is very difficult to generate high-quality structured grids for complex shapes. Even if structured grids can be generated, due to the complexity of the Jacobian matrix for the conversion between physical space and computational space, it will significantly affect the computational accuracy and efficiency. The proposed Chimera nested grid method enables structured grids to be easily applied to the numerical simulation of complex shapes. However, traditional structured nested grids have poor adaptability and a complex mesh generation process, making it difficult to handle complex flow problems and CFD / RBD coupled solution problems. Summary of the Invention

[0004] Aiming at the defects existing in the prior art, the present invention provides a method for rapidly and automatically generating a structured multi-layer and multi-block nested background Cartesian grid, which can effectively solve the above problems.

[0005] The technical solution adopted by the present invention is as follows:

[0006] The present invention provides a method for rapidly and automatically generating a structured multi-layer and multi-block nested background Cartesian grid, including the following steps: Step 1, input the surface mesh file of a three-dimensional geometric body and determine the basic parameters, including: far-field size S Far , the scale S1 of the background grid cells in the first layer, the number of background grid transition layers T, and the number of background grid nested boundary layers C;

[0007] Step 2, estimate the number of background grid layers N based on the far-field size S Far , the scale S1 of the background grid cells in the first layer, and the number of background grid transition layers T;

[0008] Therefore, centering on the first-level background grid, the second-level background grid, the third-level background grid, ···, the N-level background grid are nested layer by layer in the direction from the inside to the outside, and the scales of the background grid cells gradually increase, which are: S2, S3 ··· S N , where S k = S1 × 2 k-1 , k = 2, 3, ..., N;

[0009] Step 3: Construct an initial geometric bounding box that minimally and completely encloses the three-dimensional geometric body according to the surface grid file of the three-dimensional geometric body; the initial geometric bounding box is a cuboid;

[0010] Step 4: Optimize the initial geometric bounding box to obtain an optimized geometric bounding box, which is a cuboid, and each side length thereof is an integer multiple of the first-level background grid cell scale S1;

[0011] The optimized geometric bounding box is called the first-level geometric bounding box Cluster1, corresponding to the first-level background grid;

[0012] Step 5: Adopt a building-block method to sequentially construct the second-level background grid, the third-level background grid, ···, the N-level background grid to form a nested background grid layer by layer;

[0013] Step 6: Grid the first-level geometric bounding box Cluster1 according to the first-level background grid cell scale S1; for the second-level background grid, the third-level background grid, ···, the N-level background grid, grid them according to the second-level background grid cell scale S2, the third-level background grid cell scale S3 ··· the N-level background grid cell scale S N respectively, thereby generating a structured multi-layer and multi-block nested background Cartesian grid.

[0014] The method for quickly and automatically generating a structured multi-layer and multi-block nested background Cartesian grid provided by the present invention has the following advantages:

[0015] The present invention can realize the efficient and automatic generation of a high-quality structured multi-layer and multi-block background Cartesian grid only by relying on a small number of input parameters and simple surface grid information. The grid generation process is simple and efficient, easy to be programmed and implemented, has low memory occupation, and is convenient for large-scale parallel processing, providing a good foundation for realizing the numerical simulation of CFD (Computational Fluid Dynamics) coupled with RBD (Rigid Body Dynamics) or grid adaptive numerical simulation. Brief Description of the Drawings

[0016] Figure 1 Schematic flow chart of a method for quickly and automatically generating a structured multi-layer and multi-block nested background Cartesian grid provided by the present invention;

[0017] Figure 2 Schematic diagram of a grid system for spatial discretization using the Chimera nested grid method;

[0018] Figure 3 Schematic diagram of a structured single-block grid for the discrete surface of a cylinder;

[0019] Figure 4 Schematic diagram of a structured multi-block point-lap grid for the discrete surface of a cylinder;

[0020] Figure 5 Schematic diagram of a structured multi-block nested grid for the discrete surface of a cylinder;

[0021] Figure 6 Schematic diagram of the scale relationship of background grids at different levels;

[0022] Figure 7 Schematic diagram of the nested topological structure of the No. 1 background grid cluster at different levels;

[0023] Figure 8 Schematic diagram of the nested topological structure of the No. 2 background grid cluster at different levels;

[0024] Figure 9 Schematic diagram of the nested topological structure of the No. 3 background grid cluster at different levels;

[0025] Figure 10 Schematic diagram of the nested topological structure of the No. 4 background grid cluster at different levels;

[0026] Figure 11 Schematic diagram of the nested topological structure of the No. 5 background grid cluster at different levels;

[0027] Figure 12 Schematic diagram of the nested topological structure of the No. 6 background grid cluster at different levels;

[0028] Figure 13 Schematic diagram of the constructed initial geometric bounding box;

[0029] Figure 14 Schematic diagram of the optimized geometric bounding box;

[0030] Figure 15 Schematic diagram of the grid cluster number, longitudinal and transverse normal definitions, and building method at the first level;

[0031] Figure 16 Schematic diagram of the grid cluster number, longitudinal and transverse normal definitions, and building method at the second level;

[0032] Figure 17It is a schematic diagram after the construction of the second-level grid clusters;

[0033] Figure 18 It is a three-dimensional diagram of the grid clusters No. 1 and No. 2 at the second level;

[0034] Figure 19 It is the front view of the grid clusters No. 1 and No. 2 at the second level;

[0035] Figure 20 It is the side view of the grid clusters No. 1 and No. 2 at the second level;

[0036] Figure 21 It is a three-dimensional diagram of the grid clusters No. 3 and No. 4 at the second level;

[0037] Figure 22 It is the front view of the grid clusters No. 3 and No. 4 at the second level;

[0038] Figure 23 It is the side view of the grid clusters No. 3 and No. 4 at the second level;

[0039] Figure 24 It is a three-dimensional diagram of the grid clusters No. 5 and No. 6 at the second level;

[0040] Figure 25 It is the front view of the grid clusters No. 5 and No. 6 at the second level;

[0041] Figure 26 It is the side view of the grid clusters No. 5 and No. 6 at the second level;

[0042] Figure 27 It is a three-dimensional diagram of the grid clusters No. 1 and No. 2 at the third level;

[0043] Figure 28 It is a three-dimensional diagram of the grid clusters No. 3 and No. 4 at the third level;

[0044] Figure 29 It is a three-dimensional diagram of the grid clusters No. 5 and No. 6 at the third level;

[0045] Figure 30 It is a schematic diagram of the uniform subdivision of the first-level grid. Detailed implementation manners

[0046] In order to make the technical problems, technical solutions and beneficial effects solved by the present invention clearer and more understandable, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0047] The Cartesian grid has good orthogonality, and the grid generation process is simple and time-saving. At the same time, the Cartesian grid has a natural hierarchical structure, which is very suitable for grid adaptation according to the change of flow field structure and realizing the coupled solution of CFD / RBD. However, the traditional Cartesian grid is unstructured and cannot be applied to the finite difference method to achieve high-precision numerical simulation. The present invention provides a method for quickly and automatically generating a structured multi-layer multi-block nested background Cartesian grid suitable for the finite difference method, which solves the problem that the traditional Cartesian grid is not suitable for structured solvers, and at the same time provides a good basis for the CFD / RBD coupled numerical simulation and grid adaptive numerical simulation of structured grids.

[0048] For the grid system with spatial discretization using the Chimera nested grid method, the present invention decomposes the computational domain into a body-fitted computational domain and a background computational domain. The body-fitted computational domain is the viscous region near the geometric surface. For the complex multi-component aircraft shape, according to the shape characteristics, the geometry as a whole is split into components, and each component generates a structured single-block grid containing boundary layer grids alone to fill the near-surface area. The body-fitted grid clusters of each component finally form a body-fitted grid system with overlapping regions with each other. The generation of the body-fitted grid can use various existing commercial grid generation software such as Pointwise, ICEMCFD, etc., which is not the field involved in the present invention. The background computational domain is the flow region from near the surface to the far-field boundary. The present invention mainly proposes an efficient automatic filling method for a structured multi-layer multi-block nested Cartesian grid for the background computational domain.

[0049] Reference Figure 1 , the method for quickly and automatically generating a structured multi-layer multi-block nested background Cartesian grid provided by the present invention includes the following steps:

[0050] Step 1, input the surface grid file of the three-dimensional geometry and determine the basic parameters, including: far-field size S Far , the first-level background grid cell size S1, the background grid transition layer number T, and the background grid nested boundary layer number C;

[0051] Among them, the first-level background grid cell size S1 is determined by the following formula:

[0052] S1 = a0·S Out , 0.5 < a0 < 2.0

[0053] Where:

[0054] S Out is the outermost body-fitted grid cell size of the body-fitted computational domain of the three-dimensional geometry;

[0055] a0 is the coefficient used to calculate the first-level background grid cell size S1.

[0056] Step 2: Estimate the number of background grid levels N based on the far-field size S Far , the scale S1 of the background grid cells at the first level, and the number of background grid transition layers T

[0057] Therefore, centering on the background grid at the first level, layer-by-layer nesting is performed in the direction from the inside to the outside to form the background grid at the second level, the background grid at the third level, ···, the background grid at the Nth level, and the scale of the background grid cells gradually increases, which are: S2, S3 ··· S N , where S k = S1 × 2 k-1 , k = 2, 3, ···, N

[0058] In this step, the following method is used to estimate the number of background grid levels N

[0059] Let the number of background grid levels N be the maximum value of the integers that satisfy the following conditions, which is the finally determined number of background grid levels N

[0060] Δ1 + Δ2 +... + Δ N ≤ S Far

[0061] where: Δ1, Δ2,..., Δ N , are the transition layer thicknesses of the background grid at the first level, the transition layer thicknesses of the background grid at the second level, …, the transition layer thicknesses of the background grid at the Nth level, respectively, and are calculated by the following formula

[0062]

[0063] Step 3: Construct an initial geometric bounding box that minimally and completely encloses the three-dimensional geometric body according to the surface mesh file of the three-dimensional geometric body; the initial geometric bounding box is a cuboid

[0064] Step 3 is specifically as follows

[0065] Traverse the surface mesh file of the three-dimensional geometric body, and extract the minimum coordinate point P min (X min , Y min , Z min ) and the maximum coordinate point P max (X max , Y max , Z max ) of the three-dimensional geometric body in the physical space inertial coordinate system. Using the minimum coordinate point P min (X min , Y min , Z min ) and the maximum coordinate point P max (X max , Ymax , Z max ), the connection line is used as the polar diagonal line, and then an initial geometric bounding box that completely encloses the three-dimensional geometric body is constructed. The length Length_X of the initial geometric bounding box initial , width Length_Y initial and height Length_Z initial are respectively:

[0066]

[0067] Step 4: Optimize the initial geometric bounding box to obtain an optimized geometric bounding box. The optimized geometric bounding box is a cuboid, and each side length is an integer multiple of the scale S1 of the background grid unit at the first level;

[0068] The optimized geometric bounding box is called the first-level geometric bounding box Cluster1, corresponding to the first-level background grid;

[0069] Step 4 is specifically as follows:

[0070] Step 4.1: Determine the optimization factor D:

[0071] Step 4.1.1: Let the initial value of the loop counter I be 1, and the initial value of the optimization factor D be 0;

[0072] Step 4.1.2: Judge whether I is less than N. If so, execute Step 4.1.3; otherwise, execute Step 4.1.4;

[0073] Step 4.1.3: Let D = 2·D + 4, I = I + 1; then return to Step 4.1.2;

[0074] Step 4.1.4: Output the finally determined optimization factor D;

[0075] Step 4.2: Use the optimization factor D. According to the following formula, obtain the length Length_X, width Length_Y optimized , and height Length_Z optimized of the optimized geometric bounding box are respectively: optimized

[0076]

[0077] where k is an integer, and the function even((2 N-1 ·k - D·T)·S1, Length_X initial ) represents returning the integer closest to Length_X initial in the direction of increasing absolute value (2 N-1 ·k - D·T)·S1; ​

[0078] The vertex p with the maximum value of the polar diagonal of the optimized geometric bounding box max,optimized and the vertex p with the minimum value min,optimized The coordinates in this coordinate system are respectively:

[0079]

[0080] Thus, the optimized geometric bounding box is obtained.

[0081] Step 5: In a building-block manner, construct the second-level background grid, the third-level background grid, ···, the N-level background grid in sequence to form a nested background grid layer by layer;

[0082] In this step, for any level of the background grid among the second-level background grid, the third-level background grid, ···, the N-level background grid, denoted as: Cluster a , a = 2, 3, 4 ··· N, is constructed in the following way:

[0083] For the optimized geometric bounding box, that is, the first-level geometric bounding box Cluster 1,1 , which is a cuboid and is formed by 6 grid clusters, and the 6 grid clusters are denoted as:

[0084] Cluster 1,1 Cluster 1,2 Cluster 1,3 Cluster 1,4 Cluster 1,5 Cluster 1,6 , which respectively represent the upper surface grid cluster, the lower surface grid cluster, the front surface grid cluster, the rear surface grid cluster, the left surface grid cluster, and the right surface grid cluster;

[0085] For the a-level background grid, which is a cuboid and is formed by 6 grid clusters, and the 6 grid clusters are denoted as: Cluster a,b , b = 1, 2, 3, 4, 5, 6;

[0086] Among them, Cluster a,1 Cluster a,2 Cluster a,3 Cluster a,4 Cluster a,5 Cluster a,6 respectively represent the upper surface grid cluster, the lower surface grid cluster, the front surface grid cluster, the rear surface grid cluster, the left surface grid cluster, and the right surface grid cluster. Each surface grid cluster is a cuboid, and the 6 faces of each surface grid cluster are formed by the corresponding faces of its previous-level background grid migrating inwards or outwards.

[0087] The specific construction method of each surface grid cluster is as follows:

[0088] The upper surface grid cluster Cluster a,1 The outer normal boundary of is migrated outward by Δ a-1,1 from the upper surface of the upper surface grid cluster Cluster a of the previous layer, where Δ a = S a-1,1 ·T. Its inner normal boundary is migrated inward by O a = S a ·C from the upper surface of the upper surface grid cluster Cluster a-1,3 of the previous layer. Its longitudinal front surface boundary is migrated outward by Δ a = S a ·T from the front surface grid cluster Cluster a-1,4 of the previous layer. Its longitudinal rear surface boundary is migrated outward by Δ a = S a ·T from the rear surface grid cluster Cluster a-1,5 of the previous layer. Its transverse left surface boundary is migrated outward by Δ a = S a ·T from the left surface grid cluster Cluster a-1,6 of the previous layer. Its transverse right surface boundary is migrated outward by Δ a = S a ·T.

[0089] The lower surface grid cluster Cluster a,2 The outer normal boundary of is migrated outward by Δ a-1,2 from the lower surface of the lower surface grid cluster Cluster a of the previous layer, where Δ a = S a-1,2 ·T. Its inner normal boundary is migrated inward by O a = S a ·C from the lower surface of the lower surface grid cluster Cluster a-1,3 of the previous layer. Its longitudinal front surface boundary is migrated outward by Δ a = S a ·T from the front surface grid cluster Cluster a-1,4 of the previous layer. Its longitudinal rear surface boundary is migrated outward by Δ a = S a ·T from the rear surface grid cluster Cluster a-1,5 of the previous layer. Its transverse left surface boundary is migrated outward by Δ a = S a·Determined by T; the right surface boundary in the horizontal direction is migrated outward by Δ from the right surface mesh cluster Cluster of its previous layer a-1,6 outward migration by Δ a = S a ·Determined by T;

[0090] the normal outer boundary of the front surface mesh cluster Cluster a,3 is migrated outward by Δ from the front surface of the front surface mesh cluster Cluster of its previous layer a-1,3 outward migration by Δ a = S a ·Determined by T, its normal inner boundary is migrated inward by O from the front surface of the front surface mesh cluster Cluster of its previous layer a-1,3 inward migration by O a = S a ·Determined by C; its left surface boundary in the longitudinal direction is migrated outward by S from the left surface of the left surface mesh cluster Cluster of its previous layer a-1,5 outward migration by S a determined; its right surface boundary in the longitudinal direction is migrated outward by S from the right surface of the right surface mesh cluster Cluster of its previous layer a-1,6 outward migration by S a determined; its upper surface boundary in the horizontal direction is migrated outward by S from the upper surface of the upper surface mesh cluster Cluster of its previous layer a-1,1 outward migration by S a determined; its lower surface boundary in the horizontal direction is migrated outward by S from the lower surface of the lower surface mesh cluster Cluster of its previous layer a-1,2 outward migration by S a determined;

[0091] the normal outer boundary of the rear surface mesh cluster Cluster a,4 is migrated outward by Δ from the rear surface of the rear surface mesh cluster Cluster of its previous layer a-1,4 outward migration by Δ a = S a ·Determined by T, its normal inner boundary is migrated inward by O from the rear surface of the rear surface mesh cluster Cluster of its previous layer a-1,4 inward migration by O a = S a ·Determined by C; its left surface boundary in the longitudinal direction is migrated outward by S from the left surface of the left surface mesh cluster Cluster of its previous layer a-1,5 outward migration by S a determined; its right surface boundary in the longitudinal direction is migrated outward by S from the right surface of the right surface mesh cluster Cluster of its previous layer a-1,6 outward migration by S a determined; its upper surface boundary in the horizontal direction is migrated outward by S from the upper surface of the upper surface mesh cluster Cluster of its previous layer a-1,1 outward migration by S a determined; its lower surface boundary in the horizontal direction is migrated outward by S from the lower surface of the lower surface mesh cluster Cluster of its previous layer a-1,2The lower surface migrates outwards by S a Determine;

[0092] Left surface grid cluster Cluster a,5 The outer boundary of the normal is migrated outwards by Δ from the left surface grid cluster Cluster of its previous layer a-1,5 The left surface of... migrates outwards by Δ a = S a ·T is determined, and its inner boundary of the normal is migrated inwards by O from the left surface grid cluster Cluster of its previous layer a-1,5 The left surface of... migrates inwards by O a = S a ·C is determined; its longitudinal front surface boundary is migrated outwards by Δ from the front surface grid cluster Cluster of its previous layer a-1,3 Migrate outwards by Δ a = S a ·T is determined; its longitudinal rear surface boundary is migrated outwards by Δ from the rear surface grid cluster Cluster of its previous layer a-1,4 Migrate outwards by Δ a = S a ·T is determined; its transverse upper surface boundary is migrated inwards by S2 from the upper surface grid cluster Cluster of its previous layer a-1,1 The upper surface of... migrates inwards by S2; its transverse lower surface boundary is migrated inwards by S2 from the lower surface grid cluster Cluster of its previous layer a-1,2 The lower surface of... migrates inwards by S2;

[0093] Right surface grid cluster Cluster a,6 The outer boundary of the normal is migrated outwards by Δ from the right surface grid cluster Cluster of its previous layer a-1,6 The right surface of... migrates outwards by Δ a = S a ·T is determined, and its inner boundary of the normal is migrated inwards by O from the right surface grid cluster Cluster of its previous layer a-1,6 The right surface of... migrates inwards by O a = S a ·C is determined; its longitudinal front surface boundary is migrated outwards by Δ from the front surface grid cluster Cluster of its previous layer a-1,3 Migrate outwards by Δ a = S a ·T is determined; its longitudinal rear surface boundary is migrated outwards by Δ from the rear surface grid cluster Cluster of its previous layer a-1,4 Migrate outwards by Δ a = S a ·T is determined; its transverse upper surface boundary is migrated inwards by S2 from the upper surface grid cluster Cluster of its previous layer a-1,1 The upper surface of... migrates inwards by S2; its transverse lower surface boundary is migrated inwards by S2 from the lower surface grid cluster Cluster of its previous layer a-1,2 The lower surface of... migrates inwards by S2;

[0094] The a-level background grid is thus determined.

[0095] Step 6: Grid the first-level geometric bounding box Cluster 1,1 , gridding it according to the cell scale S1 of the first-level background grid; for the second-level background grid, the third-level background grid, ···, the N-level background grid, grid them respectively according to the cell scale S2 of the second-level background grid, the cell scale S3 of the third-level background grid ··· the cell scale S of the N-level background grid N to generate a structured multi-layer and multi-block nested background Cartesian grid.

[0096] The present invention also provides a fluid dynamics simulation method based on a method for quickly and automatically generating a structured multi-layer and multi-block nested background Cartesian grid. For example, when applied to the fluid dynamics simulation of a helicopter, for the rotor in the helicopter, a three-dimensional solid model of the rotor is obtained, and then the method for quickly and automatically generating a structured multi-layer and multi-block nested background Cartesian grid provided by the present invention is used to generate the background Cartesian grid of the rotor; therefore, by using the CFD coupled with RBD numerical simulation method, taking each grid in the background Cartesian grid as the research object, with the pitch angle, roll angle, yaw angle and other attitudes of the rotor as input parameters, and by solving the mechanical equations, its mechanical parameters are obtained, including mechanical parameters such as the surface pressure of the rotor.

[0097] The purpose of the present invention is to use a PLOT3D format surface grid file containing complex three-dimensional model geometric information and a small number of user input parameters to achieve the efficient and automatic generation of a structured multi-layer and multi-block nested background Cartesian grid.

[0098] The main steps of the present invention can be summarized as:

[0099] Step 1: Estimate the number of background grid levels. The far-field size is selected by the characteristic length of the geometry (such as 50 times the characteristic length of the geometry), but 50 times the characteristic length of the geometry may not be divisible by the cell scale of the background grid. To avoid non-uniform grids, the far-field size is only used as a reference value for generating the background grid. As long as the far-field size is large enough, the far-field morphology will not affect the numerical simulation. During the actual generation of the background grid, the number of background grid levels is estimated in advance. The final far-field morphology of the generated background grid is a cuboid, and its length, width and height dimensions are divisible by the outermost layer grid scale of the background grid.

[0100] Step 2: Construct an initial geometric bounding box. Extract the maximum and minimum values of the geometric surface grid points in the x, y, and z dimensions in the physical space inertial system, and then construct an initial geometric bounding box that completely encloses the geometric surface.

[0101] Step 3: Optimize the geometric bounding box. The side length of the initial geometric bounding box may not be divisible by the scale of the smallest grid cell of the background grid. To avoid non-uniform grids and ensure grid transition, the size of the initial geometric bounding box is appropriately optimized.

[0102] Step 4: Construct background grid clusters at different levels. Each level of the high-level background grid is constructed by six square grid clusters in a "building block" manner, and the boundary of the grid cluster is formed by migrating the boundary of the grid cluster in the previous level along the normal direction.

[0103] Step 5: Divide the grid block by block. Determine the dimension of each grid cluster at each level according to the grid cell scale at different levels, and divide the uniform structured Cartesian grid block by block.

[0104] The necessary inputs for the automated background grid generation method of the present invention are as follows:

[0105] (1) The PLOT3D format surface grid file SUR.x describing the geometric surface information

[0106] The PLOT3D data format is a widely used standard CFD data format derived from NASA, which stores the X, Y, and Z coordinate information of grid nodes. To describe the geometric surface information, a very fine surface grid is not required, and an appropriate resolution is sufficient. Even if there is a small distortion of the geometric surface details, it does not affect the generation of the background grid.

[0107] For simple three-dimensional geometric shapes, a single-block surface grid can be generated. For complex three-dimensional geometric shapes, it is difficult to generate a single-block surface grid. A multi-block nested surface grid or a multi-block overlapping surface grid can also be used to describe the geometric shape. Usually, there is no need to separately prepare the surface grid required to describe the surface information. The first step in generating a body-fitted grid is to divide the surface grid, and this surface grid can be used as the input required for generating the background grid.

[0108] (2) The far-field size S Far

[0109] The background computational domain is a cuboid, and the far-field size S Far is the minimum side length of the background cuboid computational domain, and the value of this size needs to be selected according to the characteristic length of the geometry.

[0110] (3) The scale S1 of the background grid cells at the first level

[0111] The background grid is composed of nested Cartesian grid clusters at different resolution scales. The densest level of the grid that wraps the body-fitted grid system is defined as the first level, and the scale of the background grid cells at the first level is S1. The outer layers are the second level, the third level... the Nth level in sequence, and their background grid cell scales are S2, S3... S N , SN =S1×2 N-1 , that is, the scale of the second-level background grid cell is twice that of the first-level background grid cell, the scale of the third-level background grid cell is twice that of the second-level background grid cell, and the scale of the Nth-level background grid cell is twice that of the N-1th-level background grid cell. The size of S1 needs to be consistent with the scale of the outermost grid cell S of the body-fitting grid. Out Roughly consistent, that is, S1 = a0·S Out , 0.5<a0<2.0, a0 is the coefficient used to calculate the scale S1 of the first-level background grid unit to ensure the nested interpolation accuracy of the body-fitting grid system and the background grid system.

[0112] According to the input file and input parameters, the background grid automatic generation process is executed. The specific steps are as follows:

[0113] Step 1: Estimate the number of background grid levels N

[0114] Since the far field size S Far It is determined based on the characteristic length of the geometric shape of the three-dimensional geometric body, S Far It may not be possible to be represented by the background grid unit scale S of the outermost level (i.e., level N). N To avoid non-uniform grids, the initial far-field size S is determined Far It is only used as a reference value for background grid generation. For CFD numerical simulation, as long as the far-field size S Far If the value is large enough, the far-field shape will not affect the numerical simulation. In the actual process of generating the background grid, the number of background grid levels and the scale of the outermost background grid unit are estimated in advance. The far-field shape of the background grid generated in the end is a cuboid, whose length, width and height can be divided by the scale of the outermost background grid unit.

[0115] According to the input parameters: the first level background grid unit scale S1, the far field size S Far And the number of background grid transition layers T (preset parameters) at each level, the number of background grid levels N and the size of the outermost background grid unit S can be estimated through a simple loop counting algorithm N .

[0116] The pseudo code of the algorithm for estimating the number of background grid levels N is as follows:

[0117] First, the algorithm is initialized:

[0118] Initialize counters

[0119]

[0120] Where N is the number of background grid levels; Scounter is a far - field size counter. When S counter > S Far , stop the loop counting; Δ1 is the thickness of the background grid of the first level.

[0121] Start loop counting and estimate the number of background grid levels N:

[0122] Loop over counter N

[0123]

[0124] Where: Δ N is the thickness of the background grid of the Nth level; Δ N-1 is the thickness of the background grid of the (N - 1)th level.

[0125] Within the loop, S counter is incremented by the thickness of one level of the background grid step by step. When S counter > S Far , stop counting and break out of the loop. Since S N = S1×2 (N-1) , that is, the scale of the background grid cells of the second level is twice that of the first level, the scale of the background grid cells of the third level is twice that of the second level, ··· the scale of the background grid cells of the Nth level is twice that of the (N - 1)th level. At the same time, the number of transition layers T of the background grid for each level is the same. Therefore, the thickness of the background grid of the second level is twice that of the first level, the thickness of the background grid of the third level is twice that of the second level, ··· the thickness of the background grid of the Nth level is twice that of the (N - 1)th level. Through the above loop counting algorithm, the number of background grid levels N can be quickly obtained.

[0126] Among them, the Loop function is the loop function, and the If function is the conditional function.

[0127] Step 2, construct the initial geometric bounding box

[0128] Traverse the PLOT3D surface grid input file that describes the geometric shape of the three - dimensional geometry, and then extract the maximum and minimum coordinate points of the surface grid points in the three dimensions of X, Y, and Z in the physical space inertial coordinate system OXYZ i . To construct a cuboid, only two coordinate points are needed. From the minimum coordinate point P min (X min , Y min , Z min ) and the maximum coordinate point P max (X max , Y max , Z max)A polar diagonal of a cuboid can be constructed, and from this polar diagonal, an initial geometric bounding box that completely encloses the geometric surface of the three-dimensional geometric object can be constructed.

[0129] The initial geometric bounding box corresponds to the first-level background grid. The length, width, and height of the initial geometric bounding box are respectively:

[0130]

[0131] The centroid P of this initial geometric bounding box centroid in the inertial coordinate system OXYZ of physical space i has coordinates (X centroid , Y centroid , Z centroid ) as:

[0132]

[0133] This centroid P centroid is also the centroid of the far-field calculation domain. Taking this centroid P centroid as the coordinate origin, a coordinate system oxyz for constructing the background grid is established. The coordinates (x centroid , y centroid , z centroid ) of the centroid P in this coordinate system are: (0, 0, 0). The polar diagonal vertices p centroid , p max , p min in this coordinate system are respectively:

[0134]

[0135] Step 3, Initial geometric bounding box optimization

[0136] Since the initial geometric bounding box is constructed by extracting the physical information of the geometric surface, its length, width, and height may not be divisible by the cell size S1 of the first-level background grid. To avoid non-uniform Cartesian grids, the initial geometric bounding box needs to be extended outward by several layers appropriately, while ensuring that there are enough transition layers for each level of the background grid. The size of the initial geometric bounding box needs to be optimized. Here, an input parameter T is defined to control the number of transition layers for each level of the background grid, representing the minimum number of layers when transitioning from the grid of this level to the next level. The default value of T is 5 layers, and it can be modified according to the required number of transition layers during input.

[0137] The pseudocode for the method of optimizing the size of the initial geometric bounding box is as follows:

[0138] First, algorithm initialization:

[0139] Initialize counters

[0140]

[0141] Among them, I is the algorithm loop counter; D is the optimization factor counter. When I = N - 1, the loop counting stops and the optimization factor D is output.

[0142] Start loop counting to find the optimization factor D:

[0143] Loop While I < N

[0144]

[0145] After finding the optimization factor D, optimize the initial geometric bounding box size. The length, width, and height of the optimized geometric bounding box Cluster1 are respectively:

[0146]

[0147] Among them, k is an integer, and the function even(p, q) returns the integer p closest to q in the direction of increasing absolute value. The polar diagonal vertices p max,optimized , p min,optimized In this coordinate system, the coordinates are respectively:

[0148]

[0149] Step 4, construct the 2nd to Nth level background grids

[0150] The optimized geometric bounding box is a cuboid, which can fully enclose the three-dimensional geometric body and ensure sufficient transition layers to connect with the 2nd level background grid. Given the polar diagonal vertices p max,optimized , p min,optimized It is known, then the position of the geometric bounding box in the coordinate system oxyz constructed with the centroid as the origin is uniquely determined. Its six outer boundary surfaces in the up and down (z direction), front and back (x direction), and left and right (y direction) are determined. Subsequently, use the "building block" method to build the 2nd to Nth level background grids layer by layer from the inside out. Each layer of the 2nd to Nth level background grids consists of 6 grid clusters. Define the upper grid cluster as grid cluster 1, the lower grid cluster as grid cluster 2, the front grid cluster as grid cluster 3, the back grid cluster as grid cluster 4, the left grid cluster as grid cluster 5, and the right grid cluster as grid cluster 6. The normal direction of the grid cluster is the thickness direction from the inside out. The longitudinal and transverse directions of the grid cluster are the width direction and length direction perpendicular to the normal direction respectively. The 6 grid clusters of the 2nd to Nth level can be expressed as:

[0151] Cluster a,b , a = 2, 3, 4 ··· N, b = 1, 2, 3, 4, 5, 6

[0152] In the actual process of constructing the grid clusters, only the two vertices of a polar diagonal of the grid cluster need to be determined. The polar diagonal vertices of the grid clusters at the 2nd to Nth levels can be respectively expressed as:

[0153] p max _Cluster a,b ,p min _Cluster a,b ,a = 2, 3, 4 ··· N, b = 1, 2, 3, 4, 5, 6

[0154] The outer normal boundary of the grid cluster at this level is formed by migrating the outer boundary of the grid cluster at the previous level outward by Δ i ,i = 2, 3, 4 ··· N. The inner normal boundary of the grid cluster at this level is formed by migrating the outer boundary of the grid cluster at the previous level inward by O i ,i = 2, 3, 4 ··· N. The inward migration is to ensure that there is sufficient nested boundary between the grid cluster at this level and the grid cluster at the previous level for interpolating and transferring flow information. For the commonly used second-order format, only 1 layer of nested boundary is required. For the third-order format, 2 layers of nested boundary are required. For higher-order formats, 3 layers or even more layers of nested boundary are required. Here, an input parameter C is defined to control the number of nested boundary layers of the background grid at each level. The default value of C is 1 layer, and it can be modified according to the required number of nested boundary layers when inputting. Therefore, the normal number of layers of a grid cluster is (T + C) layers, with a default of 6 layers. At the same time, to avoid excessive grid overlap areas causing unnecessary grid waste, the front, back, left, and right four grid clusters of each level, namely Cluster a,b ,a = 2, 3, 4 ··· N, b = 3, 4, 5, 6 only need to have their longitudinal and transverse boundaries formed by migrating the outer boundary of the grid cluster at the previous level outward by 1 layer of grid.

[0155]

[0156] Taking the construction of 6 grid clusters of the 2nd-level background grid as an example:

[0157] (1) First, it is the construction of grid clusters 1 and 2 in the up-down direction

[0158] Cluster 2,1 (i.e., grid cluster 1 on the upper side of the 2nd level), its outer normal boundary (i.e., the upper surface) is determined by migrating the upper surface of the geometric bounding box Cluster1 outward by Δ2 = S2 · T, and its inner normal boundary (i.e., the lower surface) is determined by migrating the upper surface of the geometric bounding box Cluster1 inward by O2 = S2 · C.

[0159] Cluster 2,2The outer normal boundary (i.e., the lower surface) of [[ID=]], which is the 2nd grid cluster on the lower side of the second layer, is migrated outward from the lower surface of the geometric bounding box by Δ2 = S2·T, and the inner normal boundary (i.e., the upper surface) is migrated inward from the lower surface of the geometric bounding box by O2 = S2·C.

[0160] Cluster 2,1 The longitudinal boundaries (i.e., the front and back surfaces) of [[ID=]] and [[ID=]] are respectively migrated outward from the front and back surfaces of the geometric bounding box by Δ2 = S2·T. At the same time, the outer normal boundaries of [[ID=]] (i.e., the 3rd grid cluster on the front side of the second layer) and [[ID=]] (i.e., the 4th grid cluster on the back side of the second layer) are also determined, as well as the longitudinal boundaries of [[ID=]] (i.e., the 5th grid cluster on the left side of the second layer) and [[ID=]] (i.e., the 6th grid cluster on the right side of the second layer). 2,2 of [[ID=]] are respectively migrated outward from the front and back surfaces of the geometric bounding box by Δ2 = S2·T. At the same time, the outer normal boundaries of [[ID=]] (i.e., the 3rd grid cluster on the front side of the second layer) and [[ID=]] (i.e., the 4th grid cluster on the back side of the second layer) are also determined, as well as the longitudinal boundaries of [[ID=]] (i.e., the 5th grid cluster on the left side of the second layer) and [[ID=]] (i.e., the 6th grid cluster on the right side of the second layer). 2,3 (i.e., the 3rd grid cluster on the front side of the second layer) and [[ID=]] 2,4 (i.e., the 4th grid cluster on the back side of the second layer) and [[ID=]] 2,5 (i.e., the 5th grid cluster on the left side of the second layer) and [[ID=]] 2,6 (i.e., the 6th grid cluster on the right side of the second layer).

[0161] Cluster 2,1 The transverse boundaries (i.e., the left and right surfaces) of [[ID=]] and [[ID=]] are respectively migrated outward from the left and right surfaces of the geometric bounding box by Δ2 = S2·T. At the same time, the outer normal boundaries of [[ID=]] and [[ID=]] are also determined. 2,2 of [[ID=]] are respectively migrated outward from the left and right surfaces of the geometric bounding box by Δ2 = S2·T. At the same time, the outer normal boundaries of [[ID=]] and [[ID=]] are also determined. 2,5 and [[ID=]] 2,6 are also determined.

[0162] Then, the polar diagonal vertex coordinates of [[ID=]] are respectively: 2,1

[0163]

[0164]

[0165] Cluster 2,2 The polar diagonal vertex coordinates of [[ID=]] are respectively:

[0166]

[0167]

[0168] (2) Next, the construction of the 3rd and 4th grid clusters in the front - back direction is carried out.

[0169] Cluster 2,3 The outer normal boundary (i.e., the front surface) of [[ID=]] and the outer normal boundary (i.e., the back surface) of [[ID=]] have been determined in (1). 2,4

[0170] Cluster 2,3 ​​The inner normal boundary (i.e., the rear surface) is determined by migrating inwards from the front surface of the geometric bounding box by O2 = S2·C, Cluster 2,4 The inner normal boundary (i.e., the front surface) is determined by migrating inwards from the rear surface of the geometric bounding box by O2 = S2·C.

[0171] Cluster 2,3 With Cluster 2,4 The longitudinal boundaries (i.e., the left and right surfaces) are respectively determined by migrating outwards from the left and right surfaces of the geometric bounding box by S2, and the transverse boundaries (i.e., the upper and lower surfaces) are respectively determined by migrating outwards from the upper and lower surfaces of the geometric bounding box by S2.

[0172] Then for Cluster 2,3 The coordinates of the extreme diagonal vertices are respectively:

[0173]

[0174]

[0175] Cluster 2,4 The coordinates of the extreme diagonal vertices are respectively:

[0176]

[0177]

[0178] (3) Finally, it is the construction of Grid Clusters No. 5 and 6 in the left - right direction

[0179] Cluster 2,5 The outer normal boundary (i.e., the left surface) of Cluster and Cluster 2,6 The outer normal boundary (i.e., the right surface) have been determined in (1).

[0180] Cluster 2,5 The inner normal boundary (i.e., the right surface) is determined by migrating inwards from the left surface of the geometric bounding box by O2 = S2·C, Cluster 2,6 The inner normal boundary (i.e., the left surface) is determined by migrating inwards from the right surface of the geometric bounding box by O2 = S2·C.

[0181] Cluster 2,5 With Cluster 2,6 The longitudinal boundaries (i.e., the left - right boundaries) have also been determined in (1). Finally, only the transverse boundaries (i.e., the upper and lower surfaces) of Cluster and Cluster need to be determined. Cluster 2,5 With Cluster 2,6 The transverse boundaries (i.e., the upper and lower surfaces), Cluster 2,5 With Cluster 2,6The horizontal boundaries are determined by migrating inwards by S2 from the upper and lower surfaces of the geometric bounding box.

[0182] Then for Cluster 2,5 the coordinates of the extreme diagonal vertices are respectively:

[0183]

[0184]

[0185] Cluster 2,6 the coordinates of the extreme diagonal vertices are respectively:

[0186]

[0187]

[0188] According to the above steps, 6 grid clusters of the second level can be constructed, and the construction method of the grid clusters of the third to N levels is similar.

[0189] Step 5, divide the grid block by block

[0190] According to Steps 3 and 4, the geometric bounding box corresponding to the background grid of the first level and 6 grid clusters of each level of the background of the second to N levels are constructed. Subsequently, the grid is divided block by block. Taking the geometric bounding box Cluster1 of the first level as an example, the extreme diagonal vertices p max _Cluster a,b , p min _Cluster a,b , are respectively:

[0191]

[0192] The scale of the background grid unit of this level is S1. First, determine the grid dimensions (j 1,1 , k 1,1 , l 1,1 ) of Cluster1:

[0193]

[0194]

[0195]

[0196] where the int function returns the integer closest in the direction of increasing absolute value.

[0197] Then the physical space coordinates (x p , y p , zp ) can be determined by its structured index number (j p , k p , l p ) as:

[0198]

[0199]

[0200]

[0201] where the float function returns the floating-point number of the function value.

[0202] By using the above grid division method, the uniform structured Cartesian grids of the 2nd to Nth level grid clusters can be divided block by block.

[0203] A fast automatic generation method for structured multi-layer multi-block nested background Cartesian grids provided by the present invention has the following advantages:

[0204] The structured background Cartesian grid generation method provided by the present invention has a low dependence on geometric surface information, a wide application range, and few input parameters. The generated structured background Cartesian grid has a simple data structure, good transition, a simple conversion between physical space and computational space, and is suitable for high-precision numerical simulation using the finite difference method. The method principle is simple, easy to program and implement, has a low memory occupancy rate, and is convenient for parallel implementation. At the same time, the grid has been "pre"-blocked, which is convenient for embedding the grid parallel decomposition of CFD to achieve efficient large-scale parallel computing, providing a good basis for CFD / RBD coupled numerical simulation or grid adaptive numerical simulation.

[0205] The following introduces a simple and easy-to-display specific embodiment:

[0206] The present invention provides a fast automatic generation method for structured multi-layer multi-block nested background Cartesian grids, and the method flow is as Figure 1 shown. For a grid system with spatial discretization using the Chimera nesting method, the computational domain is decomposed into a body-fitted computational domain and a background computational domain, as Figure 2 shown. Based on the input geometric surface PLOT3D grid and a small number of input parameters, structured multi-block nested background Cartesian grids with different cell scales for wrapping the object are generated efficiently and automatically.

[0207] The inventor applied the proposed fast automatic generation method for structured multi-layer multi-block nested background Cartesian grids to the background grid generation of a certain cylinder, with the cylinder diameter D = 1m and length L = 4m. Figures 3 - 5 Structured single-block grids, multi-block point-lapped grids, and nested grids with surface discretization are respectively shown. The input parameter far-field size S Far= 100m, the scale S1 of the grid cells in the first layer of the background grid is 0.1m, and the parameters are set as T = 5, C = 1.

[0208] The background grid is composed of nested Cartesian grid clusters of different scales. The densest grid cluster that wraps the body-fitted grid system is defined as the first layer. The scale of the grid cells in this layer of the background grid is S1, and the subsequent layers are the second layer, the third layer... the (N - 1)th layer, and the Nth layer in sequence. The scales of the grid cells in different layers of the background grid are S2, S3... S N-1 、S N , where S N = S1×2 N-1 , that is, the scale of the grid cells in the second layer of the background grid is 2 times that of the first layer, the scale of the grid cells in the third layer is 2 times that of the second layer,... the scale of the grid cells in the Nth layer is 2 times that of the (N - 1)th layer.

[0209] The size of S1 needs to be roughly consistent with the size S Out of the outermost grid of the body-fitted grid, that is, S1 = a·S Out , 0.5 < a < 2.0, to ensure the nested interpolation accuracy between the body-fitted grid system and the background grid system. Here, the scale S out of the outermost grid of the cylindrical body-fitted grid is 0.1m, so S1 is set to 0.1m. The relationship between the scales of the background grids of different layers is as Figure 6 shown, and the nested topological structure of the grid clusters in different layers of the background grid is as Figures 7 - 12 shown.

[0210] The background computational domain is a cuboid, and the far-field size S Far , that is, the minimum side length of the background cuboid computational domain, needs to be selected according to the characteristic length of the input geometry. For this embodiment, the input geometry is a cylinder, and its characteristic length is the cylinder diameter D = 1m. The far-field size S Far is set to 100 times the characteristic length, that is, S Far = 100m.

[0211] Step 1, optimize the far-field size S Far and estimate the number of background grid layers N according to the far-field size S Far and the scale S1 of the grid cells in the first layer of the background grid.

[0212] Since the far-field size S Far = 100m is selected according to the characteristic length of the geometry shape, S Far may not be divisible by the scale S N of the grid cells in the outermost layer (i.e., the Nth layer) of the background grid. To avoid non-uniform grids, S FarOptimize.

[0213] According to the scale S1 = 0.1m of the background grid cells at the first level, the far-field size S Far = 100m, and the number of transition layers T = 5 (pre-set parameter) for each level of the background grid, the number of levels N of the background grid and the scale S N of the outermost background grid cells can be estimated through a simple loop counting algorithm. The method for estimating the number of levels N of the background grid and the optimization method for the far-field size S Far are as follows:

[0214] First, algorithm initialization:

[0215] Initialize counters

[0216]

[0217] Among them, N is the number of levels of the background grid; S counter is the far-field size counter. When S counter > S Far , stop the loop counting; Δ1 is the thickness of the background grid at the first level.

[0218] Start loop counting to estimate the number of levels N of the background grid:

[0219] Loop over counter N

[0220]

[0221] Among them: Δ N is the thickness of the background grid at the Nth level; Δ N-1 is the thickness of the background grid at the (N - 1)th level.

[0222] Inside the loop, S counter is incremented by the thickness of one level of the background grid step by step. When S counter > S Far , stop the counting and break out of the loop. Since S N = S1 × 2 (N-1) , that is, the scale of the background grid cells at the second level is twice that of the background grid cells at the first level, the scale of the background grid cells at the third level is twice that of the background grid cells at the second level, ··· the scale of the background grid cells at the Nth level is twice that of the background grid cells at the (N - 1)th level. At the same time, the number of transition layers T for each level of the background grid is the same. Therefore, the thickness of the background grid at the second level is twice that of the background grid at the first level, the thickness of the background grid at the third level is twice that of the background grid at the second level, ··· the thickness of the background grid at the Nth level is twice that of the background grid at the (N - 1)th level. Through the above loop counting algorithm, the number of levels N of the background grid can be quickly obtained.

[0223] Loop 1

[0224] N = 1, Δ1 = 0.5m, S counter = 0.0m

[0225]

[0226] Loop 2

[0227] N = 2, Δ2 = 1.0m, S counter = 1.0m

[0228]

[0229] Loop 3

[0230] N = 3, Δ3 = 2.0m,, S counter = 3.0m

[0231]

[0232] Loop 4

[0233] N = 4, Δ4 = 4.0m, S counter = 7.0m

[0234]

[0235] Loop 5

[0236] N = 6, Δ6 = 16.0m, S counter = 31.0m

[0237]

[0238] Loop 7

[0239] N = 7, Δ7 = 32.0m, S counter = 63.0m

[0240]

[0241] Finally, it is estimated that there are 7 levels in the background grid, N = 7, and the scale S of the background grid cells at the Nth level N = S1·2 (N -1) = 0.1m × 2 7-1 = 6.4m.

[0242] Step 2, construct the initial geometric bounding box

[0243] Traverse the PLOT3D surface grid input file SUR.x that describes the geometric shape of the cylinder, and then extract the maximum and minimum values of the coordinate points of the surface grid points in the X, Y, and Z dimensions in the inertial coordinate system of physical space. For this embodiment, the input geometry is a cylinder with a diameter D = 1m, a length L = 4m, and a centroid coordinate of (0, 0, 0). Therefore, the minimum coordinate point P min (X min , Y min , Z min ) is (-2, -0.5, -0.5), and the maximum coordinate point P max (X max , Y max , Z max ) is (+2, +0.5, +0.5). From the minimum coordinate point P min and the maximum coordinate point P max , construct a polar diagonal of a cuboid, from which an initial geometric bounding box that completely encloses the cylinder surface can be constructed as Figure 13 shown. This initial geometric bounding box corresponds to the first-level background grid. The length, width, and height of the initial geometric bounding box are respectively:

[0244]

[0245] Step 3, Initial geometric bounding box optimization

[0246] Since the initial geometric bounding box is constructed by extracting the physical information of the geometric surface, its length, width, and height may not be divisible by the scale S1 of the first-level background grid cells. To avoid non-uniform Cartesian grids, in addition, the initial geometric bounding box needs to be extended outward by several layers appropriately, and at the same time ensure that there are enough transition layers for each level of the background grid. It is necessary to optimize the size of the initial geometric bounding box. Here, an input parameter T is defined to control the number of transition layers of each level of the background grid, which represents the minimum number of layers when transitioning from the grid of this level to the next level. The value of T is default to 5 layers and can be modified according to the required number of transition layers when inputting.

[0247] The pseudo-code of the size optimization method of the initial geometric bounding box is as follows:

[0248] First, algorithm initialization:

[0249] Initialize counters

[0250]

[0251] Among them, I is the algorithm loop counter; D is the optimization factor counter. When I = N - 1, stop the loop counting and output the optimization factor D.

[0252] Start the loop count and calculate the optimization factor D:

[0253] Loop While I < N

[0254]

[0255] The loop count process is as follows:

[0256] Loop 1 I = 1, D = 0

[0257]

[0258] Loop 2 I = 2, D = 4

[0259]

[0260] Loop 3 I = 3, D = 12

[0261]

[0262] Loop 4 I = 4, D = 28

[0263]

[0264] Loop 5 I = 5, D = 60

[0265]

[0266] Loop 6 I = 6, D = 124

[0267]

[0268] Calculate the optimization factor D = 252 and optimize the initial geometric bounding box size. The length, width, and height of the optimized geometric bounding box Cluster1 are respectively:

[0269]

[0270] Among them, k is an integer, and the function even(p, q) returns the integer p closest to q in the direction of increasing absolute value. The extreme diagonal vertices p max,optimized , p min,optimized The coordinates in the coordinate system oxyz are respectively:

[0271]

[0272] The optimized geometric bounding box is as Figure 14 shown.

[0273] Step 4, construct the background grids of the 2nd to Nth levels

[0274] The optimized geometric bounding box is a cuboid that can fully enclose the three-dimensional geometric body and ensure sufficient transition layers to connect with the second-level background grid. The six outer boundaries of the geometric bounding box in the up-down (z-direction), left-right (y-direction), and front-back (x-direction) can be defined by the coordinates of its eight vertices. Subsequently, the second to N-level background grids are constructed layer by layer from the inside out in a "building block" manner. Each layer of the second to N-level background grids consists of six grid clusters. The upper grid cluster is defined as grid cluster 1, the lower grid cluster is defined as grid cluster 2, the front grid cluster is defined as grid cluster 3, the rear grid cluster is defined as grid cluster 4, the left grid cluster is defined as grid cluster 5, and the right grid cluster is defined as grid cluster 6. The normal direction of the grid cluster is the thickness direction from the inside out, and the longitudinal and transverse directions of the grid cluster are the width direction and length direction perpendicular to the normal direction respectively. The six grid clusters of the second to N-level can be expressed as Cluster a,b , a = 2, 3, 4···N, b = 1, 2, 3, 4, 5, 6. Taking the construction of the second-level background grid as an example, the numbering and direction definition of the six grid clusters are shown as Figures 15 - 17 shown

[0275] For this embodiment, taking the construction of the six grid clusters of the second-level background grid as an example:

[0276] (1) First, it is the construction of grid clusters 1 and 2 in the up-down direction

[0277] Cluster 2,1 (i.e., the upper grid cluster 1 of the second level) The outer normal boundary (i.e., the upper surface) is determined by advancing 1.0 m outward from the upper surface of the geometric bounding box, where Δ2 = S2·T = 0.2 m × 5 = 1.0 m. The inner normal boundary (i.e., the lower surface) is determined by advancing 0.6 m inward from the upper surface of the geometric bounding box, where O2 = S2·C = 0.2 m × 3 = 0.6 m. Cluster 2,2 (i.e., the lower grid cluster 2 of the second level) The outer normal boundary (i.e., the lower surface) is determined by advancing 1.0 m outward from the lower surface of the geometric bounding box, and the inner normal boundary (i.e., the upper surface) is determined by advancing 0.6 m inward from the lower surface of the geometric bounding box. Cluster 2,1 The longitudinal boundaries (i.e., the front and rear surfaces) of Cluster 2,2 are respectively determined by advancing 1.0 m outward from the front and rear surfaces of the geometric bounding box. At the same time, the outer normal boundaries of Cluster 2,3 (i.e., the front grid cluster 3 of the second level) and Cluster 2,4 (i.e., the rear grid cluster 4 of the second level) and the longitudinal boundaries of Cluster 2,5 (i.e., the left grid cluster 5 of the second level) and Cluster 2,6 (i.e., the right grid cluster 6 of the second level) are also determined. Cluster2,1 With Cluster 2,2 's lateral boundaries (i.e., the left and right surfaces) are determined by pushing outwards from the left and right surfaces of the geometric bounding box by Δ2 = 1.0 m. At the same time, the normal outer boundaries of Cluster 2,5 and Cluster 2,6 are also determined. The construction process of Cluster 2,1 and Cluster 2,2 is as shown in Figures 18 - 20 as follows.

[0278] Then the polar diagonal vertex coordinates of Cluster 2,1 are respectively:

[0279]

[0280]

[0281] Cluster 2,2 's polar diagonal vertex coordinates are respectively:

[0282]

[0283]

[0284] (2) Next, the construction of Grid Clusters 3 and 4 in the front - to - back direction

[0285] Cluster 2,3 's normal outer boundary (i.e., the front surface) and Cluster 2,4 's normal outer boundary (i.e., the back surface) have been determined in (1). Cluster 2,3 's normal inner boundary (i.e., the back surface) is determined by pushing inwards from the front surface of the geometric bounding box by O2 = 0.6 m. Cluster 2,4 's normal inner boundary (i.e., the front surface) is determined by pushing inwards from the back surface of the geometric bounding box by O2 = 0.6 m. Cluster 2,3 and Cluster 2,4 's longitudinal boundaries (i.e., the left and right surfaces) are respectively determined by pushing outwards from the left and right surfaces of the geometric bounding box by S2 = 0.1 m, and the lateral boundaries (i.e., the upper and lower surfaces) are respectively determined by pushing outwards from the upper and lower surfaces of the geometric bounding box by S2 = 0.1 m. The construction process of Cluster 2,3 and Cluster 2,4 is as shown in Figures 21 - 23 as follows.

[0286] Then the polar diagonal vertex coordinates of Cluster 2,3 are respectively:

[0287]

[0288]

[0289] Cluster 2,4 The polar diagonal vertex coordinates of are as follows:

[0290]

[0291]

[0292] (3) Finally, the construction of Grid Clusters 5 and 6 in the left - right direction

[0293] Cluster 2,5 The outer normal boundary (i.e., the left surface) of and Cluster 2,6 The outer normal boundary (i.e., the right surface) of have been determined in (1). Cluster 2,5 The inner normal boundary (i.e., the right surface) of is determined by advancing 0.6 m inward from the left surface of the geometric bounding box. Cluster 2,6 The inner normal boundary (i.e., the left surface) of is determined by advancing 0.6 m inward from the right surface of the geometric bounding box. Cluster 2,5 The longitudinal boundaries (i.e., the left - right boundaries) of and Cluster 2,6 have also been determined in (1). Finally, only the transverse boundaries (i.e., the upper - lower surfaces) of Cluster 2,5 and Cluster 2,6 need to be determined. The transverse boundaries of Cluster 2,5 and Cluster 2,6 are determined by advancing 0.1 m inward from the upper - lower surfaces of the geometric bounding box. The construction process of Cluster 2,5 and Cluster 2,6 is as shown in Figures 24 - 26 as follows.

[0294] Then the polar diagonal vertex coordinates of Cluster 2,5 are as follows:

[0295]

[0296]

[0297] Cluster 2,6 The polar diagonal vertex coordinates of are as follows:

[0298]

[0299]

[0300] According to the above steps, 6 grid clusters at the second level can be constructed. The construction methods of the grid clusters at the third to seventh levels are similar. The construction process at the third level is as Figures 27 - 28 shown.

[0301] Step 5: Divide the grid block by block

[0302] Based on Steps 3 and 4, the geometric bounding box corresponding to the background grid at the first level and 6 grid clusters at each level of the background from the second to the seventh level are constructed, with a total of 1 + 6×(N - 1) = 1 + 6×6 = 37 grid blocks

[0303] Subsequently, the grid is divided block by block. Taking the geometric bounding box Cluster1 at the first level as an example, the extreme diagonal vertices p max _Cluster a,b , p min _Cluster a,b , respectively, are:

[0304]

[0305] The scale of the background grid unit at this level is S1 = 0.1m. First, determine the grid dimensions (j 1,1 , k 1,1 , l 1,1 ) of Cluster1:

[0306]

[0307]

[0308]

[0309] Among them, the int function returns the integer closest in the direction of increasing absolute value.

[0310] Then, the physical space coordinates (x p , y p , z p ) of any point P in Cluster1 can be determined by its structured index number (j p , k p , l p ) as:

[0311]

[0312]

[0313]

[0314] Among them, the float function returns the floating-point number of the function value.Figure 30 The schematic diagram of the first-level grid division is given. By using the above grid division method, the uniform structured Cartesian grids of the remaining 36 grid clusters at the 2nd to 7th levels can be divided block by block. The above is only the preferred embodiment of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.

Claims

1. A method for quickly and automatically generating a structured multi-layer and multi-block nested background Cartesian grid, characterized in that, Including the following steps: Step 1, input the surface mesh file of the three-dimensional geometric body and determine the basic parameters, including: far-field size S Far , the scale S1 of the background grid cells in the first layer, the number T of background grid transition layers, and the number C of background grid nested boundary layers; Step 2, according to the far-field size S Far , the first-level background grid cell scale S1, and the number of background grid transition layers T, estimate the number of background grid levels N; Therefore, centering on the background grid of the first level, the background grids of the second level, the third level, ···, the Nth level are nested layer by layer in the direction from the inside to the outside. The scales of the background grid units gradually increase, which are: S2, S3 ··· SN, where Sk = S1 × 2k-1, k = 2, 3,..., N; N , where, S k = S1 × 2 k-1 , k = 2, 3,..., N; Step 3: Construct an initial geometric bounding box that minimally and completely encloses the three-dimensional geometric body according to the surface mesh file of the three-dimensional geometric body; the initial geometric bounding box is a cuboid; Step 4: Optimize the initial geometric bounding box to obtain an optimized geometric bounding box, which is a cuboid and each side length thereof is an integer multiple of the scale S1 of the background grid cells at the first level; The optimized geometric bounding box is called the first-level geometric bounding box Cluster1, corresponding to the first-level background grid; Step 4 is specifically as follows: Step 4.1: Determine the optimization factor D: Step 4.1.1: Let the initial value of the loop counter I be 1 and the initial value of the optimization factor D be 0; Step 4.1.2: Determine whether I is less than N. If so, execute Step 4.1.3; otherwise, execute Step 4.1.4; Step 4.1.3: Let D = 2·D + 4 and I = I + 1; then return to Step 4.1.2; Step 4.1.4: Output the finally determined optimization factor D; Step 4.2, using the optimization factor D, according to the following formula, obtain the length Length_X of the optimized geometric bounding box optimized , width Length_Y optimized and height Length_Z optimized respectively as follows: where k is an integer, and the function even((2 N-1 ·k - D·T)·S1, Length_X initial ) represents returning the integer closest to Length_X initial in the direction of increasing absolute value of (2 N-1 ·k - D·T)·S1; Length_X initial , Length_Y initial and Length_Z initial are the length, width, and height of the initial geometric bounding box, respectively; The vertex p with the maximum value of the polar diagonal of the optimized geometric bounding box maxo,ptimiz and the vertex p with the minimum value mino,ptimiz The coordinates in this coordinate system are respectively: Thus, an optimized geometric bounding box is obtained; Step 5: In a building-block manner, sequentially construct the second-level background grid, the third-level background grid, ···, the N-level background grid to form a nested background grid layer by layer; Step 6, grid the first-level geometric bounding box Cluster1 according to the scale S1 of the first-level background grid cells; for the second-level background grid, the third-level background grid, ···, the Nth-level background grid, grid them respectively according to the scale S2 of the second-level background grid cells, the scale S3 of the third-level background grid cells ··· the scale S of the Nth-level background grid cells N to generate a structured multi-layer and multi-block nested background Cartesian grid.

2. The method for quickly and automatically generating a structured multi-layer multi-block nested background Cartesian grid according to claim 1, characterized in that, In Step 1, the scale S1 of the background grid cells at the first level is determined by the following formula: S1 = a0·S Out , 0.5 < a0 < 2.0 Where: S Out is the scale of the outermost body-fitted grid cell of the body-fitted computational domain of the three-dimensional geometric body; a0 is the coefficient used to calculate the scale S1 of the background grid cells at the first level.

3. The method for quickly and automatically generating a structured multi-layer multi-block nested background Cartesian grid according to claim 1, wherein In Step 2, the following method is used to estimate the number of background grid levels N: Let the number of background grid levels N be the maximum value of the integers that satisfy the following conditions, which is the finally determined number of background grid levels N: Δ1 + Δ2 +... + Δ N ≤ S Far Where: Δ1, Δ2,..., Δ N , are the transition layer thicknesses of the background grid of the first level, the background grid of the second level,..., the background grid of the Nth level, respectively, and are calculated by the following formula:

4. The method for quickly and automatically generating a structured multi-layer and multi-block nested background Cartesian grid according to claim 1, wherein, Step 3 is specifically as follows: Traverse the surface mesh file of the three-dimensional geometric body, and extract the minimum coordinate point of the three-dimensional geometric body in the inertial coordinate system of physical space and the maximum coordinate point Take the connection line between the minimum coordinate point P min (X min , Y min , Z min ) and the maximum coordinate point P max (X max , Y max , Z max ) as the polar diagonal line, and then construct an initial geometric bounding box that minimally and completely encloses the three-dimensional geometric body. The length Length_X initial , width LengthY_ intial and height Length_Z initial are respectively:

5. The rapid automatic generation method of a structured multi-layer multi-block nested background Cartesian grid according to claim 1, characterized in that For any hierarchical background grid among the second-level background grid, the third-level background grid, ···, the N-level background grid, it is expressed as: Cluster a , where a = 2, 3, 4... N, and it is constructed in the following way: For the optimized geometric bounding box, that is, the first-level geometric bounding box Cluster1, which is a cuboid and is formed by 6 grid clusters, and the 6 grid clusters are represented as: Cluster 1,1 Cluster 1,2 Cluster 1,3 Cluster 1,4 Cluster 1,5 Cluster 1,6 represent the upper surface mesh cluster, the lower surface mesh cluster, the front surface mesh cluster, the rear surface mesh cluster, the left surface mesh cluster and the right surface mesh cluster respectively; For the background grid at the a-th level, it is a cuboid formed by 6 grid clusters, and the 6 grid clusters are represented as: Cluster a,b , where b = 1, 2, 3, 4, 5, 6; Among them, Cluster a,1 Cluster a,2 Cluster a,3 Cluster a,4 Cluster a,5 Cluster a,6 respectively represent the upper surface grid cluster, the lower surface grid cluster, the front surface grid cluster, the rear surface grid cluster, the left surface grid cluster and the right surface grid cluster. Each surface grid cluster is a cuboid, and the six faces of each surface grid cluster are formed by the corresponding faces of its previous-level background grid migrating inwards or outwards.

6. The method for quickly and automatically generating a structured multi-layer and multi-block nested background Cartesian grid according to claim 5, wherein The specific construction method of each surface grid cluster is as follows: The outer boundary of the normal direction of the upper surface mesh cluster Cluster a,1 is migrated outward by Δ a-1,1 = S a · T from the upper surface of the upper surface mesh cluster Cluster of its previous layer. Its inner boundary of the normal direction is migrated inward by O a = S a-1,1 · C from the upper surface of the upper surface mesh cluster Cluster of its previous layer; its longitudinal front surface boundary is migrated outward by Δ a = S a · T from the front surface mesh cluster Cluster of its previous layer; its longitudinal rear surface boundary is migrated outward by Δ a-1,3 = S a · T from the rear surface mesh cluster Cluster of its previous layer; its transverse left surface boundary is migrated outward by Δ a = S a-1,4 · T from the left surface mesh cluster Cluster of its previous layer; its transverse right surface boundary is migrated outward by Δ a = S a · T from the right surface mesh cluster Cluster of its previous layer; its transverse right surface boundary is migrated outward by Δ a-1,5 = S a · T from the right surface mesh cluster Cluster of its previous layer; its transverse right surface boundary is migrated outward by Δ a = S a-1,6 · T from the right surface mesh cluster Cluster of its previous layer; a = S a · T is determined; Lower surface mesh cluster Cluster a,2 The outer normal boundary of is migrated outward by Δ a-1,2 from the lower surface of the lower surface mesh cluster of its previous layer a = S a · T is determined, and its inner normal boundary is migrated inward by O a-1,2 from the lower surface of the lower surface mesh cluster of its previous layer a = S a · C is determined; its longitudinal front surface boundary is migrated outward by Δ a-1,3 from the front surface mesh cluster of its previous layer a = S a · T is determined; its longitudinal rear surface boundary is migrated outward by Δ a-1,4 from the rear surface mesh cluster of its previous layer a = S a · T is determined; its transverse left surface boundary is migrated outward by Δ a-1,5 from the left surface mesh cluster of its previous layer a = S a · T is determined; its transverse right surface boundary is migrated outward by Δ a-1,6 from the right surface mesh cluster of its previous layer a = S a · T is determined; The outer boundary of the normal direction of the front surface mesh cluster Cluster a,3 is determined by the outer migration of the front surface of the front surface mesh cluster Cluster of its previous layer a-1,3 by Δ a = S a ·T. Its inner boundary of the normal direction is determined by the inner migration of the front surface of the front surface mesh cluster Cluster of its previous layer a-1,3 by O a = S a ·C. Its longitudinal left surface boundary is determined by the outer migration of the left surface of the left surface mesh cluster Cluster of its previous layer a-1,5 by S a ; its longitudinal right surface boundary is determined by the outer migration of the right surface of the right surface mesh cluster Cluster of its previous layer a-1,6 by S a ; its transverse upper surface boundary is determined by the outer migration of the upper surface of the upper surface mesh cluster Cluster of its previous layer a-1,1 by S a ; its transverse lower surface boundary is determined by the outer migration of the lower surface of the lower surface mesh cluster Cluster of its previous layer a-1,2 by S a ; The outer boundary of the back surface mesh cluster Cluster a,4 is determined by the back surface of the previous layer's back surface mesh cluster Cluster a-1,4 migrating outward by Δ a = S a · T, and its inner boundary is determined by the back surface of the previous layer's back surface mesh cluster Cluster a-1,4 migrating inward by O a = S a · C; its longitudinal left surface boundary is determined by the left surface of the previous layer's left surface mesh cluster Cluster a-1,5 migrating outward by S a ; its longitudinal right surface boundary is determined by the right surface of the previous layer's right surface mesh cluster Cluster a-1,6 migrating outward by S a ; its transverse upper surface boundary is determined by the upper surface of the previous layer's upper surface mesh cluster Cluster a-1,1 migrating outward by S a ; its transverse lower surface boundary is determined by the lower surface of the previous layer's lower surface mesh cluster Cluster a-1,2 migrating outward by S a ; Left surface grid cluster Cluster a,5 The outer normal boundary of is migrated outward by the left surface of the left surface grid cluster in its previous layer a-1,5 by Δ a = S a · T is determined. Its inner normal boundary is migrated inward by the left surface of the left surface grid cluster in its previous layer a-1,5 by O a = S a · C is determined; its longitudinal front surface boundary is migrated outward by the front surface of the front surface grid cluster in its previous layer a-1,3 by Δ a = S a · T is determined; its longitudinal rear surface boundary is migrated outward by the rear surface of the rear surface grid cluster in its previous layer a-1,4 by Δ a = S a · T is determined; its transverse upper surface boundary is migrated inward by the upper surface of the upper surface grid cluster in its previous layer a-1,1 by S2. Its transverse lower surface boundary is migrated inward by the lower surface of the lower surface grid cluster in its previous layer a-1,2 by S2 is determined; Right surface mesh cluster Cluster a,6 The outer normal boundary of is migrated outward by the right surface of the right surface mesh cluster Cluster of its previous layer a-1,6 by Δ a = S a ·T is determined. Its inner normal boundary is migrated inward by the right surface of the right surface mesh cluster Cluster of its previous layer a-1,6 by O a = S a ·C is determined; its longitudinal front surface boundary is migrated outward by the front surface of the front surface mesh cluster Cluster of its previous layer a-1,3 by Δ a = S a ·T is determined; its longitudinal rear surface boundary is migrated outward by the rear surface of the rear surface mesh cluster Cluster of its previous layer a-1,4 by Δ a = S a ·T is determined; its transverse upper surface boundary is migrated inward by the upper surface of the upper surface mesh cluster Cluster of its previous layer a-1,1 by S2. Its transverse lower surface boundary is migrated inward by the lower surface of the lower surface mesh cluster Cluster of its previous layer a-1,2 by S2; Thus, the a-level background grid is determined.

7. A hydrodynamic simulation method, characterized in that, Apply the method for quickly and automatically generating a structured multi-layer and multi-block nested background Cartesian grid according to any one of claims 1-6.

Citation Information

Patent Citations

  • Parallel grid nesting method and device capable of realizing rapid optimization of overlapped regions

    CN110110446A

  • Method and device for calculating wall distance under Cartesian grid

    CN115357849A