A two-dimensional river sparse data hydrodynamic reconstruction method for complex riverbeds

CN122987698APending Publication Date: 2026-10-27ZHEJIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611472606.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-21
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

然而,对于复杂河床二维河流水动力模拟仍存在若干问题:① 复杂河床高程导致水深变化剧烈,直接预测水深会增加网络学习难度;② 河床坡度直接影响二维浅水方程动量平衡,需要在物理残差中准确体现;③ 不同量纲的空间、时间和地形特征可能造成训练梯度异常;④ 空间稀疏训练点需要具备较好的区域代表性,以支持从少量离散数据恢复连续高分辨率流场

Benefits of technology

(1)本发明的重构精度高。本发明采用经校核的二维水动力模型数据作为参考信息,并将河床底部高程作为独立地形输入,为物理信息神经网络训练提供水动力参考数据和地形信息,降低了水深、x方向流速、y方向流速的数值误差,在复杂河床、稀疏数据条件下实现了高精度二维流场重构;为洪水演进模拟、河道水动力分析、洪水风险预警以及河流工程管理提供更高效可靠的技术支持。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122987698A_ABST
    Figure CN122987698A_ABST
Patent Text Reader

Abstract

The application discloses a complex riverbed two-dimensional river sparse data hydrodynamic reconstruction method, S1, obtaining the two-dimensional hydrodynamic data and the riverbed bottom elevation after checking; S2, gridizing sparse sampling and unifying normalized space-time characteristics; S3, three independent fully connected networks are used for respectively predicting H, u and v; S4, using h=ReLu(H-z) to distinguish the dry and wet boundaries; S5, automatically differentiating to construct a shallow water equation residual containing a terrain slope; S6, constructing a total loss function, including data, physical and boundary losses; S7, training dynamic weights and reconstructing a high-resolution two-dimensional flow field. The application is based on a physical information neural network and realizes rapid reconstruction of a high-resolution two-dimensional water depth field and a flow velocity field under complex riverbed conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of river hydrodynamic numerical simulation, flood prediction, and artificial intelligence technology, specifically to a method for hydrodynamic reconstruction of complex riverbeds using sparse two-dimensional river data. It is applicable to natural rivers with significant elevation variations, longitudinal and transverse slope changes, and complex wet-dry boundaries, enabling rapid reconstruction of high-resolution two-dimensional depth and velocity fields under conditions of sparse spatial hydrodynamic data. Background Technology

[0002] Two-dimensional river hydrodynamic models are crucial techniques for flood evolution simulation, river hydrodynamic analysis, flood risk early warning, and river engineering management. Traditional two-dimensional hydrodynamic models typically rely on mass and momentum conservation equations, using numerical methods such as finite difference and finite volume to solve the two-dimensional shallow water equations. However, for natural rivers, the riverbed elevation exhibits spatial non-uniformity; meandering sections, local steep slopes, and lateral topographic variations cause significant spatial changes in water depth and flow velocity. To accurately characterize these hydrodynamic features, traditional two-dimensional numerical models usually require high-precision computational grids and small time steps, resulting in high computational costs and making it difficult to meet the demands for rapid simulation and real-time response.

[0003] With the development of machine learning and deep learning, using neural networks to build alternative models to traditional hydrodynamic models can reduce online computation time. However, purely data-driven models typically rely on large amounts of high-quality training data. The number of monitoring points for water level, depth, and velocity in actual rivers is limited, and acquiring high-frequency, high-density two-dimensional flow field data is costly, resulting in spatially sparse training data. Physical information neural networks, by incorporating physical information such as governing equations and boundary conditions into the neural network training process, can constrain the network output using physical laws under limited data conditions. However, several problems still exist in 2D river hydrodynamic simulation for complex riverbeds: ① Complex riverbed elevations lead to drastic changes in water depth, and directly predicting water depth increases the difficulty of network learning; ② Riverbed slope directly affects the momentum balance of the 2D shallow water equations, which needs to be accurately reflected in the physical residuals; ③ Spatial, temporal, and topographical features with different dimensions may cause abnormal training gradients; ④ Spatially sparse training points need to have good regional representativeness to support the recovery of continuous high-resolution flow fields from a small amount of discrete data.

[0004] Therefore, it is necessary to establish a neural network hydrodynamic simulation method that integrates complex riverbed topographic information and physical constraints in order to achieve accurate and efficient reconstruction of the two-dimensional river flow field under sparse data conditions. Summary of the Invention

[0005] In view of the shortcomings of the prior art, the technical problem to be solved by the present invention is to provide a method for hydrodynamic reconstruction of sparse two-dimensional river data in complex riverbeds, which constructs a high-resolution two-dimensional river flow field that conforms to the physical laws of shallow water equations under the condition of sparse topographic and spatial information in complex riverbeds.

