Mesh generation methods, apparatus, equipment and media
By updating the surface data of the target fluid domain and regenerating the Cartesian mesh, the problem of mesh deformation caused by the motion of the fluid domain boundary is solved, which improves the stability and accuracy of the simulation and reduces the waste of computational resources.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 无锡先进内燃动力技术创新中心
- Filing Date
- 2026-01-29
- Publication Date
- 2026-05-26
AI Technical Summary
In 3D simulations, as the fluid domain boundary moves, the orthogonality of the Cartesian mesh and the deformation of mesh elements lead to a decrease in simulation stability and accuracy.
By generating a background Cartesian mesh, the surface data of the target fluid domain is updated, and the target Cartesian mesh is regenerated based on the updated surface data, thus avoiding mesh deformation at the boundary.
It improves the stability and accuracy of simulations under boundary motion conditions in the target fluid domain, reduces the waste of computational resources, and improves computational efficiency.
Smart Images

Figure CN121600221B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computational fluid dynamics, and in particular to a mesh generation method, apparatus, device, and medium. Background Technology
[0002] Computational Fluid Dynamics (CFD) is widely used in the simulation of fluid velocity fields, temperature fields, and multiphysics coupling, and is also an important component of Computer-Aided Engineering (CAE). Mesh generation is one of the key technologies in CFD, and the quality of the mesh significantly affects the accuracy and efficiency of the computation.
[0003] In 3D simulations, the Cartesian mesh is a special type of hexahedral mesh where all edges of its mesh elements are parallel to the Cartesian coordinate axes. Therefore, the Cartesian mesh naturally possesses the characteristics of being easy to generate and having strong orthogonality. To balance computational accuracy and mesh quantity, a common mesh generation strategy is to use sparse meshes in flat regions and denser meshes in key regions. In recent years, with the development of mesh generation technology, this strategy is typically implemented using a relatively sparse global mesh combined with adaptive mesh refinement to capture key flow characteristics. For transient simulations of complex flows, some boundaries of the fluid domain often move over time. If only the mesh nodes near the moving boundaries move with the boundaries, some mesh elements will be stretched or compressed. This not only destroys the orthogonality of the Cartesian mesh but also easily leads to excessive mesh element deformation, affecting the stability and accuracy of the simulation. Summary of the Invention
[0004] Therefore, it is necessary to provide a mesh generation method, apparatus, device, and medium to address the aforementioned technical problems.
[0005] In a first aspect, this application provides a mesh generation method, comprising: generating a background Cartesian mesh corresponding to a target fluid domain to be simulated; if the boundary of the target fluid domain at a first time step moves relative to the boundary at a second time step, updating the second surface data of the target fluid domain at the second time step to obtain the first surface data of the target fluid domain at the first time step; wherein, the first time step is a time step that is temporally located after and adjacent to the second time step; and obtaining the first target Cartesian mesh of the target fluid domain at the first time step based on the first surface data and the background Cartesian mesh.
[0006] In one embodiment, the method further includes: if the boundary of the target fluid domain at the first time step has not moved compared to the boundary at the second time step, then the second Cartesian grid of the target fluid domain at the second time step is adaptively processed to obtain the first target Cartesian grid of the target fluid domain at the first time step.
[0007] In one embodiment, adaptive processing is performed on the second target Cartesian grid corresponding to the target fluid domain at the second time step to obtain the first target Cartesian grid corresponding to the target fluid domain at the first time step. This includes: adaptive processing of the second target Cartesian grid according to the first grid adaptive strategy corresponding to the target fluid domain at the first time step to obtain the first target Cartesian grid; wherein the second target Cartesian grid is obtained based on the second grid adaptive strategy corresponding to the target fluid domain at the second time step, and the first grid adaptive strategy is different from the second grid adaptive strategy.
[0008] In one embodiment, obtaining the first target Cartesian grid corresponding to the target fluid domain at the first time step based on the first surface data and the background Cartesian grid includes: determining the non-frozen grid cells in each grid cell of the background Cartesian grid based on the first surface data and the background Cartesian grid, wherein the non-frozen grid cells include boundary grid cells and grid cells within the computational domain; performing mesh adaptive processing on each non-frozen grid cell according to the first mesh adaptive strategy corresponding to the target fluid domain at the first time step to obtain the first intermediate Cartesian grid; wherein the first mesh adaptive strategy includes the first encryption region corresponding to the first time step, the encryption level corresponding to the first encryption region, the boundary encryption triggering condition corresponding to the first time step, and the calculation result triggering condition corresponding to the first time step; and performing adaptive processing on the first intermediate Cartesian grid based on the first intermediate Cartesian grid and the preset boundary processing strategy to obtain the first target Cartesian grid.
[0009] In one embodiment, according to the first mesh adaptive strategy corresponding to the target fluid domain at the first time step, mesh adaptive processing is performed on each non-frozen mesh cell to obtain a first intermediate Cartesian mesh. This includes: for each non-frozen mesh cell, determining the adaptive processing mark corresponding to each non-frozen mesh cell according to the first mesh adaptive strategy, the adaptive processing mark including to be refined and to be coarsened; refining the non-frozen mesh cells with the adaptive processing mark to be refined, and coarsening the non-frozen mesh cells with the adaptive processing mark to be coarsened to obtain a first temporary Cartesian mesh; determining the non-frozen mesh cells in the first temporary Cartesian mesh based on the first temporary Cartesian mesh and the first surface data; iteratively executing the above process of determining the adaptive mark corresponding to the non-frozen mesh cell according to the first mesh adaptive strategy, obtaining the first temporary Cartesian mesh, and determining the non-frozen mesh cells in the first temporary Cartesian mesh, until there are no adaptive processing marks in any of the non-frozen mesh cells in the first temporary Cartesian mesh, thus obtaining the first intermediate Cartesian mesh.
[0010] In one embodiment, based on a first intermediate Cartesian grid and a preset boundary processing strategy, the first intermediate Cartesian grid is adaptively processed to obtain a first target Cartesian grid. This includes: performing iterative encryption processing on frozen grid cells that are neighbors with boundary grid cells in the first intermediate Cartesian grid, until the encryption level of the boundary grid cells in the first intermediate Cartesian grid is consistent with that of the corresponding neighboring frozen grid cells, thus obtaining a first transitional Cartesian grid; marking the neighboring frozen grid cells corresponding to each boundary grid cell in the first transitional Cartesian grid as reserved layer grid cells; and performing iterative update processing on the first transitional Cartesian grid until the reserved layer in the updated first transitional Cartesian grid reaches a preset number of layers, thus obtaining the first target Cartesian grid. The iterative update process of the first transitional Cartesian grid includes: performing iterative encryption processing on frozen grid cells that are neighbors with the latest marked reserved layer grid cells, until their encryption level is consistent with that of the latest marked reserved layer grid cells, marking the neighboring frozen grid cells as new reserved layer grid cells, thus obtaining the updated first transitional Cartesian grid.
[0011] In one embodiment, updating the second surface data of the target fluid domain at the second time step to obtain the first surface data of the target fluid domain at the first time step includes: if the boundary's motion is translation, simplifying the translational motion boundary into a layer of triangular facets, translating all vertices on the triangular facets belonging to the second translational motion boundary according to the motion trajectory to obtain the first translational motion boundary, and translating the vertices on the triangular facets belonging to the second translational connecting boundary accordingly, causing the triangular facets belonging to the second translational connecting boundary to deform and form the triangular facets belonging to the first translational connecting boundary, wherein the translational connecting boundary corresponding to the first time step is simplified into a layer of triangular facets; if the boundary's motion is rotation, rotating the vertices on the second rotational motion boundary to obtain the first rotational motion boundary. This causes each moving vertex on the moving boundary of the triangular facet belonging to the second rotational connection boundary to rotate accordingly. For each moving vertex belonging to the second rotational connection boundary and after rotation, the two stationary vertices closest to the moving vertex are determined from the stationary vertices on the stationary boundary of the triangular facet belonging to the second rotational connection boundary to form a triangular facet belonging to the first rotational connection boundary. Also, for each stationary vertex belonging to the second rotational connection boundary and after rotation, the two moving vertices closest to the stationary vertex are determined from the moving vertices belonging to the second rotational connection boundary to form a triangular facet belonging to the first rotational boundary. Based on the first stationary boundary, the first translational motion boundary, the first rotational motion boundary, the triangular facet belonging to the first translational connection boundary, and the triangular facet belonging to the first rotational connection boundary, the first surface data is obtained.
[0012] Secondly, this application also provides a mesh generation apparatus, comprising: a background mesh generation module for generating a background Cartesian mesh corresponding to a target fluid domain to be simulated; a boundary update module for updating the second surface data of the target fluid domain at the second time step if the boundary of the target fluid domain at the first time step moves relative to the boundary at the second time step, thereby obtaining the first surface data of the target fluid domain at the first time step; wherein the first time step is a time step that is temporally located after and adjacent to the second time step; and a mesh generation module for obtaining the first target Cartesian mesh of the target fluid domain at the first time step based on the first surface data and the background Cartesian mesh.
[0013] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in the first aspect.
[0014] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method as described in the first aspect.
[0015] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method as described in the first aspect.
[0016] The aforementioned mesh generation method, apparatus, equipment, medium, and product first generate a background Cartesian mesh corresponding to the target fluid domain to be simulated. If the boundary of the target fluid domain at the first time step moves compared to the boundary at the second time step, the second surface data of the target fluid domain at the second time step is updated to obtain the first surface data of the target fluid domain at the first time step. Based on the first surface data and the background Cartesian mesh, the first target Cartesian mesh of the target fluid domain at the first time step is obtained. In this way, when the boundary of the target fluid domain moves, the surface data corresponding to the target fluid domain is updated, and the target Cartesian mesh corresponding to the current time step is regenerated based on the updated surface data, avoiding the problem of reduced simulation stability and accuracy caused by mesh deformation at the boundary. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a diagram illustrating the application environment of a mesh generation method in one embodiment.
[0019] Figure 2 This is a flowchart illustrating a mesh generation method in one embodiment.
[0020] Figure 3 This is a flowchart illustrating the steps for obtaining the first target Cartesian grid in one embodiment.
[0021] Figure 4 This is a flowchart illustrating the step of obtaining the first intermediate Cartesian grid in one embodiment.
[0022] Figure 5 This is a flowchart illustrating the steps for obtaining the first surface data in one embodiment.
[0023] Figure 6 This is a structural block diagram of a mesh generation device in one embodiment.
[0024] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0026] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0027] The mesh generation method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located in the cloud or on other grid servers. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, drones, low-altitude aircraft, IoT devices, and portable wearable devices. Server 104 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services.
[0028] Terminal 102 generates a background Cartesian mesh corresponding to the target fluid domain to be simulated; if the boundary of the target fluid domain at the first time step moves relative to the boundary at the second time step, the second surface data of the target fluid domain at the second time step is updated to obtain the first surface data of the target fluid domain at the first time step; wherein, the first time step is the time step that is after and adjacent to the second time step in time sequence; based on the first surface data and the background Cartesian mesh, the first target Cartesian mesh corresponding to the target fluid domain at the first time step is obtained.
[0029] In one exemplary embodiment, such as Figure 2 As shown, a mesh generation method is provided, which can be applied to... Figure 1 Taking terminal 102 as an example, the explanation includes the following steps 202 to 206.
[0030] Step 202: Generate the background Cartesian mesh corresponding to the target fluid domain to be simulated.
[0031] The fluid domain is the region through which the fluid flows, defined by geometric boundaries. The background Cartesian mesh refers to the global mesh covering the entire target fluid domain to be simulated. If boundary motion exists, the background mesh should cover the entire fluid domain before and after the motion.
[0032] For example, based on the pre-input overall size of the background mesh, a cube that completely accommodates the geometric model is generated. This cube is then divided according to the pre-input background mesh cell sizes to obtain a background Cartesian mesh. For example, the encryption level of each mesh cell in the background Cartesian mesh is 0. In some implementations, the background Cartesian mesh may also be referred to as the root mesh.
[0033] Step 204: If the boundary of the target fluid domain at the first time step moves relative to the boundary at the second time step, then the second surface data of the target fluid domain at the second time step is updated to obtain the first surface data of the target fluid domain at the first time step.
[0034] The first time step is the time step that follows and is adjacent to the second time step in terms of temporal sequence. It should be noted that the first time step refers to any time step in the mesh generation process of the target fluid domain; the "first" in the first time step and the "second" in the second time step are used to distinguish them as two different time steps. In other words, the first time step refers to the time step currently being processed, and the second time step is the time step preceding the current moment.
[0035] Here, surface data refers to the coordinate data of the surface of the target fluid domain in the Cartesian coordinate system, used to describe the surface geometry of the target fluid domain boundary; in this embodiment, the boundary of the target fluid domain moves over time. The boundary of the target fluid domain at the first time step may be the same as or different from the boundary at the second time step.
[0036] The Cartesian mesh of the target fluid domain is generated based on the surface data of the target fluid domain. In one possible implementation, the process of acquiring the initial surface data of the target fluid domain includes: acquiring the stereolithography (STL) file corresponding to the target fluid domain, and obtaining the initial surface data based on the stereolithography file. The initial surface data includes multiple facets, each described by a normal vector and three vertices.
[0037] In one possible implementation, when the first time step is the first time step T1 in the mesh generation process, the first surface data corresponding to the first time step is the initial surface data. This application's embodiments mainly discuss how to perform the mesh generation process when the first time step is not the first time step T1 in the mesh generation process.
[0038] In this embodiment, when the boundary of the target fluid domain at the first time step moves relative to the boundary at the second time step, the second surface data of the target fluid domain at the second time step is updated to obtain the first surface data of the target fluid domain at the first time step.
[0039] For example, the trajectory of each boundary of the target fluid domain moving over time is obtained in advance. Based on the trajectory, it is determined whether the boundary corresponding to the current time step has moved compared to the boundary corresponding to the previous time step. If the boundary corresponding to the current time step has moved compared to the boundary corresponding to the previous time step, the surface data corresponding to the previous time step is updated based on the trajectory to obtain the surface data corresponding to the current time step.
[0040] Step 206: Based on the first surface data and the background Cartesian grid, obtain the first target Cartesian grid corresponding to the target fluid domain in the first time step.
[0041] Specifically, based on the first surface data, position attributes are labeled for each grid cell in the background Cartesian grid. Based on the position attributes of each grid cell and a preset adaptive strategy, the background Cartesian grid is adaptively processed to obtain the first target Cartesian grid.
[0042] The adaptive processing includes either refinement or coarsening. In this technical field, mesh refinement is also referred to as mesh densification.
[0043] In one possible implementation, after obtaining the first target Cartesian mesh, the first target Cartesian mesh is output to the solver so that the solver can perform the calculation processing corresponding to the first time step based on the first target Cartesian mesh and obtain the calculation result corresponding to the first time step.
[0044] The mesh generation method provided in the above embodiments generates a background Cartesian mesh corresponding to the target fluid domain to be simulated. If the boundary of the target fluid domain at the first time step moves compared to the boundary at the second time step, the second surface data of the target fluid domain at the second time step is updated to obtain the first surface data of the target fluid domain at the first time step. Based on the first surface data and the background Cartesian mesh, the first target Cartesian mesh of the target fluid domain at the first time step is obtained. In this way, when the boundary of the target fluid domain moves, the surface data corresponding to the target fluid domain is updated, and the target Cartesian mesh corresponding to the current time step is regenerated based on the updated surface data, avoiding the problem of reduced simulation stability and accuracy caused by mesh deformation at the boundary. The mesh generation method provided in the above embodiments can improve the stability and accuracy of simulation when the boundary of the target fluid domain moves.
[0045] In one exemplary embodiment, based on Figure 2 The embodiment shown further includes a mesh generation method that, if the boundary of the target fluid domain at the first time step has not moved relative to the boundary at the second time step, then adaptive processing is performed on the second Cartesian mesh of the target fluid domain at the second time step to obtain the first target Cartesian mesh of the target fluid domain at the first time step.
[0046] In this embodiment, if the boundary of the target fluid domain does not move between different time steps, adaptive processing is performed based on the target Cartesian grid generated in the previous time step to adapt to the computational processing requirements of the current time step.
[0047] In one possible implementation, the mesh adaptation strategy differs for different time steps. For example, in a scenario where the target fluid domain is the fluid domain during the simulation of an internal combustion engine, the time step corresponding to the instant of spark plug ignition requires a higher level of mesh refinement near the spark plug, while the time steps corresponding to non-ignition instants require a relatively lower level of mesh refinement.
[0048] In this embodiment, the process of adaptively processing the second target Cartesian grid corresponding to the target fluid domain at the second time step to obtain the first target Cartesian grid corresponding to the target fluid domain at the first time step includes: adaptively processing the second target Cartesian grid according to the first grid adaptive strategy corresponding to the target fluid domain at the first time step to obtain the first target Cartesian grid.
[0049] The second target Cartesian grid is obtained based on the second grid adaptive strategy corresponding to the target fluid domain at the second time step. The first grid adaptive strategy is different from the second grid adaptive strategy.
[0050] In this embodiment, when the boundary of the target fluid domain remains stationary, the process of adaptively processing the second target Cartesian mesh according to the first mesh adaptive strategy, taking advantage of the opportunity to re-mesh after each time step, includes coarsening and refining processes to adapt the first target Cartesian mesh to the computational requirements of the first time step. Simultaneously, different mesh adaptive strategies are employed at different time steps, ensuring that the target Cartesian mesh for each time step meets the computational requirements of the current time step. Compared to using the same refinement strategy for every time step, the mesh generation method provided in this embodiment reduces the waste of computational resources and improves computational efficiency.
[0051] In one exemplary embodiment, please refer to Figure 3 ,based on Figure 2 The embodiment shown includes steps 302 to 306, in which the process of obtaining the first target Cartesian grid corresponding to the target fluid domain at the first time step based on the first surface data and the background Cartesian grid.
[0052] Step 302: Based on the first surface data and the background Cartesian grid, determine the unfrozen grid cells in each grid cell of the background Cartesian grid.
[0053] The unfrozen mesh elements include boundary mesh elements and computational domain mesh elements. The first surface data describes the surface geometry of the target fluid domain at the first time step. The first surface consists of multiple triangular facets. Mesh elements in the background Cartesian mesh that intersect with the triangular facets are labeled as boundary mesh elements. Mesh elements in the background Cartesian mesh that are inside the geometry described by the first surface data are labeled as computational domain mesh elements. The remaining mesh elements are labeled as computational domain outside mesh elements. In this embodiment, mesh adaptive processing is first performed on the boundary mesh elements and computational domain inside mesh elements. After all boundary mesh elements and computational domain inside mesh elements have been processed, the computational domain outside mesh elements are processed. Therefore, in this embodiment, the boundary mesh elements and computational domain inside mesh elements are called unfrozen mesh elements, and the computational domain outside mesh elements are called frozen mesh elements.
[0054] In one possible implementation, the process of determining the non-frozen mesh cells in each mesh cell of the background Cartesian mesh based on the first surface data and the background Cartesian mesh includes: traversing the triangular facets in the first surface, obtaining the maximum and minimum values of the three vertices of each triangular facet in the three coordinate directions of the Cartesian coordinate system, generating the bounding box corresponding to each triangular facet at the first time step based on the three sets of maximum and minimum values, performing a fast intersection judgment based on the bounding box corresponding to the first time step and the background Cartesian mesh, filtering out possible intersecting triangular facets and their corresponding mesh cells, judging each possible intersecting triangular facet and its corresponding background mesh cell one by one, determining the mesh cells that intersect with the triangular facets, recording the intersecting mesh cells as boundary mesh cells, and recording the intersection relationship between each boundary mesh cell and the triangular facet; judging and marking the positions of other mesh cells in the background Cartesian mesh, dividing them into mesh cells within the computational domain and mesh cells outside the computational domain, and freezing the mesh cells outside the computational domain.
[0055] Step 304: According to the first mesh adaptive strategy corresponding to the target fluid domain in the first time step, perform mesh adaptive processing on each non-frozen mesh element to obtain the first intermediate Cartesian mesh.
[0056] The first grid adaptive strategy includes the first encryption region corresponding to the first time step, the encryption level corresponding to the first encryption region, the boundary encryption triggering condition corresponding to the first time step, and the calculation result triggering condition corresponding to the first time step.
[0057] In one possible implementation, the mesh adaptive strategy corresponding to each time step includes not only the adaptive strategy specific to that time step, but also a general adaptive strategy. For example, the general adaptive strategy includes: whether the encryption layer difference between two adjacent unfrozen mesh cells is greater than 1; when the number of triangular faces intersecting with an unfrozen mesh cell is greater than or equal to 2, the relationship between the angle between the normal vectors of any two triangular faces intersecting with that unfrozen mesh and a preset angle threshold; and whether the number of buffer layers meets preset requirements.
[0058] For example, if for a certain non-frozen mesh cell, the number of triangular faces intersecting with the non-frozen mesh cell is 2, and the angle between the normal vectors of these two triangular faces is greater than a preset angle threshold, then the non-frozen mesh cell usually needs to be refined. Furthermore, during the refinement process of the non-frozen mesh cell, it is also necessary to determine whether the encryption level of the non-frozen mesh cell has reached the preset encryption level. If the preset encryption level has been reached, then the refinement process of the non-frozen mesh cell is not performed; if the preset encryption level has not been reached, then the refinement process of the non-frozen mesh cell is performed.
[0059] In some implementations, the preset angle thresholds for each time step are different. In other implementations, the preset angle thresholds for each time step are the same.
[0060] In one possible implementation, the encryption region and encryption level corresponding to each time step, as well as the boundary encryption triggering condition corresponding to each time step, are pre-input by the user; the calculation result triggering for each time step is determined by the simulation calculation result of the previous time step, wherein the calculation result triggering condition for each time step itself is pre-input by the user, and whether the condition is triggered is determined by the calculation result of the previous time step; for example, during combustion, a certain mesh cell triggers mesh refinement at a certain time step due to the sudden increase in temperature gradient caused by flame propagation, and after a period of time, the temperature gradient of the mesh cell decreases, and the mesh cell may undergo mesh coarsening in the next time step.
[0061] In one possible implementation method, please refer to Figure 4 The process of performing mesh adaptive processing on each non-frozen mesh element to obtain the first intermediate Cartesian mesh according to the first mesh adaptive strategy corresponding to the target fluid domain at the first time step includes steps 402 to 408.
[0062] Step 402: For each unfrozen mesh cell, determine the adaptive processing label corresponding to the unfrozen mesh cell according to the first mesh adaptive strategy. The adaptive processing label includes "to be refined" and "to be coarsened".
[0063] Step 404: Perform mesh refinement on the unfrozen mesh cells marked as to be refined in the adaptive processing, and perform mesh coarsening on the unfrozen mesh cells marked as to be coarsened in the adaptive processing to obtain the first temporary Cartesian mesh.
[0064] For example, each unfrozen mesh cell is processed according to its corresponding adaptive processing mark. After processing, the adaptive mark in each mesh cell is deleted. The new mesh obtained after refinement and the new mesh obtained after coarsening are marked with the processed mark. For example, the processed mark indicates that the current time step is over-refined or over-coarsened, so as to facilitate data mapping during simulation calculation.
[0065] For example, during the mesh refinement process of an unfrozen mesh cell, the unfrozen mesh is directly and uniformly refined into 8 new mesh cells.
[0066] For example, during the process of coarsening the polar grid of an unfrozen grid cell, it is necessary to ensure that none of the eight sub-grids under the parent grid of the unfrozen grid cell have sub-grids of the next refinement level and that all eight sub-grids need to be coarsened before coarsening the unfrozen grid cell is performed; otherwise, the adaptive processing mark of the unfrozen grid cell is deleted.
[0067] Step 406: Determine the unfrozen mesh cells in the first temporary Cartesian mesh based on the first temporary Cartesian mesh and the first surface data.
[0068] Based on the first surface data, the boundary grid cells, in-computation domain grid cells, and out-of-computation domain grid cells in the first temporary Cartesian grid are determined to update the positional attributes of each grid cell. The out-of-computation domain grid cells are frozen, while the boundary grid cells and in-computation domain grid cells are unfrozen grid cells, which are used for adaptive refinement processing in subsequent iterations.
[0069] For example, the process of determining the unfrozen grid cells in the first temporary Cartesian grid also includes updating the neighbor relationships of each grid cell in the first temporary Cartesian grid.
[0070] Step 408: Iteratively execute the above process of determining the adaptive processing mark corresponding to each non-frozen mesh cell according to the first mesh adaptive strategy, obtaining the first temporary Cartesian mesh, and determining the non-frozen mesh cells in the first temporary Cartesian mesh, until there are no adaptive processing marks in each non-frozen mesh cell in the first temporary Cartesian mesh, and obtain the first intermediate Cartesian mesh.
[0071] Specifically, steps 402 to 406 are iteratively executed until, after step 402 is completed, it is found that none of the non-frozen grid cells in the first temporary Cartesian grid have adaptive processing markers. In this case, the current first temporary Cartesian grid is taken as the first intermediate Cartesian grid.
[0072] Step 306: Based on the first intermediate Cartesian grid and the preset boundary processing strategy, the first intermediate Cartesian grid is adaptively processed to obtain the first target Cartesian grid.
[0073] In one possible implementation, the process of performing mesh adaptive processing on each frozen mesh cell in the first intermediate Cartesian mesh to obtain the first target Cartesian mesh, based on a first intermediate Cartesian mesh and a preset boundary processing strategy, includes: iteratively encrypting frozen mesh cells that are neighbors with boundary mesh cells in the first intermediate Cartesian mesh until the encryption level of the boundary mesh cells in the first intermediate Cartesian mesh is consistent with that of their corresponding neighboring frozen mesh cells, thus obtaining a first transitional Cartesian mesh; marking the neighboring frozen mesh cells corresponding to each boundary mesh cell in the first transitional Cartesian mesh as reserved layer mesh cells, and iteratively updating the first transitional Cartesian mesh until the reserved layer in the updated first transitional Cartesian mesh reaches a preset number of layers, thus obtaining the first target Cartesian mesh. The iterative encryption process of the first transitional Cartesian mesh includes: iteratively encrypting frozen mesh cells that are neighbors with the latest marked reserved layer mesh cells until their encryption level is consistent with that of the latest marked reserved layer mesh cells, marking the neighboring frozen mesh cells as new reserved layer mesh cells, thus obtaining the updated first transitional Cartesian mesh.
[0074] The above boundary processing is a method for processing the mesh near the boundary when using the immersion boundary method. It performs additional processing on the frozen mesh cells. The specific processing method of this boundary mesh adaptation is as follows: Traverse the boundary mesh cells in the first intermediate Cartesian mesh. For each boundary mesh cell, check whether there are any outside the computation domain mesh cells in the neighboring mesh cells of the boundary mesh cell. If so, determine whether the encryption level of the boundary mesh cell is the same as that of the corresponding neighboring frozen mesh cell. If they are different, mark the neighboring frozen mesh cell as a state to be encrypted. After traversing all the boundary mesh cells, perform mesh refinement processing on the frozen mesh cells marked as a state to be encrypted, update the neighbor relationship of each boundary mesh cell, and repeat the above process of traversing the boundary mesh cells, marking the neighboring frozen mesh cells with inconsistent encryption levels, performing mesh refinement processing and updating the neighbor relationship of each boundary mesh cell until the encryption level of each boundary mesh cell is consistent with that of the corresponding neighboring frozen mesh cell, thus obtaining the first transitional Cartesian mesh.
[0075] Traverse the boundary grid cells, query the neighboring frozen grid cells outside the computational domain for each boundary grid cell, activate them and mark them as reserved layer grid cells, and denote them as the first reserved layer.
[0076] Traverse the first layer of reserved grid cells, query the neighboring frozen grid cells outside the computational domain for each reserved grid cell, and determine whether the encryption level of the reserved grid cell is the same as that of its corresponding neighboring frozen grid cell. If they are different, mark the neighboring frozen grid cell as unencrypted. After traversing all the reserved grid cells in the first layer, refine the grid for the frozen grid cells marked as unencrypted, and update the neighbor relationships of each reserved grid cell. Repeat the above process of traversing the reserved grid cells, marking neighboring frozen grid cells with inconsistent encryption levels, refining the grid, and updating the neighbor relationships of each reserved grid cell until the encryption level of the reserved grid cell and its corresponding neighboring frozen grid cell are consistent, and obtain the updated first transitional Cartesian grid.
[0077] Traverse the reserved layer grid cells of the first layer, query the neighboring frozen grid cells outside the computational domain of each reserved layer grid cell, activate them and mark them as reserved layer grid cells, and record the reserved layer as the second layer; repeat the above process to obtain the updated first transition Cartesian grid until the number of reserved layers reaches the preset number of layers, and use the updated first transition Cartesian grid as the target Cartesian grid.
[0078] For example, the preset number of attempts can be an experience value set by the user in advance; for example, the preset number of attempts is determined based on the type of immersion boundary method adopted by the user.
[0079] The above implementation method avoids abrupt changes in the mesh hierarchy at the boundary by iteratively encrypting and activating the neighboring frozen mesh cells of the boundary mesh cells, ensuring the topological consistency and encryption smoothness of the boundary mesh, and improving the stability of subsequent simulation calculations.
[0080] In one possible implementation, the process of performing mesh adaptive processing on the first intermediate Cartesian mesh to obtain the first target Cartesian mesh based on the first intermediate Cartesian mesh and a preset boundary processing strategy includes: if the user selects to use the cut-cell method to generate a body-fitting mesh, then the triangular facet data corresponding to each boundary mesh unit of the first intermediate Cartesian mesh are determined. For each boundary mesh unit, the boundary mesh unit is cut based on the triangular facets intersecting the boundary mesh unit, retaining the part of the boundary unit within the computational domain. The volume, center position, surface area, and normal vector of the retained part are calculated and recorded to obtain the boundary cut unit, thereby obtaining the first target Cartesian mesh. Optionally, cut units with a small retained volume ratio can be merged with adjacent cut units, and the volume, center position, surface area, and normal vectors of each facet can be recalculated.
[0081] In one exemplary embodiment, please refer to Figure 5 ,based on Figure 2The illustrated embodiment describes a mesh generation method that involves updating the second surface data of the target fluid domain at a second time step to obtain the first surface data of the target fluid domain at a first time step. In this embodiment, the triangular faces in the surface data are categorized according to the boundary type of their respective boundaries: triangular faces belonging to stationary boundaries, triangular faces belonging to moving boundaries, triangular faces belonging to translational connection boundaries, and triangular faces belonging to rotational connection boundaries. In this mesh generation process, the stationary boundary remains stationary. The vertices of the triangular facets belonging to the moving boundary change with the boundary's movement. The moving boundary's movement is categorized into translational and rotational motion, denoted as translational and rotational moving boundaries, respectively. The translational connecting boundary refers to the connection between the translational moving boundary and the stationary boundary. Some vertices of the triangular facets belonging to the translational connecting boundary lie on the translational moving boundary, changing with its movement, while others remain on the stationary boundary. Similarly, the rotational connecting boundary refers to the connection between the rotational moving boundary and the stationary boundary. Some vertices of the triangular facets belonging to the rotational connecting boundary lie on the rotational moving boundary, changing with its movement, while others remain on the stationary boundary. The translational connecting boundary is simplified to a single layer of triangular facets to facilitate subsequent calculations of the moved translational connecting boundary triangular facets. Figure 5 As shown, the above process includes steps 502 to 506.
[0082] Step 502: If the boundary movement is translation, then all vertices on the triangular facets belonging to the second translational boundary are translated according to the movement trajectory to obtain the first translational boundary. The vertices on the second translational boundary of the triangular facets belonging to the second translational boundary are translated accordingly, so that the triangular facets belonging to the second translational boundary are deformed to form the triangular facets belonging to the first translational boundary. The translational boundary corresponding to the first time step is simplified to a layer of triangular facets.
[0083] Among them, the second translational motion boundary is the motion boundary in the second surface data whose boundary motion type is translation, and the second translational connection boundary is the connection boundary in the second surface data whose boundary type is translational connection boundary.
[0084] Starting from the surface data corresponding to the first time step, i.e. the initial surface data, the translational connection boundary is simplified into a layer of triangular facets, which facilitates the translational movement of the translational connection boundary according to the motion trajectory.
[0085] Step 504: If the boundary movement is rotation, rotate the vertices on the second rotational boundary to obtain the first rotational boundary, so that each moving vertex on the triangular facet of the second rotational boundary located on the moving boundary rotates accordingly. For each moving vertex that belongs to the second rotational boundary and is rotated, determine the two closest stationary vertices to the moving vertex from the stationary vertices on the stationary boundary of the triangular facet of the second rotational boundary to form the triangular facet of the first rotational boundary. Also, for each stationary vertex that belongs to the second rotational boundary and is located on the stationary boundary, determine the two closest moving vertices to the stationary vertex from the moving vertices that belong to the second rotational boundary and are rotated to form the triangular facet of the first rotational boundary.
[0086] Among them, the second rotational motion boundary is the motion boundary with rotational motion type in the second surface data, and the second rotational connection boundary is the connection boundary with rotational connection type in the second surface data.
[0087] In this embodiment, for rotational motion, the rotational motion boundary is rotated. Vertices on the rotational motion boundary of the triangular facet belonging to the rotational connection boundary rotate and move accordingly, causing the triangular facet belonging to the rotational connection boundary to deform. In this embodiment, the triangular facets on the rotational connection boundary are deleted and reconstructed. The system iterates through all rotating vertices on the triangular facet belonging to the rotational connection boundary that are located on the motion boundary. For each moving vertex, among the stationary vertices on the stationary boundary of the triangular facet belonging to the rotational connection boundary, it finds the two closest stationary vertices to form a new triangular facet. Similarly, the system iterates through all stationary vertices on the stationary boundary of the triangular facet belonging to the rotational connection boundary. For each stationary vertex, among the rotating vertices, it finds the two closest moving vertices to form a new triangular facet. Through these two iterations, the reconstruction of the rotational connection boundary is completed.
[0088] Step 506: Based on the first static boundary, the first translational motion boundary, the first rotational motion boundary, the triangular facets belonging to the first translational connection boundary, and the triangular facets belonging to the first rotational connection boundary, the first surface data is obtained.
[0089] In the second surface data, the static boundary remains unchanged, that is, the position of each vertex on the triangular face belonging to the static boundary remains unchanged. The first static boundary in the first surface data is equal to the second static boundary in the second surface data. Based on the first translational motion boundary, the first rotational motion boundary, the triangular facet belonging to the first translational connection boundary, the triangular facet belonging to the first rotational connection boundary, and the first static boundary, the first surface data corresponding to the first time step is obtained, and the boundary motion processing is completed.
[0090] In one exemplary embodiment, a mesh generation method is provided, which is applied to... Figure 1 Taking terminal 102 as an example, the explanation includes the following steps S2 to S22.
[0091] Step S2: Generate the background Cartesian mesh corresponding to the target fluid domain to be simulated.
[0092] Step S4: If the boundary of the target fluid domain at the first time step moves relative to the boundary at the second time step, then the second surface data of the target fluid domain at the second time step is updated to obtain the first surface data of the target fluid domain at the first time step.
[0093] The first time step is the time step that is sequentially located after and adjacent to the second time step.
[0094] Optionally, the second surface data of the target fluid domain at the second time step is updated to obtain the first surface data of the target fluid domain at the first time step. This includes: if the boundary motion is translation, all vertices on the triangular facets belonging to the second translational motion boundary are translated according to the motion trajectory to obtain the first translational motion boundary. The vertices on the triangular facets belonging to the second translational connecting boundary are translated accordingly, causing the triangular facets belonging to the second translational connecting boundary to deform and form the triangular facets belonging to the first translational connecting boundary. The translational connecting boundary at the first time step is simplified to one layer of triangular facets. If the boundary motion is rotation, the vertices on the second rotational motion boundary are rotated to obtain the first rotational motion boundary, causing the vertices on the second rotational connecting boundary to deform and form the triangular facets belonging to the first translational connecting boundary. Each moving vertex on the triangular facet located on the moving boundary rotates accordingly. For each moving vertex belonging to the second rotational connection boundary and after rotation, the two stationary vertices closest to the moving vertex are determined from the stationary vertices on the triangular facet belonging to the second rotational connection boundary and located on the stationary boundary, forming a triangular facet belonging to the first rotational connection boundary. Also, for each stationary vertex belonging to the second rotational connection boundary and located on the stationary boundary, the two moving vertices closest to the stationary vertex are determined from the moving vertices belonging to the second rotational connection boundary and after rotation, forming a triangular facet belonging to the first rotational connection boundary. Based on the first stationary boundary, the first translational motion boundary, the first rotational motion boundary, the triangular facet belonging to the first translational connection boundary, and the triangular facet belonging to the first rotational connection boundary, the first surface data is obtained.
[0095] Step S6: Based on the first surface data and the background Cartesian grid, determine the unfrozen grid cells in each grid cell of the background Cartesian grid. The unfrozen grid cells include boundary grid cells and grid cells within the computational domain.
[0096] Step S8: For each unfrozen mesh cell, determine the adaptive processing label corresponding to each unfrozen mesh cell according to the first mesh adaptive strategy. The adaptive processing label includes "to be refined" and "to be coarsened".
[0097] Step S10: Refine the unfrozen mesh cells marked as to be refined by adaptive processing, and coarse the unfrozen mesh cells marked as to be coarsened by adaptive processing to obtain the first temporary Cartesian mesh.
[0098] Step S12: Determine the unfrozen mesh cells in the first temporary Cartesian mesh based on the first temporary Cartesian mesh and the first surface data.
[0099] Step S14: Iteratively execute the above process of determining the adaptive markers corresponding to the unfrozen mesh cells according to the first mesh adaptive strategy, obtaining the first temporary Cartesian mesh, and determining the unfrozen mesh cells in the first temporary Cartesian mesh, until there are no adaptive processing markers in any of the unfrozen mesh cells in the first temporary Cartesian mesh, and obtain the first intermediate Cartesian mesh.
[0100] Step S16: For each frozen grid cell that is a neighbor of the boundary grid cell in the first intermediate Cartesian grid, perform iterative encryption processing until the encryption level of the boundary grid cell in the first intermediate Cartesian grid is consistent with that of the corresponding neighboring frozen grid cell, and obtain the first transition Cartesian grid.
[0101] Step S18: Mark the neighboring frozen grid cells corresponding to each boundary grid cell in the first transition Cartesian grid as retained layer grid cells.
[0102] Step S20: Iteratively update the first transitional Cartesian grid until the number of retained layers in the updated first transitional Cartesian grid reaches a preset number, thus obtaining the first target Cartesian grid. The iterative update process of the first transitional Cartesian grid includes: iteratively encrypting the frozen grid cells that are neighbors of the latest marked retained layer grid cells in each frozen grid cell until their encryption level is consistent with the encryption level of the latest marked retained layer grid cell, and marking the neighboring frozen grid cells as new retained layer grid cells, thus obtaining the updated first transitional Cartesian grid.
[0103] Step S22: If the boundary of the target fluid domain at the first time step has not moved compared to the boundary at the second time step, then the second target Cartesian grid is adaptively processed according to the first grid adaptive strategy of the target fluid domain at the first time step to obtain the first target Cartesian grid.
[0104] The second target Cartesian grid is obtained based on the second grid adaptive strategy corresponding to the target fluid domain at the second time step. The first grid adaptive strategy is different from the second grid adaptive strategy.
[0105] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0106] It is understood that the term "based on" as used in this application is used to describe one or more factors that influence the determination, but does not exclude other factors that may influence the determination. For example, the phrase "determine A based on B" means that the determination of A can be based entirely or at least partially on factor B. That is, B is a factor that influences the determination of A, but does not exclude the fact that the determination of A is also based on C.
[0107] Based on the same inventive concept, this application also provides a mesh generation apparatus for implementing the mesh generation method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more mesh generation apparatus embodiments provided below can be found in the limitations of the mesh generation method described above, and will not be repeated here.
[0108] In one exemplary embodiment, such as Figure 6 As shown, a mesh generation device is provided, including: a background mesh generation module 602, a boundary update module 604, and a mesh generation module 606.
[0109] Background mesh generation module 602 is used to generate the background Cartesian mesh corresponding to the target fluid domain to be simulated.
[0110] The boundary update module 604 is used to update the data of the second surface of the target fluid domain at the second time step if the boundary of the target fluid domain at the first time step moves relative to the boundary at the second time step, so as to obtain the data of the first surface of the target fluid domain at the first time step; wherein, the first time step is the time step that is located after the second time step and adjacent to the second time step in time sequence.
[0111] The mesh generation module 606 is used to obtain the first target Cartesian mesh corresponding to the target fluid domain at the first time step based on the first surface data and the background Cartesian mesh.
[0112] In an exemplary embodiment, the mesh generation module 606 is used to adaptively process the second Cartesian mesh of the target fluid domain at the second time step if the boundary of the target fluid domain at the first time step has not moved compared to the boundary at the second time step, so as to obtain the first target Cartesian mesh of the target fluid domain at the first time step.
[0113] In an exemplary embodiment, the mesh generation module 606 is used to adaptively process the second target Cartesian mesh according to the first mesh adaptive strategy corresponding to the target fluid domain at the first time step to obtain the first target Cartesian mesh; wherein, the second target Cartesian mesh is obtained based on the second mesh adaptive strategy corresponding to the target fluid domain at the second time step, and the first mesh adaptive strategy is different from the second mesh adaptive strategy.
[0114] In an exemplary embodiment, the mesh generation module 606 is used to determine, based on the first surface data and the background Cartesian mesh, non-frozen mesh cells in each mesh cell of the background Cartesian mesh, the non-frozen mesh cells including boundary mesh cells and computational domain mesh cells; perform mesh adaptive processing on each non-frozen mesh cell according to the first mesh adaptive strategy corresponding to the target fluid domain at the first time step to obtain a first intermediate Cartesian mesh; wherein, the first mesh adaptive strategy includes the first encryption region corresponding to the first time step, the encryption level corresponding to the first encryption region, the boundary encryption triggering condition corresponding to the first time step, and the calculation result triggering condition corresponding to the first time step; and perform adaptive processing on the first intermediate Cartesian mesh based on the first intermediate Cartesian mesh and the preset boundary processing strategy to obtain the first target Cartesian mesh.
[0115] In an exemplary embodiment, the mesh generation module 606 includes a first processing unit, configured to: determine an adaptive processing label corresponding to each unfrozen mesh cell according to a first mesh adaptive strategy, wherein the adaptive processing label includes "to be refined" and "to be coarsened"; refine the unfrozen mesh cells with the adaptive processing label "to be refined" and coarse the unfrozen mesh cells with the adaptive processing label "to be coarsened" to obtain a first temporary Cartesian mesh; determine the unfrozen mesh cells in the first temporary Cartesian mesh based on the first temporary Cartesian mesh and the first surface data; iteratively execute the above process of determining the adaptive label corresponding to the unfrozen mesh cell according to the first mesh adaptive strategy, obtaining the first temporary Cartesian mesh, and determining the unfrozen mesh cells in the first temporary Cartesian mesh, until no adaptive processing label exists in any of the unfrozen mesh cells in the first temporary Cartesian mesh, thereby obtaining a first intermediate Cartesian mesh.
[0116] In an exemplary embodiment, the mesh generation module 606 includes a second processing unit, configured to perform iterative encryption processing on frozen mesh units that are neighbors of the boundary mesh units in the first intermediate Cartesian mesh, until the encryption level of the boundary mesh units in the first intermediate Cartesian mesh is consistent with that of the corresponding neighboring frozen mesh units, thus obtaining a first transitional Cartesian mesh; mark the neighboring frozen mesh units corresponding to each boundary mesh unit in the first transitional Cartesian mesh as reserved layer mesh units; and perform iterative update processing on the first transitional Cartesian mesh until the reserved layer in the updated first transitional Cartesian mesh reaches a preset number of layers, thus obtaining a first target Cartesian mesh; wherein, the process of iteratively updating the first transitional Cartesian mesh includes: performing iterative encryption processing on frozen mesh units that are neighbors of the latest marked reserved layer mesh units, until their encryption level is consistent with that of the latest marked reserved layer mesh units, marking the neighboring frozen mesh units as new reserved layer mesh units, thus obtaining the updated first transitional Cartesian mesh.
[0117] In an exemplary embodiment, the boundary update module 604 is used to, if the boundary's motion is translation, translate all vertices on the triangular facets belonging to the second translational motion boundary according to the motion trajectory to obtain the first translational motion boundary. The vertices on the triangular facets belonging to the second translational connection boundary that are located on the second translational motion boundary are also translated accordingly, causing the triangular facets belonging to the second translational connection boundary to deform and form the triangular facets belonging to the first translational connection boundary. Here, the translational connection boundary corresponding to the first time step is simplified to one layer of triangular facets. If the boundary's motion is rotation, the vertices on the second rotational motion boundary are rotated to obtain the first rotational motion boundary, causing the vertices on the triangular facets belonging to the second rotational connection boundary that are located on the motion boundary to be translated accordingly. The moving vertex rotates accordingly. For each moving vertex belonging to the second rotational connection boundary and after rotation, from the stationary vertices on the triangular facet belonging to the second rotational connection boundary that are located on the stationary boundary, the two stationary vertices closest to the moving vertex are determined to form a triangular facet belonging to the first rotational connection boundary. Also, for each stationary vertex belonging to the second rotational connection boundary that is located on the stationary boundary, from the moving vertices belonging to the second rotational connection boundary and after rotation, the two moving vertices closest to the stationary vertex are determined to form a triangular facet belonging to the first rotational connection boundary. Based on the first stationary boundary, the first translational motion boundary, the first rotational motion boundary, the triangular facet belonging to the first translational connection boundary, and the triangular facet belonging to the first rotational connection boundary, the first surface data is obtained.
[0118] Each module in the aforementioned mesh generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0119] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 7As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a grid generation method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0120] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0121] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0122] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0123] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0124] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0125] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0126] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0127] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A mesh generation method, characterized in that, The method is executed by a terminal, and the method includes: Generate a background Cartesian grid corresponding to the target fluid domain to be simulated, wherein the target fluid domain is the fluid domain in the internal combustion engine working simulation process; If the boundary of the target fluid domain at the first time step moves relative to the boundary at the second time step, then the second surface data of the target fluid domain at the second time step is updated to obtain the first surface data of the target fluid domain at the first time step; wherein, the first time step is a time step that is sequentially located after and adjacent to the second time step, and the process of obtaining the initial surface data of the target fluid domain includes: obtaining the stereolithography file corresponding to the target fluid domain, and obtaining the initial surface data based on the stereolithography file; Based on the first surface data and the background Cartesian grid, determine the unfrozen grid cells in each grid cell of the background Cartesian grid. The unfrozen grid cells include boundary grid cells and grid cells within the computational domain. According to the first mesh adaptive strategy corresponding to the target fluid domain at the first time step, mesh adaptive processing is performed on each of the non-frozen mesh elements to obtain a first intermediate Cartesian mesh; wherein, the first mesh adaptive strategy includes the first encryption region corresponding to the first time step, the encryption level corresponding to the first encryption region, the boundary encryption triggering condition corresponding to the first time step, and the calculation result triggering condition corresponding to the first time step, wherein whether the calculation result triggering condition corresponding to each time step is triggered is determined by the calculation result of the previous time step; For each of the frozen grid cells that are neighbors with the boundary grid cells in the first intermediate Cartesian grid, iterative encryption processing is performed until the encryption level of the boundary grid cells in the first intermediate Cartesian grid is consistent with that of the corresponding neighboring frozen grid cells, thus obtaining the first transitional Cartesian grid. Mark the neighboring frozen grid cells corresponding to each boundary grid cell in the first transitional Cartesian grid as reserved layer grid cells; The first transitional Cartesian grid is iteratively updated until the number of retained layers in the updated first transitional Cartesian grid reaches a preset number, thereby obtaining the first target Cartesian grid corresponding to the target fluid domain at the first time step. The first target Cartesian grid is then output to the solver so that the solver can perform the calculation processing corresponding to the first time step based on the first target Cartesian grid to obtain the calculation result corresponding to the first time step. The process of iteratively updating the first transition Cartesian grid includes: iteratively encrypting the frozen grid cells that are neighbors of the latest marked reserved layer grid cells in each of the frozen grid cells until their encryption level is consistent with the encryption level of the latest marked reserved layer grid cells, marking the neighboring frozen grid cells as new reserved layer grid cells, and obtaining the updated first transition Cartesian grid based on the first surface data and the background Cartesian grid.
2. The method according to claim 1, characterized in that, The method further includes: If the boundary of the target fluid domain at the first time step has not moved compared to the boundary at the second time step, then the second Cartesian grid of the target fluid domain at the second time step is adaptively processed to obtain the first target Cartesian grid of the target fluid domain at the first time step.
3. The method according to claim 2, characterized in that, Adaptive processing is performed on the second target Cartesian grid corresponding to the target fluid domain at the second time step to obtain the first target Cartesian grid corresponding to the target fluid domain at the first time step, including: According to the first mesh adaptive strategy corresponding to the target fluid domain at the first time step, the second target Cartesian mesh is adaptively processed to obtain the first target Cartesian mesh. The second target Cartesian grid is obtained based on the second grid adaptive strategy corresponding to the target fluid domain at the second time step, and the first grid adaptive strategy is different from the second grid adaptive strategy.
4. The method according to claim 1, characterized in that, According to the first mesh adaptive strategy corresponding to the target fluid domain at the first time step, mesh adaptive processing is performed on each of the non-frozen mesh elements to obtain a first intermediate Cartesian mesh, including: For each unfrozen mesh cell, an adaptive processing label corresponding to each unfrozen mesh cell is determined according to the first mesh adaptive strategy. The adaptive processing label includes "to be refined" and "to be coarsened". The non-frozen mesh cells marked as to be refined by the adaptive processing are refined, and the non-frozen mesh cells marked as to be coarsened by the adaptive processing are coarsened to obtain a first temporary Cartesian mesh. Based on the first temporary Cartesian grid and the first surface data, determine the unfrozen grid cells in the first temporary Cartesian grid; The process of iteratively executing the above steps—determining the adaptive markers corresponding to the unfrozen mesh cells according to the first mesh adaptive strategy, obtaining the first temporary Cartesian mesh, and determining the unfrozen mesh cells in the first temporary Cartesian mesh—continues until no adaptive processing markers exist for any of the unfrozen mesh cells in the first temporary Cartesian mesh, thus obtaining the first intermediate Cartesian mesh.
5. The method according to claim 1, characterized in that, Updating the second surface data of the target fluid domain at the second time step to obtain the first surface data of the target fluid domain at the first time step includes: If the boundary movement is translation, then all vertices on the triangular facets belonging to the second translational boundary are translated according to the movement trajectory to obtain the first translational boundary. The vertices on the triangular facets belonging to the second translational boundary are translated accordingly, causing the triangular facets belonging to the second translational boundary to deform and form the triangular facets belonging to the first translational boundary. The translational boundary corresponding to the first time step is simplified to a single layer of triangular facets. If the boundary movement is rotation, then the vertices on the second rotational movement boundary are rotated to obtain the first rotational movement boundary, so that each moving vertex on the movement boundary of the triangular facet belonging to the second rotational connection boundary rotates accordingly. For each moving vertex belonging to the second rotational connection boundary and after rotation, the two stationary vertices closest to the moving vertex are determined from the stationary vertices on the stationary boundary of the triangular facet belonging to the second rotational connection boundary to form the triangular facet belonging to the first rotational connection boundary. Also, for each stationary vertex belonging to the second rotational connection boundary and located on the stationary boundary, the two moving vertices closest to the stationary vertex are determined from the moving vertices belonging to the second rotational connection boundary and after rotation to form the triangular facet belonging to the first rotational connection boundary. The first surface data is obtained based on the first static boundary, the first translational motion boundary, the first rotational motion boundary, the triangular facets belonging to the first translational connection boundary, and the triangular facets belonging to the first rotational connection boundary.
6. A mesh generation device, characterized in that, The device is used in a terminal, and the device includes: The background mesh generation module is used to generate a background Cartesian mesh corresponding to the target fluid domain to be simulated, wherein the target fluid domain is the fluid domain in the internal combustion engine working simulation process; A boundary update module is used to update the second surface data of the target fluid domain at the second time step if the boundary of the target fluid domain at the first time step moves relative to the boundary at the second time step, thereby obtaining the first surface data of the target fluid domain at the first time step; wherein, the first time step is a time step that is sequentially located after and adjacent to the second time step, and the process of obtaining the initial surface data of the target fluid domain includes: obtaining the stereolithography file corresponding to the target fluid domain, and obtaining the initial surface data based on the stereolithography file; A mesh generation module is used to determine, based on the first surface data and the background Cartesian mesh, non-frozen mesh cells in each mesh cell of the background Cartesian mesh, wherein the non-frozen mesh cells include boundary mesh cells and computational domain mesh cells; perform mesh adaptive processing on each non-frozen mesh cell according to a first mesh adaptive strategy corresponding to the target fluid domain at the first time step to obtain a first intermediate Cartesian mesh; wherein the first mesh adaptive strategy includes a first encryption region corresponding to the first time step, an encryption level corresponding to the first encryption region, a boundary encryption trigger condition corresponding to the first time step, and a calculation result trigger condition corresponding to the first time step, wherein whether the calculation result trigger condition corresponding to each time step is triggered is determined by the calculation result of the previous time step; perform iterative encryption processing on frozen mesh cells in each frozen mesh cell that are neighbors with the boundary mesh cells in the first intermediate Cartesian mesh, until the encryption level of the boundary mesh cells in the first intermediate Cartesian mesh and their corresponding neighboring frozen mesh cells is reached. Consistent with the first transition Cartesian mesh, a first transition Cartesian mesh is obtained. The neighboring frozen mesh units corresponding to each boundary mesh unit in the first transition Cartesian mesh are marked as reserved layer mesh units. The first transition Cartesian mesh is iteratively updated until the reserved layer in the updated first transition Cartesian mesh reaches a preset number of layers, resulting in the first target Cartesian mesh corresponding to the target fluid domain at the first time step. The first target Cartesian mesh is output to the solver, allowing the solver to perform the calculation processing corresponding to the first time step based on the first target Cartesian mesh, obtaining the calculation result corresponding to the first time step. The iterative update process for the first transition Cartesian mesh includes: iteratively refining the frozen mesh units that are neighbors of the latest marked reserved layer mesh unit in each of the frozen mesh units until their refining level is consistent with the refining level of the latest marked reserved layer mesh unit; marking the neighboring frozen mesh units as new reserved layer mesh units, resulting in the updated first transition Cartesian mesh based on the first surface data and the background Cartesian mesh.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.