A grid generation method and device for lake geometry simulation

By generating and cropping buffers to automatically generate grid control edges, the problems of low efficiency and poor consistency of manually generating grids are solved, and efficient and stable grid generation and numerical simulation are achieved.

CN119598730BActive Publication Date: 2025-08-08HEBEI WATER CONSERVANCY RES INST
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411647674.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-08-08
Estimated Expiration
2044-11-18

AI Technical Summary

Technical Problem

In the prior art, when generating non-uniform grids, manual grid generation edge control efficiency is low and the consistency is poor, which affects the numerical simulation effect.

Method used

By obtaining the original boundary and boundary buffering direction of the calculation domain, multiple buffers are generated and cropped to extract the grid control edges, realizing automatic grid generation.

Benefits of technology

It improves the drawing efficiency of grid control edges and the efficiency of generating grids, ensures the consistency of grid quality, and improves the accuracy and stability of numerical simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119598730B_ABST
    Figure CN119598730B_ABST
Patent Text Reader

Abstract

The present invention provides a mesh generation method and device for lake geometry simulation, belonging to the field of numerical simulation technology, capable of efficiently generating the mesh required for numerical simulation. This method utilizes the range of the numerical simulation to set a buffer zone, then determines mesh control edges based on the buffer zone. The mesh is then generated based on these mesh control edges. This method automatically generates mesh control edges, improving mesh generation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of numerical simulation technology, and in particular to a grid generation method and device that can be used for lake geometry simulation. Background Art

[0002] In the field of numerical simulation, the computational domain is usually divided into multiple grids, and then data processing and analysis of the computational domain are completed based on the grids.

[0003] Meshes include uniform and non-uniform meshes. Non-uniform meshes enable accurate numerical simulations of objects with varying characteristics within the computational domain (e.g., detailed features or global features). Currently, one method for generating non-uniform meshes is to manually draw mesh control boundaries (referred to as mesh control edges) based on the boundaries of the computational domain. The mesh is then generated based on the original computational domain boundaries and mesh control edges.

[0004] In the above method, manually generating mesh control edges makes the mesh generation efficiency low. Summary of the Invention

[0005] The present invention proposes a grid generation method and device that can be used for lake geometry simulation, which can realize the automatic generation of grid control edges and grids, thereby improving the efficiency of grid generation.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] In a first aspect, the present invention provides a grid generation method that can be used for lake geometry simulation, comprising:

[0008] Get the original boundary of the computational domain; the original boundary includes the boundary of the computational domain and the boundaries of the internal objects of the computational domain;

[0009] Generate multiple buffers according to the original boundary of the computational domain and the boundary buffer direction; the multiple buffers include the boundary buffer of the computational domain and the boundary buffer of the internal objects;

[0010] Performing clipping processing on the multiple buffers to obtain the buffer of the calculation domain;

[0011] Extract the boundary of the buffer zone of the computational domain and obtain the mesh control edge of the computational domain;

[0012] A grid of the computational domain is generated according to the original boundary of the computational domain and the grid control edge of the computational domain, and the grid is used to perform numerical simulation on the computational domain.

[0013] The grid generation method provided by the present invention can generate different buffer zones for different objects according to the boundary buffer directions of different objects in the calculation domain, and clip the buffer zones so that the boundaries of the buffer zones can be automatically extracted using the buffer zones to obtain grid control edges, and then the grid can be automatically generated based on the grid control edges. Compared with the method of manually drawing grid control edges, the grid generation method provided by the present invention improves the efficiency of drawing grid control edges, thereby improving the efficiency of generating grids.

[0014] In an implementation of the first aspect, the boundary buffer direction of the calculation domain is an inner boundary direction;

[0015] The boundary buffer direction of the internal object is the boundary outside direction, or the boundary inside direction and the boundary outside direction; wherein, the boundary inside direction is the direction from the boundary to the inside of the calculation domain, and the boundary outside direction is the direction from the boundary to the outside of the calculation domain.

[0016] In an implementation manner of the first aspect, a boundary buffer direction of the internal object is determined according to a numerical simulation requirement for the internal object.

[0017] In an implementation of the first aspect, clipping the multiple buffers to obtain the buffer of the computational domain includes:

[0018] Performing a union operation on the buffers whose boundary buffering directions are outside the boundary among the multiple buffers to obtain a first buffer;

[0019] The intersection between the boundary buffer of the computational domain and the first buffer is removed to obtain a second buffer; the buffer of the computational domain includes the second buffer and a buffer whose boundary buffer direction is an inner boundary direction in the boundary buffer of the internal object.

