Ship viscous flow numerical simulation method based on mixed Cartesian grid

By using a hybrid Cartesian mesh method, combined with full-threaded tree and overlapping mesh techniques, a data structure adapted to the viscous flow solver is generated, which solves the shortcomings of traditional Cartesian meshes in describing complex ship boundaries and achieves high-precision numerical simulation of ship viscous flow.

CN121327982APending Publication Date: 2026-01-13CHINA SHIP SCIENTIFIC RESEARCH CENTER
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202511423143.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-30
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Traditional Cartesian grids are difficult to accurately describe the surface boundaries of ships with complex configurations, resulting in insufficient accuracy and reliability in numerical simulations of ship viscosity and flow.

Method used

A hybrid Cartesian mesh method is adopted, which constructs a hybrid partitioned mesh of body-fitted mesh and Cartesian mesh, generates a Cartesian mesh using a full-threaded tree, and uses overlapping mesh technology for assembly coupling. Combining the overlapping mesh technology and the optimization algorithm of the full-threaded tree, a data structure adapted to different viscous flow solvers is generated.

Benefits of technology

It improves the accuracy and robustness of numerical simulation of ship viscous flow, can accurately capture fluid details near complex boundaries, and is suitable for numerical simulation of resistance and flow field of underwater and surface ships under motion conditions. It has strong adaptability and computational efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121327982A_ABST
    Figure CN121327982A_ABST
Patent Text Reader

Abstract

The invention discloses a ship viscous flow numerical simulation method based on a hybrid Cartesian grid, and relates to the technical field of ship CFD. The method comprises the steps that after a computational domain is constructed, a body-fitted grid is generated at the object plane boundary of a ship model; then, on the basis of the outermost-layer body-fitted grid, a full-thread tree is used for carrying out space division on a computational domain to generate a Cartesian grid, and the full-thread tree is output as Cartesian grid topological information matched with the data structure of the target viscous flow solver; and finally, assembling and coupling the body-fitted grid and the Cartesian grid by using an overlapping grid technology to obtain a mixed partition grid unit, and applying the mixed partition grid unit to a solving process of a target viscous flow solver. Therefore, the accuracy and robustness of viscous flow numerical simulation of the ship with the complex geometry are improved, and the method can be well applied to resistance and flow field numerical simulation scenes in underwater and water surface ship body motion states.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of ship CFD technology, and in particular to a numerical simulation method for ship viscous flow based on a hybrid Cartesian grid. Background Technology

[0002] With the continuous development of computer technology, CAE technology has become one of the important tools for ship design and simulation. By using computational fluid dynamics (CFD) methods to numerically simulate the hydrodynamic characteristics of ships in water, we can evaluate the ship's resistance, maneuverability, and the stress on the hull structure, thereby guiding the optimization and improvement of ship design.

[0003] Mesh generation is the foundation and prerequisite for CFD calculations. Cartesian meshes, as a special type of non-body-fitted unstructured mesh, are widely used because of their simple data structure and adaptive refinement method. They not only facilitate the automation of mesh generation, but also dynamically and adaptively distribute the mesh based on flow field characteristics and object surface geometry.

[0004] However, the non-fit nature of the rectangular hexahedral mesh elements in the Cartesian mesh does not allow it to accurately describe the surface boundary. Therefore, relying solely on the traditional Cartesian mesh cannot accurately fit the surface, making it difficult to balance the requirements of geometric fidelity of the computational object and the reduction of the computational mesh in practical numerical simulation scenarios. Currently, some approaches use methods such as the Immersed Boundary Method (IBM), Embedded Boundary Method, SharpInterface Method, and Ghost Cell Method (GCM) to virtually introduce the surface boundary into the Cartesian mesh. These methods use additional source terms, force terms, or special numerical processing methods to simulate the influence of the surface boundary on the physical process, overcoming the aforementioned shortcomings of the Cartesian mesh. This approach performs well in scenarios with simple surface boundary shapes, such as the numerical simulation of hypersonic aircraft. However, for computational objects with complex geometries like ships, high-conformity spatial discretization is a crucial prerequisite for ensuring the accuracy and reliability of CFD calculations. The aforementioned methods still cannot accurately describe the flow field details on the object surface when dealing with complex shapes and viscous flow calculations, resulting in less than ideal accuracy and reliability for ship viscous flow numerical simulation methods implemented using these methods. Summary of the Invention

[0005] To address the aforementioned problems and technical requirements, this application proposes a numerical simulation method for ship viscous flow based on a hybrid Cartesian grid. The technical solution of this application is as follows:

[0006] A numerical simulation method for ship viscous flow based on hybrid Cartesian grids, comprising:

[0007] The computational domain is obtained by constructing a ship model and its surrounding background domain.

[0008] Generate a body-fitted mesh near the object surface boundary of the ship model within the background domain;

[0009] Based on the outermost body-fitted mesh, the computational domain is spatially partitioned using a full-thread tree to generate a Cartesian mesh, and the full-thread tree is output as Cartesian mesh topology information that matches the data structure of the target viscous flow solver;

[0010] Based on the topological information of the body-fitted mesh and the Cartesian mesh, the body-fitted mesh and the Cartesian mesh are coupled together using the overlapping mesh technique to obtain a hybrid partitioned mesh. The target viscous flow solver is then called to perform numerical simulation of ship viscous flow based on the hybrid partitioned mesh.

[0011] A further technical solution involves using a full-threaded tree to spatially partition the computational domain based on the outermost body-fitted mesh to generate a Cartesian mesh, including:

[0012] Using all discrete points of the outermost body-fitted mesh as input, a Cartesian mesh is generated by spatially partitioning the computational domain based on the geometric features and mesh scale of the outermost body-fitted mesh using a fully threaded tree. During the splitting process of the fully threaded tree, it is checked whether the current node intersects with the outermost body-fitted mesh. If the current node intersects with the outermost body-fitted mesh, the current node is split if its scale is greater than the bounding box scale of the intersecting outermost body-fitted mesh and greater than the minimum mesh scale. If the current node does not intersect with the outermost body-fitted mesh, the current node is split if it is outside the boundary of the outermost body-fitted mesh and its scale is greater than the target mesh scale. In the generated Cartesian mesh, the outermost body-fitted mesh has the same mesh scale as its neighboring Cartesian meshes.

[0013] A further technical solution involves using a full-threaded tree to spatially partition the computational domain based on the outermost body-fitted mesh to generate a Cartesian mesh, which also includes:

[0014] After splitting the current node into 8 child nodes based on an octree structure, for each child node: when the child node is closer to the positive x-axis in the x-axis direction, the value of the first index bit is 1; otherwise, the value of the first index bit is 0. When the child node is closer to the positive y-axis in the y-axis direction, the value of the second index bit is 1; otherwise, the value of the second index bit is 0. When the child node is closer to the positive z-axis in the z-axis direction, the value of the third index bit is 1; otherwise, the value of the third index bit is 0. The binary code formed by the values ​​of the three index bits of the child node is used as the position index of the child node.