[0006] Therefore, the present invention is implemented using the following technical solution: A method for hydrodynamic reconstruction of complex riverbeds using sparse two-dimensional river data includes the following steps: S1: Establish a two-dimensional hydrodynamic model of the target river, and use monitoring data including measured water level and flow rate to verify the two-dimensional hydrodynamic model, and obtain the verified two-dimensional hydrodynamic data and riverbed bottom elevation; S2: Construct spatially sparse spatiotemporal training samples and use a unified scaling transformation method to normalize spatial coordinates, time, and riverbed bottom elevation; S3: Construct three independently trained fully connected neural networks. The three independent fully connected networks predict the elevation and the flow velocity in the x and y directions of spatial coordinates, respectively. S4: The dry and wet boundary is determined by using the rectified linear unit function based on the difference between the predicted water surface elevation and the bottom elevation of the riverbed; S5: Based on the predicted water depth and the predicted flow velocity in the x and y directions of spatial coordinates, the residual of the shallow water equation with topographic slope is constructed using automatic differentiation. S6: Construct data loss based on the predicted values ​​of water depth, x-direction flow velocity u, and y-direction flow velocity v and the corresponding hydrodynamic reference values; construct physical loss based on the mass conservation residuals and momentum conservation residuals obtained in S5; and construct boundary constraint loss based on the computational domain boundary conditions and the initial state; combine the data loss, physical loss, and boundary constraint loss to form the total loss function of the physical information neural network. S7: Dynamic weight training and reconstruction of high-resolution two-dimensional flow fields.

[0007] Furthermore, in S1, the spatial coordinates x, y, time t, water depth h, x-direction flow velocity u, and y-direction flow velocity v of the target river within the two-dimensional computational domain are extracted from the verified two-dimensional hydrodynamic model. At the same time, the riverbed bottom elevation z corresponding to each spatial location is obtained, and the initial conditions and boundary conditions for training the physical information neural network are obtained.

[0008] Furthermore, in S2, the method for constructing spatially sparse spatiotemporal training samples is as follows: the two-dimensional computational domain is divided into multiple spatial sampling grids; in each spatial sampling grid, the candidate hydrodynamic data point closest to the grid center is selected as the spatial training point; and the x, y, t, z, and hydrodynamic state corresponding to each spatial training point are extracted at multiple time steps; a unified scale transformation method is used to normalize the spatial coordinates x, y, time t, and riverbed bottom elevation z, so that spatiotemporal and topographic features of different dimensions are at a consistent numerical scale; the unified normalization adopts the following formula:

[0009] Among them, X i X represents the original feature to be normalized. i ′ represents the normalized feature, X max and X min Based on the maximum and minimum values ​​of the corresponding features within the entire computational domain of the target river, the normalized features are located in the interval [-1, 1].

[0010] Furthermore, in S3, the three fully connected neural networks all take normalized spatial coordinates x, y, time t, and riverbed bottom elevation z as input, and output predicted water surface elevation H, predicted flow velocity u in the x-direction, and predicted flow velocity v in the y-direction, respectively. Each fully connected neural network has the same network hierarchical structure and its network parameters are independent of each other; the three independent fully connected neural networks are respectively represented as:

[0011] in, f H , f u and f v Let these represent the fully connected neural network mapping functions corresponding to water surface elevation, x-direction flow velocity, and y-direction flow velocity, respectively; where , and This represents the predicted value of the neural network; the hidden layers of the three independent fully connected neural networks use the Tanh activation function combined with batch normalization, and the network weights are initialized using the Xavier uniform distribution method; each fully connected neural network includes 5 hidden layers, each with 100 neurons, and the Adam optimization algorithm is used for parameter updates, with an initial learning rate of 1×10⁻⁶. -3 The dynamic weight moving average decay coefficient β is 0.9; the trainable parameters of the three fully connected neural networks are independent of each other.

[0012] Furthermore, in step S4, the water depth is calculated based on the physical relationship between the predicted water surface elevation H and the riverbed bottom elevation z, and the predicted water depth h and the wet / dry boundary are obtained using ReLU nonnegative mapping. The water depth and the wet / dry boundary satisfy the following formula:

[0013] Where ReLU represents the rectifier linear unit function; when Hz≤0, h=0 and the corresponding position is determined to be the dry region; when Hz>0, h=Hz and the corresponding position is determined to be the wet region.

[0014] Furthermore, in step S5, the predicted water depth h and the predicted flow velocities u and v in both directions are substituted into the two-dimensional shallow water control equation. Automatic differentiation is used to calculate the partial derivatives of the predicted variables with respect to spatial coordinates x and y and time t. The riverbed topographic slope in the x and y directions is calculated based on the riverbed bottom elevation z, and the riverbed topographic slope and riverbed friction slope are jointly introduced into the momentum source term of the two-dimensional shallow water control equation to construct mass conservation residuals, momentum conservation residuals in the x and y directions. The two-dimensional shallow water control equation is in vector form.

[0015] Wherein, the state vector, the flux vector in the x-direction, the flux vector in the y-direction, and the source term are respectively:

[0016] The formulas for the topographic slope of the riverbed in the x and y directions are as follows:

[0017] The riverbed friction slope is determined using the Manning formula:

[0018] Where g is the acceleration due to gravity, n is the Manning roughness coefficient; s 0x s 0y These represent the topographic slopes of the riverbed in the x and y directions, respectively. s fx , s fy These represent the riverbed friction slopes in the x and y directions, respectively. The residuals of the three two-dimensional shallow water equations constructed using automatic differentiation are as follows:

[0019] Where ε1 is the mass conservation residual, ε2 is the momentum conservation residual in the x-direction, and ε3 is the momentum conservation residual in the y-direction.

[0020] Furthermore, in S6, the physical loss is:

[0021] The data loss is:

[0022] Among them, spatial boundary condition loss L bc and initial condition loss L ic Commonly constitutes boundary constraint loss:

[0023] The total loss function is:

[0024] Where N is the number of samples involved in the calculation of data loss and physical residual, and i is the sample index; N bc and N ic These represent the number of spatial boundary condition samples and the number of initial condition samples, respectively, and j and k are the corresponding sample indices; L h , L u and L v Representing water depth, x directional flow velocity and y The data loss of directional flow velocity, where λ1, λ2 and λ3 are the corresponding data loss weights; L phy , L bc , L ic and L bound These represent physical loss, spatial boundary condition loss, initial condition loss, and boundary constraint loss, respectively; the capped variables in the formula represent neural network predictions, and the uncapped variables represent hydrodynamic reference values.

[0025] Furthermore, in step S7, a two-stage dynamic weight training strategy is used to optimize the physical information neural network. In the first training stage, a mapping relationship between spatiotemporal terrain features and hydrodynamic variables is established based on data loss. In the first training stage, water depth... h , x directional flow velocity and y The data loss weights for directional flow velocities are all initialized to 1, and only the data loss is used to update the network parameters, i.e.: λ1=λ2=λ3=1 When the water depth h , x directional flow velocity and y Once the prediction error of the directional flow velocity reaches the preset switching threshold, the second training phase begins.

[0026] Furthermore, in step S7, when the prediction errors of water depth and flow velocities in both directions meet the preset switching conditions, the second training phase begins. This phase introduces physical loss and boundary constraint loss, and dynamically adjusts the data loss weights corresponding to water depth, x-direction flow velocity, and y-direction flow velocity based on the gradient norm of each loss term relative to the neural network parameters. The second training phase adjusts the data loss weights based on the gradient norm of each loss term relative to the neural network parameters θ. L 2. Gradient norm calculation of weight correction values, the sum of gradient norms is:

[0027] The adjusted values ​​for the three data loss weights are:

[0028] And update each weight using a moving average method:

[0029] Where θ represents the trainable parameters of the neural network. This represents the gradient operation relative to the network parameter θ. G sum Indicates the gradient of each loss term L 2 Sum of norms; λ i,c Indicates the first i The correction value for the data loss weights, λ i,old and λ i,new These represent the weights before and after the update, respectively, and β represents the moving average decay coefficient.

[0030] Furthermore, in step S7, after training is completed, the target position coordinates are generated according to a spatial density higher than that of the spatially sparse training samples, and the target time and target spatial position are matched.x , y , t and z Inputting three fully connected neural networks, continuous coordinate inference is performed at locations other than the spatially sparse training points to obtain the water surface elevation H. x Directional flow velocity u , y Directional flow velocity v Then, the water depth is obtained according to h=ReLU(Hz), and the high-resolution two-dimensional hydrodynamic flow field is reconstructed.

[0031] The beneficial effects of adopting the above technical solution are as follows: (1) The reconstruction accuracy of the present invention is high. The present invention uses the verified two-dimensional hydrodynamic model data as reference information and the bottom elevation of the riverbed as an independent terrain input, providing hydrodynamic reference data and terrain information for the training of the physical information neural network, reducing the numerical errors of water depth, x-direction flow velocity and y-direction flow velocity, and realizing high-precision two-dimensional flow field reconstruction under complex riverbed and sparse data conditions; providing more efficient and reliable technical support for flood evolution simulation, river hydrodynamic analysis, flood risk early warning and river engineering management.

[0032] (2) This invention is highly adaptable to sparse training data. It uses gridded representative sparse sampling instead of completely random sampling, which reduces the amount of training data and improves the two-dimensional spatial uniformity of training points. Furthermore, it reduces training instability caused by differences in the dimensions of different features by uniformly normalizing x, y, t, and z. (3) Under complex riverbed conditions, this invention can train the wet-dry boundary discrimination more stably. This invention uses three independent fully connected neural networks to predict H, u and v respectively, so that the water surface elevation and the flow velocity in the two directions are solved by independent networks, and the parameters of each network are independent of each other, which alleviates the gradient imbalance problem when training complex multi-objective loss, and improves the stability and convergence of training; combined with the use of h=ReLU(Hz) to calculate water depth in step 4, it avoids the neural network directly fitting the drastic water depth changes caused by complex riverbed elevation, and achieves wet-dry boundary discrimination while ensuring the non-negativity of water depth through ReLU; (4) This invention deeply integrates topographic and physical information, and uses automatic differentiation to construct the residuals of the two-dimensional shallow water equation. It also explicitly introduces the longitudinal and transverse topographic slopes calculated from the riverbed bottom elevation into the momentum source term, allowing complex riverbed topography to directly participate in physical information constraints, thus exhibiting better versatility. After the model is trained offline, it can output high spatial resolution water depth and two-dimensional velocity fields through continuous coordinate inference outside of sparse training points, thereby reducing the online computation cost of high-density two-dimensional numerical simulations and making it applicable to various complex riverbed natural rivers. Attached Figure Description