[0020] In an implementation of the first aspect, the internal objects of the computational domain include at least one of the following: a village within a lake, a lake, a river, a fish pond, a dike, a embankment, a village by the lake, a trench, a reed field, and a levee.

[0021] In a second aspect, the present invention provides a grid generation device that can be used for lake geometry simulation, including an acquisition module, a buffer generation module, a clipping module, an extraction module, and a grid generation module;

[0022] The acquisition module is used to acquire the original boundary of the calculation domain; the original boundary includes the boundary of the calculation domain and the boundary of the internal object of the calculation domain;

[0023] The buffer generation module is used to generate a plurality of buffers according to the original boundary of the computing domain and the boundary buffer direction; the plurality of buffers include the boundary buffer of the computing domain and the boundary buffer of the internal object;

[0024] The clipping module is used to perform clipping processing on the multiple buffers to obtain the buffer of the calculation domain;

[0025] The extraction module is used to extract the boundary of the buffer zone of the calculation domain to obtain the grid control edge of the calculation domain;

[0026] The grid generation module is used to generate a grid of the computational domain according to the original boundary of the computational domain and the grid control edge of the computational domain, and the grid is used to perform numerical simulation on the computational domain.

[0027] In an implementation manner of the second aspect, the buffer generation module is specifically configured to determine a boundary buffer direction of the internal object according to a numerical simulation requirement for the internal object.

[0028] In an implementation of the second aspect, the buffer generation module is specifically configured to perform clipping processing on the multiple buffers to obtain the buffer of the computational domain, including:

[0029] Performing a union operation on the buffers whose boundary buffering directions are outside the boundary among the multiple buffers to obtain a first buffer;

[0030] The intersection between the boundary buffer of the computational domain and the first buffer is removed to obtain a second buffer; the buffer of the computational domain includes the second buffer and a buffer whose boundary buffer direction is an inner boundary direction in the boundary buffer of the internal object.

[0031] In an implementation of the second aspect, the mesh generation module is specifically configured to generate a mesh of the computational domain according to an original boundary of the computational domain and a mesh control edge of the computational domain, including:

[0032] generating a mesh of the computational domain according to a mesh size at an original boundary of the computational domain and a mesh size at the mesh control edge; wherein the mesh size at the original boundary is smaller than the mesh size at the mesh control edge;

[0033] Among them, for the area from the original boundary to the mesh control edge, the mesh size gradually increases from the mesh size at the original boundary to the mesh size at the mesh control edge; the mesh size of the area between the mesh control edges is the same as the mesh size at the mesh control edge.

[0034] In a third aspect, the present invention provides an electronic device comprising a processor and a memory coupled to the processor; the memory is used to store computer instructions, and when the electronic device is running, the processor executes the computer instructions stored in the memory, so that the electronic device performs the method described in the first aspect or any one of its implementations.

[0035] In a fourth aspect, the present invention provides a computer-readable storage medium comprising computer program instructions, which, when executed by a computer, enable the computer to execute the method as described in the first aspect or any one of its implementations.

[0036] In a fifth aspect, the present invention provides a computer program product, comprising computer program instructions, which, when executed on a computer, enable the computer to execute the method as described in the first aspect or any one of its implementations.

[0037] The technical effects corresponding to the above-mentioned second to fifth aspects and their possible implementation methods can refer to the above-mentioned description of the technical effects of the first aspect and its possible implementation methods, and will not be repeated here.

[0038] The beneficial effects of the present invention are:

[0039] The grid generation method provided by the present invention can generate different buffer zones for different objects according to the boundary buffer directions of different objects in the calculation domain, and clip the buffer zones so that the boundaries of the buffer zones can be automatically extracted using the buffer zones to obtain grid control edges, and then the grid can be automatically generated based on the grid control edges. Compared with the method of manually drawing grid control edges, the grid generation method provided by the present invention improves the efficiency of drawing grid control edges, thereby improving the efficiency of generating grids. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 This is one of the flow charts of the grid generation method provided in the embodiment of the present application;

[0041] Figure 2 This is the second flow chart of the grid generation method provided in the embodiment of the present application;

[0042] Figure 3 is an example diagram of the computational domain in the grid generation method provided in an embodiment of the present application;

[0043] Figure 4 This is an example diagram of a buffer zone generated by a computational domain in a grid generation method provided in an embodiment of the present application;

[0044] Figure 5 This is an example diagram of mesh control edges generated by the computational domain in the mesh generation method provided in an embodiment of the present application;

[0045] Figure 6 Schematic diagram of a portion of the computational domain and its mesh control edges in a certain example of the mesh generation method provided in an embodiment of the present application;

[0046] Figure 7 This is a schematic diagram of a grid generated by a partial computational domain in a certain example of a grid generation method provided in an embodiment of the present application;