[0015] Compare the 3D coordinates (x, y, z) of the entity element in the current node with the volume center coordinates (x0, y0, z0) of the current node in the three axes. If x > x0, set the first index bit to 1; otherwise, set the first index bit to 0. If y > y0, set the second index bit to 1; otherwise, set the second index bit to 0. If z > z0, set the third index bit to 1; otherwise, set the third index bit to 0. Store the entity element in the current node in the child node corresponding to the position index formed by the values ​​of the three index bits.

[0016] A further technical solution involves using overlapping mesh technology to assemble and couple the body-fit mesh with the Cartesian mesh to obtain a hybrid partitioned mesh, including:

[0017] The mesh classification method based on object surface moment classification combined with Cartesian auxiliary mesh classification divides the body-fitted mesh into body-fitted active mesh and body-fitted inactive mesh, and divides the Cartesian mesh into Cartesian active mesh and Cartesian inactive mesh.

[0018] Push the body-fitted active mesh to the body-fitted inactive mesh in multiple layers, and define the last two layers as body-fitted interpolation meshes; push the Cartesian active mesh to the Cartesian inactive mesh in multiple layers, and define the last two layers as Cartesian interpolation meshes;

[0019] For each body-fitting interpolation grid, a corresponding Cartesian grid is searched as its host grid, and for each Cartesian interpolation grid, a corresponding body-fitting grid is searched as its host grid.

[0020] A further technical solution involves calling the target viscous flow solver to perform numerical simulations of ship viscous flow based on a hybrid partitioned grid, including any type of grid such as body-fitted grids and Cartesian grids:

[0021] Discretize the governing equations for viscous flow numerical simulation independently on each active grid in the current grid type to obtain a system of linear algebraic equations of the form [A]·X=b. Solve the governing equations for viscous flow numerical simulation to obtain the flow field values ​​for each active grid in the current grid type. Here, [A] is the global coefficient matrix and contains the coefficient matrix corresponding to each active grid in the current grid type, X contains the flow field values ​​for each active grid in the current grid type, and b contains the source terms for each active grid in the current grid type.

[0022] For any interpolation grid i in the current grid type, the flow field value φ of interpolation grid i is obtained by interpolation using the flow field value of the host grid corresponding to interpolation grid i. i Set the i-th element of the coefficient matrix in the i-th row of the global coefficient matrix [A] corresponding to the interpolation grid i to 1, and set the remaining N-1 elements to 0. Modify the source term of the interpolation grid i to φ. i ;

[0023] For any inactive mesh j in the current mesh type, set the j-th element in the j-th row of the global coefficient matrix [A] corresponding to the inactive mesh j to 1, and set the remaining N-1 elements to 0. Set the source item of the inactive mesh j to 0.

[0024] The modified viscous flow numerical simulation governing equations are solved iteratively.

[0025] A further technical solution involves outputting the full-thread tree as Cartesian mesh topology information that matches the data structure of the target viscous flow solver, including:

[0026] Starting from the root node, visit the entire thread tree and recursively find all leaf nodes at the bottom level. For each leaf node, execute (1) to (5):

[0027] (1) Assign a unique volume number to the cube unit represented by the leaf node, and calculate the geometric coordinates of the cube unit represented by the leaf node. The geometric coordinates include the volume center coordinates of the cube unit, the face center coordinates of each surface in the cube unit, the edge center coordinates of each edge in the cube unit, and the coordinates of each vertex in the cube unit.

[0028] (2) Add the key-value pairs consisting of the body center coordinates and body number of the cube cell represented by the leaf node to the body cell hash table elemMap;

[0029] (3) Based on the geometric coordinates of the cube unit represented by the leaf node, and combined with the hierarchical relationship between the leaf node and its neighboring nodes, create a face unit at the corresponding surface of the cube unit represented by the leaf node. Use the vertexMap hash table to store the information of all vertices in the face unit, and use the face-point relationship linked list to store the correspondence between the created face unit and all the points it contains.

[0030] (4) Use a volume-surface relationship list to record the correspondence between the created face units and the cube units they belong to;

[0031] (5) Add the key-value pairs consisting of the face center coordinates and face address of the created face cell to the face cell hash table facesMap;

[0032] Based on the data structure of the target viscous flow solver, the volume element hash table elemMap, the face element hash table facesMap, and the point element hash table vertexMap are transformed to obtain the volume, face, and point information in the mesh topology of the target viscous flow solver. Combined with the correspondence recorded in the face-point relationship chain and the volume-face relationship chain, the Cartesian mesh topology information that matches the data structure of the target viscous flow solver and contains the volume-face-point topology relationship is obtained.

[0033] A further technical solution involves creating surface elements at the corresponding body surface of the cubic unit represented by the leaf node, including any individual surface of the cubic unit represented by the leaf node:

[0034] Check if the leaf node has any neighboring nodes on the body surface that share the body surface with the cube element represented by the current leaf node;

[0035] When a leaf node has no neighboring nodes on the body surface, a face element is created on the body surface and a unique face number is generated, and the cube element represented by the leaf node is used as the main element of the created face element.

[0036] When a leaf node has neighboring nodes on the body surface and those neighboring nodes are also leaf nodes, check if there is a key-value pair of the face center coordinates of the current body surface in the face element hash table facesMap. If there is no key-value pair of the face center coordinates of the current body surface in the face element hash table facesMap, create a face element on the body surface and generate a unique face number. The cube element represented by the leaf node is used as the main body element of the created face element, and the cube element represented by the neighboring node of the leaf node on the body surface is used as the sub-body element of the created face element.

[0037] A further technical solution involves using a vertexMap hash table to store information about all vertices in the face cells, including:

[0038] Iterate through each vertex in the created face cells, and check if there is a key-value pair of the coordinates of the currently visited vertex in the vertex cell hash table vertexMap. If there is no key-value pair of the coordinates of the currently visited vertex in the vertex cell hash table vertexMap, add the key-value pair of the coordinates of the currently visited vertex and the vertex number to the vertex cell hash table vertexMap.

[0039] Further technical solutions include: the numerical simulation method for ship viscosity flow also includes:

[0040] Visit the neighboring nodes of the leaf node on the body surface and determine the level of the neighboring nodes. When the level of the neighboring nodes of the leaf node on the body surface is different from that of the leaf node, determine whether there is a dangling point at the center of each edge and the face center of the leaf node on the body surface.

[0041] When using a face-point relationship linked list to store the correspondence between the created face unit and all the points it contains, the corresponding correspondence between the face unit and all the vertices and dangling points it contains is also stored.

[0042] A further technical solution involves using a volume-face relationship linked list to record the correspondence between the created face units and the cube units they belong to, including:

[0043] Determine the volume center coordinates of the main body unit of the created face unit, query the volume number ownerID corresponding to the volume center coordinates of the main body unit of the created face unit from the volume unit hash table elemMap, and add the face number of the created face unit to the face list elemFacePairs[ownerID] corresponding to the volume number ownerID;

[0044] When a face element has a secondary body element, determine the body center coordinates of the secondary body element of the face element, query the body number neighID corresponding to the body center coordinates of the secondary body element of the face element from the body element hash table elemMap, and add the face number of the face element to the face list elemFacePairs[neighID] corresponding to the body number neighID.

[0045] The beneficial technical effects of this application are:

[0046] This application discloses a numerical simulation method for ship viscous flow based on a hybrid Cartesian grid. This method utilizes a body-fitted grid to generate a boundary layer grid with a large slenderness ratio. Based on the outermost body-fitted grid, a Cartesian grid is generated through full-thread tree recursive partitioning, thus providing a structural foundation for the subsequent assembly of the Cartesian and body-fitted grids. Then, an overlapping grid strategy is used to decompose the complex computational domain into multiple sub-regions, avoiding the problem of fitting complex boundaries with traditional single-block grids. This method can more accurately capture the fine turbulent structural details near the wall. While adaptively refining the grid near complex boundaries (such as walls and sharp corners), it maintains the Cartesian topology of the global grid, thereby accurately capturing fluid, especially boundary layer flow details. Therefore, it improves the accuracy and robustness of viscous flow numerical simulation for ships with complex geometries, and has good applications in numerical simulation scenarios of resistance and flow field under underwater and surface ship motion.

[0047] This method utilizes a mature recursive subdivision algorithm for Cartesian meshes based on a fully threaded tree, which can be automated by a program, avoiding time-consuming steps such as mesh smoothing and quality optimization in traditional unstructured mesh generation. Furthermore, to adapt to the data formats of different viscous flow solvers, this application also provides a method for outputting the fully threaded tree as Cartesian mesh topology information, enabling the method to use various viscous flow solvers and exhibiting strong adaptability. In addition, this application optimizes the node splitting process of existing fully threaded trees by introducing binary-formatted position indices to quickly identify and find child nodes of parent nodes in the fully threaded tree, thus improving efficiency and reducing computational overhead. Moreover, when an object moves, the sub-regions of overlapping meshes only need to adjust their position or orientation, without needing to regenerate the entire computational domain mesh; the local refinement region of the FTT can dynamically adjust the subdivision hierarchy according to the object's movement, further reducing computational overhead. Attached Figure Description

[0048] Figure 1 This is a flowchart of a numerical simulation method for ship viscosity flow according to one embodiment of this application.

[0049] Figure 2 This is a schematic diagram of the computational domain constructed in an instance.

[0050] Figure 3 This is a schematic diagram illustrating the position index of each child node during the node splitting process in a full-thread tree.

[0051] Figure 4 This is a schematic diagram of the dangling points in the cube represented by the leaf nodes.

[0052] Figure 5 This is a schematic diagram of the assembly of a Cartesian mesh onto a body mesh.

[0053] Figure 6 yes Figure 2 The surface pressure map of the ship model obtained by numerical simulation using the method of this application is shown in the example. Detailed Implementation

[0054] The specific embodiments of this application will be further described below with reference to the accompanying drawings.

[0055] To retain the advantages of Cartesian grids while effectively handling viscous turbulent flows and high Reynolds number compressible flows, this application discloses a numerical simulation method for ship viscous flows based on a hybrid Cartesian grid. The basic idea of ​​this method is to combine the advantages of body-fitted grids and Cartesian grids, thereby transforming the non-body-fitted boundary problem of the Cartesian grid into a flow field information transfer problem between the two grids. This extends the method to the numerical simulation of unsteady motion boundary problems. Please refer to [reference needed]. Figure 1 The flowchart shown illustrates the following steps in this numerical simulation method for ship viscosity flow:

[0056] Step 110: Construct the ship model and its surrounding background domain to obtain the computational domain. The ship model is constructed based on the ship's geometry. The computational domain needs to completely encompass the entire ship model and is typically a cubic region. The specific coverage area is set according to the requirements of the ship viscous flow numerical simulation scenario. For example, in one instance, the constructed ship model is as follows: Figure 2 As shown in 210, the cube region 220 is the computational domain, and the area outside the ship model 210 and inside the computational domain 220 is the background domain.

[0057] Step 120: Generate a body-fitted mesh near the object boundary of the ship model within the background domain. The body-fitted mesh contains the mesh of the closed object boundary of the ship model. The body-fitted mesh can be generated directly using existing software, which will not be elaborated here.

[0058] Step 130: Based on the outermost body-fitted mesh, the computational domain is spatially partitioned using a full-threaded tree to generate a Cartesian mesh.

[0059] Fully Threaded Tree (FTT) is a fundamental tool for Cartesian mesh generation. It constructs structured Cartesian meshes by recursively partitioning the computational domain. Furthermore, FTT can decompose a large mesh generation task into many small, independently parallelizable tasks, thus greatly improving generation speed. Therefore, it is widely used in Cartesian mesh generation. The data structure of a fully threaded tree mainly includes:

[0060] (a) OctPr: A pointer of type OctNode. It points to the address of the parent node of the current node. If the current node has no parent node, it points to NULL, and in this case, the current node is called the root node.

[0061] (b) OctCh[8]: An array of pointers of type OctNode. Points to the addresses of the 8 child nodes of the current node. If the current node has no child nodes, it points to NULL, and the current node is called a leaf node.

[0062] (c)OctNb[6]: An array of pointers of type OctNode. Pointers to the addresses of the current node's neighboring nodes in the six directions of the cube. This pointer is released after a leaf node splits.

[0063] (d)TC: A pointer to a SingleLinkedList type. It is a singly linked list used to store the indices of the outermost meshes that intersect with the current node. When the current node intersects with the outermost mesh, the singly linked list TC is allocated memory to store the indices of all intersecting outermost meshes. After the calculation of the child nodes is completed, the parent node's singly linked list is released from memory.

[0064] In traditional methods, the computational domain is spatially partitioned using a full-thread tree based directly on the surface boundary of the simulated object (in this application, ship model 210) to generate a Cartesian mesh. However, in this application, because the body-fitted mesh and the Cartesian mesh are to be combined, the Cartesian mesh is not generated directly based on the surface boundary as in the traditional approach. Instead, it is generated based on the outermost body-fitted mesh generated in step 120. The outermost body-fitted mesh is the layer of body-fitted meshes that is furthest from the surface boundary of the ship model and is located at the outer boundary of the body-fitted mesh.

