A method for numerical simulation of rarefied gas dynamics of aircraft models

By using a red-black tree data structure to optimize tetrahedral mesh preprocessing in the DSMC method, the problem of low computational efficiency is solved, and efficient numerical simulation of rarefied gas dynamics is achieved.

CN120145922BActive Publication Date: 2025-11-18CALCULATION AERODYNAMICS INST CHINA AERODYNAMICS RES & DEV CENT
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510233713.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-28
Publication Date
2025-11-18
Estimated Expiration
2045-02-28

AI Technical Summary

Technical Problem

Existing tetrahedral mesh-based DSMC methods have low computational efficiency in numerical simulations of rarefied gas dynamics, especially in large-scale mesh calculations.

Method used

A tetrahedral mesh preprocessing method based on red-black tree data structure is adopted. By constructing a red-black tree data structure, the data structure of volume element-surface element-node is quickly established, which improves the computational efficiency and supports dynamic load balancing.

Benefits of technology

It significantly improves the computational efficiency of numerical simulation of rarefied gas dynamics for aircraft models, especially in large-scale grid computing, where the efficiency improvement is remarkable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120145922B_ABST
    Figure CN120145922B_ABST
Patent Text Reader

Abstract

The application discloses a kind of aircraft model rare gas dynamics numerical simulation method, it is related to numerical simulation field, the method includes: step 1: based on aircraft model parameter construction tetrahedron grid file;Step 2: the tetrahedron grid file is handled, obtains the tetrahedron grid file based on red-black tree;Step 3: setting inflow parameter, numerical simulation is carried out using the tetrahedron grid file based on red-black tree, obtains simulation result;The present application can effectively improve internal face element de-redundant process, improve the efficiency of tetrahedron grid geometry preprocessing program, to improve the efficiency of aircraft model rare gas dynamics numerical simulation method, compared with the processing mode based on array loop, computing efficiency is significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of numerical simulation, in particular to a method for numerical simulation of rarefied gas dynamics of an aircraft model. BACKGROUND

[0002] DSMC (Direct Simulation Monte Carlo) is a numerical simulation method based on probability statistics, mainly used for solving rarefied gas dynamics problems. This method simulates the micro behavior of gas and statistics the macro flow characteristics by discretizing the molecular motion and collision process, combined with Monte Carlo random sampling technology.

[0003] DSMC method features:

[0004] Applicability: mainly for rarefied gas (Knudsen number greater than 0.1 flow), such as hypersonic aircraft flow, vacuum plume, micro-nano scale flow, etc.

[0005] Efficiency: dynamic memory allocation, local time step optimization and other technologies are used to improve the calculation efficiency, such as high efficiency search algorithm in unstructured grid can reduce the consumption of computing resources.

[0006] Physical model: commonly used variable hard sphere model (VHS) to describe molecular collision, surface reflection model (such as complete diffuse reflection or CLL model) to simulate the interaction between molecules and boundaries.

[0007] DSMC method combines molecular motion with probability statistics to provide an efficient and accurate simulation tool for rarefied gas flow, especially in the fields of hypersonic aircraft design and microfluidic device development, which is irreplaceable.

[0008] The specific steps of DSMC (Direct Simulation Monte Carlo) can be divided into the following main stages: 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. Each stage simulates the micro behavior of gas molecules through discretization and probability statistics, and finally derives the macro flow characteristics.

[0009] Tetrahedral meshes are a commonly used mesh type in unstructured mesh computation. Mesh generation software (such as Gridgen) typically exports files (.inp format) containing only the spatial coordinates of each mesh node, the node numbers of the tetrahedron, and boundary condition information; that is, only a volume element-node data structure. However, many applications require a volume element-surface element-node data structure. For example, the DSMC method, most commonly used in numerical simulations of rarefied gas dynamics, needs to find adjacent volume elements by traversing the surface elements through which the particle's trajectory passes, and continue trajectory determination until the final volume element containing the particle is found.

[0010] Each tetrahedral cell has four facets. Boundary facets are unique, while internal facets are shared by adjacent cell types. A storage structure for facets can be built by iterating through each cell, but this results in redundancy among internal facets. While array looping can eliminate redundancy, this method is inefficient when dealing with a large number of meshes.

[0011] Therefore, the current DSMC method based on tetrahedral meshes suffers from the technical problem of low computational efficiency. Summary of the Invention