[0047] Figure 8 It is a structural diagram of the grid generation device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] In the description and claims of the present invention, the terms "first" and "second" are used to distinguish different objects rather than to describe a specific order of objects.

[0049] In the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present invention should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0050] In the description of the present invention, unless otherwise specified, "a plurality of" means two or more than two. For example, a plurality of buffer zones means two or more than two buffer zones.

[0051] The grid generation method and device for lake geometric simulation provided by the embodiment of the present invention relate to the field of numerical simulation. Specifically, the method can generate grids in a specified area (the specified area is the range of numerical simulation, or called the calculation domain). These grids are used to perform numerical simulation calculations on the specified area. The embodiment of the present invention automatically generates grid control edges, and then generates non-uniform grids based on the grid control edges. The use of non-uniform grids can realize the capture and optimization of geometric details in the specified area, thereby improving the accuracy of numerical simulation.

[0052] First, some technical terms involved in the grid generation method and apparatus provided in the embodiments of the present invention are explained.

[0053] 1. Numerical simulation

[0054] Numerical simulation is the simulation and analysis of various physical (such as fluid mechanics, aerodynamics, structural mechanics, and electromagnetic field simulation), chemical (such as molecular dynamics simulation of various substances, quantum chemical calculations, reaction kinetics simulation) and biological (such as cell dynamics simulation, gene expression simulation) processes in the environment through mathematical models and computational methods.

[0055] Specifically, simulation and analysis environments include oceans, rivers and lakes, aerospace, meteorological changes, fluid mechanics, and transportation engineering. For example, numerical simulation of lakes can predict and analyze flow dynamics, water quality changes, and pollutant diffusion in rivers and lakes, providing insights for decision-making in water resource management, environmental protection, and engineering design. Numerical simulation of rivers and lakes involves establishing mathematical models, discretization, meshing, determining boundary and initial conditions, iterative solution, and analysis of results.

[0056] 2. Grid

[0057] Meshing is the process of discretizing a continuous computational domain into a series of small cells using meshing technology (a tool used to divide the computational domain). Meshing facilitates numerical simulations of the computational domain. The size and shape of the mesh directly impact the accuracy and efficiency of the simulation.

[0058] The grid determines the spatial resolution of the computational domain and also affects the stability and convergence of the numerical calculation method. Therefore, grid generation and optimization is an important research area in numerical simulation.

[0059] 3. Mesh Control Edge

[0060] Mesh control edges are used to specify the mesh size and density in different areas to ensure that there is a sufficiently fine mesh in key areas, thereby capturing the geometric details of key areas in the computational domain, thereby improving the accuracy of numerical simulation calculations in key areas, while using larger or sparser meshes in other areas to save computing resources.

[0061] Based on the above description of technical terms, numerical simulation requires pre-determining the mesh of the simulated object (a simulated object is a computational domain containing different objects). Typically, when generating a non-uniform mesh, mesh control edges need to be drawn in advance. Existing techniques use hand-drawn mesh control edges. Based on these mesh control edges, meshes of varying densities can be generated for detail areas of the computational domain that require focused simulation, as opposed to other areas. This method is slow to manually draw mesh control edges, resulting in low mesh generation efficiency. Furthermore, because different people may use different drawing rules, the quality of the generated mesh also varies. Consequently, the resulting meshes are inconsistent, potentially leading to poor numerical simulation results.

[0062] In order to solve the problems of low efficiency and low consistency of grid generation in the above-mentioned method, an embodiment of the present application provides a grid generation method and device that can be used for lake geometry simulation. The method sets a boundary buffer zone for the computational domain and the internal objects of the computational domain. The boundary buffer zone can be used to automatically generate grid control edges, which can avoid the problems of low efficiency and low consistency in manually drawing grid control edges, thereby improving the efficiency of grid generation, and making the calculation effect of numerical simulation of the computational domain have better stability, thereby improving the effect of numerical simulation.

[0063] For example, the mesh generation method for lake geometry simulation provided in an embodiment of the present invention can be performed by an electronic device with processing capabilities, such as a computer or server. For example, if the electronic device is a computer, the hardware components of the computer may include: a processor, memory, a network interface, a user interface, a communication bus, etc.

[0064] The processor is used to control the electronic device to perform related processing and computing tasks. For example, the processor can generate multiple buffers, perform clipping processing on the multiple buffers, and generate grids. The processor may include a central processing unit (CPU) or other processors. The processor may be single-core or multi-core. For example, the processor may include multiple CPUs.