[0065] Specifically, firstly, an axis-aligned bounding box is created based on the size of the computational domain boundary, and an initial uniform mesh is generated based on this for subsequent targeted refinement. Then, a KD tree for the outermost body-fitted mesh is constructed for rapid spatial location lookup. Finally, using all discrete points of the outermost body-fitted mesh as input and the axis-aligned bounding box of the computational domain boundary as the partitioning object, a full-threaded tree is used to spatially partition the computational domain based on the geometric features and mesh scale of the outermost body-fitted mesh to generate a Cartesian mesh. Because the spatial partitioning is based on the outermost body-fitted mesh, the mesh scale of the outermost body-fitted mesh is consistent with that of its neighboring Cartesian meshes in the final generated Cartesian mesh, thus providing support for subsequent overlapping mesh assembly and interpolation calculations.

[0066] In the above process, firstly, all discrete points of the outermost body-fitted mesh are added to the singly linked list TC of a given node, and then the node is split. Node splitting is a recursive process and is the core of Cartesian mesh generation. During the splitting of the full-thread tree, it is necessary to check whether the current node intersects with the outermost body-fitted mesh to ensure that Cartesian mesh elements within the outer boundary of the body-fitted mesh do not participate in refinement. Therefore: if the current node intersects with the outermost body-fitted mesh, then the current node is split if its size is larger than the bounding box size of the intersecting outermost body-fitted mesh and larger than the minimum mesh size. If the current node does not intersect with the outermost body-fitted mesh, then the current node is split if its size is outside the boundary of the outermost body-fitted mesh and larger than the target mesh size. The minimum mesh size and target mesh size mentioned above are pre-defined.

[0067] When splitting a node, the current node's level is first compared to the maximum level of the tree to determine whether to update the tree's depth. In a fully threaded tree, only the neighbors of leaf nodes are used; therefore, `octNb` can be released when splitting the current node to save memory. Then, the geometric parameters of the child nodes are calculated and initialized. Next, the eight pointers in the current node's `octCh` are set to the child nodes, and the `octPr` pointers of the eight child nodes are set to the current node, thus completing the normal split. The fully threaded tree also uses a balanced octree for neighbor lookup and tree balancing. A balanced octree is characterized by the [2:1] rule, meaning the ratio of the side lengths of adjacent nodes is at most 2. The purpose of constructing a balanced octree is to avoid adjacent grid cells with large scale differences in the Cartesian mesh.

[0068] After splitting the current node, the entity elements stored in the current node are then distributed to the child nodes resulting from the split according to spatial inclusion relationships. In a 3D scene, splitting the current node into an octree structure results in 8 child nodes after halving along the x, y, and z axes. Please refer to [reference needed]. Figure 3In traditional methods, to allocate the entity element stored in the current node to its child nodes, it is necessary to compare the three-dimensional coordinates (x, y, z) of the entity element in the current node with the coordinate range covered by the eight child nodes. To improve running speed, this application also optimizes this part:

[0069] Please combine Figure 3 After splitting the current node into 8 child nodes based on an octree structure, the position index of each child node can be determined according to its relative position along the x, y, and z axes. This application uses a binary position index containing three index bits. For each child node: when the child node is closer to the positive x-axis, its first index bit is set to 1; when the child node is closer to the negative x-axis, its first index bit is set to 0. When the child node is closer to the positive y-axis, its second index bit is set to 1; when the child node is closer to the negative y-axis, its second index bit is set to 0. When the child node is closer to the positive z-axis, its third index bit is set to 1; when the child node is closer to the negative z-axis, its third index bit is set to 0. Then, the binary code formed by the values ​​of the three index bits of the child node is used as the position index of the child node, as follows: Figure 3 The location index of each of the 8 child nodes is shown.

[0070] Based on this, when storing the 3D coordinates (x, y, z) of the entity element in the current node into a child node, it is only necessary to use bitwise operators to compare the 3D coordinates (x, y, z) of the entity element in the current node with the volume center coordinates (x0, y0, z0) of the current node in the three axes, and obtain the position index according to the comparison result. Specifically: when x > x0, the first index bit is set to 1, otherwise the first index bit is set to 0; when y > y0, the second index bit is set to 1, otherwise the second index bit is set to 0; when z > z0, the third index bit is set to 1, otherwise the third index bit is set to 0. Then, the entity element in the current node is stored in the child node corresponding to the position index formed by the values ​​of the three index bits. For example, in an instance, x <x0、y<y0、z> If z0 is selected, the entity element in the current node will be stored in the child node with position index 001. Using this method, bitwise operators can replace comparisons of relative positions in geometric space, thus speeding up program execution.

[0071] In addition, to facilitate the storage of information related to each node, in one embodiment, a position index is added to each node element of each node. This position index also uses binary form. Each node includes three node element types: vertex, edge, and face. Each node element type includes multiple node elements. When the node is a cube structure, it includes 8 vertices, 8 edges, and 8 faces. For each node element of each node element type in each node: when the node element is closer to the positive x-axis direction, the value of the first index bit of the node element is determined to be 1; when the node element is closer to the negative x-axis direction, the value of the first index bit of the node element is determined to be 0. When the node element is closer to the positive y-axis direction, the value of the second index bit of the node element is determined to be 1; when the node element is closer to the negative y-axis direction, the value of the second index bit is determined to be 0. When the node element is closer to the positive z-axis direction, the value of the third index bit of the node element is determined to be 1; when the node element is closer to the negative z-axis direction, the value of the third index bit is determined to be 0. The binary code formed by the values ​​of the three index bits of the node element is used as the position index of the node element.

[0072] Step 140: Various viscous flow solvers require Cartesian mesh topology information based on unstructured data structures. However, the full-thread tree uses a branch tree data structure, which cannot be directly used for viscous flow solvers. Furthermore, different viscous flow solvers adapt to different data structures. Therefore, it is necessary to further output the full-thread tree as Cartesian mesh topology information that matches the data structure of the target viscous flow solver, including:

[0073] Step S141: Starting from the root node, visit the entire thread tree and recursively find all leaf nodes at the bottom level.

[0074] Step S142, for each leaf node, perform the following steps:

[0075] (1) Assign a unique volume number to the cube unit represented by the leaf node. The geometric coordinates of the cube unit represented by the leaf node can be calculated by using the minimum and maximum coordinates of the leaf node recorded in the full-thread tree. The calculated geometric coordinates include the volume center coordinates of the cube unit, the face center coordinates of each surface in the cube unit, the edge center coordinates of each edge in the cube unit, and the coordinates of each vertex in the cube unit.

[0076] (2) Using the body center coordinates as the key and the body number as the value, add the key-value pair consisting of the body center coordinates and body number of the cube unit represented by the leaf node to the body unit hash table elemMap.