[0012] This invention proposes a tetrahedral mesh preprocessing method based on a red-black tree data structure, which can realize the rapid construction of tetrahedral mesh volume element-face element-node data structure. This not only improves the computational efficiency of the DSMC method, but also supports the efficient implementation of technologies such as dynamic load balancing.

[0013] To achieve the above-mentioned objectives, this invention provides a numerical simulation method for rarefied gas dynamics in an aircraft model, the method comprising:

[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 a red-black tree;

[0016] Step 3: Set the incoming flow parameters, and perform numerical simulation using the red-black tree-based tetrahedral mesh file to obtain simulation results;

[0017] Step 2 includes:

[0018] Step 2.1: Read in the tetrahedral mesh file and obtain the information of the tetrahedral mesh file;

[0019] Step 2.2: Establish a red-black tree data structure based on the information in the tetrahedral mesh file;

[0020] Step 2.3: For the volume elements in the tetrahedral mesh file i1≤i≤m, where m is the total number of volume elements in the tetrahedral mesh file; determine the volume elements. i Surface element k Whether it is within the red-black tree data structure, where k is an integer, 1≤k≤4, if the face element k If the element is not within the red-black tree data structure, then a new tree node is created within the red-black tree data structure, and the element is... k The information is stored in the corresponding linked list structure, and a volume element is created in the red-black tree data structure. i Surface element information; if surface element k Within the red-black tree data structure, the search element... k The corresponding tree node is updated, and the adjacent volume element information of the surface element stored in the tree node is updated.

[0021] Step 2.4: For the boundary surface elements in the tetrahedral mesh file j 1≤j≤n, where n is the total number of boundary surface elements in the tetrahedral mesh file; determine the boundary surface elements. j Whether it is within the red-black tree data structure, if the boundary element j Within the red-black tree data structure, the boundary surface elements are updated. j The right-side volume element is the boundary surface element. j Boundary condition information.

[0022] The principle of this invention is as follows: a red-black tree is a self-balancing, highly efficient binary search tree that can complete operations such as searching, adding, and deleting in O(logN) time. This method improves the efficiency of numerical simulation methods for rarefied gas dynamics in aircraft models by constructing a tetrahedral mesh file based on a red-black tree. Since dynamic load balancing technology requires repartitioning the mesh, the red-black tree-based mesh preprocessing method described in this invention is needed for repartitioning. Therefore, this method not only improves the computational efficiency of the DSMC method but also supports the efficient implementation of techniques such as dynamic load balancing.

[0023] Step 2.1 reads in the tetrahedral mesh file to obtain the object to be processed. Step 2.2 initializes the red-black tree data structure to prepare for the subsequent insertion of each tetrahedral face. Step 2.3 sequentially stores each tetrahedral face 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, it indicates that the face is an internal face, and it does not need to be stored again, only its adjacent volumetric information needs to be updated. That is, the left and right volumetric elements of each face are found. Step 2.4 is used to iterate through the boundary facetric elements if a face has only one adjacent volumetric element, which is a boundary facet. The specific boundary type is found.

[0024] Preferably, the information stored in each tree node of the red-black tree data structure is the numbering information of three grid nodes of the face element in the tetrahedral mesh file.

[0025] Preferably, step 2 further includes:

[0026] Step 2.5: Calculate and obtain the grid volume, grid 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 grid nodes of the tetrahedral mesh file, grid node coordinates, the total number of volume elements, the grid nodes constituting the volume elements, and boundary conditions.

[0028] Preferably, step 2.2 further includes: obtaining the key value of the corresponding tree node by sorting the three node numbers of the face element in ascending order.

[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 The method for determining the size relationship of the key values is as follows:

[0031] The grid node numbers of face element a are (a1, a2, a3), and the grid node numbers of face element b are (b1, b2, b3); where a1, a2, a3, b1, b2, and b3 are all the corresponding grid 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 node insertion process in a red-black tree data structure is as follows:

[0038] Initialize a leaf node NIL with black color, and set the root node to point to NIL. Then, add the tree nodes one by one to the red-black tree data structure, including:

[0039] The first tree node is inserted as follows: Create a new tree node z1, store the key values ​​and data information corresponding to the first group of face elements 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.

[0040] The second tree node is inserted as follows: create a new tree node z2, store the key values ​​and data information corresponding to the first group of face elements 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.

[0041] The following operations are performed in a loop: node pointer y points to pointer x; if the key value of tree node z2 is less than the key value of node pointer x, then node pointer x points to the left subtree of node pointer x; otherwise, node pointer x points to the right subtree of node pointer x, until node pointer x points to null and the loop ends.

[0042] After the loop operation is completed, node pointer x points to the position to be inserted (i.e., a null pointer), node pointer y points to the parent node of node pointer x, and the parent node of tree node z2 points to node pointer y. The key value of tree node z2 is compared with the key value of node pointer y. Based on the comparison result, the tree node information of tree node z2 is stored in the corresponding subtree position of node pointer y. The left and right subtrees of tree node z2 are set to null and the color of the left and right subtrees of tree node z2 is set to red. Then, it is determined whether a correction operation is needed. If the parent node of tree node z2 is red, no correction is needed, and the root node of the red-black tree data structure is set to black. If tree node z2 causes the red-black tree to be unbalanced, a balancing operation is needed. The balancing operation is to improve the retrieval efficiency of the red-black tree.

[0043] The third tree node is inserted as follows: create a new tree node z3, store the key value and data information corresponding to the first group of face elements into 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] The following operations are performed in a loop: node pointer y points to node pointer x; if the key value of tree node z3 is less than the key value of node pointer x, node pointer x points to the left subtree of node pointer x; otherwise, node pointer x points to the right subtree of node pointer x, until node pointer x points to null and the loop ends.

[0045] 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, and the parent node of tree node z3 points to node pointer y. The key value of tree node z3 is compared with the key value of node pointer y. Based on the comparison result, the tree node information of tree node z3 is stored in the corresponding subtree position of node pointer y. The left and right subtrees of tree node z3 are set to null and the color of the left and right subtrees of tree node z3 is set to red. Then, it is determined whether a correction operation is needed. If the parent node of tree node z3 is red, no correction is needed, and the root node of the red-black tree data structure is set to black. If tree node z3 causes the red-black tree to be unbalanced, a balancing operation is needed. The balancing operation is to improve the retrieval efficiency of the red-black tree.

[0046] Subsequent node insertions are performed using the same method as the second and third node insertions, completing the insertion of all tree nodes in the red-black tree data structure.

[0047] Specifically, storing the tree node information of tree node z2 in the corresponding subtree position of node pointer y based on the comparison result includes: if the key value of tree node z2 is less than the key value of node pointer y, storing the tree node information of tree node z2 in the left subtree position of node pointer y; otherwise, storing the tree node information of tree node z2 in the right subtree position of node pointer y.

[0048] Similarly, based on the comparison result, the tree node information of tree node z3 is stored in the corresponding subtree position of node pointer y, including: if the key value of tree node z3 is less than the key value of node pointer y, the tree node information of tree node z3 is stored in the left subtree position of node pointer y; otherwise, the tree node information of tree node z3 is stored in the right subtree position of node pointer y.

[0049] One or more technical solutions provided by this invention have at least the following technical effects or advantages:

[0050] This invention establishes a red-black tree data structure based on the node number of the face element, which has the characteristics of self-balancing, efficient search and addition, and can effectively improve the internal face element redundancy removal process, improve the efficiency of tetrahedral mesh geometry preprocessing program, and thus improve the efficiency of numerical simulation method of rarefied gas dynamics of aircraft model. Compared with the processing method based on array loop, the computational efficiency is significantly improved. Attached Figure Description

[0051] The accompanying drawings, which are provided to further illustrate embodiments of the invention and constitute a part of this invention, are not intended to limit the scope of the invention.

[0052] Figure 1 This is a flowchart illustrating a numerical simulation method for rarefied gas dynamics in an aircraft model. Detailed Implementation

[0053] To better understand the above-mentioned objectives, 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 embodiments. It should be noted that, where there is no conflict, the embodiments of the present invention and the features thereof can be combined with each other.

[0054] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.

[0055] Example 1;

[0056] Please refer to Figure 1 , Figure 1 This invention provides a numerical simulation method for rarefied gas dynamics in an aircraft model, comprising:

[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 incoming flow parameters, and perform numerical simulation using the red-black tree-based tetrahedral mesh file to obtain simulation results;

[0060] Step 2 includes:

[0061] Step 2.1: Read in the tetrahedral mesh file and obtain the information of the tetrahedral mesh file;

[0062] Step 2.2: Establish a red-black tree data structure based on the information in the tetrahedral mesh file;

[0063] Step 2.3: For the volume elements in the tetrahedral mesh file i 1≤i≤m, where m is the total number of volume elements in the tetrahedral mesh file; determine the volume elements. i Surface element k Whether it is within the red-black tree data structure, where k is an integer, 1≤k≤4, if the face element k If the element is not within the red-black tree data structure, then a new tree node is created within the red-black tree data structure, and the element is... k The information is stored in the corresponding linked list structure, and a volume element is created in the red-black tree data structure. i Surface element information; if surface element kWithin the red-black tree data structure, the search element... k The corresponding tree node is updated, and the adjacent volume element information of the surface element stored in the tree node is updated.

[0064] Step 2.4: For the boundary surface elements in the tetrahedral mesh file j 1≤j≤n, where n is the total number of boundary surface elements in the tetrahedral mesh file; determine the boundary surface elements. j Whether it is within the red-black tree data structure, if the boundary element j Within the red-black tree data structure, the boundary surface elements are updated. j The right-side volume element is the boundary surface element. j Boundary condition information.

[0065] The computational flow of the DSMC method typically includes initialization (mesh reading and preprocessing), particle initialization, particle movement and boundary condition handling, particle collision, statistical sampling, and output. The DSMC method is a commonly used method in numerical simulations; however, the specific steps of the DSMC method will not be elaborated upon in this embodiment of the invention.

[0066] In this context, a grid node refers to a geometric point in a 3D grid, while a tree node refers to a data storage structure within 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 volume element refers to the adjacent volume element of the face element, which has a constituent face element that is the current face element.

[0068] Among them, boundary elements are elements for which boundary conditions need to be defined, as opposed to interior elements.

[0069] The following embodiments of the present invention provide a detailed description of the method for obtaining tetrahedral mesh files based on red-black trees, specifically including:

[0070] First, the tetrahedral mesh file (.inp) is read in to obtain information such as the total number of mesh nodes, mesh node coordinates, total number of volume elements, the mesh nodes that make up the volume elements, and boundary conditions. Volume element and mesh node information can be directly read from the mesh file. Here, mesh nodes are mesh points, volume elements are mesh cells composed of mesh nodes, boundary conditions refer to the type of mesh boundary surfaces, and volume element and node information refers to the mesh node numbers that make up the volume element, i.e., which mesh nodes make up the volume element.

[0071] Next, a red-black tree data structure is established, where each tree node stores information such as the three grid node numbers of the face element. The three grid node numbers of the face element (sorted from smallest to largest) serve as the key value 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 the face element, which are three integers. The way to compare the magnitudes of the 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, the face element is each face of the volume element, and 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 way to determine the size relationship of their key values is as follows:

[0074] For the face element a , the node numbers are (a1, a2, a3), and for the face element b , the node numbers are (b1, b2, b3);

[0075] If a1 = b1, a2 = b2, 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 and 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, all voxels are iterated through (numbered from smallest to largest, processing all voxels sequentially), and the four triangular facets of each voxel are evaluated. If the facet is not in the red-black tree (the red-black tree consists of many tree nodes; if the currently evaluated facet does not match any of the tree node information in the red-black tree, i.e., the facet is not in the red-black tree), a new tree node is created within the tree, and the facet information (grid node number and adjacent voxel numbers) is stored in the corresponding linked list structure (the linked list structure is obtained when the red-black tree is defined), and the facet information of the voxel (including the facet number and the constituent grid nodes) is established simultaneously. If the facet is already in the red-black tree, the corresponding tree node is searched, and the adjacent voxel information of the facet stored in that tree node is updated. The corresponding facet information of the corresponding voxel can be obtained at the same time. Each facet has one voxel on each of its left and right sides; these left and right voxels are the adjacent voxels. If the facet is a boundary facet, it has only one adjacent voxel.

[0080] Then, loop through the boundary elements, search the red-black tree according to the current boundary element node number. If the corresponding element is found in the red-black tree, update the right volume element of the element to the boundary condition information of the corresponding boundary element. The boundary element is the element on the mesh boundary.

[0081] Then, complete the remaining geometric preprocessing information (such as calculating mesh volume, mesh center, and surface normals) to prepare for numerical simulation calculations.

[0082] The node information in a 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) 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, k1_min is the minimum node number of face element 1, k1_mid is the middle node number of face element 1, 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, k2_min is the minimum node number of face element 2, k2_mid is the middle node number of face element 2, 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 and 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 and 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 and 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 its average performance is good. 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: The two children of each red node are both black.

[0089] Property 5: All paths from any node to each of its leaves contain the same number of black nodes.

[0090] If any of the five principles of a red-black tree are not satisfied, the balance is broken, and three operations—color change, left rotation, and right rotation—are needed to restore balance. Color change refers to changing the color of a node from red to black or vice versa. Left rotation involves using a node as a pivot, rotating its parent node (the root of the subtree) 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 involves using a node as a pivot, rotating its parent node (the root of the subtree) 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 node insertion process in a red-black tree is as follows:

[0092] Initialize a leaf node NIL with black color, and set the root node to point to NIL. Then, add the tree nodes one by one to the red-black tree data structure, including:

[0093] The first tree node is inserted as follows: Create a new tree node z1, store the key values ​​and data information corresponding to the first group of face elements 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.

[0094] The second tree node is inserted as follows: create a new tree node z2, store the key values ​​and data information corresponding to the first group of face elements 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.

[0095] The following operations are performed in a loop: node pointer y points to pointer x; if the key value of tree node z2 is less than the key value of node pointer x, then node pointer x points to the left subtree of node pointer x; otherwise, node pointer x points to the right subtree of node pointer x, until node pointer x points to null and the loop ends.

[0096] After the loop operation is completed, node pointer x points to the position to be inserted (i.e., a null pointer), node pointer y points to the parent node of node pointer x, and the parent node of tree node z2 points to node pointer y. The key value of tree node z2 is compared with the key value of node pointer y. Based on the comparison result, the tree node information of tree node z2 is stored in the corresponding subtree position of node pointer y. The left and right subtrees of tree node z2 are set to null, and the color of the left and right subtrees of tree node z2 is set to red. Then it is determined whether a correction operation is needed. If the parent node of tree node z2 is red, no correction is needed, and the root node of the red-black tree data structure is set to black.

[0097] The third tree node is inserted as follows: create a new tree node z3, store the key value and data information corresponding to the first group of face elements into 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;

[0098] The following operations are performed in a loop: node pointer y points to node pointer x; if the key value of tree node z3 is less than the key value of node pointer x, node pointer x points to the left subtree of node pointer x; otherwise, node pointer x points to the right subtree of node pointer x, until node pointer x points to null and the loop ends.

[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, and the parent node of tree node z3 points to node pointer y. The key value of tree node z3 is compared with the key value of node pointer y. Based on the comparison result, the tree node information of tree node z3 is stored in the corresponding subtree position of node pointer y. The left and right subtrees of tree node z3 are set to null and the color of the left and right subtrees of tree node z3 is set to red. Then it is determined whether a correction operation is needed. If the parent node of tree node z3 is red, no correction is needed. The root node of the red-black tree data structure is set to black.

[0100] Subsequent node insertions are performed using the same method as the second and third node insertions, completing the insertion of all tree nodes in the red-black tree data structure.

[0101] Numerical tests were conducted on the content of this invention using three standard calculation examples (flow around a flat plate, flow around a cylinder, and flow around a high-speed aircraft).

[0102] The incoming Mach number for the flat plate example is 4.0, and the incoming flow density is 4.65e-6 kg / m³. 3 The incoming flow temperature is 300K, and the wall temperature is 500K.

[0103] The incoming Mach number of the flow around the cylinder is 24.85, and the incoming flow density is 6.865e-6 kg / m³. 3 The incoming flow temperature is 187K and the wall temperature is 1000K.

[0104] The incoming Mach number of the high-speed aircraft is 27.5, and 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 presents the performance test results for different examples.

[0106] Table 1 Performance Test Table

[0107] Example name Grid amount / ten thousand Partition number Original time / s Present time / s Efficiency promotion 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 trees proposed in this invention can greatly improve the computational efficiency of numerical simulation methods, especially when the mesh size is large.

[0109] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0110] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A numerical simulation method for rarefied gas dynamics in an aircraft model, characterized in that, The method includes: Step 1: Construct a tetrahedral mesh file based on the aircraft model parameters; Step 2: Process the tetrahedral mesh file to obtain a tetrahedral mesh file based on a red-black tree; Step 3: Set the incoming flow parameters, and perform numerical simulation using the red-black tree-based tetrahedral mesh file to obtain simulation results; Step 2 includes: Step 2.1: Read in the tetrahedral mesh file and obtain the information of the tetrahedral mesh file; Step 2.2: Establish a red-black tree data structure based on the information in the tetrahedral mesh file; Step 2.3: For volume element i in the tetrahedral mesh file, 1≤i≤m, where m is the total number of volume elements in the tetrahedral mesh file; determine whether the face element k of volume element i is in the red-black tree data structure, where k is an integer, 1≤k≤4. If face element k is not in the red-black tree data structure, create a new tree node in the red-black tree data structure, store the information of face element k in the corresponding linked list structure, and establish the face element information of volume element i in the red-black tree data structure; if face element k is in the red-black tree data structure, search for the tree node corresponding to face element k and update the adjacent volume element information of the face element stored in the tree node. Step 2.4: For boundary element j in the tetrahedral mesh file, 1≤j≤n, where n is the total number of boundary elements in the tetrahedral mesh file; determine whether boundary element j is within the red-black tree data structure. If boundary element j is within the red-black tree data structure, update the right-hand volume element of boundary element j to the boundary condition information of boundary element j.

2. The numerical simulation method for rarefied gas dynamics of an aircraft model according to claim 1, characterized in that, In the red-black tree data structure, each tree node stores the numbering information of the three grid nodes of the face element in the tetrahedral mesh file.

3. The numerical simulation method for rarefied gas dynamics of an aircraft model according to claim 1, characterized in that, Step 2 also includes: Step 2.5: Calculate and obtain the mesh volume, mesh center, and surface normal information of the tetrahedral mesh file.

4. The numerical simulation method for rarefied gas dynamics of an aircraft model according to claim 1, characterized in that, The information in the tetrahedral mesh file includes: the total number of mesh nodes, mesh node coordinates, total number of volume elements, the constituent mesh nodes of the volume elements, and boundary conditions.

5. The numerical simulation method for rarefied gas dynamics of an aircraft model according to claim 2, characterized in that, Step 2.2 further includes: using the three node numbers of the face element to sort in ascending order to obtain the key value of the corresponding tree node.

6. The numerical simulation method for rarefied gas dynamics of an aircraft model according to claim 5, characterized in that, Step 2.2 also includes determining the key value relationships of the face elements.

7. The numerical simulation method for rarefied gas dynamics of an aircraft model according to claim 1, characterized in that, The tree node information in a red-black tree data structure includes: key value, color, left subtree pointer, right subtree pointer, parent node pointer, and data information.

8. The numerical simulation method for rarefied gas dynamics of an aircraft model according to claim 1, characterized in that, The process of inserting a tree node in a red-black tree data structure is as follows: Initialize a leaf node NIL with black color, and set the root node to point to NIL. Then, add the tree nodes one by one to the red-black tree data structure, including: The first tree node is inserted as follows: Create a new tree node z1, store the key values ​​and data information corresponding to the first group of face elements 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 is inserted as follows: create a new tree node z2, store the key values ​​and data information corresponding to the first group of face elements 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 following operations are performed in a loop: node pointer y points to pointer x; if the key value of tree node z2 is less than the key value of node pointer x, then node pointer x points to the left subtree of node pointer x; otherwise, node pointer x points to the right subtree of node pointer x, until node pointer x points to null and the loop ends. 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, and the parent node of tree node z2 points to node pointer y. The key value of tree node z2 is compared with the key value of node pointer y. Based on the comparison result, the tree node information of tree node z2 is stored in the corresponding subtree position of node pointer y. The left and right subtrees of tree node z2 are set to null, and the color of the left and right subtrees of tree node z2 is set to red. Then it is determined whether a correction operation is needed. If the parent node of tree node z2 is red, no correction is needed, and the root node of the red-black tree data structure is set to black. The third tree node is inserted as follows: create a new tree node z3, store the key value and data information corresponding to the first group of face elements into 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; The following operations are performed in a loop: node pointer y points to node pointer x; if the key value of tree node z3 is less than the key value of node pointer x, node pointer x points to the left subtree of node pointer x; otherwise, node pointer x points to the right subtree of node pointer x, until node pointer x points to null and the loop ends. 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, and the parent node of tree node z3 points to node pointer y. The key value of tree node z3 is compared with the key value of node pointer y. Based on the comparison result, the tree node information of tree node z3 is stored in the corresponding subtree position of node pointer y. The left and right subtrees of tree node z3 are set to null and the color of the left and right subtrees of tree node z3 is set to red. Then it is determined whether a correction operation is needed. If the parent node of tree node z3 is red, no correction is needed. The root node of the red-black tree data structure is set to black. Subsequent node insertions are performed using the same method as the second and third node insertions, completing the insertion of all tree nodes in the red-black tree data structure.

Citation Information

Patent Citations

  • Load balancing method in numerical simulation calculation

    CN113850032A

  • Aircraft wall surface stress tensor sampling method, device and equipment and storage medium

    CN116204985A