Grid generation method, electronic device and computer readable storage medium
Through automated grid encryption and intersect judgment methods, the problem of inefficient computing grid settings in the prior art is solved, which improves grid generation efficiency and reduces the simulation calculation amount.
Patent Information
- Application Number
- CN202411619184.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-11-13
AI Technical Summary
In the prior art, the setting of the computing grid requires manual operation by the user, which is time-consuming and labor-intensive and inefficient.
Provide a grid generation method, by presetting the encryption level of the target geometry model and the grid encryption level of the background mesh model, automatically perform grid encryption and intersect judgment until the encryption requirements of the target geometry model are met.
It improves the efficiency of grid generation, reduces unnecessary grid encryption, and reduces the amount of subsequent simulation calculations.
Smart Images

Figure CN119129028B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of grid generation, and in particular to a grid generation method, an electronic device and a computer-readable storage medium. Background Art
[0002] When simulating airflow organization, etc., it is usually necessary to generate a computational grid first, and then use simulation software to discretize equations on the computational grid and perform numerical solutions to obtain simulation results. Usually, the setting of the computational grid requires the user to manually set it according to the structural characteristics of the model. This setting method is time-consuming, labor-intensive and inefficient. Summary of the invention
[0003] The main purpose of this application is to provide a grid generation method, an electronic device and a computer-readable storage medium, which can improve the efficiency of grid generation.
[0004] In order to solve the above technical problems, the first technical solution adopted by the present application is: to provide a grid generation method. The method includes generating a background grid model according to a target scene and generating a target geometric model according to a target object in the target scene, wherein the target geometric model corresponds to a preset encryption level, and each grid in the background grid model corresponds to a grid encryption level; in response to the presence of an intersecting grid in the background grid model that intersects with the target geometric model, and the grid encryption level of the intersecting grid is less than the preset encryption level corresponding to the target geometric model, determining that the intersecting grid is a grid to be encrypted; encrypting the grid to be encrypted using a new grid encryption level, and continuing to use the encrypted background grid model and the target geometric model for intersection judgment until there is no grid to be encrypted in the background grid model; wherein the new grid encryption level is higher than the previous grid encryption level of the grid to be encrypted; in response to the absence of a grid to be encrypted, performing computational domain judgment processing on the background grid model to obtain a computational domain grid model corresponding to the target scene.
[0005] To solve the above technical problem, the second technical solution adopted by the present application is to provide an electronic device, which includes a memory and a processor, wherein the memory is used to store program data, and the program data can be executed by the processor to implement the method described in the first technical solution.
[0006] To solve the above technical problems, the third technical solution adopted by the present application is to provide a computer-readable storage medium. The computer-readable storage medium stores program data and can be executed by a processor to implement the method described in the first technical solution.
[0007] The beneficial effect of the present application is as follows: the present application sets a preset encryption level for the target geometric model in advance, and sets a mesh encryption level for each mesh in the background mesh. Then, the background mesh model and the target geometric model are subjected to intersection determination. If there are intersecting meshes in the background mesh whose mesh encryption level is lower than the preset encryption level of the target geometric model, they are encrypted according to a higher mesh encryption level, and the encrypted background mesh model is used to continue the intersection determination. Until there are no more meshes to be encrypted, the encrypted background mesh model is further subjected to calculation and determination processing to obtain a computational domain mesh model. The above method enables the background mesh model to be meshed accordingly according to the mesh encryption level and the situation of the intersecting meshes, and ensures that the mesh encryption level of the background mesh model can match the preset encryption level of the target geometric model, and can meet the encryption level requirements of the target geometric model, thereby improving the efficiency of mesh generation, and also reducing unnecessary mesh encryption, and reducing the amount of subsequent simulation calculations. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work, among which:
[0009] Figure 1 It is a flowchart of the first embodiment of the grid generation method of the present application;
[0010] Figure 2 It is a flowchart of the second embodiment of the grid generation method of the present application;
[0011] Figure 3 It is a schematic diagram of the flow chart of the third embodiment of the grid generation method of the present application;
[0012] Figure 4 is a flowchart of a fourth embodiment of the grid generation method of the present application;
[0013] Figure 5 is a flowchart of a fifth embodiment of the grid generation method of the present application;
[0014] Figure 6 is a flowchart of a sixth embodiment of the grid generation method of the present application;
[0015] Figure 7 is a flow chart of the seventh embodiment of the grid generation method of the present application;
[0016] Figure 8 is a flow chart of an eighth embodiment of the grid generation method of the present application;
[0017] Fig. 9 It is a structural schematic diagram of an embodiment of the electronic device of the present application;
[0018] Fig.10 It is a structural diagram of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0019] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0020] The terms "first", "second", etc. in this application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0021] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0022] Reference Figure 1 , Figure 1 This is a flow chart of the first embodiment of the grid generation method of the present application, which includes but is not limited to the following steps.
[0023] S11: Generate a background grid model according to the target scene and generate a target geometric model according to the target object in the target scene. The target geometric model corresponds to a preset encryption level, and each grid in the background grid model corresponds to a grid encryption level.
[0024] The target scene includes related scenes for which simulation calculations of gas organization and the like are required. For example, if the gas circulation in a room needs to be simulated, the room is the target scene. The target objects in the target scene include objects that may affect the simulation calculations. For example, they may be chairs, cabinets, vents, etc. that exist in the target scene. It is also possible to set an area in the target scene according to actual needs, and set corresponding sizes for it to facilitate the subsequent addition of objects. For example, a tagging field is set in the target scene, which can be used for monitoring gas organization and parameter evaluation, and can also be used to add objects such as heat sources. There can be one or more target objects in the target scene.
[0025] In the field of mesh generation, refinement refers to further subdividing the mesh into smaller meshes.
[0026] The background mesh model and the target geometric model may be generated separately, and after the generation is completed, the target geometric model is substituted into the background mesh model.
[0027] In one embodiment, the generated target geometric model includes a triangulated surface mesh model.
[0028] S12: In response to the presence of an intersecting mesh in the background mesh model that intersects with the target geometric model, and the mesh encryption level of the intersecting mesh is lower than the preset encryption level corresponding to the target geometric model, determining the intersecting mesh as a mesh to be encrypted.
[0029] When it is determined that there is a grid in the background grid model that intersects with the target geometric model, it is further determined whether the grid encryption level of the intersecting grid is lower than the preset encryption level corresponding to the target geometric model with which it intersects. If so, it means that the encryption level of the intersecting grid is not sufficient to meet the encryption requirements of the target geometric model and needs to be further encrypted, and it is determined as a grid to be encrypted.
[0030] When performing intersection determination, only the intersection between the target geometric model surface and the background mesh model is considered, and the internal settings of the target geometric model are not considered, nor are the internal settings of the target geometric model limited. The same is true for any subsequent intersection determination, which only considers the surface of the target geometric model.
[0031] S13: Encrypting the grid to be encrypted using the new grid encryption level, and continuing to use the encrypted background grid model and the target geometric model for intersection judgment until there is no grid to be encrypted in the background grid model, wherein the new grid encryption level is higher than the previous grid encryption level of the grid to be encrypted.
[0032] S14: In response to the absence of a grid to be encrypted, a computational domain determination process is performed on the background grid model to obtain a computational domain grid model corresponding to the target scene.
[0033] The mesh to be encrypted is encrypted with a higher encryption level. After the encryption is completed, the intersection judgment is continued until there is no mesh to be encrypted in the background mesh. If there is no mesh to be encrypted, it means that the encryption level of the mesh in the background mesh model has met the encryption requirements of the target geometric model. Then the encrypted background mesh model can be further processed and the computational domain mesh model can be obtained through computational domain judgment processing.
[0034] In this embodiment, the grids in the generated grid model are three-dimensional grids.
[0035] In this embodiment, a preset encryption level is set for the target geometric model in advance, and a mesh encryption level is set for each mesh in the background mesh. Then, the background mesh model and the target geometric model are subjected to intersection determination. If there are intersecting meshes in the background mesh whose mesh encryption level is lower than the preset encryption level of the target geometric model, they are encrypted according to a higher mesh encryption level, and the encrypted background mesh model is used to continue the intersection determination. Until there are no more meshes to be encrypted, the encrypted background mesh model is further subjected to calculation and determination processing to obtain a computational domain mesh model. The above method enables the background mesh model to be meshed accordingly according to the mesh encryption level and the situation of the intersecting meshes, and ensures that the mesh encryption level of the background mesh model can match the preset encryption level of the target geometric model, and can meet the encryption level requirements of the target geometric model, thereby improving the efficiency of mesh generation, and also reducing unnecessary mesh encryption, and reducing the amount of subsequent simulation calculations.
[0036] In one embodiment, after generating a background mesh model according to a target scene and generating a target geometric model according to a target object in the target scene, the method further includes: in response to the absence of intersecting meshes between the target geometric model and the background mesh model, determining the mesh where the target geometric model is located in the background mesh model as the mesh to be encrypted. The specific steps may refer to the following embodiments.
[0037] Reference Figure 2 , Figure 2 This is a flow chart of the second embodiment of the grid generation method of the present application, which includes but is not limited to the following steps.
[0038] S21: Generate a background grid model according to the target scene and generate a target geometric model according to the target object in the target scene, the target geometric model corresponds to a preset encryption level, and each grid in the background grid model corresponds to a grid encryption level.
[0039] The target geometric model and the background mesh model are judged for mesh intersection. If it is determined that there is no intersecting mesh in the background mesh model that intersects with the target geometric model, step S22 is executed. If it is determined that there is an intersecting mesh in the background mesh that intersects with the target geometric model, and the mesh encryption level of the intersecting mesh is less than the preset encryption level corresponding to the target geometric model, step S23 is executed.
[0040] S22: In response to the fact that there is no intersecting mesh in the background mesh model that intersects with the target geometric model, the mesh where the target geometric model is located in the background mesh model is determined as the mesh to be encrypted.
[0041] If the size of some target geometric models is too small, they may not intersect with any grid in the background grid model, and the grid where the target geometric model is located needs to be encrypted. After the grid to be encrypted is determined, step S24 is executed.
[0042] S23: In response to the presence of an intersecting mesh in the background mesh model that intersects with the target geometric model, and the mesh encryption level of the intersecting mesh is lower than the preset encryption level corresponding to the target geometric model, determining the intersecting mesh as a mesh to be encrypted.
[0043] After the grid to be encrypted is determined, step S24 is executed.
[0044] S24: Encrypting the grid to be encrypted using the new grid encryption level, and continuing to use the encrypted background grid model and the target geometric model for intersection judgment until there is no grid to be encrypted in the background grid model, wherein the new grid encryption level is higher than the previous grid encryption level of the grid to be encrypted.
[0045] S25: In response to the absence of a grid to be encrypted, a computational domain determination process is performed on the background grid model to obtain a computational domain grid model corresponding to the target scene.
[0046] After the mesh to be encrypted is determined, the mesh to be encrypted is encrypted with a higher encryption level. After the encryption is completed, the intersection judgment is continued, and the above steps are repeated after each encryption, and step S22 or step S23 is executed again to determine whether there are still meshes to be encrypted, until there are no meshes to be encrypted in the background mesh. Or after the background mesh model and the target geometric model are generated, it is determined that there are no meshes to be encrypted, that is, there are no meshes to be encrypted in the background mesh. The absence of meshes to be encrypted indicates that the encryption level of the meshes in the background mesh model has met the encryption requirements of the target geometric model, and the encrypted background mesh model can be further processed, and the computational domain mesh model can be obtained through computational domain determination processing.
[0047] In this embodiment, intersection determination and occupancy determination are used simultaneously to avoid the problem of missing geometry recognition caused by too small a geometric size of the target geometric model.
[0048] Reference Figure 3 , Figure 3 This is a flow chart of the third embodiment of the grid generation method of the present application. This method is a further extension of step S14. It includes but is not limited to the following steps.
[0049] S31: In response to the existence of an intersecting surface in the target geometric model that intersects with the background mesh model, a boundary surface is generated according to the intersecting surface.
[0050] After the background mesh is encrypted, the computational domain of the background mesh model needs to be determined to obtain the computational domain mesh model. First, the background mesh model and the target geometry model are determined to intersect. The target geometry model is determined to intersect with each mesh in the background mesh model. For the part of the face where the target geometry model intersects with any mesh, it is copied to generate another overlapping face and used as the boundary face. Finally, the boundary face that surrounds the entire target geometry model can be obtained. The obtained boundary face is also part of the background mesh model and serves as the mesh face of the corresponding mesh.
[0051] Specifically, the faces of all target geometric models and meshes can be judged for face intersection, the intersecting faces can be copied, and the point order can be reset according to the face normal information to generate another overlapping face with opposite normal. The part information to which the face belongs is given according to the intersecting face information, and the generated other face belongs to the background mesh model and is set as the boundary face.
[0052] S32: Using the boundary surface and the preset internal grids in the background grid model, perform internal grid determination on all grids in the background grid model to determine all non-internal grids.
[0053] S33: Delete all non-interior grids in the background grid model to obtain a computational domain grid model.
[0054] Since there is usually no flow of gas tissue etc. inside the target object when simulating gas tissue etc., a boundary surface is generated when obtaining the calculation domain, thereby separating the target geometric model from the background mesh model and separating the target object from the target scene.
[0055] In the process of obtaining the computational domain mesh model, it is necessary to determine the mesh type of each mesh. The mesh type can be divided into internal mesh and non-internal mesh. In the pre-setting, the mesh type of the mesh in the computational domain is regarded as internal mesh.
[0056] The preset internal grid is a pre-set grid belonging to the computational domain, which is needed to obtain the computational domain. The internal grid needs to be outside the range surrounded by the boundary surface, otherwise an error will be reported when generating the computational domain grid model, prompting the user to modify the preset internal grid.
[0057] All internal meshes in the background mesh model can be obtained according to the preset internal meshes and boundary surfaces, and the remaining meshes are all non-internal meshes. Usually in the background mesh model, the meshes within the range surrounded by the boundary surface are all non-internal meshes, and the meshes outside the range surrounded by the boundary surface are all internal meshes. After deleting all non-internal meshes, all the remaining internal meshes constitute the computational domain mesh model.
[0058] Reference Figure 4 , Figure 4 This is a flow chart of the fourth embodiment of the grid generation method of the present application. This method is a further extension of step S32. It includes but is not limited to the following steps.
[0059] S41: traverse all grids in the background grid model to determine the surface intersection grids that intersect with the internal grids.
[0060] A face-intersecting mesh is a mesh that has an intersecting face with an internal mesh.
[0061] S42: Determine the surface intersection meshes whose intersection surfaces with the internal meshes are not boundary surfaces as internal meshes.
[0062] If the intersection surface between the surface intersection mesh and the internal mesh is not a boundary surface, the surface intersection mesh is also determined as an internal mesh. If it is a boundary surface, the surface intersection mesh is determined as a non-internal mesh.
[0063] S43: Repeat the traversal until the internal mesh in the background mesh model is consistent with the previous traversal, the traversal ends and all meshes in the background mesh model that are not internal meshes are determined to be non-internal meshes.
[0064] Furthermore, in one embodiment, if the grid is determined to be a non-internal grid, the grid will not be traversed in the subsequent traversal process. This method can save certain computing resources and improve the efficiency of grid generation.
[0065] Finally, until the internal mesh in the background mesh model is consistent with the last traversal, or there is no mesh in the background mesh model that meets the above conditions (that is, the mesh is an internal mesh, and there is a mesh whose mesh type has not been determined in the intersecting surface mesh), the traversal ends, and all meshes in the background mesh model that are not internal meshes are determined, that is, all non-internal meshes are determined. The internal mesh in this embodiment is consistent with the last traversal, which means that the number and position of the obtained internal meshes are the same as those in the last traversal.
[0066] After deleting all non-internal grids, the computational domain grid model can be obtained.
[0067] In one embodiment, deleting all non-interior grids in the background grid model to obtain the computational domain grid model includes: performing grid point smoothing on the background grid model from which all non-interior grids have been deleted to obtain the computational domain grid model. The specific steps may refer to the following embodiments.
[0068] Reference Figure 5 , Figure 5 This is a flow chart of the fifth embodiment of the grid generation method of the present application. This method is a further extension of the above embodiment. It includes but is not limited to the following steps.
[0069] S51: Determine all non-boundary grid points in the background grid model from which all non-interior grids are deleted.
[0070] After deleting all non-interior mesh points, all non-boundary mesh points that do not exist on the boundary surfaces are identified.
[0071] S52: traverse all non-boundary grid points, and update the coordinates of each grid point according to the weighted calculation result of the area of all adjacent faces of each grid point and the coordinates of the face center.
[0072] During each traversal, for each non-boundary grid point, the grid surface containing the non-boundary grid point is obtained and used as the adjacent surface of the non-boundary grid point. The weighted average of the face center coordinates of all adjacent surfaces and the corresponding weights is calculated using the areas of all adjacent surfaces of the non-boundary grid point as weights, and the weighted average result is used as the new coordinates of the non-boundary grid point. For example, a non-boundary grid point x has eight adjacent surfaces a, b, c, d, e, f, g, and h. Their respective areas are respectively the area S1 of adjacent surface a, the area S2 of adjacent surface b, the area S3 of adjacent surface c, the area S4 of adjacent surface d, the area S5 of adjacent surface e, the area S6 of adjacent surface f, the area S7 of adjacent surface g, and the area S8 of adjacent surface h. The face center coordinates corresponding to each adjacent surface are divided into the face center coordinate A of adjacent surface a, the face center coordinate A of adjacent surface b, and the face center coordinate S9 of adjacent surface h. The new coordinates of the boundary grid point x are X=A*(S1 / S)+B*(S2 / S)+C*(S3 / S)+D*(S4 / S)+E*(S5 / S)+F*(S6 / S)+G*(S7 / S)+H*(S8 / S). Among them, S=S1+S2+S3+S4+S5+S6+S7+S8.
[0073] The grid points on the boundary surfaces do not need to be changed.
[0074] S53: Repeat the traversal for a preset number of times to obtain a computational domain grid model.
[0075] The number of smoothing passes can be set according to the actual situation and is not limited here. Within a certain number of times, the more times, the better the smoothing effect, the better the corresponding subsequent calculation and simulation effect, but the longer the time spent on the mesh generation process.
[0076] In this embodiment, the smoothing process can improve the orthogonality of the mesh in the transition area near the boundary and improve the mesh quality.
[0077] Reference Figure 6 , Figure 6 This is a flow chart of the sixth embodiment of the grid generation method of the present application. This method is a further extension of the above embodiment. It includes but is not limited to the following steps.
[0078] S61: Determine the background size of the background grid model according to the target scene.
[0079] S62: Generate a background grid model based on the background size and the preset grid resolution.
[0080] The background grid size can be determined in the form of a cuboid or a combination thereof. For example, if the target scene is a cuboid-like room, to calculate the gas circulation in the cuboid-like room, the background grid size can be determined by a circumscribed cuboid of the room. During design, the circumscribed cuboid can be represented by two vectors. The two vectors are pointMin and pointMax, and the background grid size is pointMax-pointMin. Then the preset grid resolution bgr (backGroundResolution) of the background grid model is further obtained. It can be resized according to the actual scene. The number of background grid division nodes can be obtained based on the background grid size and the preset grid resolution. The number of divisions in three dimensions is nCellX / Y / Z=ceil((pointMax-pointMin) / bgr). Ceil is rounded up.
[0081] When generating a background grid model, the size and shape of each grid therein are usually the same. Therefore, the same grid encryption level is set for them for subsequent calculations. In one embodiment, when generating a background grid model, the grid encryption levels corresponding to all grids in the background grid model are the same. Further, the grid encryption levels of all grids can be set to zero.
[0082] Reference Figure 7 , Figure 7 This is a flow chart of the seventh embodiment of the grid generation method of the present application. This method is a further extension of the above embodiment. It includes but is not limited to the following steps.
[0083] S71: Obtain the object geometric size and the expected number of grids of the target object.
[0084] S72: Determine a first encryption level according to the geometric size of the object and a preset grid resolution, and determine a second encryption level according to the expected number of grids and a preset grid resolution.
[0085] The first encryption level calculated based on the geometric size of the object is the corresponding encryption level obtained based on the geometric size of the object. The second encryption level calculated based on the expected number of grids is to ensure that the encryption level of the target geometric model of the target object meets the expected number of grids. Considering the need to ensure a certain number of analytical grids, the preset encryption level of the target geometric model is determined by setting two constraints, one of which is calculated based on the geometric size of the object and the other is obtained based on the expected number of grids.
[0086] S73: In response to the first encryption level being greater than the second encryption level, determining the first encryption level as the preset encryption level; in response to the first encryption level being less than the second encryption level, determining the second encryption level as the preset encryption level.
[0087] A larger encryption level is selected as the default encryption level of the target geometric model of the target object.
[0088] In an embodiment of the present application, the present application approximates the target object with a rectangle, or a cuboid, or a combination thereof, and ensures that the obtained target geometric model is the same or similar to the target object as much as possible. The target geometric model includes at least one of a rectangle, a cuboid, and a combination of a rectangle and a cuboid. The target geometric model generated by a target object can be one or more. If a target object corresponds to multiple target geometric models, each target geometric model needs to calculate its corresponding preset encryption level. When calculating the preset encryption level of each target geometric model, the preset encryption level is obtained according to the object geometric dimensions of the corresponding part in the target object.
[0089] For example, a tuyere can usually be represented by a rectangular surface, and its corresponding target geometric model can be a rectangular surface. The size of the rectangular surface can be obtained to calculate its corresponding first encryption level.
[0090] For some target objects, some three-dimensional parts can be processed as two-dimensional. For example, the size of a desktop in one dimension is much smaller than the sizes in the opposite directions of the other two dimensions, so this part can be processed as a two-dimensional surface. The size of the surface is obtained to calculate its corresponding first encryption level.
[0091] The three-dimensional part is generally processed in a three-dimensional manner. The size of the cuboid is obtained to calculate the corresponding first encryption level.
[0092] According to actual needs, the target geometric model may also be other shapes and is not limited to the rectangle, cuboid, or a combination thereof described in this application.
[0093] By using standardized target geometry models to describe the target object, manual operations can be effectively reduced, mesh generation efficiency can be improved, and the amount of subsequent calculations can be reduced to a certain extent.
[0094] Reference Figure 8 , Figure 8 This is a flow chart of the eighth embodiment of the grid generation method of the present application. This method is a further extension of the above embodiment. It includes but is not limited to the following steps.
[0095] S81: Determine at least two geometric dimensions in at least two directions according to the geometric dimensions of the object.
[0096] S82: Determine a first encryption level according to a smallest geometric dimension of at least two geometric dimensions and a preset grid resolution.
[0097] After obtaining the geometric size of the object, it is dimensionally parsed to obtain at least two dimensional directions, and the corresponding geometric size can be obtained in each dimensional direction. Then the first encryption level is calculated according to the minimum geometric size and the preset grid resolution of the background grid model. The dimensional direction of the parsing is generally the side length direction of the corresponding target geometric model.
[0098] For example, air vents are generally represented by surfaces, so it is necessary to parse out two dimensions and sort them in descending order according to the numerical values of the object's geometric dimensions. If size1>size2, the air vent encryption level is max(ceil(log2(bgr*nCellVent / size2)),ceil(log2(bgr / defaultCellSizeVent))).
[0099] For some objects, some of their components, such as the table top, have a dimension much smaller than the other two dimensions, so it is more appropriate to treat them as faces. When parsing, the geometric size components of the object are arranged in descending order, size1>size2>size3, and size3 is ignored. The encryption level of the object is calculated as: max(ceil(log2(bgr*nCellVent / size2)),ceil(log2(bgr / defaultCellSizeVent))).
[0100] For some objects, they are processed as normal three-dimensional parts, such as cabinets. When parsing, the geometric size components of the objects are arranged in descending order, size1>size2>size3. The encryption level of the object is calculated as: max(ceil(log2(bgr*nCellObstacle / size3)), ceil(log2(bgr / defaultCellObstacle))).
[0101] For the marked domain, its role is usually to add sources / sinks to the equation, and it is usually treated as a normal 3D component. When parsing, the object geometry size components are sorted in descending order, size1>size2>size3. The encryption level of the object is calculated as: max(ceil(log2(bgr*nCellRegion / size3)),ceil(log2(bgr / defaultCellSizeRegion))).
[0102] In one embodiment, the above-mentioned grid generation method is applied to the field of airflow simulation, and the generated computational domain grid model is a gas flow domain grid model in the airflow simulation process.
[0103] like Fig. 9 As shown, Fig. 9 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application.
[0104] The electronic device includes a processor 110 and a memory 120 .
[0105] The processor 110 controls the operation of the electronic device, and the processor 110 may also be referred to as a CPU (Central Processing Unit). The processor 110 may be an integrated circuit chip having the ability to process a signal sequence. The processor 110 may also be a general-purpose processor, a digital signal sequence processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0106] The memory 120 stores instructions and program data required for the processor 110 to operate.
[0107] The processor 110 is used to execute instructions to implement the method provided by any embodiment and possible combination of the grid generation method embodiments of the present application.
[0108] like Fig.10 As shown, Fig.10 This is a schematic diagram of the structure of an embodiment of a computer-readable storage medium of the present application.
[0109] An embodiment of a readable storage medium of the present application includes a memory 210, and the memory 210 stores program data. When the program data is executed, the method provided by any embodiment and possible combination of the grid generation method embodiments of the present application is implemented.
[0110] The memory 210 may include a medium that can store program instructions, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or may be a server that stores the program instructions. The server may send the stored program instructions to other devices for execution, or may execute the stored program instructions itself.
[0111] In summary, the present application sets a preset encryption level for the target geometric model in advance, and sets a mesh encryption level for each mesh in the background mesh. Then, the background mesh model and the target geometric model are subjected to intersection determination. If there are intersecting meshes in the background mesh whose mesh encryption level is lower than the preset encryption level of the target geometric model, they are encrypted according to the higher mesh encryption level, and the encrypted background mesh model is used to continue the intersection determination. Until there are no more meshes to be encrypted, the encrypted background mesh model is further subjected to calculation and determination processing to obtain the computational domain mesh model. The above method enables the background mesh model to be meshed accordingly according to the mesh encryption level and the situation of the intersecting meshes, and ensures that the mesh encryption level of the background mesh model can match the preset encryption level of the target geometric model, and can meet the encryption level requirements of the target geometric model, thereby improving the efficiency of mesh generation, and also reducing unnecessary mesh encryption, and reducing the amount of subsequent simulation calculations.
[0112] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only illustrative, for example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0113] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0114] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0115] If the integrated units in the above other embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), disk or optical disk and other media that can store program codes.
[0116] The above descriptions are merely embodiments of the present application and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A grid generation method, characterized in that: The method comprises: Generate a background mesh model according to a target scene and generate a target geometric model according to a target object in the target scene, wherein the target geometric model corresponds to a preset encryption level, and each mesh in the background mesh model corresponds to a mesh encryption level; In response to the presence of an intersecting mesh in the background mesh model that intersects with the target geometric model, and the mesh encryption level of the intersecting mesh is lower than the preset encryption level corresponding to the target geometric model, determining the intersecting mesh as a mesh to be encrypted; Encrypting the grid to be encrypted using a new grid encryption level, and continuing to use the encrypted background grid model and the target geometric model to perform intersection judgment until the grid to be encrypted does not exist in the background grid model; wherein the new grid encryption level is higher than the previous grid encryption level of the grid to be encrypted; In response to the absence of the to-be-encrypted grid, performing computational domain determination processing on the background grid model to obtain a computational domain grid model corresponding to the target scene; The step of performing computational domain determination processing on the background grid model to obtain a computational domain grid model corresponding to the target scene includes: In response to the existence of an intersecting surface in the target geometric model that intersects with the background mesh model, generating a boundary surface according to the intersecting surface; Using the boundary surface and the internal grids preset in the background grid model, performing internal grid determination on all grids in the background grid model to determine all non-internal grids; Deleting all the non-interior grids in the background grid model to obtain the computational domain grid model; The step of using the boundary surface and the internal grids preset in the background grid model to perform internal grid determination on all grids in the background grid model to determine all non-internal grids includes: Traversing all grids in the background grid model to determine the surface intersection grids that intersect with the internal grids; Determine the surface intersection grids whose intersection surfaces with the internal grid are not boundary surfaces as the internal grids; The traversal is repeated until the internal grid in the background grid model is consistent with that in the previous traversal, the traversal is terminated and all grids in the background grid model that are not internal grids are determined to be the non-interior grids.
2. The method according to claim 1, characterized in that After generating the background grid model according to the target scene and generating the target geometric model according to the target object in the target scene, the method further includes: In response to the fact that the intersecting mesh that intersects with the target geometric model does not exist in the background mesh model, the mesh where the target geometric model is located in the background mesh model is determined as the mesh to be encrypted.
3. The method according to claim 1, characterized in that Deleting all the non-interior grids in the background grid model to obtain the computational domain grid model includes: The background grid model from which all non-interior grids are deleted is subjected to grid point smoothing processing to obtain the computational domain grid model.
4. The method according to claim 3, characterized in that The step of performing grid point smoothing processing on the background grid model from which all non-internal grids are deleted to obtain the computational domain grid model comprises: Determine all non-boundary grid points in the background grid model from which all non-interior grids are deleted; Traversing all the non-boundary grid points, and updating the coordinates of each grid point according to a weighted calculation result of the area of all adjacent faces of each grid point and the coordinates of the face center; The calculation domain grid model is obtained by repeatedly traversing the grid a preset number of times.
5. The method according to claim 1, characterized in that The step of generating a background grid model according to the target scene includes: Determining the background size of the background grid model according to the target scene; The background grid model is generated based on the background size and a preset grid resolution.
6. The method according to claim 5, characterized in that Determining the preset encryption level corresponding to the target geometric model includes: Obtaining the object geometric size and the expected number of grids of the target object; Determine a first encryption level according to the geometric size of the object and the preset grid resolution, and determine a second encryption level according to the expected number of grids and the preset grid resolution; In response to the first encryption level being greater than the second encryption level, the first encryption level is determined to be the preset encryption level; and in response to the first encryption level being less than the second encryption level, the second encryption level is determined to be the preset encryption level.
7. The method according to claim 6, characterized in that Determining the first encryption level according to the geometric size of the object and the preset grid resolution includes: Determine at least two geometric dimensions in at least two dimensional directions according to the geometric dimensions of the object; The first encryption level is determined according to the smallest geometric dimension of the at least two geometric dimensions and the preset grid resolution.
8. The method according to claim 5, characterized in that When the background grid model is generated, the grid encryption levels corresponding to all the grids in the background grid model are the same.
9. The method according to claim 1, characterized in that: The method is applied in the field of airflow simulation.
10. An electronic device, characterized in that: The invention comprises a memory and a processor, wherein the memory is used to store program data, and the program data can be executed by the processor to implement the method according to any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that: Program data is stored and can be executed by a processor to implement the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Environmental fluid distribution information generation method and device, electronic equipment and storage medium
CN115048877A
Cartesian grid generation method and device suitable for multi-component model
CN115470511A