[0065] Memory is used to store computer instructions and related data. For example, memory can store data about the original boundary and the mesh control edges of the computational domain. Memory can be random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical storage, magnetic disk storage media, or other magnetic storage devices, or any other medium capable of storing program code or data accessible by a computer. Memory can optionally be integrated into the processor or independent of the processor.

[0066] The network interface is used for the computer to communicate with other devices or communication networks. The network interface can be a transceiver with transceiver functions. Optionally, the network interface can include a standard wired interface or a wireless interface (such as a Wi-Fi interface, a Bluetooth interface, or a 5G interface).

[0067] The communication bus is used to achieve connection and communication between different components. For example, the processor, memory, network interface, and user interface mentioned above can be interconnected through the communication bus.

[0068] The user interface may include a display screen and an input unit (such as a keyboard). Optionally, the user interface may also include a standard wired interface and a wireless interface.

[0069] Those skilled in the art will appreciate that the above-mentioned computer may also include more or fewer components, or a combination of certain components, or different arrangements of components, and the embodiments of the present application are not limited thereto.

[0070] The embodiment of the present application mainly introduces the grid generation process by taking the scenario of numerical simulation of rivers and lakes as an example. In this way, the calculation domain includes water storage areas (for example, the calculation domain includes lakes, or fish ponds, or embankments, etc.). Of course, the calculation domain can also include other objects, for example, the calculation domain includes villages, etc.

[0071] Combining the above content, such as Figure 1 As shown, the grid generation method for lake geometry simulation provided in the embodiment of the present application includes S101-S105.

[0072] S101. Obtain the original boundary of the computational domain.

[0073] Specifically, the original boundary of the calculation domain includes the boundary of the calculation domain and the boundary of the internal object of the calculation domain, wherein the boundary of the calculation domain is a boundary indicating the outer contour of the calculation domain.

[0074] It should be understood that before performing numerical simulation on the computational domain, it is necessary to use the edge of the computational domain (i.e., the numerical simulation range) as the outline and generate a grid within the outline, so as to perform numerical simulation on the computational domain based on the grid. Since the computational domain also contains at least one internal object that needs to be numerically simulated, in an embodiment of the present application, it is necessary to obtain the boundary of the computational domain and the boundary of the internal object of the computational domain for subsequent data processing.

[0075] The objects within the computational domain include key areas that require simulation, and non-key areas that do not. Key areas are typically feature regions that require simulation (i.e., areas containing the fluid to be simulated) or feature regions that participate in the simulation. Non-key areas are typically background regions that do not require simulation (i.e., are not involved in the simulation and do not participate in the simulation). The objects that require simulation within a key area vary depending on the numerical simulation scenario. For example, a key area may include an electromagnetic field region that requires simulation.

[0076] Optionally, the data representation of the boundary of the computational domain and the boundary of the internal objects of the computational domain is the coordinates of points on the boundary.

[0077] For example, the boundary of the computational domain and the boundaries of the objects within the computational domain are represented as a point coordinate data set P0. P0 includes a point coordinate data set P1 for the boundary of the computational domain and a point coordinate data set P2 for the boundaries of the objects within the computational domain. The above point coordinate data set P1 can also be called a boundary layer, and the point coordinate data set P2 can also be called an internal geometry layer.

[0078] For example, the element area of the internal objects of the computational domain may include at least one of the following: lakes, rivers, fish ponds, dikes, embankments, villages along the lake (pond), embankments, trenches, and reed fields; the non-element area of the internal objects of the computational domain may include at least one of the following: land parcel areas (belonging to the background), villages within the lake (pond). Figure 3 As shown, the internal objects of the computational domain include feature areas (such as fish ponds) and non-feature areas (such as villages).

[0079] Optionally, after obtaining the original boundary point coordinate set P0 of the computational domain, the point coordinate data set P0 may be smoothed to reduce unnecessary geometric details in the boundary data, thereby reducing the amount of computation. For example, the scipy library in the prior art may be used for smoothing.

[0080] For example, the scipy library can apply the Savitzky-Golay filter therein to achieve data smoothing. Specifically, first prepare the data to be smoothed, and then specify the window length and the order of the polynomial according to the data and the required smoothing degree to obtain the smoothed data.

[0081] S102: Generate multiple buffer zones according to the original boundary of the computational domain and the boundary buffer direction.

[0082] Specifically, the multiple buffers include a boundary buffer of the computing domain and a boundary buffer of the internal object; wherein the boundary buffer of the computing domain is generated according to the boundary buffer direction of the computing domain, and the boundary buffer of the internal object is generated according to the boundary buffer direction of the internal object.

[0083] The boundary buffer direction may include an inner boundary direction and an outer boundary direction. The inner boundary direction is a direction from the boundary to the inside of the computational domain, and the outer boundary direction is a direction from the boundary to the outside of the computational domain.

