River grid generation method, device and equipment and storage medium
By establishing a mapping basis between the body-fitted coordinate system and the Cartesian coordinate system in the meandering river channel, and performing iterative coordinate transformation and node selection, a structured mesh that conforms to the geometric characteristics of the river channel is generated. This solves the problem of inaccurate mesh description in the existing technology and improves the accuracy and efficiency of numerical simulation.
Patent Information
- Application Number
- CN202510945234.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-09
- Publication Date
- 2025-11-07
AI Technical Summary
The meshes generated by existing technologies are difficult to accurately describe the geometric features of meandering river channels, which limits the accuracy and efficiency of numerical simulations.
By establishing a mapping basis between the river channel body-fitted coordinate system and the Cartesian coordinate system, iterative coordinate transformation is performed using grid control parameters to generate a structured grid that conforms to the geometric characteristics of the river channel, and the target node set is selected to simplify the grid structure.
It significantly improves the accuracy and applicability of river channel grids, enabling them to better reflect the geometric characteristics of rivers and enhance the precision and efficiency of numerical simulations.
Smart Images

Figure CN120911040A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of water conservancy engineering technology, specifically to a method, apparatus, equipment, and storage medium for generating river grids. Background Technology
[0002] As one of the most widespread alluvial river types in nature, meandering rivers have attracted widespread attention from researchers and engineers in the field of water conservancy engineering both domestically and internationally. In scientific research or engineering practice, it is often necessary to conduct numerical simulations of water and sediment movement or material transport within meandering rivers to analyze and predict trends in these movements and provide a basis for scientific conclusions or engineering decisions.
[0003] Numerical simulation is based on the "mesh"—a set of discrete nodes and their geometric topological relationships. "Mesh generation" is the core process of constructing this set according to specific rules. For mainstream numerical computation methods such as the finite difference method and the finite volume method, mesh generation is an essential step before simulation. The quality of the mesh directly affects the accuracy and efficiency of the simulation, and can even determine its success or failure.
[0004] Unlike unstructured grids commonly used in marine areas, structured grids are more suitable for river channels due to their well-defined flow direction. However, most current structured grids for meandering rivers are generated based on Cartesian coordinates, whose linear axes do not match the geometry of meandering channels, making it difficult for the generated grids to accurately describe the characteristics of these channels. Summary of the Invention
[0005] In view of this, the present invention provides a method, apparatus, device and storage medium for generating river grids to solve the problem that grids generated by existing technologies are difficult to accurately describe the characteristics of meandering river channels.
[0006] In a first aspect, the present invention provides a method for generating river grids, the method comprising:
[0007] Determine the grid control parameters of the target river channel in the river channel body coordinate system, and determine the node coordinates and node number of the reference node and the node number of the node to be determined. The node coordinates indicate the geometric position of the node in the Cartesian coordinate system, and the node number indicates the position index of the node.
[0008] Based on the grid control parameters, the node coordinates and node number of the reference node, and the node number of the node to be determined, the coordinates of the reference node are transformed until the node number of the reference node matches the node number of the node to be determined, thus obtaining the node coordinates of the node to be determined.
[0009] The undetermined node is used as a new reference node. The undetermined node is redefined. The process returns to the step of transforming the reference node's coordinates and node number based on the mesh control parameters, the reference node's node coordinates and node number, and the undetermined node's node number, until the reference node's node number matches the undetermined node's node number, and the undetermined node's node coordinates are obtained. This process continues until the node coordinates of all undetermined nodes are obtained.
[0010] Based on the grid control parameters, the target node set is obtained by filtering from all undetermined nodes;
[0011] The grid structure of the target river channel is generated based on the node coordinates of all target nodes in the target node set.
[0012] This invention establishes a mapping foundation between the river channel body-fitted coordinate system and the Cartesian coordinate system by acquiring grid control parameters, ensuring that the final generated grid conforms to the geometric characteristics of the river channel. By clearly defining the iteration starting point and reference nodes, a benchmark is provided for subsequent coordinate calculations. Through iteration, the reference node gradually moves towards the undetermined node. During the movement, the node coordinates are continuously calculated using the grid control parameters of the river channel body-fitted coordinate system until the node indices of the two systems are consistent, thus obtaining the coordinates of the undetermined node. This allows the undetermined node to conform to the geometric characteristics of the target river channel. The above process is repeated, with each iteration using the result of the previous iteration as a new starting point to obtain the node coordinates of all nodes. From these, the final target node set is formed, removing unnecessary nodes and simplifying the grid structure while retaining key information. This optimizes the quality and applicability of the grid. The grid structure generated based on the selected nodes can accurately reflect the geometric characteristics of the target river channel. Its grid lines maintain good orthogonality near the river channel centerline and can adapt to the river channel shape at the boundaries, significantly improving the accuracy of the river channel grid.
[0013] In one optional implementation, based on mesh control parameters, the node coordinates and node number of the reference node, and the node number of the node to be determined, the reference node undergoes a coordinate transformation until the node number of the reference node matches the node number of the node to be determined, thereby obtaining the node coordinates of the node to be determined, including:
[0014] The iteration path is determined based on the node index of the reference node and the node index of the node to be determined.
[0015] Based on the grid control parameters, the node coordinates and node number of the reference node, and the node number of the node to be determined, the reference node undergoes coordinate transformation according to the iterative path until the node number of the reference node matches the node number of the node to be determined, thus obtaining the node coordinates of the node to be determined.
[0016] The application can ensure that the coordinate transformation process is carried out according to the predetermined logic, reduce the uncertainty in the calculation, and improve the efficiency of the grid generation.
[0017] In an optional embodiment, the node sequence number comprises a horizontal sequence number and a vertical sequence number.
[0018] Based on the node sequence number of the reference node and the node sequence number of the pending node, the iteration path is determined, comprising:
[0019] When the vertical sequence number of the reference node is inconsistent with the vertical sequence number of the pending node, and the horizontal sequence number of the reference node is consistent with the horizontal sequence number of the pending node, the iteration path is determined to be vertical priority.
[0020] When the horizontal sequence number of the reference node is inconsistent with the horizontal sequence number of the pending node, and the vertical sequence number of the reference node is consistent with the vertical sequence number of the pending node, the iteration path is determined to be horizontal priority.
[0021] When the horizontal sequence number of the reference node is inconsistent with the horizontal sequence number of the pending node, and the vertical sequence number of the reference node is inconsistent with the vertical sequence number of the pending node, the iteration path is determined to be vertical priority or horizontal priority.
[0022] When the reference node is located on the river center line of the target river, the iteration path is determined to be vertical first and then horizontal.
[0023] The application determines the iteration path under different conditions by analyzing the sequence numbers of the reference node and the pending node, so as to ensure that an accurate grid structure can be constructed according to the specific characteristics of the river and the requirements of the numerical simulation in the grid generation process.
[0024] In an optional embodiment, the iteration path is vertical priority, and the grid control parameters comprise the vertical dimension of the river center line segment between the cross sections where each two adjacent nodes on each vertical grid line are located, the deflection angle of the river center line relative to the x-axis at each cross section, the radius of curvature of the river center line at each cross section, the deflection angle weight coefficient, the radius of curvature weight coefficient, and the distance weight coefficient.
[0025] Based on the grid control parameters, the node coordinates and the node sequence number of the reference node, and the node sequence number of the pending node, the reference node is subjected to coordinate transformation according to the iteration path until the node sequence number of the reference node is consistent with the node sequence number of the pending node, and the node coordinates of the pending node are obtained, comprising:
[0026] Based on the node sequence number of the reference node, the node sequence number of the next node is determined on the vertical grid line where the reference node is located.
[0027] determining a first transverse distance of the reference node to the river centerline, determining a second transverse distance of the next node to the river centerline;
[0028] determining a weighted average transverse distance based on the first transverse distance, the second transverse distance and a distance weight coefficient, determining a weighted average deflection angle based on the deflection angle of the reference node, the deflection angle of the next node and a deflection angle weight coefficient, determining a weighted average radius of curvature based on the radius of curvature of the reference node, the radius of curvature of the next node and a radius of curvature weight coefficient;
[0029] determining the first x-axis increment and the first y-axis increment based on the node sequence number of the reference node, the node sequence number of the next node, the longitudinal dimension between the reference node and the next node, the weighted average deflection angle, the weighted average radius of curvature and the weighted average transverse distance;
[0030] determining the node coordinates of the next node based on the node coordinates of the reference node, the first x-axis increment and the first y-axis increment;
[0031] taking the next node as a new reference node, and determining whether the node sequence number of the reference node is consistent with the node sequence number of the to-be-determined node;
[0032] when the node sequence number of the reference node is not consistent with the node sequence number of the to-be-determined node, returning to the step of determining the iteration path based on the node sequence number of the reference node and the node sequence number of the to-be-determined node until the node sequence number of the reference node is consistent with the node sequence number of the to-be-determined node, and taking the node coordinates of the reference node as the node coordinates of the to-be-determined node.
[0033] The application determines the node sequence number of the next node on the longitudinal grid line based on the node sequence number of the reference node, ensures the accuracy and continuity of node selection in the iteration process, determines the weighted average transverse distance by combining the first transverse distance, the second transverse distance and the distance weight coefficient, simultaneously uses the weighted average values of the deflection angle and the radius of curvature, makes the coordinate transformation process be able to comprehensively consider the change of the river geometry characteristics, dynamically determines the first x-axis increment and the first y-axis increment, thereby obtains the node coordinates of the next node, ensures that each coordinate transformation can adapt to the specific situation of the current node, takes the next node as a new reference node and constantly repeats the iteration process until the node sequence number of the reference node is consistent with the node sequence number of the to-be-determined node, realizes the step-by-step approximation from the reference node to the to-be-determined node, thereby obtains the node coordinates of the to-be-determined node, and provides a reliable basis for subsequent generation of high-quality river grid structures.
[0034] In an optional embodiment, the iteration path is transverse priority, and the grid control parameters include the transverse dimension of the transverse grid line segment between each two adjacent nodes on each transverse grid line;
[0035] based on the grid control parameters, the node coordinates and the node sequence numbers of the reference nodes, and the node sequence number of the to-be-determined node, the reference nodes are subjected to coordinate transformation according to the iteration path until the node sequence number of the reference node is consistent with the node sequence number of the to-be-determined node, and the node coordinates of the to-be-determined node are obtained, and the method further comprises:
[0036] based on the node sequence number of the reference node, the node sequence number of the next node is determined on the horizontal grid line where the reference node is located;
[0037] based on the node sequence number of the reference node, the node sequence number of the next node, the horizontal dimension between the reference node and the next node, and the deflection angle of the reference node, the second x-axis increment and the second y-axis increment are determined;
[0038] based on the node coordinates of the reference node, the second x-axis increment, and the second y-axis increment, the node coordinates of the next node are determined;
[0039] the next node is taken as a new reference node, and it is judged whether the node sequence number of the reference node is consistent with the node sequence number of the to-be-determined node;
[0040] when the node sequence number of the reference node is not consistent with the node sequence number of the to-be-determined node, the step of determining the iteration path based on the node sequence number of the reference node and the node sequence number of the to-be-determined node is returned to until the node sequence number of the reference node is consistent with the node sequence number of the to-be-determined node, and the node coordinates of the reference node are taken as the node coordinates of the to-be-determined node.
[0041] The application determines the node sequence number of the next node on the horizontal grid line where the reference node is located, ensures the accuracy and continuity of node selection in the iteration process, dynamically determines the second x-axis increment and the second y-axis increment, obtains the node coordinates of the next node, considers the geometric characteristics on the horizontal grid line, combines the change of the deflection angle of the river center line, takes the next node as a new reference node, and repeatedly iterates until the node sequence number of the reference node is consistent with the node sequence number of the to-be-determined node, and when the node sequence number of the reference node is consistent with the node sequence number of the to-be-determined node, the node coordinates of the to-be-determined node are obtained, which provides a reliable basis for subsequent generation of high-quality river grid structures.
[0042] In an alternative embodiment, the iteration path is first longitudinal and then horizontal.
[0043] based on the grid control parameters, the node coordinates and the node sequence numbers of the reference nodes, and the node sequence number of the to-be-determined node, the reference nodes are subjected to coordinate transformation according to the iteration path until the node sequence number of the reference node is consistent with the node sequence number of the to-be-determined node, and the node coordinates of the to-be-determined node are obtained, and the method further comprises:
[0044] Based on the grid control parameters, the node coordinates and the node serial numbers of the reference nodes, and the node serial number of the to-be-determined node, the reference nodes perform coordinate transformation according to the iteration path with longitudinal priority, until the longitudinal serial number of the reference node is consistent with the longitudinal serial number of the to-be-determined node, to obtain the node coordinates and the node serial numbers of the intermediate node.
[0045] Based on the grid control parameters, the node coordinates and the node serial numbers of the intermediate node, and the node serial number of the to-be-determined node, the intermediate node continues to perform coordinate transformation according to the iteration path with transverse priority, until the transverse serial number of the intermediate node is consistent with the transverse serial number of the to-be-determined node, to obtain the node coordinates of the to-be-determined node.
[0046] The present application realizes the step-by-step accurate positioning of the node coordinates by dividing the iteration path of the reference node located on the center line of the river channel into two stages, effectively reduces the calculation complexity, guarantees the calculation speed, ensures the accuracy of the results, and provides a reliable basis for subsequent generation of high-quality river channel grid structure.
[0047] In an optional implementation, based on the node coordinates of all target nodes in the target node set, a grid structure of the target river channel is generated, including:
[0048] Based on the node coordinates of all target nodes, all target nodes are plotted in a target coordinate system.
[0049] For each transverse serial number, all target nodes with the same transverse serial number are connected to generate a plurality of transverse grid lines.
[0050] For each longitudinal serial number, all target nodes with the same longitudinal serial number are connected to generate a plurality of longitudinal grid lines.
[0051] Based on all target nodes, the plurality of longitudinal grid lines and the plurality of transverse grid lines, a grid structure of the target river channel is generated.
[0052] The present application can truly reflect the geometric characteristics of the target river channel by plotting all target nodes in the target coordinate system and generating longitudinal grid lines and transverse grid lines to generate a grid structure of the target river channel, thereby providing a high-quality data basis for subsequent river channel simulation, analysis and optimization.
[0053] In a second aspect, the present application provides a river channel grid generation device, which comprises:
[0054] A determination module is configured to determine grid control parameters of a target river channel in a river channel body coordinate system, and determine node coordinates and node serial numbers of reference nodes and node serial numbers of to-be-determined nodes, wherein the node coordinates indicate the geometric positions of the nodes, and the node serial numbers indicate the position indexes of the nodes.
[0055] The coordinate transformation module is configured to perform coordinate transformation on the reference node based on the grid control parameter, the node coordinate and the node number of the reference node, and the node number of the pending node, until the node number of the reference node is consistent with the node number of the pending node, and the node coordinate of the pending node is obtained.
[0056] The coordinate iteration module is configured to determine the pending node again by taking the pending node as a new reference node, and return to the step of performing coordinate transformation on the reference node based on the grid control parameter, the node coordinate and the node number of the reference node, and the node number of the pending node, until the node number of the reference node is consistent with the node number of the pending node, and the node coordinate of the pending node is obtained, until the node coordinates of all the pending nodes are obtained.
[0057] The screening module is configured to screen the target node set from all the pending nodes based on the grid control parameter.
[0058] The generating module is configured to generate the grid structure of the target river channel based on the node coordinates of all the target nodes in the target node set.
[0059] In a third aspect, the present application provides a computer device, comprising a memory and a processor, the memory and the processor are communicatively connected with each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the river channel grid generation method of the first aspect or any of the corresponding embodiments thereof.
[0060] In a fourth aspect, the present application provides a computer readable storage medium, which stores computer instructions, and the computer instructions are used to make a computer execute the river channel grid generation method of the first aspect or any of the corresponding embodiments thereof. BRIEF DESCRIPTION OF DRAWINGS
[0061] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the drawings needed in the specific embodiments or the prior art description will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.
[0062] Figure 1 is a flow chart of the river channel grid generation method according to an embodiment of the present application;
[0063] Figure 2 is a schematic diagram of moving the reference node to the pending node according to an embodiment of the present application;
[0064] Figure 3 is a flow chart of another river channel grid generation method according to an embodiment of the present application;
[0065] Figure 4 is a schematic diagram of a grid structure of a target river channel according to an embodiment of the present application;
[0066] Figure 5 is a structural block diagram of a river channel grid generation device according to an embodiment of the present application;
[0067] Figure 6 is a schematic diagram of a hardware structure of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0068] To make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0069] Currently, the structured grid of a curved river channel is mostly generated based on a Cartesian coordinate system, and the straight-line characteristics of the coordinate axes do not match the geometric shape of the curved river channel, which leads to that the generated grid is difficult to accurately describe the characteristics of the curved river channel. The present application establishes a mapping basis of a river channel body coordinate system and a Cartesian coordinate system by obtaining grid control parameters, and ensures that the finally generated grid conforms to the geometric characteristics of the river channel, which significantly improves the accuracy of the river channel grid.
[0070] According to an embodiment of the present application, a river channel grid generation method embodiment is provided. It should be noted that the steps shown in the flowchart of the drawings can be executed in a computer system such as a group of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0071] In the present embodiment, a river channel grid generation method is provided, which can be used in terminals such as computers, etc. Figure 1 is a flowchart of a river channel grid generation method according to an embodiment of the present application, as shown in Figure 1 The flowchart includes the following steps:
[0072] In step S101, the grid control parameters of the target river channel in the river channel body coordinate system are determined, and the node coordinates and node serial numbers of the reference nodes and the node serial numbers of the to-be-determined nodes are determined. The node coordinates indicate the geometric positions of the nodes in the Cartesian coordinate system, and the node serial numbers indicate the position indexes of the nodes.
[0073] Specifically, the target river channel is a curved river channel, and when a Cartesian coordinate system is directly used to generate a grid structure thereof, the grid cells are difficult to accurately match the characteristics of the curved river channel. The channel-fitted coordinate system is an orthogonal curvilinear coordinate system specially adapted to the geometric shape of the river channel, and is used to solve the limitations of the traditional Cartesian coordinate system in numerical simulation of the curved river channel. The core idea is to make the grid lines of the coordinate system as much as possible to fit the boundaries and flow direction of the river channel through coordinate transformation, so as to improve the accuracy and efficiency of numerical simulation. Therefore, the grid control parameters of the channel-fitted coordinate system are obtained to enable coordinate transformation based on the parameters. The grid control parameters include grid scale parameters, river channel geometric parameters, grid scale parameters, and weight coefficient parameters. More specifically, the grid scale parameters include the number of longitudinal grid line nodes and the number of transverse grid line nodes, which are used to define the calculation range and the total number of nodes; the river channel geometric parameters include the deflection angle of the river channel center line relative to the x-axis at the cross section where each node is located and the curvature radius of the river channel center line at the cross section where each node is located, which are used to ensure that the grid fits the shape of the river channel; the grid scale parameters include the longitudinal scale of the river channel center line between the cross sections where each two adjacent nodes on each longitudinal grid line are located and the transverse scale of the transverse grid line segment between each two adjacent nodes on each transverse grid line, which are used to control the grid density and adapt to the accuracy requirement; and the weight coefficient parameters include the deflection angle weight coefficient, the curvature radius weight coefficient, and the distance weight coefficient, which are used to fine-tune the orthogonality and symmetry of the grid.
[0074] Any node in the target river channel is selected as a reference node for coordinate transformation, and its Cartesian coordinates and node number are determined. The Cartesian coordinates represent the position of the node in the physical space, and each value in the coordinates has a clear physical meaning, such as (100m, 50m), while the node number represents the position index of the node in the grid, such as (5, 3) indicating the node located in the fifth row on the left bank upstream. The pending node is the starting point of coordinate conversion, and from this node, the node coordinates in the Cartesian coordinate system are iteratively calculated through coordinate transformation based on the grid control parameters of the channel-fitted coordinate system. Therefore, the node with the node number (1, 1) is usually selected as the initial pending node to sequentially implement the coordinate transformation iteration of all nodes. By obtaining the grid control parameters, the mapping basis of the channel-fitted coordinate system and the Cartesian coordinate system is established to ensure that the finally generated grid conforms to the geometric characteristics of the river channel, and the reference node and the starting point of iteration are clearly defined to provide a basis for subsequent coordinate calculation.
[0075] In step S102, based on the grid control parameters, the node coordinates and node number of the reference node, and the node number of the pending node, the reference node is subjected to coordinate transformation until the node number of the reference node is consistent with the node number of the pending node, and the node coordinates of the pending node are obtained.
[0076] Specifically, the reference node is moved step by step to the to-be-determined node through iteration, and the Cartesian coordinates are continuously calculated by using the grid control parameters of the river surface body coordinate system during the movement, until the node numbers of the two are consistent. When the numbers are consistent, it means that the reference node has been successfully "moved" to the position of the to-be-determined node, thereby obtaining the Cartesian coordinates of the to-be-determined node, so that the to-be-determined node can be fitted to the geometric characteristics of the curved river.
[0077] In step S103, the to-be-determined node is taken as a new reference node, and the to-be-determined node is re-determined, and the step of returning to the step of performing coordinate transformation on the reference node based on the grid control parameters, the node coordinates and the node number of the reference node, and the node number of the to-be-determined node, until the node number of the reference node is consistent with the node number of the to-be-determined node, and the node coordinates of the to-be-determined node are obtained, until the node coordinates of all to-be-determined nodes are obtained.
[0078] Specifically, the Cartesian coordinates of the to-be-determined node have been determined through the above steps, and the Cartesian coordinates are taken as a new reference node. Then, it is judged whether the longitudinal number of the to-be-determined node reaches the number of longitudinal grid lines. If not, the node located in the next column of the to-be-determined node is taken as a new to-be-determined node, that is, if the to-be-determined node is (i p ,j p ), the new to-be-determined node is (i p ,j p +1), and the coordinate transformation is continued in step S102. If the longitudinal number of the to-be-determined node reaches the number of longitudinal grid lines, it is judged whether the transverse number reaches the number of transverse grid lines. If not, the node with the node number (i p +1,j p ) is taken as a new to-be-determined node, that is, the coordinate transformation on the nodes in a column is restarted, and the coordinate transformation is continued in step S102. If it has reached, it means that all to-be-determined nodes have determined the Cartesian coordinates through coordinate transformation. This local iteration method avoids the global solving complexity of the traditional implicit method, and significantly improves the calculation efficiency.
[0079] In step S104, based on the grid control parameters, a target node set is screened from all to-be-determined nodes.
[0080] Specifically, in actual simulation, it may be necessary to adjust the density of the grid to adapt to different accuracy requirements. For example, some complex flow conditions require the use of high-density grids to achieve high simulation accuracy, while some not-so-complex flow conditions do not require the use of the same high-density grid. Through the screening operation, redundant nodes can be reduced, and the grid density can be flexibly controlled, so as to adapt to different simulation accuracy requirements without the need to regenerate the grid, thereby effectively reducing the calculation amount.
[0081] Step S105, generating the grid structure of the target river channel based on the node coordinates of all target nodes in the target node set.
[0082] Specifically, since the node coordinates of all target nodes are fitted to the geometric features of the target river channel, the grid lines of the grid structure constructed based on these target nodes can maintain good orthogonality near the center line of the river channel and can also adapt to the shape of the river channel at the boundary, thereby significantly improving the accuracy of the river channel grid.
[0083] The present application establishes the mapping basis of the river channel body coordinate system and the Cartesian coordinate system by obtaining the grid control parameters, ensures that the finally generated grid conforms to the geometric features of the river channel, and provides a reference for subsequent coordinate calculation by explicitly specifying the iteration starting point and the reference node. The reference node is gradually moved to the to-be-determined node through iteration, and the node coordinates are continuously calculated using the grid control parameters of the river channel body coordinate system during the movement process until the node numbers of the two are consistent, thereby obtaining the coordinates of the to-be-determined node. In this way, the to-be-determined node can be fitted to the geometric features of the target river channel. The above process is repeated, and the result of each iteration is used as the new starting point to obtain the node coordinates of all nodes. The final target node set is formed by screening, unnecessary nodes are removed, the grid structure is simplified, and key information is retained, thereby optimizing the quality and applicability of the grid. The grid structure generated based on the screened nodes can accurately reflect the geometric features of the target river channel, the grid lines can maintain good orthogonality near the center line of the river channel, and can also adapt to the shape of the river channel at the boundary, thereby significantly improving the accuracy of the river channel grid.
[0084] In the present embodiment, a river channel grid generation method is provided, which can be used in the terminal described above. The method specifically includes the following steps:
[0085] Step S201, determining the grid control parameters of the target river channel in the river channel body coordinate system, and determining the node coordinates and node number of the reference node and the node number of the to-be-determined node. The node coordinates indicate the geometric position of the node in the Cartesian coordinate system, and the node number indicates the position index of the node. For details, please refer to Figure 1 The step S101 of the embodiment shown in the figure will not be described here again.
[0086] Step S202, based on the grid control parameters, the node coordinates and node number of the reference node, and the node number of the to-be-determined node, performing coordinate transformation on the reference node until the node number of the reference node is consistent with the node number of the to-be-determined node, thereby obtaining the node coordinates of the to-be-determined node.
[0087] Specifically, the above step S202 includes:
[0088] Step S2021, determining the iteration path based on the node sequence number of the reference node and the node sequence number of the pending node, the node sequence number including the horizontal sequence number and the vertical sequence number.
[0089] In some optional embodiments, the step S2021 comprises:
[0090] Step a1, when the vertical sequence number of the reference node is inconsistent with the vertical sequence number of the pending node, and the horizontal sequence number of the reference node is consistent with the horizontal sequence number of the pending node, determining the iteration path as vertical priority. Specifically, if the node sequence number is (i, j), i represents the vertical sequence number and j represents the horizontal sequence number. When the reference node and the pending node have different vertical sequence numbers but the same horizontal sequence number, it means that they are on the same vertical grid line, but the specific positions on the vertical grid line are different, that is, the cross sections they pass through are different. At this time, the iteration path is determined as vertical priority, and iteration along the vertical direction can more directly reach the pending node from the reference node. Vertical priority helps to maintain the continuity and stability of the grid generation process in the vertical direction, and is more in line with the main direction characteristics of river flow, which is beneficial to the subsequent numerical simulation of physical phenomena such as water flow.
[0091] Step a2, when the horizontal sequence number of the reference node is inconsistent with the horizontal sequence number of the pending node, and the vertical sequence number of the reference node is consistent with the vertical sequence number of the pending node, determining the iteration path as horizontal priority. Specifically, when the horizontal sequence numbers of the reference node and the pending node are different, but the vertical sequence numbers are the same, it means that they are on the same cross section of the river, but the specific positions on the cross section are different. At this time, the iteration path is determined as horizontal priority, because in the same cross section, the change in the horizontal direction may be more critical to describe the geometric shape and physical characteristics of the river (such as the horizontal variation of river bed elevation, the horizontal distribution of flow velocity, etc.). By iterating in the horizontal direction first, the characteristics of the river in that cross section can be more accurately captured, providing a more accurate basis for subsequent numerical simulation.
[0092] Step a3, when the horizontal sequence number of the reference node is inconsistent with the horizontal sequence number of the pending node, and the vertical sequence number of the reference node is inconsistent with the vertical sequence number of the pending node, determining the iteration path as vertical priority or horizontal priority. Specifically, when the reference node and the pending node are inconsistent in both vertical and horizontal sequence numbers, the vertical priority or horizontal priority can be determined according to specific needs or experience.
[0093] Step a4, when the reference node is located at the river centerline of the target river, the iteration path is determined as first longitudinal and then transverse. Specifically, when the reference node is located at the river centerline, since the centerline plays an important role in describing the overall shape and flow characteristics of the river, the iteration is first performed in the longitudinal direction, so that the grid can better fit the overall trend of the river. Then the iteration is performed in the transverse direction, which can accurately construct the transverse grid perpendicular to the centerline on the basis of the determined longitudinal framework, so as to more accurately describe the cross-sectional shape of the river and the distribution of related physical quantities. By analyzing the reference node and the node number of the to-be-determined node, the iteration path in different cases is determined to ensure that the accurate grid structure can be constructed according to the specific characteristics of the river and the requirements of numerical simulation in the grid generation process.
[0094] In some optional embodiments, Figure 2 is a schematic diagram of the movement of the reference node according to an embodiment of the present application to the to-be-determined node, as Figure 2 shown, (i R ,j R ) represents the reference node, and (i p ,j p ) represents the to-be-determined node. Figure (a) is a schematic diagram of the movement of the reference node to the to-be-determined node through the iteration path of longitudinal priority, figure (b) is a schematic diagram of the movement of the reference node to the to-be-determined node through the iteration path of transverse priority, and figure (c) is a schematic diagram of the movement of the reference node to the to-be-determined node through the iteration path of longitudinal priority and transverse priority alternately.
[0095] Step S2022, based on the grid control parameters, the node coordinates and the node number of the reference node, and the node number of the to-be-determined node, the reference node is subjected to coordinate transformation according to the iteration path until the node number of the reference node is consistent with the node number of the to-be-determined node, and the node coordinates of the to-be-determined node are obtained. The grid control parameters include the longitudinal dimension of the river centerline segment between each two adjacent nodes on each longitudinal grid line, the transverse dimension of the transverse grid segment between each two adjacent nodes on each transverse grid line, the deflection angle of the river centerline at the cross section where each node is located relative to the x-axis, the radius of curvature of the river centerline at the cross section where each node is located, the deflection angle weight coefficient, the radius of curvature weight coefficient, and the distance weight coefficient.
[0096] In some optional embodiments, when the iteration path is longitudinal priority, the above step S2022 includes:
[0097] Step b1, based on the node number of the reference node, the node number of the next node on the longitudinal grid line where the reference node is located is determined. Specifically, the node number of the next node on the longitudinal grid line where the reference node (i p ,j p) the next node in topological sense and determine its node serial number (i', j), to ensure the iteration advancing along the shortest longitudinal path to the pending node and avoiding redundant calculation. More specifically, if i p , then i' = i + 1; if i > i p , then i' = i - 1.
[0098] Step b2, determine the first transverse distance of the reference node to the river centerline and the second transverse distance of the next node to the river centerline. Specifically, the first transverse distance and the second transverse distance of the reference node and the next node to the river centerline are determined by the following formula (1).
[0099]
[0100] wherein (i, j) represents the node serial number of the reference node or the next node; n i,j) represents the first transverse distance or the second transverse distance between the node (i, j) and the river centerline; j C represents the transverse serial number of the node which is on the same transverse grid line with the node (i, j) and simultaneously on the river centerline of the target river; represents the transverse serial number of the node which is on the same transverse grid line with the node (i, j) and simultaneously between the node (i, j C ) and the node (i, j C ) including (i, j C ) but not including (i, j); represents the serial number of the next node including (i, j) on the same transverse grid line with the node (i, j) and topologically closer to (i, j) than (i', j C ), that is, if j > j C , if j < j C , represents the transverse dimension between the node and , which can be arbitrarily selected according to the needs of grid density, but should ensure that the sum of the transverse dimensions of all transverse grid line segments on the same transverse grid line equals the width of the river cross section to which the transverse grid line conforms.
[0101] In step b3, the weighted average lateral distance is determined based on the first lateral distance, the second lateral distance and the distance weight coefficient, the weighted average deflection angle is determined based on the deflection angle of the reference node, the deflection angle of the next node and the deflection angle weight coefficient, and the weighted average radius of curvature is determined based on the radius of curvature of the reference node, the radius of curvature of the next node and the radius of curvature weight coefficient. Specifically, the weighted average value of the first lateral distance and the second lateral distance is determined as the weighted average lateral distance by the following formula (2) to describe the position of the longitudinal grid line segment between the reference node (i, j) and the next node (i', j) deviating from the river center line, thereby affecting the curvature correction of the coordinate transformation. The weighted average deflection angle is determined by the following formula (3). The weighted average radius of curvature is determined by the following formula (4) to ensure that the longitudinal grid line segment between the reference node and the next node conforms to the bending trend of the river.
[0102]
[0103] wherein, represents the weighted average lateral distance; n (i,j) represents the first lateral distance of the reference node to the river center line; n (i′,j) represents the second lateral distance of the next node to the river center line; represents the distance weight coefficient.
[0104]
[0105] wherein, represents the weighted average deflection angle; θ i represents the deflection angle of the river center line at the cross section where the reference node is located; θ i′ represents the deflection angle of the river center line at the cross section where the next node is located; represents the deflection angle weight coefficient.
[0106]
[0107] wherein, represents the weighted average radius of curvature; R i represents the radius of curvature of the river center line at the cross section where the reference node is located; R i' represents the radius of curvature of the river center line at the cross section where the next node is located; represents the radius of curvature weight coefficient.
[0108] Step b4: Based on the node number of the reference node, the node number of the next node, the longitudinal scale between the reference node and the next node, the weighted average deflection angle, the weighted average radius of curvature, and the weighted average lateral distance, determine the first x-axis increment and the first y-axis increment. Specifically, based on the transformation relationship between the riverbed-fitted coordinate system and the Cartesian coordinate system, derive the coordinate increment for longitudinal movement using the following equation (5) to ensure that the grid lines conform to the geometric features of the riverbed.
[0109]
[0110] Where, Δx (i,j)→(i′,j) and Δy (i,j)→(i′,j) These represent the first x-axis increment and the first y-axis increment, respectively; i represents the vertical index of the reference node; i′ represents the vertical index of the next node; Indicates the weighted average horizontal distance; Indicates the weighted average radius of curvature; Indicates the weighted average deflection angle; This represents the longitudinal scale between the reference node (i,j) and the next node (i′,j). It can be arbitrarily selected according to the density requirements of the grid, but it should be ensured that the sum of the longitudinal scales of the river centerline segments between all pairs of adjacent cross sections is equal to the length of the river centerline.
[0111] Step b5: Based on the node coordinates of the reference node, the first x-axis increment, and the first y-axis increment, determine the node coordinates of the next node. Specifically, as shown in equation (6), the first x-axis increment is added to the x-axis coordinate of the reference node, and the first y-axis increment is added to the y-axis coordinate to obtain the node coordinates of the next node. Since these node coordinates are obtained through coordinate transformation between the riverbed-fitted coordinate system and the Cartesian coordinate system, they conform to the river characteristics of the target river.
[0112]
[0113] Where, x (i′,j) and y (i′,j) These represent the x-axis and y-axis coordinates of the next node, respectively; x (i,j) and y (i,j) These represent the x-axis and y-axis coordinates of the reference node, respectively; Δx (i,j)→(i′,j) and Δy (i,j)→(i ′ ,j) These represent the first x-axis increment and the first y-axis increment, respectively.
[0114] Step b6, taking the next node as the new reference node, judging whether the node sequence number of the reference node is consistent with the node sequence number of the pending node. Specifically, taking the next node as the new reference node, at this time judging whether the node sequence number of the reference node is consistent with the node sequence number of the pending node, if consistent, taking the node coordinate of the reference node at this time as the node coordinate of the pending node, if inconsistent, the reference node still needs to move to the pending node.
[0115] Step b7, when the node sequence number of the reference node is inconsistent with the node sequence number of the pending node, returning to the step of determining the iteration path based on the node sequence number of the reference node and the node sequence number of the pending node until the node sequence number of the reference node is consistent with the node sequence number of the pending node, taking the node coordinate of the reference node as the node coordinate of the pending node. Specifically, when the node sequence number of the reference node is inconsistent with the node sequence number of the pending node, returning to step S2021 to re-determine the iteration path and perform coordinate transformation again until the node sequence number of the reference node is consistent with the node sequence number of the pending node to obtain the coordinate of the pending node that fits the river feature.
[0116] In some optional embodiments, when the iteration path is transverse priority, the above step S2022 includes:
[0117] Step c1, based on the node sequence number of the reference node, determining the node sequence number of the next node on the transverse grid line where the reference node is located. Specifically, determining the next node on the transverse grid line where the reference node (i, j) is located that is closer to the pending node (i p ,j p ) in the topological sense, and determining its node sequence number (i, j'), ensuring that the iteration advances to the pending node along the shortest transverse path and avoiding redundant calculation. More specifically, if j p , then j' = j + 1; if j > j p , then j' = j - 1.
[0118] Step c2, based on the node sequence number of the reference node, the node sequence number of the next node, the transverse dimension between the reference node and the next node, and the deflection angle of the reference node, determining the second x-axis increment and the second y-axis increment. Specifically, according to the transformation relationship between the river surface coordinate system and the Cartesian coordinate system, the coordinate increment of transverse movement is derived by the following formula (7) to ensure that the grid line fits the geometric feature of the river.
[0119]
[0120] where Δx (i,j)→(i,j′) and Δy (i,j)→(i,j′) represent the second x-axis increment and the second y-axis increment, respectively; j represents the transverse sequence number of the reference node; j' represents the transverse sequence number of the next node; θ i represents the deflection angle of the river centerline at the cross section where the reference node is located. This represents the lateral scale between the reference node (i,j) and the next node (i,j′).
[0121] Step c3: Based on the node coordinates of the reference node, the second x-axis increment, and the second y-axis increment, determine the node coordinates of the next node. Specifically, as shown in equation (8), the second x-axis increment is added to the x-axis coordinate of the reference node, and the second y-axis increment is added to the y-axis coordinate to obtain the node coordinates of the next node. Since these node coordinates are obtained through coordinate transformation between coordinate systems, they conform to the channel characteristics of the target river.
[0122]
[0123] Where, x (i,j′) and y (i,j′) These represent the x-axis and y-axis coordinates of the next node, respectively; x (i,j) and y (i,j) These represent the x-axis and y-axis coordinates of the reference node, respectively; Δx (i,j)→(i,j′) and Δy (i,j)→(i,j′) These represent the second x-axis increment and the second y-axis increment, respectively.
[0124] Step c4: Take the next node as the new reference node and determine whether the node number of the reference node matches the node number of the node to be determined. For details, please refer to step b6, which will not be repeated here.
[0125] Step c5: If the node number of the reference node is inconsistent with the node number of the node to be determined, return to the step of determining the iteration path based on the node numbers of the reference node and the node number of the node to be determined, until the node number of the reference node is consistent with the node number of the node to be determined, and then use the node coordinates of the reference node as the node coordinates of the node to be determined. For details, please refer to step b7, which will not be repeated here.
[0126] In some optional implementations, steps b7 and c5 both return to step S2021 to redetermine the iteration path before performing coordinate transformation. In practical applications, to simplify calculations, it may not be necessary to redetermine the iteration path. That is, after step b7, the vertical priority iteration path is used to perform coordinate transformation until the node numbers of the reference node and the node to be determined are consistent. After step c5, the horizontal priority iteration path is used to perform coordinate transformation until the node numbers of the reference node and the node to be determined are consistent.
[0127] In some optional implementations, when the iteration path is first vertical and then horizontal, step S2022 above includes:
[0128] Step d1, based on the grid control parameters, the node coordinates and node serial numbers of the reference node and the node serial number of the to-be-determined node, the reference node is subjected to coordinate transformation according to the longitudinal-priority iterative path until the longitudinal serial number of the reference node is consistent with the longitudinal serial number of the to-be-determined node, and the node coordinates and node serial number of the intermediate node are obtained. Specifically, if the reference node is located on the river center line, the reference node is first moved to a position consistent with the longitudinal serial number of the to-be-determined node according to the longitudinal-priority iterative path through steps b1 to b7 (the iterative path is not re-determined when step b7 is executed), and an intermediate node located at the current position, its node coordinates and node serial number are obtained.
[0129] Step d2, based on the grid control parameters, the node coordinates and node serial numbers of the intermediate node and the node serial number of the to-be-determined node, the intermediate node is subjected to coordinate transformation according to the transverse-priority iterative path until the longitudinal serial number of the intermediate node is consistent with the longitudinal serial number of the to-be-determined node, and the node coordinates of the to-be-determined node are obtained. Specifically, the intermediate node is moved to a position consistent with the longitudinal serial number of the to-be-determined node according to the transverse-priority iterative path through steps c1 to c5 (the iterative path is not re-determined when step c5 is executed), and the node coordinates of the to-be-determined node are obtained.
[0130] Step S203, the to-be-determined node is taken as a new reference node, the to-be-determined node is re-determined, and the step of determining the to-be-determined node based on the grid control parameters, the node coordinates and node serial numbers of the reference node and the node serial number of the to-be-determined node, and the reference node is subjected to coordinate transformation until the node serial number of the reference node is consistent with the node serial number of the to-be-determined node, and the node coordinates of the to-be-determined node are obtained is returned, until the node coordinates of all to-be-determined nodes are obtained. For details, please refer to Figure 1 Step S103 of the embodiment shown in FIG. 1 is not repeated here.
[0131] Step S204, based on the grid control parameters, a target node set is screened from all to-be-determined nodes. For details, please refer to Figure 1 Step S104 of the embodiment shown in FIG. 1 is not repeated here.
[0132] In some alternative implementations, if the iteration path is longitudinal first and then transverse, meaning the reference node is located on the river centerline, and if the number of longitudinal grid lines in the grid control parameters is even (e.g., 8), then with the longitudinal grid lines being basically evenly distributed, the river centerline lies between the 4th and 5th longitudinal grid lines, meaning no longitudinal grid line coincides with the river centerline. In this case, a hypothetical longitudinal grid line coinciding with the river centerline can be created and designated as the 5th longitudinal grid line. The original 5th, 6th, 7th, and 8th longitudinal grid lines are then designated as the 6th, 7th, 8th, and 9th longitudinal grid lines, respectively, to ensure the iteration follows the longitudinal first and then transverse iteration path. In this scenario, target nodes for creating the hypothetical longitudinal grid line need to be selected from the undetermined nodes so that this hypothetical longitudinal grid line is not reflected in the final grid structure.
[0133] Step S205: Generate the grid structure of the target river channel based on the node coordinates of all target nodes in the target node set.
[0134] Specifically, step S205 includes:
[0135] Step S2051: Based on the node coordinates of all target nodes, draw all target nodes in the target coordinate system. Specifically, the target coordinate system adopts a Cartesian coordinate system. By visualizing the discrete target nodes as geometric points in this coordinate system, the foundation for the topology construction of the structured mesh is laid.
[0136] Step S2052: For each horizontal index, connect all target nodes of the vertical indices to generate multiple vertical grid lines. Specifically, for each horizontal index, for example j... p =1, j p =1, i p =1,2,...,N i The target nodes are connected in ascending order of their vertical numbers to form a vertical grid line. This grid line extends along the river's flow direction, and its curvature is determined by the deflection angle and radius of curvature of the target nodes located on the river's centerline. This grid line visually reflects the river's orientation in the longitudinal flow direction. Wherein, N... i This indicates the number of nodes on the vertical grid lines.
[0137] Step S2053: For each vertical index, connect all target nodes of the horizontal indices to generate multiple horizontal grid lines. Specifically, for each vertical index, for example i... p =1, change i p =1,j p =1,2,...,N jThe target nodes are connected in ascending order of horizontal serial number to form a horizontal grid line, which is perpendicular to the tangent direction of the river center line and reflects the shape and characteristics of the target river in the cross section. Among them, N j represents the number of nodes on the horizontal grid line.
[0138] In step S2054, the grid structure of the target river is generated based on all the target nodes, the plurality of longitudinal grid lines and the plurality of horizontal grid lines. Specifically, all the target nodes are taken as the vertices of the grid cells, the line segments of the longitudinal grid lines between the two target nodes adjacent in the longitudinal direction are taken as the edges between the grid cells, and the line segments of the horizontal grid lines between the two target nodes adjacent in the horizontal direction are taken as the edges between the grid cells, and a regular quadrilateral grid cell is formed by topological connection. This structured grid completely reproduces the curved boundary and flow characteristics of the river through the geometric relationship between the vertices and edges of each grid cell, ensures that the grid cells in the vicinity of the river center line have good orthogonality, and the grid cells at the boundary naturally fit the shape of the riverbank through the geometric adaptability of the coordinate transformation, so that the finally generated grid structure provides a high-precision calculation basis for the numerical simulation of the curved river.
[0139] In some optional embodiments, Figure 3 is a flow chart of another river grid generation method according to an embodiment of the present application, as shown in Figure 3As shown, first, the grid control parameters of the river body coordinate system are determined, and the node coordinates and node serial numbers of the reference nodes and the to-be-determined nodes are determined. Then, based on the node serial numbers of the two, the iteration path is determined. When the longitudinal-priority iteration path is adopted, the node serial number of the next node close to the to-be-determined node on the longitudinal grid line is determined. Then, the weighted average transverse distance, the weighted average deflection angle and the weighted average radius of curvature are determined, and the first x-axis increment and the first y-axis increment are determined in combination with the reference node and the to-be-determined node. Then, the node coordinates of the next node are determined through the two increments, and the next node is taken as a new reference node. Then, it is judged whether the node serial numbers of the reference node and the to-be-determined node are the same, if yes, the node coordinates of the to-be-determined node are obtained, and if not, the iteration path is determined again to perform coordinate transformation again. When the transverse-priority iteration path is adopted, the node serial number of the next node close to the to-be-determined node on the transverse grid line is determined. Then, the second x-axis increment and the second y-axis increment are determined. Then, the node coordinates of the next node are determined through the two increments, and the next node is taken as a new reference node. Then, it is judged whether the node serial numbers of the reference node and the to-be-determined node are the same, if yes, the node coordinates of the to-be-determined node are obtained, and if not, the iteration path is determined again to perform coordinate transformation again. When the longitudinal-transverse iteration path is adopted, the node coordinates of the to-be-determined node are obtained by referring to the processing procedures of the above two iteration paths. Then, the target node set is screened from all the to-be-determined nodes, and the grid structure of the target river body is generated based on the set.
[0140] In some optional embodiments, Figure 4 is a schematic diagram of the grid structure of a target river body according to an embodiment of the present application, as Figure 4 As shown, the grid structure obtained by the river body generation method provided by the embodiment of the present application can accurately reflect the geometric characteristics of the target river body, and the grid lines thereof can keep good orthogonality near the river body center line and can also adapt to the shape of the river body at the boundary.
[0141] The application establishes the mapping basis of the river body coordinate system and the Cartesian coordinate system by acquiring the grid control parameters, ensures that the finally generated grid conforms to the geometric characteristics of the river, and provides a reference for subsequent coordinate calculation by clearly defining the iteration starting point and the reference node. The reference node is gradually moved to the to-be-determined node through iteration, and the node coordinates are continuously calculated by using the grid control parameters of the river body coordinate system during the movement, until the node numbers of the two are consistent, so as to obtain the coordinates of the to-be-determined node. In this way, the to-be-determined node can be fitted to the geometric characteristics of the target river. The above process is repeated, and the result of each iteration is used as a new starting point to obtain the node coordinates of all nodes. The final target node set is formed by screening, unnecessary nodes are removed, the grid structure is simplified, and the key information is retained, thereby optimizing the quality and applicability of the grid. The grid structure generated based on the screened nodes can accurately reflect the geometric characteristics of the target river, and the grid lines near the center line of the river can maintain good orthogonality, and can also adapt to the shape of the river at the boundary, thereby significantly improving the accuracy of the river grid.
[0142] In the embodiment, a river grid generation device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware or a combination of software and hardware is also possible and contemplated.
[0143] The embodiment provides a river grid generation device, as shown in Figure 5 The device comprises:
[0144] The determining module 501 is configured to determine the grid control parameters of the target river in the river body coordinate system, and determine the node coordinates and node numbers of the reference node and the node numbers of the to-be-determined node. The node coordinates indicate the geometric position of the node, and the node numbers indicate the position index of the node.
[0145] The coordinate transformation module 502 is configured to perform coordinate transformation on the reference node based on the grid control parameters, the node coordinates and node numbers of the reference node, and the node numbers of the to-be-determined node, until the node numbers of the reference node and the node numbers of the to-be-determined node are consistent, and obtain the node coordinates of the to-be-determined node.
[0146] The coordinate iteration module 503 is configured to take the to-be-determined node as a new reference node, re-determine the to-be-determined node, and return to the step of performing coordinate transformation on the reference node based on the grid control parameters, the node coordinates and node numbers of the reference node, and the node numbers of the to-be-determined node, until the node numbers of the reference node and the node numbers of the to-be-determined node are consistent, and obtain the node coordinates of the to-be-determined node, until the node coordinates of all to-be-determined nodes are obtained.
[0147] The screening module 504 is configured to screen the target node set from all the pending nodes based on the grid control parameters.
[0148] The generating module 505 is configured to generate the grid structure of the target river channel based on the node coordinates of all the target nodes in the target node set.
[0149] In some optional embodiments, the coordinate transformation module 502 comprises:
[0150] The first determining unit is configured to determine the iteration path based on the node sequence number of the reference node and the node sequence number of the pending node.
[0151] The coordinate transformation unit is configured to perform coordinate transformation on the reference node according to the iteration path until the node sequence number of the reference node is consistent with the node sequence number of the pending node, so as to obtain the node coordinate of the pending node, based on the grid control parameters, the node coordinate and the node sequence number of the reference node, and the node sequence number of the pending node.
[0152] In some optional embodiments, the node sequence number comprises a horizontal sequence number and a vertical sequence number.
[0153] The first determining unit comprises:
[0154] The first determining sub-unit is configured to determine the iteration path as vertical priority when the vertical sequence number of the reference node is inconsistent with the vertical sequence number of the pending node and the horizontal sequence number of the reference node is consistent with the horizontal sequence number of the pending node.
[0155] The second determining sub-unit is configured to determine the iteration path as horizontal priority when the horizontal sequence number of the reference node is inconsistent with the horizontal sequence number of the pending node and the vertical sequence number of the reference node is consistent with the vertical sequence number of the pending node.
[0156] The third determining sub-unit is configured to determine the iteration path as vertical priority or horizontal priority when the horizontal sequence number of the reference node is inconsistent with the horizontal sequence number of the pending node and the vertical sequence number of the reference node is inconsistent with the vertical sequence number of the pending node.
[0157] The fourth determining sub-unit is configured to determine the iteration path as vertical priority first and then horizontal priority when the reference node is located on the river center line of the target river channel.
[0158] In some optional embodiments, the iteration path is vertical priority, and the grid control parameters comprise a vertical dimension of a river center line segment between every two adjacent nodes on each vertical grid line, a deflection angle of the river center line relative to the x-axis at each cross section where the nodes are located, a radius of curvature of the river center line at each cross section where the nodes are located, a deflection angle weight coefficient, a radius of curvature weight coefficient, and a distance weight coefficient.
[0159] The coordinate transformation unit comprises:
[0160] The first serial number determining subunit is configured to determine the serial number of the next node on the longitudinal grid line where the reference node is located based on the serial number of the reference node.
[0161] The distance determining subunit is configured to determine a first transverse distance from the reference node to the center line of the river and a second transverse distance from the next node to the center line of the river.
[0162] The fifth determining subunit is configured to determine a weighted average transverse distance based on the first transverse distance, the second transverse distance, and a distance weight coefficient, determine a weighted average deflection angle based on the deflection angle of the reference node, the deflection angle of the next node, and a deflection angle weight coefficient, and determine a weighted average radius of curvature based on the radius of curvature of the reference node, the radius of curvature of the next node, and a radius of curvature weight coefficient.
[0163] The first increment determining subunit is configured to determine a first x-axis increment and a first y-axis increment based on the serial number of the reference node, the serial number of the next node, a longitudinal dimension between the reference node and the next node, the weighted average deflection angle, the weighted average radius of curvature, and the weighted average transverse distance.
[0164] The first coordinate determining subunit is configured to determine the node coordinates of the next node based on the node coordinates of the reference node, the first x-axis increment, and the first y-axis increment.
[0165] The first judging subunit is configured to take the next node as a new reference node and judge whether the serial number of the reference node is consistent with the serial number of the pending node.
[0166] The sixth determining subunit is configured to return to the step of determining the iterative path based on the serial number of the reference node and the serial number of the pending node until the serial number of the reference node is consistent with the serial number of the pending node, and take the node coordinates of the reference node as the node coordinates of the pending node, when the serial number of the reference node is not consistent with the serial number of the pending node.
[0167] In some optional embodiments, the iterative path is transverse-priority, and the grid control parameters comprise a transverse dimension of a transverse grid line segment between every two adjacent nodes on each transverse grid line.
[0168] The coordinate transformation unit further comprises:
[0169] The second serial number determining subunit is configured to determine the serial number of the next node on the transverse grid line where the reference node is located based on the serial number of the reference node.
[0170] a second delta determination subunit configured to determine a second x-axis delta and a second y-axis delta based on the node sequence number of the reference node, the node sequence number of the next node, a lateral dimension between the reference node and the next node, and a deflection angle of the reference node.
[0171] a second coordinate determination subunit configured to determine node coordinates of the next node based on the node coordinates of the reference node, the second x-axis delta, and the second y-axis delta.
[0172] a second judgment subunit configured to determine whether the node sequence number of the reference node is consistent with the node sequence number of the pending node by taking the next node as a new reference node.
[0173] a seventh determination subunit configured to return to the step of determining the iteration path based on the node sequence number of the reference node and the node sequence number of the pending node until the node sequence number of the reference node is consistent with the node sequence number of the pending node, and to take the node coordinates of the reference node as the node coordinates of the pending node, when the node sequence number of the reference node is not consistent with the node sequence number of the pending node.
[0174] In some optional embodiments, the iteration path is first longitudinal and then lateral.
[0175] The coordinate transformation unit further includes:
[0176] an eighth determination subunit configured to cause the reference node to perform coordinate transformation according to a longitudinal-first iteration path based on the grid control parameters, the node coordinates and the node sequence number of the reference node, and the node sequence number of the pending node, until the lateral sequence number of the reference node is consistent with the lateral sequence number of the pending node, to obtain node coordinates and a node sequence number of an intermediate node.
[0177] a ninth determination subunit configured to cause the intermediate node to continue performing coordinate transformation according to a lateral-first iteration path based on the grid control parameters, the node coordinates and the node sequence number of the intermediate node, and the node sequence number of the pending node, until the longitudinal sequence number of the intermediate node is consistent with the longitudinal sequence number of the pending node, to obtain the node coordinates of the pending node.
[0178] In some optional embodiments, the generation module 505 includes:
[0179] a drawing unit configured to draw all the target nodes in the target coordinate system based on the node coordinates of all the target nodes.
[0180] a first generation unit configured to connect all the target nodes of the same longitudinal sequence number to generate a plurality of longitudinal grid lines.
[0181] a second generation unit configured to connect all the target nodes of the same lateral sequence number to generate a plurality of lateral grid lines.
[0182] The third generation unit is used to generate the grid structure of the target river channel based on all target nodes, multiple vertical grid lines, and multiple horizontal grid lines.
[0183] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0184] In this embodiment, the river grid generation device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0185] This invention also provides a computer device having the above-described features. Figure 5 The shown is a river grid generation device.
[0186] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 6 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 6 Take a processor 10 as an example.
[0187] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0188] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.
[0189] The memory 20 can include a program storage area and a data storage area, where the program storage area can store an operating system, application programs required for at least one function, and the data storage area can store data created according to the use of the computer device, etc. In addition, the memory 20 can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some alternative embodiments, the memory 20 can optionally include a memory disposed remotely from the processor 10, which can be connected to the computer device through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0190] The memory 20 can include a volatile memory, such as a random access memory, and can also include a non-volatile memory, such as a flash memory, a hard disk, or a solid state disk, and can also include a combination of the above-mentioned types of memories.
[0191] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30, and the output device 40 can be connected by a bus or other means, Figure 6 For example, by a bus connection.
[0192] The input device 30 can receive input digital or character information, and generate key signal inputs related to the user settings and function controls of the computer device, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointing stick, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 can include a display device, an auxiliary lighting device (e.g., an LED), a tactile feedback device (e.g., a vibration motor), etc. The display device includes, but is not limited to, a liquid crystal display, a light-emitting diode, a display, and a plasma display. In some alternative embodiments, the display device can be a touch screen.
[0193] The embodiments of the present application further provide a computer readable storage medium, and the method according to the embodiments of the present application can be implemented in hardware, firmware, or recorded in a storage medium, or stored in a remote storage medium or a non-transitory machine readable storage medium and downloaded to a local storage medium through network, so that the method described herein can be processed by such software on a storage medium using a general purpose computer, a special purpose processor, or programmable or special hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid state disk, etc. Further, the storage medium can also include a combination of the above-mentioned memories. It can be understood that the computer, the processor, the microprocessor controller, or the programmable hardware includes a storage component that can store or receive software or computer code, when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.
[0194] Part of the present application can be applied as a computer program product, for example, computer program instructions, when executed by a computer, the operation of the computer can invoke or provide the method and / or technical solutions according to the present application. Those skilled in the art should understand that the form of computer program instructions in computer readable medium includes but is not limited to source file, executable file, installation package file, etc. Correspondingly, the way of computer program instructions executed by computer includes but is not limited to: the computer directly executes the instructions, or the computer compiles the instructions and then executes the corresponding compiled program, or the computer reads and executes the instructions, or the computer reads and installs the instructions and then executes the corresponding installed program. Here, the computer readable medium can be any available computer readable storage medium or communication medium accessible to the computer.
[0195] Although the embodiments of the present application are described in conjunction with the accompanying drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present application, and such modifications and changes fall within the scope defined by the appended claims.
Claims
1. A riverway mesh generation method characterized by comprising: The method comprises: determining grid control parameters of a target river channel in a river channel body coordinate system, and determining node coordinates and node numbers of reference nodes and node numbers of to-be-determined nodes, the node coordinates indicating geometric positions of the nodes in a Cartesian coordinate system, and the node numbers indicating position indexes of the nodes; based on the grid control parameters, the node coordinates and node numbers of the reference nodes, and the node numbers of the to-be-determined nodes, performing coordinate transformation on the reference nodes until the node numbers of the reference nodes are consistent with the node numbers of the to-be-determined nodes, to obtain the node coordinates of the to-be-determined nodes; taking the to-be-determined nodes as new reference nodes, re-determining the to-be-determined nodes, and returning to the step of performing coordinate transformation on the reference nodes based on the grid control parameters, the node coordinates and node numbers of the reference nodes, and the node numbers of the to-be-determined nodes until the node numbers of the reference nodes are consistent with the node numbers of the to-be-determined nodes, to obtain the node coordinates of the to-be-determined nodes, until the node coordinates of all to-be-determined nodes are obtained; based on the grid control parameters, screening target nodes from all to-be-determined nodes to obtain a target node set; based on the node coordinates of all target nodes in the target node set, generating a grid structure of the target river channel.
2. The method of claim 1, wherein, The step of performing coordinate transformation on the reference nodes based on the grid control parameters, the node coordinates and node numbers of the reference nodes, and the node numbers of the to-be-determined nodes until the node numbers of the reference nodes are consistent with the node numbers of the to-be-determined nodes to obtain the node coordinates of the to-be-determined nodes comprises: determining an iteration path based on the node numbers of the reference nodes and the node numbers of the to-be-determined nodes; based on the grid control parameters, the node coordinates and node numbers of the reference nodes, and the node numbers of the to-be-determined nodes, performing coordinate transformation on the reference nodes according to the iteration path until the node numbers of the reference nodes are consistent with the node numbers of the to-be-determined nodes, to obtain the node coordinates of the to-be-determined nodes.
3. The method of claim 2, wherein, The node numbers comprise a horizontal number and a vertical number. The step of determining an iteration path based on the node numbers of the reference nodes and the node numbers of the to-be-determined nodes comprises: when the vertical number of the reference node is inconsistent with the vertical number of the to-be-determined node, and the horizontal number of the reference node is consistent with the horizontal number of the to-be-determined node, determining the iteration path as vertical priority; when the horizontal number of the reference node is inconsistent with the horizontal number of the to-be-determined node, and the vertical number of the reference node is consistent with the vertical number of the to-be-determined node, determining the iteration path as horizontal priority; when the horizontal number of the reference node is inconsistent with the horizontal number of the to-be-determined node, and the vertical number of the reference node is inconsistent with the vertical number of the to-be-determined node, determining the iteration path as vertical priority or horizontal priority; when the reference node is located on a river center line of the target river channel, determining the iteration path as vertical priority first and then horizontal priority.
4. The method of claim 3, wherein, The iterative path is longitudinal priority, and the grid control parameters include a longitudinal dimension of a river center line segment between cross sections of each two adjacent nodes on a longitudinal grid line, a deflection angle of the river center line at the cross section of each node relative to an x-axis, a radius of curvature of the river center line at the cross section of each node, a deflection angle weight coefficient, a radius of curvature weight coefficient, and a distance weight coefficient; The method for determining the node coordinates of the to-be-determined nodes based on the grid control parameters, the node coordinates and the node numbers of the reference nodes, and the node numbers of the to-be-determined nodes comprises the following steps of: determining the node number of the next node on the longitudinal grid line where the reference node is located based on the node number of the reference node; determining a first transverse distance from the reference node to the river center line and a second transverse distance from the next node to the river center line; determining a weighted average transverse distance based on the first transverse distance, the second transverse distance, and the distance weight coefficient, determining a weighted average deflection angle based on the deflection angle of the reference node, the deflection angle of the next node, and the deflection angle weight coefficient, and determining a weighted average radius of curvature based on the radius of curvature of the reference node, the radius of curvature of the next node, and the radius of curvature weight coefficient; determining a first x-axis increment and a first y-axis increment based on the node number of the reference node, the node number of the next node, the longitudinal dimension between the reference node and the next node, the weighted average deflection angle, the weighted average radius of curvature, and the weighted average transverse distance; determining the node coordinates of the next node based on the node coordinates of the reference node, the first x-axis increment, and the first y-axis increment; determining whether the node number of the reference node is consistent with the node number of the to-be-determined node by taking the next node as a new reference node; when the node number of the reference node is not consistent with the node number of the to-be-determined node, returning to the step of determining the iterative path based on the node number of the reference node and the node number of the to-be-determined node until the node number of the reference node is consistent with the node number of the to-be-determined node, and taking the node coordinates of the reference node as the node coordinates of the to-be-determined node.
5. The method of claim 3, wherein, The iterative path is transverse priority, and the grid control parameters include a transverse dimension of a transverse grid segment between each two adjacent nodes on a transverse grid line; The method for determining the node coordinates of the to-be-determined nodes based on the grid control parameters, the node coordinates and the node numbers of the reference nodes, and the node numbers of the to-be-determined nodes further comprises the following steps of: determining the node number of the next node on the transverse grid line where the reference node is located based on the node number of the reference node; determining a second x-axis increment and a second y-axis increment based on the node serial number of the reference node, the node serial number of the next node, a lateral dimension between the reference node and the next node, and a deflection angle of the reference node; determining a node coordinate of the next node based on the node coordinate of the reference node, the second x-axis increment, and the second y-axis increment; determining whether the node serial number of the reference node is consistent with the node serial number of the pending node, taking the next node as a new reference node; when the node serial number of the reference node is not consistent with the node serial number of the pending node, returning to the step of determining the iteration path based on the node serial number of the reference node and the node serial number of the pending node until the node serial number of the reference node is consistent with the node serial number of the pending node, and taking the node coordinate of the reference node as the node coordinate of the pending node.
6. The method of claim 3, wherein, the iteration path is first longitudinal and then lateral; the method further comprises: based on the grid control parameters, the node coordinate and the node serial number of the reference node, and the node serial number of the pending node, making the reference node perform coordinate transformation according to a longitudinal-first iteration path until the longitudinal serial number of the reference node is consistent with the longitudinal serial number of the pending node, to obtain a node coordinate and a node serial number of an intermediate node; based on the grid control parameters, the node coordinate and the node serial number of the intermediate node, and the node serial number of the pending node, making the intermediate node continue to perform coordinate transformation according to the lateral-first iteration path until the longitudinal serial number of the intermediate node is consistent with the longitudinal serial number of the pending node, to obtain the node coordinate of the pending node.
7. The method of claim 1, wherein, the method of generating the grid structure of the target river channel based on the node coordinates of all the target nodes in the target node set comprises: drawing all the target nodes in a target coordinate system based on the node coordinates of all the target nodes; connecting all the target nodes of the same longitudinal serial number to generate a plurality of longitudinal grid lines; connecting all the target nodes of the same lateral serial number to generate a plurality of lateral grid lines; generating the grid structure of the target river channel based on all the target nodes, the plurality of longitudinal grid lines, and the plurality of lateral grid lines.
8. A riverway mesh generation apparatus characterized by comprising: the device comprises: a determination module configured to determine grid control parameters of a target river channel in a river channel body coordinate system, and determine a node coordinate and a node serial number of a reference node and a node serial number of a pending node, the node coordinate indicating a geometric position of a node, and the node serial number indicating a position index of the node; The coordinate transformation module is configured to perform coordinate transformation on the reference node based on the grid control parameter, the node coordinate and the node sequence number of the reference node, and the node sequence number of the to-be-determined node, until the node sequence number of the reference node is consistent with the node sequence number of the to-be-determined node, and the node coordinate of the to-be-determined node is obtained. The coordinate iteration module is configured to determine the to-be-determined node again by taking the to-be-determined node as a new reference node, and return to the step of performing coordinate transformation on the reference node based on the grid control parameter, the node coordinate and the node sequence number of the reference node, and the node sequence number of the to-be-determined node, until the node sequence number of the reference node is consistent with the node sequence number of the to-be-determined node, and the node coordinate of the to-be-determined node is obtained, until the node coordinates of all to-be-determined nodes are obtained. The screening module is configured to screen a target node set from all to-be-determined nodes based on the grid control parameter. The generation module is configured to generate the grid structure of the target river channel based on the node coordinates of all target nodes in the target node set.
9. A computer device, comprising: The memory and the processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the river channel grid generation method in any one of claims 1 to 7. The computer readable storage medium stores computer instructions for causing a computer to perform the river channel grid generation method in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that,