[0077] (3) Access the neighboring nodes of the leaf node at any surface of the cube unit it represents, and determine the level of the neighboring nodes. In the branch tree data structure of the full-thread tree, the neighbors of the node are not stored in advance, but are obtained by querying through the branch tree structure itself. When querying the neighboring nodes of a leaf node, the queried object needs to satisfy ① the level is less than or equal to the current leaf node (that is, the size of the cube represented by the neighboring node must be greater than or equal to the current leaf node) ② it is spatially adjacent to the current leaf node in the query direction. It should be noted that since the node elements of each node are represented by the binary position index according to the above rules, in the search of neighboring nodes, it is only necessary to specify the number of each surface and the spatial position correspondence. This application stores the 6 adjacent units of octNb[6] in the order of xmin, xmax, ymin, ymax, zmin, zmax, respectively represented by 0-5. Similarly, these 6 faces can represent the back, front, left, right, down and up of the cube respectively. Through bit operations, complex spatial relationship judgment and calculation of adjacent sibling node numbers can be quickly realized.

[0078] When a leaf node's neighboring nodes on the surface of the solid are at different levels from the leaf node, it is determined that the leaf node has dangling points at the center of each edge and face center on the solid surface. This causes a change in the total number of vertices of other faces collinear with the solid surface, such as... Figure 4 As shown. Therefore, it is necessary to record the dangling points of the leaf nodes in the cube cells they represent. In practice, a boolean array edgeContainHaningNode can be created to record whether there are dangling points at the midpoints of the 12 edges.

[0079] (4) Based on the geometric coordinates of the cube element represented by the leaf node, and considering the hierarchical relationship between the leaf node and its neighboring nodes, create surface elements at the corresponding volume surface of the cube element represented by the leaf node. For any individual surface of the cube element represented by the leaf node:

[0080] ① First, check whether the leaf node has a neighbor node on the body surface that shares the body surface with the cube cell represented by the current leaf node.

[0081] ② When a leaf node has no neighboring nodes on the surface of the body, it indicates that the surface of the body is a boundary surface. In this case, a surface element is created on the surface of the body and a unique surface number is generated. The cube element represented by the leaf node is used as the main element of the created surface element.

[0082] ③ When a leaf node has a neighbor node on the surface of the volume, further check whether that neighbor node is also a leaf node. If the neighbor node is also a leaf node, then further check whether there is a key-value pair of the face center coordinates of the current volume surface in the facet hash table facesMap. If there is no key-value pair of the face center coordinates of the current volume surface in the facet hash table facesMap, create a facet on the volume surface and generate a unique face number. The cube unit represented by the leaf node is used as the main unit of the created facet, and the cube unit represented by the neighbor node of the leaf node on the volume surface is used as the sub-unit of the created facet. If the neighbor node is not a leaf node, then no operation is performed.

[0083] When generating face elements by traversing all the volume surfaces of each leaf node, two situations of duplicate counting may occur if no restrictions are imposed: First, if the current leaf node and its neighboring nodes have the same level, the volume surfaces between the leaf node and its neighboring nodes will be counted twice. Second, if the level difference between the current leaf node and its neighboring nodes is 1, the node with the smaller level will create 1 face, while the node with the smaller level will create 4 faces in the same planar region, resulting in spatial overlap between the two.

[0084] The root cause of the above problem lies in the repeated visits to adjacent nodes. To avoid this issue, a face is defined to be created only in the following two cases: First, the visited volume surface is a boundary surface, i.e., a surface without neighboring nodes, which corresponds to case ② above. Second, the neighboring node is a leaf node and the face has not been created previously, which corresponds to case ③ above. For cases with the same level, the function uses a hash table for storage and lookup to ensure that the face is created only once. For cases with different levels, a face is created only when the four leaf nodes of the lower-level unit are visited, thus ensuring the accuracy of face creation.

[0085] (5) Use a vertexMap hash table to store information about all vertices in the face cells. Specifically:

[0086] Iterate through each vertex in the created face cells, and check if there is a key-value pair of the coordinates of the currently visited vertex in the vertex cell hash table vertexMap. If there is no key-value pair of the coordinates of the currently visited vertex in the vertex cell hash table vertexMap, add the key-value pair of the coordinates of the currently visited vertex and the vertex number to the vertex cell hash table vertexMap with the vertex coordinates as the key and the vertex number as the value.

[0087] (6) Use a face-to-point relation linked list to store the correspondence between the created face unit and all the points it contains. During the process of traversing each vertex in the created face unit, in addition to adding the vertex to the face-to-point relation linked list of the face unit, it will also check whether there is a dangling point at the midpoint of the edge where the traversed vertex is located. If there is a dangling point, it will also be added to the face-to-point relation linked list of the face unit. This way, when using the face-to-point relation linked list to store the correspondence between the created face unit and all the points it contains, the correspondence between the face unit and all the vertices and dangling points it contains will also be stored.

[0088] (7) Use a volume-surface relationship list to record the correspondence between the created face elements and the cube elements they belong to. As mentioned above, there are two cases in which face elements will be created. In the case corresponding to step ② above, the face element created only has a corresponding main body element. In the case corresponding to step ③ above, the face element created has both a corresponding main body element and a sub-volume element. Therefore, in this step:

[0089] Determine the body center coordinates of the main body unit of the created face unit, then query the body number ownerID corresponding to the body center coordinates of the main body unit of the created face unit from the body unit hash table elemMap, and add the face number of the created face unit to the face list elemFacePairs[ownerID] corresponding to the body number ownerID, thereby recording the correspondence between the face unit and the main body unit it belongs to.

[0090] When a created face element has a corresponding sub-body element, determine the body center coordinates of the sub-body element of the created face element, query the body number neighID corresponding to the body center coordinates of the sub-body element of the created face element from the body element hash table elemMap, add the face number of the created face element to the face list elemFacePairs[neighID] corresponding to the body number neighID, and similarly determine the correspondence between the face element and the sub-body element it belongs to.

[0091] (8) Using the face center coordinates as the key and the face address as the value, add the key-value pair consisting of the face center coordinates and the face address of the created face cell to the face cell hash table facesMap.

[0092] Step S143: Through the above steps, the data of the full-thread tree can be converted into the volume unit hash table elemMap, the face unit hash table facesMap, the vertex unit hash table vertexMap, the face-to-point relationship linked list, and the volume-to-face relationship linked list. In addition, variables can be used to separately record the number of volume units, the number of face units, and the number of vertex units. The variables and their meanings are summarized as follows:

[0093]

[0094]

[0095] Step S144, convert the volume element hash table elemMap, surface element hash table facesMap, and point element hash table vertexMap according to the data structure of the target viscous flow solver to obtain the volume, surface, and point information in the grid topology of the target viscous flow solver, and combine the corresponding relationships recorded in the surface-point relationship linked list and the volume-surface relationship linked list to obtain the Cartesian grid topology information that matches the data structure of the target viscous flow solver and contains the volume-surface-point topological relationship.

[0096] Step 150, based on the topological information of the body-fitted grid and the Cartesian grid topology information, use the overlapping grid technique to assemble and couple the body-fitted grid and the Cartesian grid to obtain a hybrid partitioned grid, including:

[0097] (1) Grid classification.

[0098] Based on the grid classification method that combines the physical surface moment classification and the Cartesian auxiliary grid classification, divide the body-fitted grid into body-fitted active grids and body-fitted inactive grids, and divide the Cartesian grid into Cartesian active grids and Cartesian inactive grids.

[0099] The grid classification based on the physical surface moment can be achieved by adopting the implicit grid element classification process based on the wall distance. The specific approach is as follows:

[0100] For each body-fitted grid, calculate the minimum distance distW from the body-fitted grid to all physical surfaces based on the KD-Tree method respectively, and record the number dwTag of the body-fitted grid corresponding to the minimum distance distW. Then start to classify each body-fitted grid. The classification logic is based on a reference length Lref, which can be user-defined. Specifically:

[0101] Traverse all body-fitted grids in sequence, calculate the minimum distance distW from the centroid of the currently traversed body-fitted grid to all physical surfaces, and query the number dwTag corresponding to the minimum distance distW. If the queried number dwTag is the same as the number of the currently traversed body-fitted grid and the minimum distance distW < Lref, then classify the currently traversed body-fitted grid as a body-fitted active grid; otherwise, classify the currently traversed body-fitted grid as a body-fitted inactive grid.

[0102] If we directly classify Cartesian meshes using a method based on object surface moments, the process is as follows: traverse all Cartesian meshes sequentially, calculate the minimum distance *distW* from the body center of the currently traversed Cartesian mesh to all object surfaces. If this minimum distance *distW* > *Lref*, the currently traversed Cartesian mesh is classified as an active Cartesian mesh; otherwise, it is classified as an inactive Cartesian mesh. However, this approach leads to a special case: the minimum distance *distW* from the body center of a Cartesian mesh located inside other object surfaces may be greater than the reference length, resulting in it being incorrectly classified as an active Cartesian mesh. Therefore, to eliminate these cases, an auxiliary Cartesian grid (ACG) is introduced for secondary correction. The process is as follows:

[0103] First, an orthogonal Cartesian auxiliary mesh with a mesh size less than 0.5Lref is generated based on the coordinates of all body-fitted meshes. Then, a Flood-Fill algorithm is used to identify the relative position of each auxiliary mesh to the object surface, which is either intersecting the object surface, located outside the object surface, or located inside the object surface. Finally, the Cartesian meshes covered by all auxiliary meshes located inside the object surface are reset to inactive Cartesian meshes.

[0104] (2) Define the interpolation grid.

[0105] In subsequent numerical simulations of ship viscous flow, in addition to classifying each type of mesh, it is also necessary to transfer data between body-fit meshes and Cartesian meshes. This requires defining interpolation meshes within each type of mesh, i.e., determining the body-fit interpolation mesh within the body-fit mesh and the Cartesian interpolation mesh within the Cartesian mesh. These interpolation meshes are used to transfer flow field information between the two types of meshes. When assembling and coupling body-fit and Cartesian meshes, the body-fit interpolation mesh within the body-fit mesh must extend into the region of the Cartesian active mesh; it is not allowed for the body-fit interpolation mesh to be located within the region of the Cartesian inactive mesh, and its presence within the Cartesian interpolation mesh should be avoided as much as possible. Similarly, the Cartesian interpolation mesh must extend into the region of the body-fit active mesh; it is not allowed for the Cartesian interpolation mesh to be located within the region of the body-fit inactive mesh, and its presence within the body-fit interpolation mesh should be avoided as much as possible.

[0106] Therefore, in one embodiment, the approach taken is as follows:

[0107] The active mesh is pushed multiple layers into the inactive mesh. The number of layers can be customized, but for greater stability, at least three layers are typically pushed. The final two layers are then defined as the body-fit interpolation mesh to meet the requirements for fluid gradient calculations in viscous flow numerical simulations. For example, in... Figure 5 In this example, the mesh classification results are shown in the right-hand area, where blue meshes represent inactive meshes and green meshes represent active meshes. Based on the mesh classification on the right, the active meshes are pushed forward 5 layers to the inactive meshes, and the last two layers are defined as body-fitting interpolation meshes, as shown in the left-hand area. The white and red meshes represent the 5 layers pushed forward, and the red meshes are the last two layers defined as body-fitting interpolation meshes. Those skilled in the art will understand that... Figure 5 This is just to visually demonstrate the comparison before and after grid advancement; in reality, grid advancement is carried out across the entire domain.

[0108] Accordingly, the Cartesian active grid is advanced to the Cartesian inactive grid in multiple layers, and the last two layers are defined as Cartesian interpolation grids.

[0109] (3) Search the host grid.

[0110] For each body-fit interpolation grid, a corresponding Cartesian grid is searched as its host grid, and for each Cartesian interpolation grid, a corresponding body-fit grid is searched as its host grid. In unsteady computation, the host grid needs to be searched again at each time step. This application uses the Alternating Digital Tree (ADT) method to search for the host grid. To improve search efficiency, an Oriented Bounding Box (OBB) is used to enclose the grid, assisting in the host grid search.

[0111] After completing the above operations, the assembled coupling yields a hybrid partitioned mesh, including two types: body-fitted meshes and Cartesian meshes. Each type of mesh includes three subtypes: body-fitted active meshes, body-fitted inactive meshes, body-fitted interpolated meshes, and their host meshes within the Cartesian meshes. Cartesian meshes include Cartesian active meshes, Cartesian inactive meshes, Cartesian interpolated meshes, and their host meshes within the body-fitted meshes.

[0112] Step 160: Invoke the target viscous flow solver to perform numerical simulation of ship viscous flow based on a hybrid partitioned mesh. This application is based on the Overset Additive Schwarz (OAS) strategy, for any type of mesh, either body-fitted or Cartesian:

[0113] Discretize the governing equations for viscous flow numerical simulation independently on each active grid of the current grid type, and obtain the following system of linear algebraic equations:

[0114] [A]·X=b

[0115] Where [A] is the global coefficient matrix and contains the coefficient matrices corresponding to each active grid in the current grid type, X contains the flow field values ​​of each active grid in the current grid type, and b contains the source terms of each active grid in the current grid type. The governing equations for the viscous flow numerical simulation here include the turbulence equation, momentum equation, pressure correction equation, etc.

[0116] As introduced above, each type of grid in the hybrid partitioned grid includes three categories: active grid, interpolated grid, and inactive grid. Among them, the active grid requires discrete solution of the control equations. Therefore, the flow field values ​​of each active grid in the current grid type can be obtained by directly solving the control equations of the viscous flow numerical simulation.