[0084] In the embodiment of the present invention, the calculation domain has a boundary buffer direction of the calculation domain, and the internal objects of the calculation domain have a boundary buffer direction of the internal objects.

[0085] The boundary buffer direction of the computational domain is the inner direction of the boundary.

[0086] It's understandable that the computational domain's boundary buffer direction is internal. This is because, for a computational domain, the numerical simulation process requires simulating and analyzing the state of its internal objects, without focusing on the range outside the demarcated computational domain. Therefore, the computational domain's mesh control edges should be internal to the computational domain, thereby distinguishing the difference in geometric details between the computational domain's edge and its interior (i.e., mesh density differences). In other words, if the computational domain's boundary buffer direction is external, the computational domain does not belong to a complete simulation range; it is considered an "internal object" of another computational domain. Therefore, the computational domain's boundary buffer direction is always set to internal.

[0087] The boundary buffer direction of the internal object is the boundary outside direction, or the boundary buffer direction of the internal object is the boundary inside direction and the boundary outside direction.

[0088] In one implementation, for a computational domain, before generating a buffer zone, the grid generation method provided in the embodiment of the present application further includes: determining a boundary buffer direction of the internal object based on numerical simulation requirements for the internal object of the computational domain.

[0089] Specifically, when the numerical simulation requirements for the internal objects are different, the boundary buffer directions of the internal objects may be different.

[0090] In some embodiments, when the internal object is a feature area, its boundary buffer direction is the direction inside the boundary and the direction outside the boundary; the reason is: from the relevant description of the feature area above, it can be seen that the feature area is usually a feature area that needs to be simulated or participated in the simulation calculation, so the specific geometric details of the simulation object (fluid, etc.) need to be simulated both inside and outside the feature area to improve the accuracy of the simulation. Therefore, the boundary buffer direction is the direction inside the boundary and the direction outside the boundary.

[0091] For example, combined Figure 3 ,like Figure 4 As shown in the figure, the internal objects of the computational domain include fish ponds and villages. The computational domain is numerically simulated for fluid (such as water). Since it involves the specific geometric details of the object to be simulated (i.e., water), the element area is the fish pond. Therefore, the boundary buffer directions of the fish pond are the inner boundary direction and the outer boundary direction.

[0092] In some embodiments, when the internal object is a non-element area, its boundary buffer direction is the outside boundary direction; the reason is that the non-element area belongs to the background area that does not require simulation calculations, and its structure is less affected by the objects that need to be simulated (fluid, etc.) and hardly changes; therefore, specific geometric details are not required in the non-element area, so the boundary buffer direction is the outside boundary direction.

[0093] refer to Figure 4, the internal objects of the computational domain include fish ponds and villages, and the computational domain is numerically simulated for fluids (such as water). If the village is at a high altitude (water cannot easily flow into the village) and there is no river (or water body) in the village, the non-element area is the village and does not involve the numerical simulation of the computational domain. Therefore, the boundary buffer direction of the village is the outside boundary direction.

[0094] Exemplarily, the above-mentioned buffer can be generated by the Shapely library, which is a Python library for processing planar geometric objects. It provides a variety of geometric operation functions such as union, intersection, difference, buffer analysis, distance calculation, area and length calculation; Exemplarily, the Shapely library can apply the buffer method, input any geometric object (such as a point, line or surface) and then create it to obtain a buffer.

[0095] In this embodiment of the present invention, the width of the buffer zone is set based on the aforementioned buffering directions of the computational domain boundary and the internal object boundary, thereby generating respective buffer zones. The buffer zone width is the distance between the buffer zone boundary (to be drawn) and the computational domain boundary or the internal object boundary.

[0096] Among them, the width of the buffer zone is related to factors such as the maximum mesh geometry size of the computational domain, the maximum mesh geometry size, and the mesh expansion coefficient;

[0097] In one implementation, the width of the buffer is calculated using the following formula:

[0098] L=d0×5(v (N+1) -1)

[0099] Where L is the buffer width, d0 is the minimum grid geometry size of the computational domain (the minimum grid geometry size refers to the minimum spatial resolution of the computational domain), v is the grid expansion coefficient (i.e., the maximum ratio allowed between two adjacent grid sizes, for example, set to 1.2), and N is the number of grid layers, satisfying d1 is the maximum mesh size of the computational domain.

[0100] Optionally, the minimum mesh geometry size d0 can be set to 1 / 2 of the minimum side length of the computational domain, and the maximum mesh geometry size d1 can be 10 times the minimum mesh geometry size d0.