[0033] The present invention includes the following figures: Figure 1 This is a schematic diagram of the overall process of the method for reconstructing the hydrodynamics of a complex riverbed using sparse data from two-dimensional rivers, as described in this invention. Figure 2 A schematic diagram of the physical information neural network structure constructed for predicting H, u, v, water depth conversion and physical residuals using three independent fully connected neural networks; Figure 3 A schematic diagram showing the relationship between the bottom elevation, water surface elevation, water depth, and topographic slope of a complex riverbed. Figure 4 This is a schematic diagram of representative sparse sampling in a two-dimensional computational domain gridding. Figure 5 Spatial distribution of gridded sampling points and nearest neighbor distance distribution map; Figure 6 Spatial distribution of random sampling points and nearest neighbor distance distribution. Detailed Implementation

[0034] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided below.

[0035] I. For example Figure 1 As shown, this invention provides a method for hydrodynamic reconstruction of sparse two-dimensional river data with complex riverbeds, comprising the following steps: S1: Establish a two-dimensional hydrodynamic model of the target river, and use monitoring data including measured water level and flow rate to verify the two-dimensional hydrodynamic model, and obtain the verified two-dimensional hydrodynamic data and riverbed bottom elevation; The spatial coordinates x, y, time t, water depth h, x-direction velocity u, and y-direction velocity v of the target river within the two-dimensional computational domain are extracted from the verified two-dimensional hydrodynamic model. At the same time, the riverbed bottom elevation z corresponding to each spatial location is obtained, and the initial and boundary conditions for training the physical information neural network are obtained. The spatial coordinates x and y are the spatial position coordinates of two mutually orthogonal directions in the horizontal plane of the two-dimensional computational domain of the river. Here, x represents the horizontal spatial coordinate along the preset x-axis direction, and y represents the horizontal spatial coordinate along the preset y-axis direction orthogonal to the x-axis. The two are used together to determine the planar spatial position of any point in the two-dimensional computational domain. The specific direction is determined according to the planar coordinate system adopted by the two-dimensional hydrodynamic model. The time t represents the time coordinate in the two-dimensional hydrodynamic simulation process, that is, the simulation duration starting from the preset initial moment of the simulation, which is used to characterize the dynamic changes of hydrodynamic states such as water depth and flow velocity over time.

[0036] S2: Construct spatially sparse spatiotemporal training samples and use a unified scaling transformation method to normalize spatial coordinates, time, and riverbed bottom elevation; The method for constructing spatially sparse spatiotemporal training samples is as follows: the two-dimensional computational domain is divided into multiple spatial sampling grids; in each spatial sampling grid, the candidate hydrodynamic data point closest to the grid center is selected as the spatial training point; and the x, y, t, z, and hydrodynamic state corresponding to each spatial training point are extracted at multiple time steps; a unified scaling transformation method is used to normalize the spatial coordinates x, y, time t, and riverbed bottom elevation z, so that spatiotemporal and topographic features of different dimensions are at a consistent numerical scale; the unified normalization adopts the following formula:

[0037] Among them, X i X represents the original feature to be normalized. i ′ represents the normalized feature, X max and X min Based on the maximum and minimum values ​​of the corresponding features within the entire computational domain of the target river, the normalized features are located in the interval [-1, 1].

[0038] S3: Construct three independently trained fully connected neural networks. The three independent fully connected networks predict the elevation and the flow velocity in the x and y directions of spatial coordinates, respectively. All three fully connected neural networks take normalized spatial coordinates x, y, time t, and riverbed bottom elevation z as inputs, and output predicted water surface elevation H, predicted flow velocity u in the x-direction, and predicted flow velocity v in the y-direction, respectively. Each fully connected neural network has the same network hierarchical structure and its network parameters are independent. The three independent fully connected neural networks are represented as follows:

[0039] in, f H , f u and f v Let these represent the fully connected neural network mapping functions corresponding to water surface elevation, x-direction flow velocity, and y-direction flow velocity, respectively; where , and This represents the predicted value of the neural network; the hidden layers of the three independent fully connected neural networks use the Tanh activation function combined with batch normalization, and the network weights are initialized using the Xavier uniform distribution method; each fully connected neural network includes 5 hidden layers, each with 100 neurons, and the Adam optimization algorithm is used for parameter updates, with an initial learning rate of 1×10⁻⁶. -3 The dynamic weight moving average decay coefficient β is 0.9; the trainable parameters of the three fully connected neural networks are independent of each other.

[0040] S4: The dry and wet boundary is determined by using the rectified linear unit function (h=ReLU(Hz)) based on the difference between the predicted water surface elevation and the bottom elevation of the riverbed; The water depth is calculated based on the physical relationship between the predicted water surface elevation H and the riverbed bottom elevation z. The predicted water depth h and the wet / dry boundary condition are obtained using ReLU nonnegative mapping. The water depth and the wet / dry boundary condition satisfy the following formula:

[0041] Where ReLU represents the rectifier linear unit function; when Hz≤0, h=0 and the corresponding position is determined to be the dry region; when Hz>0, h=Hz and the corresponding position is determined to be the wet region; S5: Based on the predicted water depth and the predicted flow velocity in the x and y directions of spatial coordinates, the residual of the shallow water equation with topographic slope is constructed using automatic differentiation. Substituting the predicted water depth h and the predicted flow velocities u and v in both directions into the two-dimensional shallow water control equations, the partial derivatives of the predicted variables with respect to spatial coordinates x and y and time t are calculated using automatic differentiation. The riverbed topographic slope in the x and y directions is calculated based on the riverbed bottom elevation z, and this riverbed topographic slope, along with the riverbed friction slope, is introduced into the momentum source term of the two-dimensional shallow water control equations to construct mass conservation residuals, momentum conservation residuals in the x and y directions. The two-dimensional shallow water control equations are in vector form.

[0042] Wherein, the state vector, the flux vector in the x-direction, the flux vector in the y-direction, and the source term are respectively:

[0043] The formulas for the topographic slope of the riverbed in the x and y directions are as follows:

[0044] The riverbed friction slope is determined using the Manning formula:

[0045] Where g is the acceleration due to gravity, n is the Manning roughness coefficient; s 0x s 0y These represent the topographic slopes of the riverbed in the x and y directions, respectively. s fx , s fy These represent the riverbed friction slopes in the x and y directions, respectively. The residuals of the three two-dimensional shallow water equations constructed using automatic differentiation are as follows:

[0046] Where ε1 is the mass conservation residual, ε2 is the momentum conservation residual in the x-direction, and ε3 is the momentum conservation residual in the y-direction.

[0047] S6: Construct data loss based on the predicted values ​​of water depth, x-direction flow velocity u, and y-direction flow velocity v and the corresponding hydrodynamic reference values; construct physical loss based on the mass conservation residuals and momentum conservation residuals obtained in S5; and construct boundary constraint loss based on the computational domain boundary conditions and the initial state; combine the data loss, physical loss, and boundary constraint loss to form the total loss function of the physical information neural network. The physical losses are:

[0048] The data loss is:

[0049] Among them, spatial boundary condition loss L bc and initial condition loss L ic Commonly constitutes boundary constraint loss:

[0050] The total loss function is: Where N is the number of samples involved in the calculation of data loss and physical residual, and i is the sample index; N bc and N ic These represent the number of spatial boundary condition samples and the number of initial condition samples, respectively, and j and k are the corresponding sample indices; L h , L u and L v Representing water depth, x directional flow velocity and y The data loss of directional flow velocity, where λ1, λ2 and λ3 are the corresponding data loss weights; L phy , L bc , L ic and L bound These represent physical loss, spatial boundary condition loss, initial condition loss, and boundary constraint loss, respectively; the capped variables in the formulas represent neural network predictions, while the uncapped variables represent hydrodynamic reference values. S7: Dynamic weight training and reconstruction of high-resolution two-dimensional flow field; A two-stage dynamic weight training strategy is employed to optimize the physical information neural network. In the first training stage, a mapping relationship between spatiotemporal terrain features and hydrodynamic variables is established based on data loss. In this first training stage, water depth is... h , x directional flow velocity and y The data loss weights for directional flow velocities are all initialized to 1, and only the data loss is used to update the network parameters, i.e.: λ1=λ2=λ3=1 When the water depth h , x directional flow velocity and y Once the prediction errors of the directional flow velocities all reach a preset switching threshold, the second training phase begins, introducing physical loss and boundary constraint loss. The data loss weights corresponding to water depth, x-direction flow velocity, and y-direction flow velocity are dynamically adjusted based on the gradient norm of each loss term relative to the neural network parameters. In the second training phase, the data loss weights corresponding to water depth, x-direction flow velocity, and y-direction flow velocity are adjusted based on the gradient norm of each loss term relative to the neural network parameters θ. L 2. Gradient norm calculation of weight correction values, the sum of gradient norms is:

[0051] The adjusted values ​​for the three data loss weights are:

[0052] And update each weight using a moving average method:

[0053] Where θ represents the trainable parameters of the neural network. This represents the gradient operation relative to the network parameter θ. G sum Indicates the gradient of each loss term L 2 Sum of norms; λ i,c Indicates the first i The correction value for the data loss weights, λ i,old and λ i,new These represent the weights before and after the update, respectively, and β represents the moving average decay coefficient.

[0054] After training, target location coordinates are generated according to a spatial density higher than that of the spatially sparse training samples, and the target time and target spatial location are matched. x , y , t and z Inputting three fully connected neural networks, continuous coordinate inference is performed at locations other than the spatially sparse training points to obtain the water surface elevation H. x Directional flow velocity u , y Directional flow velocity v Then, the water depth is obtained according to h=ReLU(Hz), and the high-resolution two-dimensional hydrodynamic flow field is reconstructed.

[0055] II. The present invention will be described in detail below by way of embodiments: 1. Select natural rivers with obvious riverbed undulations, meandering river sections and local steep slopes as the target area, establish a high-resolution two-dimensional hydrodynamic reference model, and use measured water level data to verify the reference model.