[0117] For any interpolation grid i in the current grid type, the flow field value φ of interpolation grid i is obtained by interpolation using the flow field value of the host grid corresponding to interpolation grid i. i Specifically, the flow field value of the body-fitted interpolation grid is obtained by interpolating the flow field value of the host grid (which is a Cartesian grid) corresponding to the body-fitted interpolation grid. The flow field value of the Cartesian interpolation grid is also obtained by interpolating the flow field value of the host grid (which is a body-fitted grid) corresponding to the Cartesian interpolation grid. Then, the i-th element (i.e., the diagonal element) in the i-th row of the global coefficient matrix [A] corresponding to the interpolation grid i is set to 1, and the remaining N-1 elements are set to 0. The source term of the interpolation grid i is modified to obtain the interpolated φ. i After the turbulence equation, momentum equation, and pressure correction equation are calculated, and after the velocity field correction, pressure field correction, and flux correction are performed, the flow field values ​​of the interpolation grid need to be updated in a timely manner to ensure that the source terms on the right-hand side of the control equations are the latest flow field values ​​when constructing the coefficient matrix of the control equations.

[0118] For any inactive mesh j in the current mesh type, since inactive meshes do not participate in flow field calculations, their values ​​will not affect the iterative calculation of the flow field. In this application, the j-th element (i.e., the diagonal element) in the j-th row of the coefficient matrix corresponding to inactive mesh j in the global coefficient matrix [A] is set to 1, and the remaining N-1 elements are set to 0. The source term of inactive mesh j is modified and set to 0.

[0119] Then, the modified viscous flow numerical simulation control equations are used to solve iteratively.

[0120] In dynamically overlapping meshes, the handling of inactive meshes is crucial. At high ship speeds, a mesh in the current mesh type might be inactive in the current time step, but become active in the next. Since inactive meshes don't participate in flow field calculations and lack flow field information (typically represented by zero values), problems arise when they become active and participate in calculations in the next time step, as they lack reasonable flow field information. To avoid this, inactive meshes need to be assigned approximate flow field information. This approximate information can be obtained by averaging adjacent meshes. Specifically, start with an inactive mesh close to the interpolation mesh; the flow field value of this inactive mesh is equal to the average of the flow field values ​​of all its adjacent meshes. Then move to the next inactive mesh. This process continues until all inactive meshes have been processed, completing one iteration. Repeat this process until the flow field values ​​of all inactive meshes converge.

[0121] This method utilizes body-fitted meshes to generate boundary layer meshes with large slender ratios, thus more accurately capturing the fine details of near-wall turbulent structures. Combined with overlapping mesh technology, it decomposes the complex computational domain into multiple sub-regions, avoiding the fitting difficulties of traditional single-block meshes to complex boundaries. It overcomes the difficulty in viscous flow numerical simulation caused by the non-body-fit nature of traditional Cartesian meshes, allowing the mesh to fit the object boundary as closely as possible geometrically, improving the simulation accuracy. When dealing with complex shapes and viscous flow calculations, it can more accurately describe the flow field details on the object surface, resulting in better numerical simulation accuracy. Furthermore, when the object moves, the sub-regions of the overlapping mesh only need to adjust their position or orientation, without regenerating the entire computational domain mesh; the local refinement region of FTT can dynamically adjust the subdivision hierarchy according to the object's movement, reducing computational overhead. Figure 2 In one example, the surface pressure diagram of the ship model obtained by numerical simulation of ship viscous flow using the method of this application is shown below. Figure 6 As shown.

[0122] The above descriptions are merely preferred embodiments of this application, and this application is not limited to the above embodiments. It is understood that other improvements and variations that can be directly derived or conceived by those skilled in the art without departing from the spirit and concept of this application should be considered to be included within the protection scope of this application.

Claims

1. A numerical simulation method for ship viscous flow based on a hybrid Cartesian grid, characterized in that, The numerical simulation method for ship viscosity flow includes: The computational domain is obtained by constructing a ship model and its surrounding background domain. A body-fitted mesh is generated within the background domain near the object surface boundary of the ship model; Based on the outermost body-fitted mesh, the computational domain is spatially partitioned using a full-thread tree to generate a Cartesian mesh, and the full-thread tree is output as Cartesian mesh topology information that matches the data structure of the target viscous flow solver; Based on the topological information of the body-fitted mesh and the Cartesian mesh, the body-fitted mesh and the Cartesian mesh are coupled together using the overlapping mesh technique to obtain a hybrid partitioned mesh. The target viscous flow solver is then called to perform numerical simulation of ship viscous flow based on the hybrid partitioned mesh.

2. The numerical simulation method for ship viscosity flow according to claim 1, characterized in that, Based on the outermost body-fitted mesh, a Cartesian mesh is generated by spatially partitioning the computational domain using a full-threaded tree, including: Using all discrete points of the outermost body-fitted mesh as input, a Cartesian mesh is generated by spatially partitioning the computational domain based on the geometric features and mesh scale of the outermost body-fitted mesh using a fully threaded tree. During the splitting process of the fully threaded tree, it is checked whether the current node intersects with the outermost body-fitted mesh. If the current node intersects with the outermost body-fitted mesh, the current node is split if its scale is greater than the bounding box scale of the intersecting outermost body-fitted mesh and greater than the minimum mesh scale. If the current node does not intersect with the outermost body-fitted mesh, the current node is split if it is outside the boundary of the outermost body-fitted mesh and its scale is greater than the target mesh scale. In the generated Cartesian mesh, the outermost body-fitted mesh has the same mesh scale as its neighboring Cartesian meshes.

3. The numerical simulation method for ship viscosity flow according to claim 2, characterized in that, The method of spatially partitioning the computational domain using a full-threaded tree based on the outermost body-fitted mesh to generate a Cartesian mesh also includes: After splitting the current node into 8 child nodes based on an octree structure, for each child node: when the child node is closer to the positive x-axis in the x-axis direction, the value of the first index bit is 1; otherwise, the value of the first index bit is 0. When the child node is closer to the positive y-axis in the y-axis direction, the value of the second index bit is 1; otherwise, the value of the second index bit is 0. When the child node is closer to the positive z-axis in the z-axis direction, the value of the third index bit is 1; otherwise, the value of the third index bit is 0. The binary code formed by the values ​​of the three index bits of the child node is used as the position index of the child node. Compare the 3D coordinates (x, y, z) of the entity element in the current node with the volume center coordinates (x0, y0, z0) of the current node in the three axes. If x > x0, set the first index bit to 1; otherwise, set the first index bit to 0. If y > y0, set the second index bit to 1; otherwise, set the second index bit to 0. If z > z0, set the third index bit to 1; otherwise, set the third index bit to 0. Store the entity element in the current node in the child node corresponding to the position index formed by the values ​​of the three index bits.

