Grid generation method and device capable of being used for geometric simulation of lake
By automatically generating grid control edges, the problems of low efficiency and inconsistent quality of manual grid control edges in the existing technology are solved, efficient and consistent grid generation is achieved, and the effect of numerical simulation is improved.
Patent Information
- Application Number
- CN202411647674.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-11-18
AI Technical Summary
In the prior art, manual generation of grid control edges results in low grid generation efficiency and low consistency of generated grid quality.
By obtaining the original boundary and boundary buffer direction of the calculation domain, multiple buffers are generated, and these buffers are cropped, and the boundaries of the buffers are automatically extracted to obtain grid control edges, thereby realizing automatic grid generation.
The drawing efficiency of grid control edges is improved, the efficiency of generating grids is improved, the consistency of grid quality is ensured, and the calculation effect of numerical simulation is improved.
Smart Images

Figure CN119598730A_ABST
Abstract
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 the data processing and analysis of the computational domain is completed based on the grids.
[0003] The mesh includes uniform mesh and non-uniform mesh. Based on the non-uniform mesh, accurate numerical simulation can be performed on objects with different features (such as detail features or global features) in the computational domain. At present, one method to generate non-uniform mesh is to manually draw the control boundary of the mesh (referred to as mesh control edge) according to the boundary of the computational domain, and then generate the mesh according to the original boundary of the computational domain and the mesh control edge.
[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 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 solution:
[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 boundary of the internal objects of the computational domain;
[0009] According to the original boundary of the computational domain and the boundary buffer direction, multiple buffers are generated; the multiple buffers include the boundary buffer of the computational domain and the boundary buffer of the internal object;
[0010] Performing clipping processing on the multiple buffers to obtain the buffer of the computing 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 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.
[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 as to facilitate the subsequent use of the buffer zones to automatically extract the boundaries of the buffer zones to obtain grid control edges, and then realize automatic grid generation 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 computing domain, and the boundary outside direction is the direction from the boundary to the outside of the computing 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 buffer 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 the buffer whose boundary buffer direction is the inner direction of the boundary in the boundary buffer of the internal object.
[0020] In an implementation of the first aspect, the internal objects of the computing domain include at least one of the following: villages within the lake, lakes, rivers, fish ponds, dikes, embankments, villages by the lake, trenches, reed fields, and levees.
[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 clip 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 used to determine the boundary buffer direction of the internal object according to the numerical simulation requirements of 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 computing domain, including:
[0029] Performing a union operation on the buffers whose boundary buffer 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 the buffer whose boundary buffer direction is the inner direction of the boundary 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] Generate 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; 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 implementations can refer to the above-mentioned description of the technical effects of the first aspect and its possible implementations, 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 as to facilitate the subsequent use of the buffer zones to automatically extract the boundaries of the buffer zones to obtain grid control edges, and then realize automatic grid generation 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 the 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 It is an example diagram of mesh control edges generated by a computational domain in a mesh generation method provided in an embodiment of the present application;
[0045] Figure 6 It is a 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 It is a schematic diagram of a grid generated by a partial calculation 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 schematic diagram of a grid generation device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] The terms "first" and "second" etc. in the description and claims of the present invention are used to distinguish different objects rather than to describe a specific order of the objects.
[0049] In the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0050] In the description of the present invention, unless otherwise specified, the meaning of "multiple" refers to two or more than two. For example, multiple buffers refer to two or more than two buffers.
[0051] The grid generation method and device for lake geometry simulation provided by the embodiment of the present invention relate to the field of numerical simulation. Specifically, the method can generate grids of a specified area (the specified area is the range of numerical simulation, or called a computational domain), and 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 non-uniform grids can be used to capture and optimize the geometric details in the specified area, thereby improving the accuracy of the numerical simulation.
[0052] First, some technical terms involved in the grid generation method and device 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, the simulation and analysis environments include oceans, rivers and lakes, aerospace, meteorological changes, fluid mechanics, and transportation engineering. For example, the numerical simulation of lakes can predict and analyze the flow dynamics, water quality changes, and pollutant diffusion of rivers and lakes, and provide references for decisions such as water resource management, environmental protection, and engineering design. Among them, the numerical simulation of rivers and lakes includes the establishment of mathematical models, discretization, meshing, determination of boundary conditions and initial conditions, iterative solution, and analysis of results.
[0056] 2. Grid
[0057] The grid is a tool used to divide the computational domain into a series of small units by using grid technology (grid technology is a tool used to divide the computational domain). The grid facilitates the numerical simulation of the computational domain. The size and shape of the grid directly affect the simulation accuracy and computational efficiency.
[0058] The grid determines the spatial resolution of the computational domain and also affects the stability and convergence of the numerical calculation method. Therefore, the generation and optimization of the grid is an important research field in numerical simulation.
[0059] 3. Mesh Control Edge
[0060] Mesh control edges are used to specify the mesh size and density of different areas to ensure that there are sufficiently fine meshes in key areas, thereby capturing the geometric details of key areas in the computational domain, so as to improve the accuracy of numerical simulation calculations in key areas, while larger or sparser meshes are used in other areas to save computing resources.
[0061] Based on the above description of technical terms, it can be known that in numerical simulation, it is necessary to obtain the mesh of the simulated object (the simulated object is a computational domain including different objects) in advance. Usually, in the process of generating non-uniform meshes, it is necessary to draw mesh control edges in advance. In the existing technology, the mesh control edges are drawn by hand. According to the mesh control edges, meshes with different densities can be generated in detail areas that need to be simulated in the computational domain and other areas. In this method, since it is slow to draw the mesh control edges manually, the efficiency of generating meshes is low; in addition, since the drawing rules of different people may be different, the quality of the generated mesh also varies from person to person. Therefore, the consistency of the mesh generated by this method is not high, which may lead to poor numerical simulation results.
[0062] In order to solve the problems of low efficiency and low grid consistency in the above-mentioned method, the 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] Exemplarily, the method for generating a mesh for lake geometry simulation provided by an embodiment of the present invention can be executed by an electronic device having a processing function, for example, the electronic device can be a computer, a server, etc. Taking the electronic device as a computer as an example, the hardware part of the computer can include: a processor, a 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] The memory is used to store computer instructions and related data, for example, the memory can store data of the original boundary, data of the mesh control edge of the computational domain, etc. The memory can be a random access memory (RAM), a read only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, or an optical memory, a disk storage medium or other magnetic storage device, or any other medium that can be used to store program code or data that can be accessed by a computer. Optionally, the memory can be integrated into the processor, and the memory can also be 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, a wireless interface (such as a WI-FI interface, a Bluetooth interface, a 5G interface).
[0067] The communication bus is used to realize the connection and communication between various 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, which is not limited in the embodiments of the present application.
[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 computational domain includes areas where water is stored (for example, the computational domain includes lakes, or fish ponds, or embankments, etc.). Of course, the computational domain may also include other objects, for example, the computational 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 calculation 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 internal objects of the above-mentioned computational domain include element areas that need to be simulated emphatically, and non-element areas that do not need to be simulated emphatically. The element areas are usually feature areas that need to be simulated (i.e., areas containing fluids that need to be simulated), or feature areas that participate in simulation calculations, and non-element areas are usually background areas that do not need to be simulated (not involved in simulation and not participating in simulation). For different numerical simulation scenarios, the objects that need to be simulated in the element areas are different. For example, the element areas include electromagnetic field areas that need to be simulated.
[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] Exemplarily, the boundary of the computational domain and the boundary of the internal object of the computational domain are represented as a point coordinate data set P0, P0 includes a point coordinate data set P1 of the boundary of the computational domain and a point coordinate data set P2 of the boundary of the internal object of 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 near lakes (ponds), 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 area (belonging to the background), villages within lakes (ponds). 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 point coordinate set P0 of the original boundary 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 calculation. Exemplarily, the scipy library in the prior art may be used for smoothing.
[0080] Exemplarily, 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 for processing based on the data and the required smoothing degree, so as 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 object of the calculation domain has a boundary buffer direction of the internal object.
[0085] Among them, the boundary buffer direction of the calculation domain is the inner direction of the boundary.
[0086] It can be understood that the boundary buffer direction of the computational domain is the boundary inner direction; the reason is that for a computational domain, the numerical simulation process needs to simulate and analyze the state of its internal objects, and does not need to pay attention to the range outside the delimited computational domain. Therefore, the grid control edge of the computational domain should be inside the computational domain, thereby distinguishing the difference between the edge of the computational domain and the geometric details inside it (i.e., the mesh density difference). In other words, if the boundary buffer direction of the computational domain is the boundary outer direction, the computational domain does not belong to a complete simulation range, that is, the computational domain is considered to be the "internal object" of another computational domain. Therefore, the boundary buffer direction of the computational domain is set to the boundary inner direction.
[0087] The boundary buffer direction of the internal object is the boundary outer direction, or the boundary buffer direction of the internal object is the boundary inner direction and the boundary outer direction.
[0088] In one implementation, for a computational domain, before generating a buffer zone, the mesh generation method provided in the embodiment of the present application further includes: determining a boundary buffer direction of the internal object according to a numerical simulation requirement 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, the boundary buffer directions are the inner direction and the outer direction of the boundary; the reason is: from the above description of the feature area, it can be seen that the feature area is usually a feature area that needs to be simulated or participates 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 directions are the inner direction and the outer direction of the boundary.
[0091] Exemplary, combined Figure 3 ,like Figure 4 As shown, the internal objects of the computational domain include fish ponds and villages. The computational domain is subjected to a fluid (such as water) numerical simulation. Since it involves 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 direction and the outer direction of the boundary.
[0092] In some embodiments, when the internal object is a non-element area, the 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 (it is difficult for water to flow into the village) and there is no river (or water body) in the village, the non-element area is the village, and the numerical simulation of the computational domain is not involved. 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, and 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, and create a buffer after inputting any geometric object (such as a point, line or surface).
[0095] In the embodiment of the present invention, the width of the buffer zone is set based on the boundary buffer direction of the calculation domain and the boundary buffer direction of the internal object, and the respective buffer zones can be generated. The width of the buffer zone is the distance between the boundary of the buffer zone (to be drawn) and the boundary of the calculation domain or the boundary of the internal object.
[0096] Among them, the width of the buffer 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 by 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 geometry size of the computational domain.
[0100] Optionally, the minimum mesh geometry size d0 may be set to 1 / 2 of the minimum side length of the computational domain, and the maximum mesh geometry size d1 may 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, that is, an area with only fluid);
[0103] (2) Evaluate the maximum number of grids required in the most empty area based on simulation accuracy and computational efficiency;
[0104] (3) The ratio of the size of the most open area in the computational domain to the maximum number of grids required in the most open 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 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 the overlapping parts that exceed the calculation domain and affect the subsequent generation of mesh control edges.
[0108] In the embodiment of the present invention, the method for clipping the buffers is Boolean operation. Boolean operation is a method for performing logical operations on geometric figures, and can combine the original geometric images to obtain new figures.
[0109] Alternatively, if 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 buffer directions are outside the boundary among 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 inner direction of the boundary and the buffer zone B3 in the outer direction of the boundary. The two have the outer directions B2 and B3 in common. 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 then 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, that is, Figure 5 Specifically, the computer completes the boundary extraction of the buffer zone in the data format of the coordinates of the points. 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 mesh of the computational domain according to the original boundary of the computational domain and the mesh control edge of the computational domain. The mesh is used to perform numerical simulation on the computational domain.
[0121] In the embodiment of the present invention, the mesh of the computational domain is generated according to the mesh size at the original boundary of the computational domain and the 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.
[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: the mesh size at the original boundary ≤ the mesh size of the area between the original boundary and the mesh control edge ≤ the mesh size at the mesh control edge ≤ the mesh size of the area between the mesh control edges.
[0125] Combination Figure 6 ,like Figure 7 As shown, exemplary, based on the above content, generating a grid of the computational domain includes the following contents:
[0126] ① First, set the grid size at the original boundary and the grid size at the grid control edge. For example, the grid size at the original boundary is set to 10 units (for example, 10 meters), and the grid size at the grid 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 data set P1 of the boundary of the calculation domain of the original boundary, the point coordinate data set P2 of the boundary of the internal object, and the point coordinate data set 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 mesh 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 as to facilitate the subsequent use of the buffer zones to automatically extract the boundaries of the buffer zones to obtain mesh control edges, and then realize automatic mesh generation based on the mesh control edges. Compared with the method of manually drawing mesh control edges, the mesh generation method provided by the embodiment of the present invention improves the efficiency of drawing mesh control edges, thereby improving the efficiency of generating meshes.
[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 calculation domain have better stability and improving the effect of the numerical simulation.
[0130] Accordingly, the present application embodiment 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 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; 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 to 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 according to the original boundary and the mesh control edge of the computational domain, and 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 used to: perform a union operation on the buffers whose boundary buffer directions are outside the boundary in the multiple buffers to obtain a first buffer, and remove the intersection between the boundary buffer of the calculation domain and the first buffer to obtain a second buffer. For example, the clipping module 503 is specifically used to implement S1031-S1032 in the above-mentioned 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, which will not be repeated here.
[0138] The embodiment of the present application also provides an electronic device, including: 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 described in the above embodiment. The processor can implement the above acquisition module 501, buffer generation module 502, clipping module 503, extraction module 504 and grid generation module 505; the above memory can also be used to 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 referenced to each other, and 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 the present application.
Claims
1. A grid generation method that can be used for lake geometry simulation, characterized in that: include: Acquire the original boundary of the computational domain; the original boundary includes the boundary of the computational domain and the boundary of the internal object of the computational domain; Generate multiple buffers according to the original boundary of the computing domain and the boundary buffer direction; the multiple buffers include the boundary buffer of the computing domain and the boundary buffer of the internal object; Performing clipping processing on the multiple buffers to obtain a buffer of the computational 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, characterized in that The boundary buffer direction of the calculation domain is the inner direction of the boundary; The boundary buffer direction of the internal object is the boundary outside direction, or the boundary inside direction and the boundary outside direction; The inner boundary direction is a direction pointing from the boundary to the inside of the computational domain, and the outer boundary direction is a direction pointing from the boundary to the outside of the computational domain.
3. The method according to claim 2, characterized in that The method further comprises: According to the numerical simulation requirements for the internal object, the boundary buffer direction of the internal object is determined.
4. The method according to claim 1, characterized in that The clipping of the plurality of buffers to obtain the buffer of the computational domain includes: Performing a union operation on the buffers whose boundary buffer 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 the buffer whose boundary buffer direction is the inner direction of the boundary in the boundary buffer of the internal object.
5. The method according to claim 1, characterized in that 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: Generate 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; 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.
6. The method according to claim 1, characterized in that The internal objects of the calculation domain include at least one of the following: villages within the lake, lakes, rivers, fish ponds, dikes, embankments, villages by the lake, trenches, reed fields, and levees.
7. A grid generation device that can be used for lake geometry simulation, characterized in that: It includes an acquisition module, a buffer generation module, a clipping module, an extraction module and a mesh 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 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; The clipping module is used to clip 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.
8. An electronic device, characterized in that: It 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 as described in any one of claims 1 to 6.
9. 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 6.
10. A computer program product, characterized in that The method comprises computer program instructions, and when the computer program instructions are executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Evolution method of multi-layer grid LBM with buffer area
CN110705183A
River ecological buffer zone remote sensing monitoring method and device based on grid division technology
CN111310674A
Grid generation method and device in water environment simulation, storage medium and terminal
CN111400932A
Method for analyzing spatial big data buffer area
CN111913965A
Geological model generation method, device and equipment based on qualitative Kriging interpolation
CN118015219A