[0056] In this embodiment, the initial water surface elevation is set to 12 m. The upstream boundary flow rate increases linearly from 5000 m³ / s to 7000 m³ / s within 10 minutes, the tributary boundary flow rate is 1907 m³ / s, the downstream boundary water level is 11.33 m, and the Manning roughness coefficient of the riverbed is 0.035. After verification, the water depth h, x-direction velocity u, and y-direction velocity v at each calculated location are output, and the riverbed bottom elevation z at the corresponding location is read.

[0057] 2. The target two-dimensional computational domain was divided into a 150 m × 150 m sampling grid. In each effective grid, the candidate hydrodynamic data point closest to the grid center was selected, resulting in 318 spatial training points. Hydrodynamic information for 10 consecutive time steps was extracted at 1-minute intervals, forming 3180 spatiotemporal training samples. At the same time, 271 computational domain boundary points were selected, and their initial states were extracted as constraint information.

[0058] The x, y, t, and z values ​​of each training sample are normalized to the range [-1, 1] according to the maximum and minimum values ​​of the entire target computational domain, and a consistent normalization scale is used in the training and subsequent inference stages.

[0059]

[0060] Table 1 Data Structure Table for Physical Information Neural Networks 3. Establish separate networks for water surface elevation, x-direction current velocity, and y-direction current velocity. Each network has 5 hidden layers with 100 neurons per layer, using Tanh as the activation function and employing Batch Normalization in the hidden layers. Network parameters are initialized using a Xavier uniform distribution. All three networks receive the same (x, y, t, z) input but output H, u, and v independently.

[0061] 4. Subtract the H output from the water surface elevation network from the corresponding riverbed bottom elevation z, and calculate h using the ReLU function. For locations where Hz ≤ 0, set the predicted water depth to 0 and classify it as a dry area; for locations where Hz > 0, set the predicted water depth equal to Hz and classify it as a wet area.

[0062] 5. Obtain the partial derivatives of h, u, and v with respect to x, y, and t using automatic differentiation, and calculate s based on the riverbed bottom elevation. 0x and s 0y In addition, the residuals of mass conservation ε1, momentum conservation ε2 in the x direction, and momentum conservation ε3 in the y direction are combined with the Manning friction slope structure.

[0063] 6. Construct data loss based on the predicted values ​​of water depth h, x-direction flow velocity u, and y-direction flow velocity v and their corresponding hydrodynamic reference values. Calculate physical loss based on the residuals of the three two-dimensional shallow water equations. Combine spatial boundary condition loss and initial condition loss as boundary constraint loss. The total network loss is composed of these three types of losses.

[0064] 7. Update network parameters using the Adam optimization algorithm, with an initial learning rate set to 1×10⁻⁶. -3In the initial training phase, only data loss is used, and the weights of the data loss for water depth and flow velocity in both directions are set to 1. When the prediction error of the three types of hydrodynamic variables reaches the preset switching threshold, physical loss and boundary constraint loss are introduced, and the data loss weights are dynamically updated using the L2 gradient norm of each loss term relative to the network parameters. The moving average decay coefficient β is set to 0.9.

[0065] After the model training reaches the preset termination condition, a high-density test grid with spatial locations that do not coincide with the training points is constructed to verify the reconstruction capability. In this embodiment, the high-density test data includes 5557 spatial locations and 10 time steps, totaling 55570 complete spatiotemporal samples. The model's mean absolute errors for water depth h, x-direction flow velocity u, and y-direction flow velocity v are approximately 0.031 m, 0.112 m / s, and 0.129 m / s, respectively.

[0066] When high-resolution two-dimensional hydrodynamic simulation is required, the x and y coordinates in the computational domain are generated according to the target spatial resolution. The target time t and the elevation z of the riverbed bottom are input. H, u and v are obtained through three independent fully connected networks, and h is obtained through ReLU water depth transformation, thereby obtaining the high-resolution two-dimensional water depth and velocity field.

[0067] Under the computational conditions of this embodiment, it takes approximately 150 minutes for the high-resolution two-dimensional reference numerical model to simulate a 10-minute hydrodynamic process. After the physical information neural network completes offline training, the forward inference time for a single high-resolution flow field is less than 0.1 seconds, which can significantly reduce the online hydrodynamic calculation time.

[0068] As can be seen from Example 1: (1) The average absolute errors of water depth, x-direction flow velocity and y-direction flow velocity in Example 1 are approximately 0.031 m, 0.112 m / s and 0.129 m / s, respectively, indicating that the present invention can still achieve two-dimensional flow field reconstruction with small error and high accuracy under complex riverbed and sparse data conditions.

[0069] (2) In Example 1, after offline training is completed, only one forward inference is needed to obtain the high-resolution flow field. The single inference time is less than 0.1 s, while the traditional high-resolution two-dimensional numerical model takes about 150 min to simulate the same 10 min process. The calculation time is significantly shortened. Compared with the traditional method, the present invention significantly improves the calculation efficiency and realizes real-time response, making the present invention applicable to application scenarios with high real-time requirements such as risk warning.

