Aircraft model rarefied gas dynamics numerical simulation method
By adopting a tetrahedral mesh preprocessing method based on red and black trees in the DSMC method, the problem of low computing efficiency in the prior art is solved, and more efficient numerical simulation and dynamic load balancing are achieved.
Patent Information
- Application Number
- CN202510233713.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2045-02-28
AI Technical Summary
The existing DSMC method based on tetrahedral mesh is less computationally efficient, especially when the number of meshes is large.
The tetrahedral mesh preprocessing method based on the red and black tree data structure is adopted to quickly construct the data structure of the vara-face element-node to improve the computing efficiency and support dynamic load balancing.
The calculation efficiency of the DSMC method is significantly improved, especially when the grid volume is large, while supporting the efficient implementation of dynamic load balancing.
Smart Images

Figure CN120145922A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of numerical simulation, and specifically, to a numerical simulation method for rarefied gas dynamics of an aircraft model. Background Art
[0002] DSMC (Direct Simulation Monte Carlo) is a numerical simulation method based on probability statistics, mainly used to solve rarefied gas dynamics problems. This method simulates the microscopic behavior of gas and statistically calculates macroscopic flow characteristics by discretizing the molecular motion and collision processes and combining Monte Carlo random sampling techniques.
[0003] Features of the DSMC method:
[0004] Applicability: mainly for rarefied gases (flows with a Knudsen number greater than 0.1), such as hypersonic vehicle flows, vacuum plumes, micro-nano scale flows, etc.
[0005] High efficiency: adopts techniques such as dynamic memory allocation and local time step optimization to improve the calculation efficiency. For example, an efficient search algorithm in unstructured grids can reduce the consumption of computing resources.
[0006] Physical model: commonly uses the variable hard sphere (VHS) model to describe molecular collisions, and surface reflection models (such as complete diffuse reflection or CLL model) to simulate the interaction between molecules and boundaries.
[0007] By combining molecular motion and probability statistics, the DSMC method provides an efficient and accurate simulation tool for rarefied gas flows, and is irreplaceable especially in the fields of hypersonic vehicle design, microfluidic device development, etc.
[0008] The specific steps of DSMC (Direct Simulation Monte Carlo) can be divided into the following main stages. Each stage simulates the microscopic behavior of gas molecules through discretization and probability statistics, and finally derives macroscopic flow characteristics. The following are the specific steps of the DSMC method: 1. Initialization; 2. Time step loop: 2.1 Molecular motion; 2.2 Molecular collision; 3. Data sampling and statistics; 4. Iteration and convergence; 5. Result output.
[0009] Tetrahedral meshes are a commonly used type of mesh in unstructured mesh calculations. The files exported by mesh generation software (such as Gridgen, etc.) in the.inp format generally only contain the spatial coordinates of each mesh node, the node numbers of the tetrahedra's constituent nodes, and boundary condition information, etc., that is, they only have a volume - node data structure, while many applications require the establishment of a volume - face - node data structure. For example, in the DSMC method, which is most commonly used in numerical simulations of rarefied gas dynamics, when calculating the movement of particles in mesh cells, it is necessary to find adjacent volumes through the faces that the particle trajectories pass through and continue to judge the trajectories until the volume where the particle finally locates is found.
[0010] Each tetrahedral element has four faces. The boundary faces are unique, while the internal faces are shared by adjacent volumes. By looping through each volume one by one, a storage structure for the faces can be established, but there is redundancy in the internal faces. Eliminating the redundancy through array looping is very inefficient when the number of meshes is large.
[0011] Therefore, the current DSMC method based on tetrahedral meshes has the technical problem of low computational efficiency. Summary of the Invention
[0012] The present invention proposes a tetrahedral mesh pre - processing method based on the red - black tree data structure, which can achieve the rapid construction of the volume - face - node data structure of tetrahedral meshes. It can not only improve the computational efficiency of the DSMC method but also support the efficient implementation of technologies such as dynamic load balancing.
[0013] To achieve the above - mentioned invention purpose, the present invention provides a numerical simulation method for rarefied gas dynamics of an aircraft model, and the method includes:
[0014] Step 1: Construct a tetrahedral mesh file based on the aircraft model parameters;
[0015] Step 2: Process the tetrahedral mesh file to obtain a tetrahedral mesh file based on the red - black tree;
[0016] Step 3: Set the on - coming flow parameters and perform numerical simulations using the tetrahedral mesh file based on the red - black tree to obtain simulation results;
[0017] Among them, the Step 2 includes:
[0018] Step 2.1: Read in the tetrahedral mesh file to obtain the information of the tetrahedral mesh file;
[0019] Step 2.2: Establish a red - black tree data structure based on the information of the tetrahedral mesh file;
[0020] Step 2.3: For the volumes in the tetrahedral mesh file i, where \(1\leq i\leq m\) and \(m\) is the total number of volume elements in the tetrahedral mesh file; determine the face element of the volume element i of k whether it is in the red - black tree data structure, \(k\) is an integer, \(1\leq k\leq4\). If the face element k is not in the red - black tree data structure, then create a new tree node in the red - black tree data structure, store the information of the face element k into the corresponding linked list structure, and establish the face element information of the volume element i in the red - black tree data structure; if the face element k is in the red - black tree data structure, then search for the corresponding tree node of the face element k and update the adjacent volume element information of the face element stored in this tree node;
[0021] Step 2.4: For the boundary face elements j in the tetrahedral mesh file, where \(1\leq j\leq n\) and \(n\) is the total number of boundary face elements in the tetrahedral mesh file; determine whether the boundary face element j is in the red - black tree data structure. If the boundary face element j is in the red - black tree data structure, then update the right - hand side volume element of the boundary face element j with the boundary condition information of the boundary face element j .
[0022] Among them, the principle of the present invention is: A red - black tree is a self - balancing and efficient binary search tree, which can complete operations such as searching, adding, and deleting in \(O(\log N)\) time. This method improves the efficiency of the numerical simulation method for rarefied gas dynamics of the aircraft model by constructing a tetrahedral mesh file based on a red - black tree. Since the dynamic load - balancing technology requires re - partitioning the mesh, and the mesh pre - processing method based on the red - black tree in the present invention is used during re - partitioning, therefore, this method can not only improve the calculation efficiency of the DSMC method, but also support the efficient implementation of technologies such as dynamic load - balancing.
[0023] Among them, Step 2.1 is used to read in the tetrahedral mesh file and obtain the object to be processed. Step 2.2 is used to initialize the red - black tree data structure to prepare for the insertion of each face element of the tetrahedron later. Step 2.3 is used to sequentially store the face elements of each tetrahedron into the red - black tree data structure. If it has not been stored before, a new red - black tree node is created for storage; if it has been stored before, indicating that this face element is an internal face element, there is no need to store it repeatedly, and only the adjacent volume element information of this face element needs to be updated. That is, find the left and right volume elements of each face element. Step 2.4 is used for if a face element has only one adjacent volume element, then it must be a boundary face element. Loop through the boundary face elements to find the specific corresponding boundary type.
[0024] Preferably, the information stored in each tree node of the red-black tree data structure is the numbering information of three mesh nodes of the face elements in the tetrahedral mesh file.
[0025] Preferably, step 2 further includes:
[0026] Step 2.5: Calculate and obtain the mesh volume, mesh center, and face element normal information of the tetrahedral mesh file.
[0027] Preferably, the information of the tetrahedral mesh file includes: the total number of mesh nodes of the tetrahedral mesh file, the mesh node coordinates, the total number of volume elements, the mesh nodes composing the volume elements, and the boundary conditions.
[0028] Preferably, step 2.2 further includes: sorting the numbers of three nodes of a face element in ascending order to obtain the key value of the corresponding tree node.
[0029] Preferably, step 2.2 further includes determining the size relationship of the key values of the face elements.
[0030] Preferably, face element a and face element b are determined in the following way for the size relationship of their key values:
[0031] The mesh node numbers of face element a are (a1, a2, a3), and the mesh node numbers of face element b are (b1, b2, b3); where a1, a2, a3, b1, b2, and b3 are all the corresponding mesh node numbers;
[0032] If a1 = b1, a2 = b2, and a3 = b3, then the key values of face element a and face element b are equal;
[0033] If a1 < b1, then the key value of face element a is less than the key value of face element b ;
[0034] If a1 = b1 and a2 < b2, then the key value of face element a is less than the key value of face element b ;
[0035] If a1 = b1, a2 = b2, and a2 < b2, then the key value of face element a is less than the key value of face element b ;
[0036] Preferably, the tree node information in the red-black tree data structure includes: key value, color, left subtree pointer, right subtree pointer, parent node pointer, and data information.
[0037] Preferably, the process of inserting a tree node in the red - black tree data structure is as follows:
[0038] Initialize a leaf node NIL with a black color, the root node points to NIL, and then add tree nodes to the red - black tree data structure one by one, including:
[0039] The insertion method of the first tree node is: create a new tree node z1, store the key value and data information corresponding to the first set of bins in the tree node z1, the parent node of the tree node z1 points to null, the root node of the red - black tree data structure points to the tree node z1, the left and right sub - trees of the root node point to null, the color of the tree node z1 is assigned red, and the color of the root node of the red - black tree data structure is assigned black;
[0040] The insertion method of the second tree node is: create a new tree node z2, store the key value and data information corresponding to the first set of bins in the tree node z2, initialize the temporarily created node pointer y to null, and the temporarily created node pointer x points to the root node of the red - black tree data structure;
[0041] Loop and execute the following operations: the node pointer y points to the pointer x. If the key value of the tree node z2 is less than the key value of the node pointer x, the node pointer x points to the left sub - tree of the node pointer x; otherwise, the node pointer x points to the right sub - tree of the node pointer x, until the node pointer x points to null to end the loop operation;
[0042] After the loop operation is completed, the node pointer x points to the position to be inserted (i.e., the null pointer), the node pointer y points to the parent node of the node pointer x, the parent node of the tree node z2 points to the node pointer y, compare the key value of the tree node z2 with the key value of the node pointer y, and store the tree node information of the tree node z2 in the corresponding sub - tree position of the node pointer y based on the comparison result; the left and right sub - trees of the tree node z2 are set to null, the left and right sub - tree colors of the tree node z2 are assigned red, and then determine whether a correction operation is required. If the parent node of the tree node z2 is red, no correction is required, and the color of the root node of the red - black tree data structure is assigned black; if the tree node z2 causes the red - black tree to be unbalanced, a balancing operation is required. The balancing operation is to improve the retrieval efficiency of the red - black tree;
[0043] The insertion method of the third tree node is: create a new tree node z3, store the key value and data information corresponding to the first set of bins in the tree node z3, initialize the node pointer y to null, and the node pointer x points to the root node of the red - black tree data structure;
[0044] Loop and execute the following operations: the node pointer y points to the node pointer x. If the key value of the tree node z3 is less than the key value of the node pointer x, the node pointer x points to the left sub - tree of the node pointer x; otherwise, the node pointer x points to the right sub - tree of the node pointer x, until the node pointer x points to null to end the loop operation;
[0045] After the loop operation is completed, the node pointer x points to the position to be inserted, the node pointer y points to the parent node of the node pointer x, the parent node of the tree node z3 points to the node pointer y, compare the key value of the tree node z3 with the key value of the node pointer y, and store the tree node information of the tree node z3 in the corresponding subtree position of the node pointer y based on the comparison result. The left and right subtrees of the tree node z3 are set to null, and the colors of the left and right subtrees of the tree node z3 are assigned red. Then, determine whether a correction operation is required. If the parent node of the tree node z3 is red, no correction is needed, and the color of the root node of the red-black tree data structure is assigned black; if the tree node z3 causes the red-black tree to be unbalanced, a balancing operation is required. The balancing operation is to improve the retrieval efficiency of the red-black tree.
[0046] The subsequent node insertion method is executed with reference to the second and third node insertion methods to complete the insertion of all tree nodes in the red-black tree data structure.
[0047] Among them, storing the tree node information of the tree node z2 in the corresponding subtree position of the node pointer y based on the comparison result includes: if the key value of the tree node z2 is less than the key value of the node pointer y, store the tree node information of the tree node z2 in the left subtree position of the node pointer y; otherwise, store the tree node information of the tree node z2 in the right subtree position of the node pointer y.
[0048] Similarly, storing the tree node information of the tree node z3 in the corresponding subtree position of the node pointer y based on the comparison result includes: if the key value of the tree node z3 is less than the key value of the node pointer y, store the tree node information of the tree node z3 in the left subtree position of the node pointer y; otherwise, store the tree node information of the tree node z3 in the right subtree position of the node pointer y.
[0049] One or more technical solutions provided by the present invention have at least the following technical effects or advantages:
[0050] The present invention establishes a red-black tree data structure based on the face element node numbering, which has characteristics such as efficient self-balancing search and addition, can effectively improve the internal face element redundancy removal process, improve the efficiency of the tetrahedral mesh geometric preprocessing program, and further improve the efficiency of the rarefied gas dynamics numerical simulation method for the aircraft model. Compared with the processing method based on array loop, the calculation efficiency is significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The drawings described herein are used to provide a further understanding of the embodiments of the present invention, and constitute a part of the present invention, but do not limit the embodiments of the present invention;
[0052] Figure 1 It is a schematic flowchart of a rarefied gas dynamics numerical simulation method for an aircraft model. Detailed implementation manners
[0053] In order to more clearly understand the above objects, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation manners. It should be noted that, without conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other.
[0054] In the following description, many specific details are set forth in order to fully understand the present invention. However, the present invention can also be implemented in other ways different from those described within the scope hereof. Therefore, the protection scope of the present invention is not limited by the specific embodiments disclosed below.
[0055] Embodiment 1;
[0056] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of a numerical simulation method for rarefied gas dynamics of an aircraft model. The present invention provides a numerical simulation method for rarefied gas dynamics of an aircraft model, and the method includes:
[0057] Step 1: Construct a tetrahedral mesh file based on the aircraft model parameters;
[0058] Step 2: Process the tetrahedral mesh file to obtain a tetrahedral mesh file based on a red-black tree;
[0059] Step 3: Set the oncoming flow parameters, and perform numerical simulation using the tetrahedral mesh file based on the red-black tree to obtain a simulation result;
[0060] Among them, the step 2 includes:
[0061] Step 2.1: Read in the tetrahedral mesh file to obtain the information of the tetrahedral mesh file;
[0062] Step 2.2: Establish a red-black tree data structure based on the information of the tetrahedral mesh file;
[0063] Step 2.3: For the volume elements i in the tetrahedral mesh file, where 1 ≤ i ≤ m and m is the total number of volume elements in the tetrahedral mesh file; determine whether the surface element i of the volume element k is within the red-black tree data structure, k is an integer, 1 ≤ k ≤ 4. If the surface element k is not within the red-black tree data structure, then create a new tree node within the red-black tree data structure, store the information of the surface element k into the corresponding linked list structure, and establish the surface element information of the volume element i in the red-black tree data structure; if the surface element kWithin the red - black tree data structure, search for the face element k corresponding tree node, and update the adjacent element information of the element stored in this tree node;
[0064] Step 2.4: For the boundary face elements in the tetrahedral mesh file j , 1 ≤ j ≤ n, where n is the total number of boundary face elements in the tetrahedral mesh file; Determine whether the boundary face element j is within the red - black tree data structure. If the boundary face element j is within the red - black tree data structure, then update the right - hand side element of the boundary face element j to the boundary condition information of the boundary face element j .
[0065] Among them, the calculation process of the DSMC method usually includes initialization (mesh reading and pre - processing), particle initialization, particle movement and boundary condition processing, particle collision, statistical sampling, and output, etc. The DSMC method is a commonly used method in numerical simulation, and the specific steps of the DSMC method are not elaborated in detail in the embodiments of the present invention.
[0066] Among them, a grid node refers to a geometric point in a three - dimensional grid, and a tree node refers to a data storage structure in a data structure.
[0067] Among them, the stored face element refers to the face element number information stored in the data structure of the tree node, and the adjacent element refers to the adjacent element on the side of the face element, and this element has a component face element that is the current face element.
[0068] Among them, the boundary face element is the face element for which boundary conditions need to be defined, opposite to the internal face element.
[0069] Next, the embodiments of the present invention will introduce in detail the method for obtaining a tetrahedral mesh file based on a red - black tree, specifically including:
[0070] First, read in the tetrahedral mesh file (.inp), and obtain information such as the total number of grid nodes, grid node coordinates, total number of elements, the grid nodes that make up the element, and boundary conditions. The element and grid node information can be directly read from the mesh file. Among them, the grid node is a grid point, the element is a grid unit composed of grid nodes, the boundary condition refers to the type of the grid boundary face, and the element and node information refers to the grid node number information that makes up the element, that is, which grid nodes the element is composed of.
[0071] Then, establish a red - black tree data structure. The information stored in each tree node is information such as the three grid node numbers of the face element. The three grid node numbers of the face element (sorted from small to large) are used as the key values of the tree node. In addition to the key value, the tree node information also includes color, left - subtree pointer, right - subtree pointer, parent - node pointer, and data information.
[0072] Among them, the key value is the numbers of three grid nodes that make up a face element, which are three integers. The method for comparing the sizes of key values is as follows: If the grid node numbers of two face elements are the same, then their key values are equal. If the smallest grid node number of face element 1 is less than the grid node number of face element 2, then the key value of face element 1 is less than the key value of face element 2. If the smallest grid node number of face element 1 is greater than the grid node number of face element 2, then the key value of face element 1 is greater than the key value of face element 2. If the smallest grid node numbers of two face elements are the same, then continue to compare the second grid node number until the size relationship between the two face elements is completely determined. Among them, a face element is each face of a volume element. The way to obtain the grid node number is that when reading in the grid node coordinates, the arrangement order of the grid nodes is their numbers.
[0073] For example, for the face element a and the face element b , the method for determining the size relationship of their key values is as follows:
[0074] The node numbers of the face element a are (a1, a2, a3), and the node numbers of the face element b are (b1, b2, b3);
[0075] If a1 = b1, a2 = b2, and a3 = b3, then the key values of the face element a and the face element b are equal;
[0076] If a1 < b1, then the key value of the face element a is less than the key value of the face element b ;
[0077] If a1 = b1 and a2 < b2, then the key value of the face element a is less than the key value of the face element b ;
[0078] If a1 = b1, a2 = b2, and a2 < b2, then the key value of the face element a is less than the key value of the face element b .
[0079] Then, loop through all the voxels (processing all voxels in ascending order of their numbers), and judge the four triangular facets of each voxel. If the facet is not in the red-black tree (the red-black tree consists of many tree nodes, and if the currently judged facet does not match the information of any tree node in the red-black tree, that is, the facet is not in the red-black tree), then create a new tree node in the tree, store the facet information (mesh node number and adjacent voxel number) into the corresponding linked list structure (the linked list structure is obtained when the red-black tree is defined), and simultaneously establish the facet information of the voxel (including facet number and the mesh nodes that make it up). If the facet is already in the red-black tree, search for the corresponding tree node and update the information of the adjacent voxels stored in that tree node. The corresponding facet information of the corresponding voxel can be obtained accordingly. Among them, there is one voxel on each of the left and right sides of each facet, and the voxels on the left and right sides are the adjacent voxels. If the facet is a boundary facet, there is only one adjacent voxel.
[0080] Then, loop through the boundary facets. Search the red-black tree according to the node number of the current boundary facet. If the corresponding facet is found in the red-black tree, update the right voxel of this facet with the boundary condition information of the corresponding boundary facet. The boundary facet is the facet on the mesh boundary.
[0081] Then, complete the remaining geometric preprocessing information (such as calculating the mesh volume, mesh center, facet normal, etc.) to prepare for the numerical simulation calculation.
[0082] Among them, the node information of the red-black tree data structure records the key value (key), color (colour), left subtree pointer (left), right subtree pointer (right), parent node pointer (p), and data information (data), etc., of the tree node.
[0083] A face element consists of three grid nodes, arranged in ascending order, such as face1(k1_min, k1_mid, k1_max) and face2(k2_min, k2_mid, k2_max). face1 and face2 are face element 1 and face element 2 respectively. k1_min, k1_mid, k1_max are the node numbers of face element 1, where k1_min is the minimum node number of face element 1, k1_mid is the middle node number of face element 1, and k1_max is the maximum node number of face element 1. k2_min, k2_mid, k2_max are the node numbers of face element 2, where k2_min is the minimum node number of face element 2, k2_mid is the middle node number of face element 2, and k2_max is the maximum node number of face element 2. When inserting a tree node and searching for a tree node in a red - black tree, it is necessary to judge the size of the face element. If k1_min is equal to k2_min, k1_mid is equal to k2_mid, and k1_max is equal to k2_max, then face1 is equal to face2. If (k1_min < k2_min) or (k1_min is equal to k2_min and k1_mid < k2_mid) or (k1_min is equal to k2_min, k1_mid is equal to k2_mid, and k1_max < k2_max), then face1 < face2. If (k1_min > k2_min) or (k1_min is equal to k2_min and k1_mid > k2_mid) or (k1_min is equal to k2_min, k1_mid is equal to k2_mid, and k1_max > k2_max), then face1 > face2.
[0084] A red - black tree is a balanced binary search tree. It does not have a strict balance property, but has good average performance. In a red - black tree, nodes are marked with two colors: red and black. The principles of a red - black tree are as follows:
[0085] Property 1: A tree node is either black or red.
[0086] Property 2: The root node must be black.
[0087] Property 3: The leaf node (NIL) must be black.
[0088] Property 4: Both children of each red node are black.
[0089] Property 5: All paths from any node to each of its leaves contain the same number of black nodes.
[0090] Once the five principles of the red - black tree are not satisfied, the balance is broken, and three operations, namely color change, left rotation, and right rotation, are required to restore the balance. Color change means that the color of a node changes from red to black or from black to red. Left rotation means that with a certain node as the pivot, its parent node (the root of the subtree) rotates to become its left subtree (left rotation). The original left subtree of the pivot becomes the right subtree of the original root node, and the original right subtree of the pivot remains unchanged. Right rotation means that with a certain node as the pivot, its parent node (the root of the subtree) rotates to become its right subtree (right rotation). The original right subtree of the pivot becomes the left subtree of the original root node, and the original left subtree of the pivot remains unchanged.
[0091] The process of inserting a tree node into a red - black tree is as follows:
[0092] Initialize a leaf node NIL with a black color, point the root node to NIL, and then add tree nodes to the red - black tree data structure one by one, including:
[0093] The insertion method for the first tree node is: create a new tree node z1, store the key value and data information corresponding to the first set of bins in the tree node z1, point the parent node of the tree node z1 to null, point the root node of the red - black tree data structure to the tree node z1, point the left and right subtrees of the root node to null, assign the color of the tree node z1 to red, and assign the color of the root node of the red - black tree data structure to black;
[0094] The insertion method for the second tree node is: create a new tree node z2, store the key value and data information corresponding to the first set of bins in the tree node z2, initialize the temporarily created node pointer y to null, and point the temporarily created node pointer x to the root node of the red - black tree data structure;
[0095] Loop and execute the following operations: point the node pointer y to the pointer x. If the key value of the tree node z2 is less than the key value of the node pointer x, then point the node pointer x to the left subtree of the node pointer x; otherwise, point the node pointer x to the right subtree of the node pointer x. End the loop operation until the node pointer x points to null;
[0096] After the loop operation is completed, the node pointer x points to the position to be inserted (i.e., the null pointer), the node pointer y points to the parent node of the node pointer x, the parent node of the tree node z2 points to the node pointer y. Compare the key value of the tree node z2 with the key value of the node pointer y, and store the tree node information of the tree node z2 in the corresponding subtree position of the node pointer y based on the comparison result; set the left and right subtrees of the tree node z2 to null, assign the colors of the left and right subtrees of the tree node z2 to red, and then determine whether a correction operation is required. If the parent node of the tree node z2 is red, no correction is required, and assign the color of the root node of the red - black tree data structure to black;
[0097] The third way to insert a tree node is as follows: create a new tree node z3, store the key value and data information corresponding to the first set of cells in tree node z3, initialize the node pointer y to be null, and point the node pointer x to the root node of the red-black tree data structure;
[0098] Loop and execute the following operations: point the node pointer y to the node pointer x. If the key value of tree node z3 is less than the key value of node pointer x, point node pointer x to the left subtree of node pointer x; otherwise, point node pointer x to the right subtree of node pointer x, and end the loop operation until node pointer x points to null;
[0099] After the loop operation is completed, node pointer x points to the position to be inserted, node pointer y points to the parent node of node pointer x, the parent node of tree node z3 points to node pointer y, compare the key value of tree node z3 with the key value of node pointer y, and store the tree node information of tree node z3 in the corresponding subtree position of node pointer y based on the comparison result. Set the left and right subtrees of tree node z3 to be null, assign the colors of the left and right subtrees of tree node z3 to be red, and then determine whether a correction operation is required. If the parent node of tree node z3 is red, no correction is needed, and assign the color of the root node of the red-black tree data structure to be black;
[0100] For subsequent node insertions, refer to the second and third node insertion methods to complete the insertion of all tree nodes in the red-black tree data structure.
[0101] Three standard test cases (flow around a flat plate, flow around a cylinder, and flow around a certain high-speed aircraft) were used to conduct numerical tests on the content of the present invention.
[0102] For the flat plate test case, the incoming flow Mach number is 4.0, the incoming flow density is 4.65e-6 kg / m 3 , the incoming flow temperature is 300K, and the wall temperature is 500K.
[0103] For the flow around a cylinder, the incoming flow Mach number is 24.85, the incoming flow density is 6.865e-6 kg / m 3 , the incoming flow temperature is 187K, and the wall temperature is 1000K.
[0104] For the high-speed aircraft, the incoming flow Mach number is 27.5, the incoming flow density is 3.416e-6 kg / m 3 , the incoming flow temperature is 187K, and the wall temperature is 700K.
[0105] Table 1 shows the performance test results under different test cases.
[0106] Table 1 Performance Test Table
[0107] Example Name Number of Meshes / 10,000 Number of Zones Original Time / s Current Time / s Efficiency Improvement 1 Flat Plate 8.5 64 9.2 3.7 60% 2 Cylinder 69 256 290.3 43.8 85% 3 Aircraft 480 2048 5684.8 282.1 95%
[0108] The results show that the tetrahedral mesh preprocessing method based on red-black tree proposed by the present invention can greatly improve the computational efficiency of numerical simulation methods, especially in the case of a large number of meshes.
[0109] Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications falling within the scope of the present invention.
[0110] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these modifications and variations.
Claims
1. A method for numerical simulation of rarefied gas dynamics of an aircraft model, characterized in that: The method comprises: Step 1: Construct a tetrahedral mesh file based on the aircraft model parameters; Step 2: Processing the tetrahedral mesh file to obtain a tetrahedral mesh file based on a red-black tree; Step 3: setting the incoming flow parameters, and performing numerical simulation using the tetrahedral mesh file based on the red-black tree to obtain simulation results; Wherein, the step 2 comprises: Step 2.1: Read the tetrahedral mesh file to obtain information of the tetrahedral mesh file; Step 2.2: Establish a red-black tree data structure based on the information of the tetrahedral mesh file; Step 2.3: For the volume elements in the tetrahedral mesh file i , 1≤i≤m, m is the total number of voxels in the tetrahedral mesh file; determine the voxel i The facet k Whether it is in the red-black tree data structure, k is an integer, 1≤k≤4, if the face element k If the face element is not in the red-black tree data structure, a new tree node is created in the red-black tree data structure, and the face element k The information is stored in the corresponding linked list structure, and the volume element is established in the red-black tree data structure i The face element information; if the face element k In the red-black tree data structure, the search facet k The corresponding tree node is created, and the adjacent voxel information of the face element stored in the tree node is updated; Step 2.4: For the boundary elements in the tetrahedral mesh file j , 1≤j≤n, n is the total number of boundary elements in the tetrahedral mesh file; determine the boundary element j Is it in the red-black tree data structure, if the boundary element j In the red-black tree data structure, the boundary pixel is updated j The right side element is the boundary element j boundary condition information.
2. The method for numerical simulation of rarefied gas dynamics of an aircraft model according to claim 1, characterized in that: The information stored in each tree node in the red-black tree data structure is the numbering information of three grid nodes of the face element in the tetrahedral grid file.
3. The method for numerical simulation of rarefied gas dynamics of an aircraft model according to claim 1, characterized in that: The step 2 also includes: Step 2.5: Calculate and obtain the mesh volume, mesh center and face element normal information of the tetrahedral mesh file.
4. The method for numerical simulation of rarefied gas dynamics of an aircraft model according to claim 1, characterized in that: The information of the tetrahedral mesh file includes: the total number of mesh nodes, mesh node coordinates, the total number of voxels, constituent mesh nodes of the voxels, and boundary conditions of the tetrahedral mesh file.
5. The method for numerical simulation of rarefied gas dynamics of an aircraft model according to claim 2, characterized in that: The step 2.2 also includes: using the three node numbers of the facets to sort in ascending order to obtain the key value of the corresponding tree node.
6. A method for numerical simulation of rarefied gas dynamics of an aircraft model according to claim 5, characterized in that: The step 2.2 also includes determining the size relationship of the key values of the facets.
7. A method for numerical simulation of rarefied gas dynamics of an aircraft model according to claim 6, characterized in that: Facet a With facet b The key value size relationship is determined as follows: Facet a The mesh nodes are numbered (a1, a2, a3), and the surface elements are b The grid node numbers are (b1, b2, b3); where a1, a2, a3, b1, b2 and b3 are the corresponding grid node numbers; If a1=b1,a2=b2,a3=b3,then the panel element a With facet b The key values are equal; If a1 < b1, then the key value of the surface element a is less than the key value of the surface element b ; If a1 = b1 and a2 < b2, then the key value of the surface element a is less than the key value of the surface element b ; If a1 = b1 and a2 = b2 and a2 < b2, then the key value of the surface element a is less than the key value of the surface element b .
8. The method for numerical simulation of rarefied gas dynamics of an aircraft model according to claim 1, characterized in that: The tree node information in the red-black tree data structure includes: key value, color, left subtree pointer, right subtree pointer, parent node pointer and data information.
9. The method for numerical simulation of rarefied gas dynamics of an aircraft model according to claim 1, characterized in that: The tree node insertion process in the red-black tree data structure is: Initialize a leaf node NIL, the color is black, the root node points to NIL, and then add the tree nodes one by one to the red-black tree data structure, including: The first tree node insertion method is: create a new tree node z1, store the key value and data information corresponding to the first group of facets into the tree node z1, the parent node of the tree node z1 points to null, the root node of the red-black tree data structure points to the tree node z1, the left and right subtrees of the root node point to null, the tree node z1 is colored red, and the root node of the red-black tree data structure is colored black; The second tree node insertion method is as follows: create a new tree node z2, store the key value and data information corresponding to the first set of facets into the tree node z2, initialize the temporarily created node pointer y to null, and point the temporarily created node pointer x to the root node of the red-black tree data structure; The loop performs the following operations: the node pointer y points to the pointer x. If the key value of the tree node z2 is less than the key value of the node pointer x, the node pointer x points to the left subtree of the node pointer x. Otherwise, the node pointer x points to the right subtree of the node pointer x until the node pointer x points to null and the loop operation ends. After the loop operation is completed, the node pointer x points to the position to be inserted, the node pointer y points to the parent node of the node pointer x, the parent node of the tree node z2 points to the node pointer y, and the key value of the tree node z2 is compared with the key value of the node pointer y. Based on the comparison result, the tree node information of the tree node z2 is stored in the corresponding subtree position of the node pointer y; the left and right subtrees of the tree node z2 are empty, and the left and right subtrees of the tree node z2 are colored red, and then it is determined whether a correction operation is required. If the parent node of the tree node z2 is red, no correction is required, and the root node color of the red-black tree data structure is assigned to black; The third tree node insertion method is: create a new tree node z3, store the key value and data information corresponding to the first group of facets into the tree node z3, initialize the node pointer y to empty, and the node pointer x points to the root node of the red-black tree data structure; The loop performs the following operations: the node pointer y points to the node pointer x. If the key value of the tree node z3 is less than the key value of the node pointer x, the node pointer x points to the left subtree of the node pointer x. Otherwise, the node pointer x points to the right subtree of the node pointer x until the node pointer x points to null and the loop operation ends. After the loop operation is completed, the node pointer x points to the position to be inserted, the node pointer y points to the parent node of the node pointer x, the parent node of the tree node z3 points to the node pointer y, and the key value of the tree node z3 is compared with the key value of the node pointer y. Based on the comparison result, the tree node information of the tree node z3 is stored in the corresponding subtree position of the node pointer y, the left and right subtrees of the tree node z3 are empty, and the left and right subtrees of the tree node z3 are colored red. Then, it is determined whether a correction operation is required. If the parent node of the tree node z3 is red, no correction is required, and the root node color of the red-black tree data structure is assigned to black. The subsequent node insertion method is executed in accordance with the second and third node insertion methods to complete the insertion of all tree nodes in the red-black tree data structure.
Citation Information
Patent Citations
Red-black tree-based finite element unit quick search method and system
CN111967175A
Load balancing method in numerical simulation calculation
CN113850032A
Aircraft wall surface stress tensor sampling method, device and equipment and storage medium
CN116204985A
Methods and systems for large-scale reservoir simulations using automated local grid refinement
US20250068804A1