[0101] Optionally, the maximum grid geometric size d1 can also be determined by the following methods (1)-(3):

[0102] (1) Determine the size of the most open area in the computational domain (i.e., an area without villages, fish ponds, or embankments, i.e., only fluid);

[0103] (2) Evaluate the maximum number of grids required for the most empty area based on simulation accuracy and computational efficiency;

[0104] (3) The ratio of the size of the most empty area in the computational domain to the maximum number of grids required in the most empty area is taken as the maximum grid geometric size d1;

[0105] For example, the most open area is about 5 km*5 km, and the maximum number of grids here is expected to be 500*500, so the maximum grid size is about 10 meters.

[0106] S103: Perform clipping processing on the multiple buffers to obtain a buffer of the calculation domain.

[0107] It should be understood that since there will be some overlapping parts between multiple buffers, after obtaining multiple buffers, these overlapping parts need to be eliminated, cropped or merged to avoid exceeding the calculation domain and overlapping parts affecting the subsequent generation of mesh control edges.

[0108] In the embodiment of the present invention, the method for clipping the buffers is a Boolean operation. The Boolean operation is a method for performing logical operations on geometric figures, and can combine original geometric images to obtain new figures.

[0109] Alternatively, as Figure 2 As shown, the above-mentioned processing of clipping multiple buffers includes S1031-S1032.

[0110] S1031 . Perform a union operation on buffers whose boundary buffering directions are outside the boundary among the multiple buffers to obtain a first buffer.

[0111] The essence of the union operation is to integrate the overlapping parts of several graphics into one, so that they are called non-overlapping fusion areas.