[0070] (3) In Example 1, a high-resolution two-dimensional water depth and velocity field were obtained with only 3180 spatiotemporal training samples. This reduced the need for high-quality training data and made the data more adaptable and versatile, applicable to various complex riverbed conditions.

[0071] (4) In Example 1, H, u and v are obtained through three independent fully connected networks, and h is obtained through ReLU water depth transformation. The present invention constructs data loss based on the predicted values ​​of water depth h, x-direction flow velocity u and y-direction flow velocity v and the corresponding hydrodynamic reference values, thus solving the problem of learning difficulties under complex riverbed conditions.

[0072] The above description is merely a preferred embodiment of the present invention. Any conventional adjustments or equivalent substitutions made by those skilled in the art to the sampling grid scale, number of network layers, number of neurons, optimizer parameters, boundary condition forms, and reference hydrodynamic data sources without departing from the essence of the technical solution of the present invention should be considered as falling within the protection scope of the present invention.

[0073] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A method for hydrodynamic reconstruction of sparse data from two-dimensional rivers with complex riverbeds, characterized in that: Includes the following steps, S1: Establish a two-dimensional hydrodynamic model of the target river, and use monitoring data including measured water level and flow rate to verify the two-dimensional hydrodynamic model, and obtain the verified two-dimensional hydrodynamic data and riverbed bottom elevation; S2: Construct spatially sparse spatiotemporal training samples and use a unified scaling transformation method to normalize spatial coordinates, time, and riverbed bottom elevation; S3: Construct three independently trained fully connected neural networks. The three independent fully connected networks predict the elevation and the flow velocity in the x and y directions of spatial coordinates, respectively. S4: The dry and wet boundary is determined by using the rectified linear unit function based on the difference between the predicted water surface elevation and the bottom elevation of the riverbed; S5: Based on the predicted water depth and the predicted flow velocity in the x and y directions of spatial coordinates, the residual of the shallow water equation with topographic slope is constructed using automatic differentiation. S6: Construct data loss based on the predicted values ​​of water depth, x-direction flow velocity u, and y-direction flow velocity v and the corresponding hydrodynamic reference values; construct physical loss based on the mass conservation residuals and momentum conservation residuals obtained in S5; and construct boundary constraint loss based on the computational domain boundary conditions and the initial state; combine the data loss, physical loss, and boundary constraint loss to form the total loss function of the physical information neural network. S7: Dynamic weight training and reconstruction of high-resolution two-dimensional flow fields.

2. The method for hydrodynamic reconstruction of sparse data of two-dimensional rivers with complex riverbeds according to claim 1, characterized in that: In S1, the spatial coordinates x, y, time t, water depth h, x-direction flow velocity u, and y-direction flow velocity v of the target river in the two-dimensional computational domain are extracted from the verified two-dimensional hydrodynamic model. At the same time, the riverbed bottom elevation z corresponding to each spatial location is obtained, and the initial conditions and boundary conditions for training the physical information neural network are obtained.

3. A method for hydrodynamic reconstruction of sparse data of two-dimensional rivers with complex riverbeds according to claim 1 or 2, characterized in that: In step S2, the method for constructing spatially sparse spatiotemporal training samples is as follows: the two-dimensional computational domain is divided into multiple spatial sampling grids; in each spatial sampling grid, the candidate hydrodynamic data point closest to the grid center is selected as the spatial training point; and the x, y, t, z, and hydrodynamic state corresponding to each spatial training point are extracted at multiple time steps; a unified scale transformation method is used to normalize the spatial coordinates x, y, time t, and riverbed bottom elevation z, so that spatiotemporal and topographic features of different dimensions are at a consistent numerical scale. The unified normalization adopts the following formula: Among them, X i X represents the original feature to be normalized. i ′ represents the normalized feature, X max and X min Based on the maximum and minimum values ​​of the corresponding features within the entire computational domain of the target river, the normalized features are located in the interval [-1, 1].

4. A method for hydrodynamic reconstruction of sparse data of two-dimensional rivers with complex riverbeds according to claim 1 or 2, characterized in that: In S3, the three fully connected neural networks all take normalized spatial coordinates x, y, time t, and riverbed bottom elevation z as inputs, and output predicted water surface elevation H, predicted flow velocity u in the x-direction, and predicted flow velocity v in the y-direction, respectively. Each fully connected neural network has the same network hierarchical structure and its network parameters are independent of each other; the three independent fully connected neural networks are respectively represented as: in, f H , f u and f v Let these represent the fully connected neural network mapping functions corresponding to water surface elevation, x-direction flow velocity, and y-direction flow velocity, respectively; where , and This represents the predicted value of the neural network; the hidden layers of the three independent fully connected neural networks use the Tanh activation function combined with batch normalization, and the network weights are initialized using the Xavier uniform distribution method; each fully connected neural network includes 5 hidden layers, each with 100 neurons, and the Adam optimization algorithm is used for parameter updates, with an initial learning rate of 1×10⁻⁶. -3 The dynamic weight moving average decay coefficient β is 0.9; the trainable parameters of the three fully connected neural networks are independent of each other.