4. The numerical simulation method for ship viscosity flow according to claim 1, characterized in that, Using overlapping meshing techniques to assemble and couple body-fit meshes with Cartesian meshes, a hybrid partitioned mesh is obtained, including: The mesh classification method based on object surface moment classification combined with Cartesian auxiliary mesh classification divides the body-fitted mesh into body-fitted active mesh and body-fitted inactive mesh, and divides the Cartesian mesh into Cartesian active mesh and Cartesian inactive mesh. Push the body-fitted active mesh to the body-fitted inactive mesh in multiple layers, and define the last two layers as body-fitted interpolation meshes; push the Cartesian active mesh to the Cartesian inactive mesh in multiple layers, and define the last two layers as Cartesian interpolation meshes; For each body-fitting interpolation grid, a corresponding Cartesian grid is searched as its host grid, and for each Cartesian interpolation grid, a corresponding body-fitting grid is searched as its host grid.

5. The numerical simulation method for ship viscosity flow according to claim 4, characterized in that, The target viscous flow solver is invoked to perform numerical simulations of ship viscous flow based on a hybrid partitioned grid, including either body-fitted grids or Cartesian grids: Discretize the governing equations for viscous flow numerical simulation independently on each active grid in the current grid type to obtain a system of linear algebraic equations of the form [A]·X=b. Solve the governing equations for viscous flow numerical simulation to obtain the flow field values ​​for each active grid in the current grid type. Here, [A] is the global coefficient matrix and contains the coefficient matrix corresponding to each active grid in the current grid type, X contains the flow field values ​​for each active grid in the current grid type, and b contains the source terms for each active grid in the current grid type. For any interpolation grid i in the current grid type, the flow field value φ of interpolation grid i is obtained by interpolation using the flow field value of the host grid corresponding to interpolation grid i. i Set the i-th element of the coefficient matrix in the i-th row of the global coefficient matrix [A] corresponding to the interpolation grid i to 1, and set the remaining N-1 elements to 0. Modify the source term of the interpolation grid i to φ. i ; For any inactive mesh j in the current mesh type, set the j-th element in the j-th row of the global coefficient matrix [A] corresponding to the inactive mesh j to 1, and set the remaining N-1 elements to 0. Set the source item of the inactive mesh j to 0. The modified viscous flow numerical simulation governing equations are solved iteratively.

6. The numerical simulation method for ship viscosity flow according to claim 1, characterized in that, The full-threaded tree output includes Cartesian mesh topology information that matches the data structure of the target viscous flow solver, including: Starting from the root node, visit the entire thread tree and recursively find all leaf nodes at the bottom level. For each leaf node, execute (1) to (5): (1) Assign a unique volume number to the cube unit represented by the leaf node, and calculate the geometric coordinates of the cube unit represented by the leaf node. The geometric coordinates include the volume center coordinates of the cube unit, the face center coordinates of each surface in the cube unit, the edge center coordinates of each edge in the cube unit, and the coordinates of each vertex in the cube unit. (2) Add the key-value pair consisting of the body center coordinates and body number of the cube unit represented by the leaf node to the body unit hash table elemMap; (3) Based on the geometric coordinates of the cube unit represented by the leaf node, and combined with the hierarchical relationship between the leaf node and its neighboring nodes, create a face unit at the corresponding surface of the cube unit represented by the leaf node, use the vertexMap hash table to store the information of all vertices in the face unit, and use the face-point relationship linked list to store the correspondence between the created face unit and all the points it contains. (4) Use a volume-surface relationship chain to record the correspondence between the created face units and the cube units they belong to; (5) Add the key-value pairs consisting of the face center coordinates and face address of the created face cell to the face cell hash table facesMap; Based on the data structure of the target viscous flow solver, the volume element hash table elemMap, the face element hash table facesMap, and the point element hash table vertexMap are transformed to obtain the volume, face, and point information in the mesh topology of the target viscous flow solver. Combined with the correspondence recorded in the face-point relationship chain and the volume-face relationship chain, the Cartesian mesh topology information that matches the data structure of the target viscous flow solver and contains the volume-face-point topology relationship is obtained.

7. The numerical simulation method for ship viscosity flow according to claim 6, characterized in that, Creating facet elements at the corresponding body surface of the cubic unit represented by the leaf node includes creating facet elements for any individual surface of the cubic unit represented by the leaf node: Detect whether the leaf node has a neighbor node on the body surface that shares the body surface with the cube unit represented by the current leaf node; When the leaf node has no neighboring nodes on the body surface, a face unit is created on the body surface and a unique face number is generated, and the cube unit represented by the leaf node is used as the main unit of the created face unit. When a leaf node has a neighbor node on the body surface and that neighbor node is also a leaf node, check if there is a key-value pair of face center coordinates for the current body surface in the face unit hash table facesMap. If there is no key-value pair of face center coordinates for the current body surface in the face unit hash table facesMap, create a face unit on the body surface and generate a unique face number. The cube unit represented by the leaf node is used as the main unit of the created face unit, and the cube unit represented by the neighbor node of the leaf node on the body surface is used as the sub-body unit of the created face unit.

8. The numerical simulation method for ship viscosity flow according to claim 6, characterized in that, The vertexMap, a hash table for vertex cells, stores information about all vertices in a face cell, including: Iterate through each vertex in the created face cells, and check if there is a key-value pair of the coordinates of the currently visited vertex in the vertex cell hash table vertexMap. If there is no key-value pair of the coordinates of the currently visited vertex in the vertex cell hash table vertexMap, add the key-value pair of the coordinates of the currently visited vertex and the vertex number to the vertex cell hash table vertexMap.

9. The numerical simulation method for ship viscosity flow according to claim 7, characterized in that, The numerical simulation method for ship viscosity flow also includes: Visit the neighboring nodes of the leaf node on the body surface and determine the hierarchy of the neighboring nodes. When the hierarchy of the neighboring nodes of the leaf node on the body surface is different from that of the leaf node, determine that there are dangling points of the leaf node at the center of each edge and the face center of each side of the body surface. When using a face-point relationship linked list to store the correspondence between the created face unit and all the points it contains, the correspondence between the face unit and all the vertices and dangling points it contains is also stored.

10. The numerical simulation method for ship viscosity flow according to claim 7, characterized in that, The correspondence between the created face elements and their corresponding cube elements is recorded using a volume-face relationship linked list, including: Determine the volume center coordinates of the main body unit of the created face unit, query the volume number ownerID corresponding to the volume center coordinates of the main body unit of the created face unit from the volume unit hash table elemMap, and add the face number of the created face unit to the face list elemFacePairs[ownerID] corresponding to the volume number ownerID; When a face element has a secondary body element, determine the body center coordinates of the secondary body element of the face element, query the body number neighID corresponding to the body center coordinates of the secondary body element of the face element from the body element hash table elemMap, and add the face number of the face element to the face list elemFacePairs[neighID] corresponding to the body number neighID.

Citation Information

Cited By

  • Grid generation method and device, equipment and medium

    CN121600221A

  • Mesh generation methods, apparatus, equipment and media

    CN121600221B