[0112] For example, Figure 4 In the calculation domain shown, the buffer zone of the village is B2, and the buffer zone of the fish pond includes the buffer zone B4 in the direction of the boundary and the buffer zone B3 in the direction of the boundary. The two have both the directions B2 and B3 in the direction of the boundary. The union operation of B2 and B3 is performed, that is, Figure 4 The boundary of the B6 area in ( Figure 4 The blue line part in the middle is deleted, so that B2 and B3 are merged into a new area (i.e., the first buffer zone).

[0113] S1032: Remove the intersection between the boundary buffer of the calculation domain and the first buffer to obtain a second buffer.

[0114] The buffer of the calculation domain includes the second buffer and a buffer whose boundary buffer direction is the inner direction of the boundary in the boundary buffer of the internal object.

[0115] In the embodiment of the present invention, an intersection operation is performed on the boundary buffer of the calculation domain and the first buffer. The essence of the intersection operation is to calculate the overlapping parts (ie, the common parts) of several graphics.

[0116] For example, Figure 4 As shown, the boundary buffer direction of the calculation domain is the inner direction of the boundary, the boundary buffer of the calculation domain is B1, the overlapping part (i.e., the intersection) of the first buffer and B1 is B5, and the intersection operation is performed on the first buffer and B1, that is, the boundary of the intersection part of the first buffer with B1 ( Figure 4 The red part in the middle is deleted, and the remaining part in the first buffer is merged with B1 to obtain the second buffer.

[0117] Exemplarily, the clipping process of the above buffer can be completed by the above-mentioned shapely library.

[0118] S104: Extract the boundary of the buffer zone of the computational domain to obtain the mesh control edge of the computational domain.

[0119] For example, Figure 5 As shown, the boundary of the buffer zone of the computational domain is extracted, which is Figure 5 Specifically, the computer extracts the boundary of the buffer zone in the form of a point coordinate data format. The point coordinate data set of the boundary of the buffer zone is P3 and is output in the form of a DXF file.

[0120] S105 . Generate a grid of the computational domain according to the original boundary of the computational domain and the grid control edge of the computational domain. The grid is used to perform numerical simulation on the computational domain.

[0121] In an embodiment of the present invention, a mesh of the computational domain is generated based on a mesh size at an original boundary of the computational domain and a mesh size at a mesh control edge, wherein the mesh size at the original boundary is smaller than the mesh size at the mesh control edge.

[0122] Optionally, for the area from the original boundary to the mesh control edge, the mesh size gradually increases from the mesh size at the original boundary to the mesh size at the mesh control edge; the mesh size of the area between the mesh control edges is the same as the mesh size at the mesh control edge.

[0123] In some embodiments, the mesh size of the region between the mesh control edges may be larger than the mesh size at the mesh control edges.

[0124] Based on the above, the above sizes have the following relationship: mesh size at the original boundary ≤ mesh size of the area between the original boundary and the mesh control edge ≤ mesh size at the mesh control edge ≤ mesh size of the area between the mesh control edges.

[0125] Combine Figure 6 ,like Figure 7 As shown, exemplary, based on the above content, generating a grid of the computational domain includes the following:

[0126] ① First, set the mesh size at the original boundary and the mesh size at the mesh control edge. For example, the mesh size at the original boundary is set to 10 units (for example, 10 meters), and the mesh size at the mesh control edge is set to 50 units.

[0127] ② Input the grid size at the original boundary and the grid size at the grid control edge, the point coordinate dataset P1 of the boundary of the calculation domain of the original boundary, the point coordinate dataset P2 of the boundary of the internal object, and the point coordinate dataset P3 of the boundary of the buffer zone obtained in the above S104 into the grid generation software (such as MIKE ZERO software), so as to generate a non-uniform grid of the calculation domain. The non-uniform grid can capture and optimize the geometric details of the key areas in the calculation domain.

[0128] In summary, the grid generation method provided by the embodiment of the present invention can generate different buffer zones for different objects according to the boundary buffer directions of different objects in the calculation domain, and clip the buffer zones so that the boundaries of the buffer zones can be automatically extracted using the buffer zones to obtain grid control edges, and then the grid can be automatically generated based on the grid control edges. Compared with the method of manually drawing grid control edges, the grid generation method provided by the embodiment of the present invention improves the efficiency of drawing grid control edges, thereby improving the efficiency of generating grids.

[0129] Furthermore, this method can avoid the influence of human factors in the manual drawing process, so that the quality consistency of the generated grid is better, thereby making the calculation effect of the numerical simulation of the computational domain more stable and improving the effect of the numerical simulation.

[0130] Accordingly, the present application provides a grid generation device that can be used for lake geometry simulation, such as Figure 8 As shown, it includes an acquisition module 501 , a buffer generation module 502 , a clipping module 503 , an extraction module 504 and a grid generation module 505 .

[0131] Among them, the acquisition module 501 is used to obtain the original boundary of the calculation domain; the original boundary includes the boundary of the calculation domain and the boundary of the internal objects of the calculation domain; for example, the acquisition module 501 is used to implement S101 in the above-mentioned grid generation method that can be used for lake geometry simulation.

[0132] The buffer generation module 502 is used to generate multiple buffers based on the original boundary of the calculation domain and the boundary buffer direction; the multiple buffers include the boundary buffer of the calculation domain and the boundary buffer of the internal object; for example, the buffer generation module 502 is used to implement S102 in the above-mentioned grid generation method that can be used for lake geometry simulation.

[0133] The clipping module 503 is used to clip the multiple buffers to obtain the buffer of the calculation domain; for example, the clipping module 503 is used to implement S103 in the above-mentioned grid generation method that can be used for lake geometry simulation.

[0134] The extraction module 504 is used to extract the boundary of the buffer zone of the computational domain and obtain the grid control edge of the computational domain; for example, the extraction module 504 is used to implement S104 in the above-mentioned grid generation method that can be used for lake geometry simulation.

[0135] The mesh generation module 505 is used to generate a mesh of the computational domain based on the original boundary and the mesh control edges of the computational domain, wherein the mesh is used to perform numerical simulation on the computational domain. The mesh generation module 505 is used to implement S105 in the above-mentioned mesh generation method that can be used for lake geometry simulation.

[0136] Optionally, the clipping module 503 is specifically configured to: perform a union operation on the buffers whose boundary buffering directions are outside the boundary, among the multiple buffers, to obtain a first buffer; and remove the intersection between the boundary buffer of the computational domain and the first buffer to obtain a second buffer. For example, the clipping module 503 is specifically configured to implement S1031-S1032 in the aforementioned grid generation method.

[0137] Each module of the above-mentioned grid generation device can also be used to execute other steps in the above-mentioned method embodiment. All relevant contents involved in the above-mentioned method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0138] The present application also provides an electronic device comprising: a processor and a memory coupled to the processor; the memory is configured to store computer instructions, and when the electronic device is in operation, the processor executes the computer instructions stored in the memory, causing the electronic device to perform the method described in the above embodiment. The processor can implement the acquisition module 501, buffer generation module 502, cropping module 503, extraction module 504, and grid generation module 505; the memory can also store data information obtained by each module.

[0139] An embodiment of the present application further provides a computer-readable storage medium, which includes a computer program. When the computer program runs on a computer, the method described in the above embodiment is executed.

[0140] An embodiment of the present application further provides a computer program product, which includes computer program instructions. When the computer program instructions are run on a computer, the method described in the above embodiment is executed.

[0141] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.

[0142] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A grid generation method that can be used for lake geometry simulation, characterized in that: include: Obtaining the original boundary of the computational domain; the original boundary includes the boundary of the computational domain and the boundaries of the internal objects of the computational domain; Generate multiple buffers based on the original boundary of the computational domain and the boundary buffer direction; the multiple buffers include the boundary buffer of the computational domain and the boundary buffer of the internal object; the boundary buffer direction of the computational domain is the boundary inner direction; the boundary buffer direction of the internal object is the boundary outer direction, or the boundary inner direction and the boundary outer direction; wherein the boundary inner direction is the direction from the boundary to the inside of the computational domain, and the boundary outer direction is the direction from the boundary to the outside of the computational domain; the width of the buffer is related to the maximum grid geometric size, the minimum grid geometric size, and the grid expansion coefficient of the computational domain; the minimum grid geometric size refers to the minimum spatial resolution of the computational domain; Performing clipping processing on the multiple buffers, wherein the clipping processing is to eliminate, clip or merge overlapping parts of the multiple buffers to obtain the buffer of the calculation domain; Extracting the boundary of the buffer zone of the computational domain to obtain the grid control edge of the computational domain; A mesh of the computational domain is generated according to the original boundary of the computational domain and the mesh control edge of the computational domain, and the mesh is used to perform numerical simulation on the computational domain.

2. The method according to claim 1, wherein The method further comprises: According to the numerical simulation requirements for the internal object, a boundary buffer direction of the internal object is determined.

3. The method according to claim 1, wherein The clipping process is performed on the multiple buffers, wherein the clipping process is to eliminate, clip or merge overlapping parts of the multiple buffers to obtain the buffer of the calculation domain, including: Performing a union operation on the buffers whose boundary buffering directions are outside the boundary among the multiple buffers to obtain a first buffer; The intersection between the boundary buffer of the computational domain and the first buffer is removed to obtain a second buffer; the buffer of the computational domain includes the second buffer and a buffer whose boundary buffer direction is an inner boundary direction in the boundary buffer of the internal object.

4. The method according to claim 1, wherein Generating a mesh of the computational domain according to the original boundary of the computational domain and the mesh control edge of the computational domain includes: generating a mesh of the computational domain according to a mesh size at an original boundary of the computational domain and a mesh size at the mesh control edge; wherein the mesh size at the original boundary is smaller than the mesh size at the mesh control edge; Among them, for the area from the original boundary to the mesh control edge, the mesh size gradually increases from the mesh size at the original boundary to the mesh size at the mesh control edge; the mesh size of the area between the mesh control edges is the same as the mesh size at the mesh control edge.

5. The method according to claim 1, wherein The internal objects of the calculation domain include at least one of the following: a village within a lake, a lake, a river, a fish pond, a dike, a embankment, a village by the lake, a trench, a reed field, and a dike.

6. A grid generation device that can be used for lake geometry simulation, characterized in that: It includes acquisition module, buffer generation module, clipping module, extraction module and grid generation module; The acquisition module is used to acquire the original boundary of the calculation domain; the original boundary includes the boundary of the calculation domain and the boundary of the internal object of the calculation domain; The buffer generation module is used to generate multiple buffers according to the original boundary of the computational domain and the boundary buffer direction; the multiple buffers include the boundary buffer of the computational domain and the boundary buffer of the internal object; the boundary buffer direction of the computational domain is the boundary inner direction; the boundary buffer direction of the internal object is the boundary outer direction, or the boundary inner direction and the boundary outer direction; wherein the boundary inner direction is the direction from the boundary to the inside of the computational domain, and the boundary outer direction is the direction from the boundary to the outside of the computational domain; the width of the buffer is related to the maximum grid geometric size, the minimum grid geometric size and the grid expansion coefficient of the computational domain; the minimum grid geometric size refers to the minimum spatial resolution of the computational domain; The clipping module is used to perform clipping processing on the multiple buffers, wherein the clipping processing is to eliminate, clip or merge overlapping parts of the multiple buffers to obtain the buffer of the calculation domain; The extraction module is used to extract the boundary of the buffer zone of the calculation domain to obtain the grid control edge of the calculation domain; The grid generation module is used to generate a grid of the computational domain according to the original boundary of the computational domain and the grid control edge of the computational domain, and the grid is used to perform numerical simulation on the computational domain.

7. An electronic device, characterized in that: The electronic device comprises a processor and a memory coupled to the processor; the memory is used to store computer instructions, and when the electronic device is running, the processor executes the computer instructions stored in the memory, so that the electronic device executes the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that The method comprises computer program instructions, which, when executed by a computer, cause the computer to perform the method according to any one of claims 1 to 5.

9. A computer program product, characterized in that The method comprises computer program instructions, which, when executed on a computer, cause the computer to perform the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method for analyzing spatial big data buffer area

    CN111913965A