5. A method for hydrodynamic reconstruction of sparse data of two-dimensional rivers with complex riverbeds according to claim 1 or 2, characterized in that: In step S4, the water depth is calculated based on the physical relationship between the predicted water surface elevation H and the riverbed bottom elevation z, and the predicted water depth h and the wet / dry boundary are obtained using ReLU nonnegative mapping. The water depth and the wet / dry boundary satisfy the following formula: Where ReLU represents the rectifier linear unit function; when Hz≤0, h=0 and the corresponding position is determined to be the dry region; when Hz>0, h=Hz and the corresponding position is determined to be the wet region.

6. A method for hydrodynamic reconstruction of sparse data of two-dimensional rivers with complex riverbeds according to claim 1 or 2, characterized in that: In step S5, the predicted water depth h and the predicted flow velocities u and v in both directions are substituted into the two-dimensional shallow water control equation. The partial derivatives of the predicted variables with respect to spatial coordinates x and y and time t are calculated using automatic differentiation. The riverbed topographic slope in the x and y directions is calculated based on the riverbed bottom elevation z, and the riverbed topographic slope and riverbed friction slope are jointly introduced into the momentum source term of the two-dimensional shallow water control equation to construct mass conservation residuals, momentum conservation residuals in the x and y directions. The two-dimensional shallow water control equation is in vector form. Wherein, the state vector, the flux vector in the x-direction, the flux vector in the y-direction, and the source term are respectively: The formulas for the topographic slope of the riverbed in the x and y directions are as follows: The riverbed friction slope is determined using the Manning formula: Where g is the acceleration due to gravity, n is the Manning roughness coefficient; s 0x s 0y These represent the topographic slopes of the riverbed in the x and y directions, respectively. s fx , s fy These represent the riverbed friction slopes in the x and y directions, respectively. The residuals of the three two-dimensional shallow water equations constructed using automatic differentiation are as follows: Where ε1 is the mass conservation residual, ε2 is the momentum conservation residual in the x-direction, and ε3 is the momentum conservation residual in the y-direction.

7. A method for hydrodynamic reconstruction of sparse data of two-dimensional rivers with complex riverbeds according to claim 1 or 2, characterized in that: In S6, the physical loss is: The data loss is: Among them, spatial boundary condition loss L bc and initial condition loss L ic Commonly constitutes boundary constraint loss: The total loss function is: Where N is the number of samples involved in the calculation of data loss and physical residual, and i is the sample index; N bc and N ic These represent the number of spatial boundary condition samples and the number of initial condition samples, respectively, and j and k are the corresponding sample indices; L h , L u and L v Representing water depth, x directional flow velocity and y The data loss of directional flow velocity, where λ1, λ2 and λ3 are the corresponding data loss weights; L phy , L bc , L ic and L bound These represent physical loss, spatial boundary condition loss, initial condition loss, and boundary constraint loss, respectively; the capped variables in the formula represent neural network predictions, and the uncapped variables represent hydrodynamic reference values.

8. A method for hydrodynamic reconstruction of sparse data of two-dimensional rivers with complex riverbeds according to claim 1 or 2, characterized in that: In step S7, a two-stage dynamic weight training strategy is used to optimize the physical information neural network. The first training stage establishes a mapping relationship between spatiotemporal terrain features and hydrodynamic variables based on data loss. In the first training stage, water depth is... h , x directional flow velocity and y The data loss weights for directional flow velocities are all initialized to 1, and only the data loss is used to update the network parameters, i.e.: λ1=λ2=λ3=1 When the water depth h , x directional flow velocity and y Once the prediction error of the directional flow velocity reaches the preset switching threshold, the second training phase begins.

9. The method for hydrodynamic reconstruction of sparse data of two-dimensional rivers with complex riverbeds according to claim 8, characterized in that: In step S7, when the prediction errors of water depth and flow velocities in both directions meet the preset switching conditions, the second training phase begins. This phase introduces physical loss and boundary constraint loss, and dynamically adjusts the data loss weights corresponding to water depth, x-direction flow velocity, and y-direction flow velocity based on the gradient norm of each loss term relative to the neural network parameters. The second training phase adjusts the data loss weights based on the gradient norm of each loss term relative to the neural network parameters θ. L 2. Gradient norm calculation of weight correction values, the sum of gradient norms is: The adjusted values ​​for the three data loss weights are: And update each weight using a moving average method: Where θ represents the trainable parameters of the neural network. This represents the gradient operation relative to the network parameter θ. G sum Indicates the gradient of each loss term L 2 Sum of norms; λ i,c Indicates the first i The correction value for the data loss weights, λ i,old and λ i,new These represent the weights before and after the update, respectively, and β represents the moving average decay coefficient.

10. The method for hydrodynamic reconstruction of sparse data of two-dimensional rivers with complex riverbeds according to claim 9, characterized in that: In step S7, after training is completed, the target location coordinates are generated according to a spatial density higher than that of the spatially sparse training samples, and the target time and target spatial location are matched. x , y , t and z Inputting three fully connected neural networks, continuous coordinate inference is performed at locations other than the spatially sparse training points to obtain the water surface elevation H. x Directional flow velocity u , y Directional flow velocity v Then, the water depth is obtained according to h=ReLU(Hz), and the high-resolution two-dimensional hydrodynamic flow field is reconstructed.