Urban flood simulation method based on physical information neural network and multi-gpu calculation

By combining physical information neural networks with multi-GPU computing, the problems of low computational efficiency, insufficient simulation accuracy, and communication latency in parallel computing in traditional urban flood simulation are solved, realizing efficient and accurate urban flood simulation and providing technical support for urban flood prevention and disaster reduction.

CN121457183BActive Publication Date: 2026-07-31PEARL RIVER HYDRAULIC RES INST OF PEARL RIVER WATER RESOURCES COMMISSION
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PEARL RIVER HYDRAULIC RES INST OF PEARL RIVER WATER RESOURCES COMMISSION
Filing Date
2025-10-20
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Traditional urban flood simulation methods suffer from low computational efficiency, insufficient simulation accuracy, and severe communication delays in large-scale simulation scenarios, making it difficult to meet the requirements of real-time simulation. Furthermore, the complex coupling relationship between the land surface and the pipeline network makes it difficult for existing models to achieve rapid simulation while ensuring physical consistency.

Method used

A physical information neural network is used to replace the numerical calculation steps of the two-dimensional shallow water equation. Combined with multi-GPU computing and high-performance communication mechanisms, an urban flood simulation method is constructed by combining physical information neural network and multi-GPU computing to achieve efficient coupling of surface runoff and underground pipe network. In parallel computing, the computational domain is partitioned according to the principles of load balancing and topology consistency to reduce data exchange overhead.

Benefits of technology

It improves computational efficiency and numerical stability, significantly enhances the accuracy of simulation results, and enables rapid, stable, and scalable simulation of large-scale urban flooding, providing efficient and reliable technical support for urban flood control, disaster reduction, and emergency decision-making.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121457183B_ABST
    Figure CN121457183B_ABST
Patent Text Reader

Abstract

This invention relates to the field of urban flood simulation technology, and more particularly to an urban flood simulation method based on a physical information neural network and multi-GPU computing. The method includes the following steps: dividing the computational domain in urban flood simulation into a triangular mesh and establishing a data matrix; dividing the solution process into reconstruction calculation, flux calculation, slope and friction source term calculation, and flux update, thereby constructing a two-dimensional shallow water equation finite volume solution process; using a physical information neural network to replace the numerical calculation steps in the two-dimensional shallow water equation finite volume solution process, obtaining a simulation prediction model through physical information neural network training, and applying the simulation prediction model to quickly calculate the surface runoff process; and coupling the urban pipe network drainage process and the surface runoff process in urban flood simulation to construct a drainage calculation model. This invention achieves rapid, stable, and scalable simulation of large-scale urban flooding through urban flood simulation technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of urban flood simulation technology, and in particular to an urban flood simulation method based on physical information neural networks and multi-GPU computing. Background Technology

[0002] Traditional urban flood simulations, based on the finite volume method using two-dimensional shallow water equations, require highly complex numerical calculations in large-scale simulation scenarios, including reconstruction calculations, flux calculations, slope and friction source term calculations, and flux updates for a large number of grid cells. This not only results in a huge computational burden but also makes them prone to numerical instability under complex terrain and boundary conditions, making it difficult to meet the real-time simulation requirements for urban flood warning and emergency response. Urban drainage systems (rainwater pipe networks, rainwater grates, etc.) have complex and variable structures and are strongly coupled with surface runoff processes. Existing models either oversimplify the drainage system, leading to insufficient accuracy, or use complex one-dimensional-two-dimensional coupled models, resulting in low computational efficiency, making it difficult to achieve rapid simulation while ensuring physical consistency. Traditional parallel computing methods face problems such as uneven subdomain partitioning and frequent boundary data exchanges in large-scale simulations, leading to low utilization of computing resources and severe communication latency. Especially in multi-GPU parallel environments, the lack of efficient communication mechanisms and load balancing strategies limits the speedup of parallel computing.

[0003] In summary, existing technologies face challenges such as the difficulty in balancing computational efficiency and simulation accuracy, the complexity of simulating the coupling between the ground surface and pipeline networks, and the high communication overhead of parallel computing, all of which urgently need to be addressed. Summary of the Invention

[0004] Therefore, it is necessary to provide a method for simulating urban flooding based on physical information neural networks and multi-GPU computing to solve at least one of the aforementioned technical problems.

[0005] To achieve the above objectives, a method for simulating urban flooding based on physical information neural networks and multi-GPU computing includes the following steps: Step S1: Divide the computational domain in the urban flood simulation into a triangular mesh and establish a data matrix. Divide the solution process into reconstruction calculation, flux calculation, slope and friction source term calculation and flux update, and then construct the finite volume solution process of the two-dimensional shallow water equation. Step S2: Use a physical information neural network to replace the numerical calculation steps in the finite volume solution process of the two-dimensional shallow water equation. Obtain a simulation prediction model through training the physical information neural network, and apply the simulation prediction model to quickly calculate the surface runoff process. Step S3: Couple the urban pipe network drainage process with the surface runoff process in the urban flood simulation, construct a drainage calculation model, and use the drainage calculation model to calculate the water exchange between rainwater wells, the surface, and the pipe network; Step S4: Construct a computing domain partitioning scheme according to the principles of load balancing and topology consistency, dividing the overall modeling area into several sub-computing domains; Step S5: Construct a data communication method between sub-computing domains, and integrate the simulation prediction model and the drainage calculation model to achieve multi-processor parallel computing in each sub-computing domain.

[0006] This invention introduces a Physical Information Neural Network (PINN) into the finite volume solution process of two-dimensional shallow water equations, replacing the most time-consuming and complex numerical calculation steps in traditional methods, thereby achieving an order-of-magnitude improvement in computational efficiency and enhanced numerical stability. Simultaneously, this invention combines a generalized model of pipe network drainage based on storm drain outflow formulas, efficiently and realistically simulating the coupling process between surface runoff and underground pipe networks without sacrificing excessive computational resources, significantly improving the accuracy of simulation results.

[0007] For massively parallel computing, this invention employs a computational domain partitioning strategy that balances load balancing and physical topology preservation, combined with a high-performance communication mechanism based on NCCL. This combined strategy ensures that the amount of computational tasks allocated to each GPU is equal, while minimizing the overhead of cross-GPU data exchange.

[0008] In summary, this invention systematically solves the three core bottlenecks in traditional urban flood simulation—slow computation speed, difficult coupling of physical processes, and low parallel efficiency—through the deep integration of physical-data hybrid driving and high-performance parallel computing. It can achieve rapid, stable, and scalable simulation of large-scale urban floods while ensuring physical consistency and computational accuracy, providing efficient and reliable technical support for urban flood control, disaster reduction, and emergency decision-making. Attached Figure Description

[0009] Figure 1 This is a flowchart illustrating the steps of an urban flood simulation method based on physical information neural networks and multi-GPU computing. Figure 2 This is a schematic diagram of the rapid simulation calculation process for urban flooding in this invention; Figure 3 This is a schematic diagram of the physical information neural network structure for solving the two-dimensional shallow water equation with finite volume in this invention. Figure 4 This is a schematic diagram of the sub-computation domain segmentation of the urban flood simulation computation domain in this invention; Figure 5 This is a schematic diagram of the NCCL communication mechanism for GPU data between sub-computation domains in this invention. Detailed Implementation

[0010] The technical method of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0011] Furthermore, the accompanying drawings are merely illustrative of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor methods and / or microcontroller methods.

[0012] It should be understood that although the terms "first," "second," etc., may be used herein to describe various units, these units should not be limited by these terms. These terms are used merely to distinguish one unit from another. For example, without departing from the scope of the exemplary embodiments, a first unit may be referred to as a second unit, and similarly, a second unit may be referred to as a first unit. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0013] To achieve the above objectives, please refer to Figures 1 to 5 This invention provides a method for simulating urban flooding based on physical information neural networks and multi-GPU computing, comprising the following steps: Step S1: Divide the computational domain in the urban flood simulation into a triangular mesh and establish a data matrix. Divide the solution process into reconstruction calculation, flux calculation, slope and friction source term calculation and flux update, and then construct the finite volume solution process of the two-dimensional shallow water equation. In this embodiment of the invention, the computational domain of the target region is discretized into 200,000 triangular grid cells, and physical quantities such as water level, water depth, and momentum are organized into a two-dimensional data matrix of dimension [200,000, N]. Simultaneously, an adjacency relation matrix describing the grid topology is established. Furthermore, the finite volume solution process of the two-dimensional shallow water equation is decomposed into four computational steps: reconstruction, flux, source term, and update. Each step is transformed into a CUDA batch matrix operation oriented towards the entire grid.

[0014] Step S2: Use a physical information neural network to replace the numerical calculation steps in the finite volume solution process of the two-dimensional shallow water equation. Obtain a simulation prediction model through training the physical information neural network, and apply the simulation prediction model to quickly calculate the surface runoff process. In this embodiment of the invention, 1.2 million sets of input-output sample pairs for four computational steps—coverage reconstruction, flux, source terms, and update—are generated through high-precision numerical simulation. Based on these, four independent physical information neural networks are constructed and trained. The training process aims to minimize the error between the predicted matrix and the true matrix. The network parameters are adjusted using a backpropagation algorithm until optimal performance is achieved on the validation set, ultimately obtaining four fixed simulation prediction models. In the simulation computation, these four models are used to directly replace traditional numerical computation steps, quickly solving the surface runoff process through a single forward inference.

[0015] Step S3: Couple the urban pipe network drainage process with the surface runoff process in the urban flood simulation, construct a drainage calculation model, and use the drainage calculation model to calculate the water exchange between rainwater wells, the surface, and the pipe network; In this embodiment of the invention, a generalized model of urban pipe network drainage based on the physical parameters of storm drain grates is constructed. This model is based on the surface water depth at the location of each storm drain. The system automatically switches between calculation formulas. When the water depth is shallow, the weir flow formula is used; when the grate is submerged, the nozzle flow formula is used, thus calculating the instantaneous discharge flow rate of each storm drain. This flow rate is deducted from the corresponding grid cell as the sink term in the surface runoff model and used as the source term in the pipe network system, thereby realizing the simulation of water exchange and coupling between the surface and the pipe network system.

[0016] Step S4: Construct a computing domain partitioning scheme according to the principles of load balancing and topology consistency, dividing the overall modeling area into several sub-computing domains; In this embodiment of the invention, a multi-level graph partitioning algorithm is used to partition a computational domain containing 200,000 cells. First, the original fine-grained mesh is simplified to a coarse mesh by iteratively merging the most densely connected vertices. Then, a region-growing partitioning process aimed at load balancing and topology preservation is performed on the coarse mesh, and the partitioning results are mapped back to the original mesh level by level, ultimately generating four sub-computational domains. At the boundaries of each sub-domain, a buffer for data exchange is constructed by setting an immersion cell and a communication cell layer.

[0017] Step S5: Construct a data communication method between sub-computing domains, and integrate the simulation prediction model and the drainage calculation model to achieve multi-processor parallel computing in each sub-computing domain; In this embodiment of the invention, four sub-computation domains are mapped to four GPUs respectively, and a communication topology based on NCCL is constructed. Within each time step, each GPU performs its internal computations in parallel using a simulation prediction model and a drainage computation model. Subsequently, the computation is completed via NCCL. Communication operations enable asynchronous data exchange between boundary immersion units in adjacent subdomains, and through The process efficiently calculates the globally uniform minimum time step. This process is repeated until the simulation ends, and finally, the results from each subdomain are integrated to form a complete urban flood simulation result.

[0018] Preferably, step S1 includes the following steps: Step S11: Divide the computational domain in the urban flood simulation into triangular mesh cells; Step S12: Establish a data matrix representing water level, water depth, elevation, and momentum; Step S13: Construct a cell adjacency matrix and record the adjacent cell indices and boundary information; Step S14: The four calculation steps of reconstruction calculation, flux calculation, bottom slope and friction source term calculation and flux update are constructed into batch matrix operations to form a finite volume solution process for the two-dimensional shallow water equation.

[0019] In this embodiment of the invention, the computational domain for urban flood simulation is discretized into 200,000 non-overlapping triangular mesh cells using unstructured mesh generation technology. A globally unique index is established for each mesh cell, vertex, and edge; this index forms the basis for subsequent data organization and computation.

[0020] For all 200,000 grid cells, their physical state variables, including water level, depth, elevation, and longitudinal and transverse momentum, are organized into multiple two-dimensional data matrices. For example, a matrix storing a single variable (such as water depth) at the center point of each cell has dimensions [200,000, 1]; a matrix storing a single variable (such as elevation) at the three vertices of each cell has dimensions [200,000, 3]. This matrix structure facilitates continuous storage of data in GPU memory and efficient parallel access.

[0021] Construct a cell adjacency matrix describing the mesh topology. This matrix records the adjacent cell indices, boundary type information, and shared edge indices between adjacent cells for each cell. This matrix provides the necessary addressing basis for subsequent flux calculations across cells in the finite volume method and is the fundamental data structure to ensure the correctness of the calculations.

[0022] The finite volume solution process for the two-dimensional shallow water equation is decomposed into four independent computational steps: reconstruction calculation, flux calculation, bottom slope and friction source term calculation, and flux update. Each computational step is transformed from traditional iterative calculation for individual grid cells into batch matrix operations for all 200,000 grid cells. Each step is designed as one or more CUDA kernel functions. These kernel functions take the data matrix established in the previous steps as input and output the computational result matrix for all grid cells at once through parallel large-scale tensor operations. For example, flux calculation is abstracted as a function whose input is the water level and momentum matrices at the cell edges, and whose output is the updated flux matrix of water level and momentum for all cells, as well as the global computation time step.

[0023] Preferably, step S2 includes the following steps: Step S21: Collect simulation data under different rainfall conditions, and obtain a sample set of input parameters and their corresponding output results, including water level matrix, water depth matrix, elevation matrix and momentum matrix; Step S22: Construct physical information neural networks for the four calculation steps: reconstruction calculation, flux calculation, bottom slope and friction source term calculation, and flux update. Step S23: Reduce the difference between the predicted value and the true value by adjusting the parameters of the physical information neural network to obtain a simulation prediction model; Step S24: Apply the simulation prediction model to urban flood simulation calculations to replace traditional numerical calculation methods for rapid solution of surface runoff processes.

[0024] In this embodiment of the invention, various rainfall scenarios with different return periods and time histories are set up, and a high-precision two-dimensional shallow water equation finite volume solver is run. During the simulation, for each of the four calculation steps—reconstruction calculation, flux calculation, bottom slope and friction source term calculation, and flux update—the complete input parameter matrix and the corresponding output result matrix are recorded, generating a total of 1.2 million input-output sample pairs. All sample pairs are deterministically divided into training and test sets in a 7:3 ratio for subsequent training and validation of the neural network.

[0025] For four independent numerical computation tasks—reconstruction calculation, flux calculation, slope and friction source term calculation, and flux update—four independent physical information neural networks were constructed. Each network adopts a composite structure combining convolutional recurrent neural networks and fully connected neural networks. The dimension of its input layer strictly matches the dimension of the input matrix of the corresponding numerical computation step, and the dimension of its output layer strictly matches the dimension of the output result matrix. This ensures that the network can completely learn and replace the original numerical computation functions.

[0026] Define a unified loss function for the training process of the four physical information neural networks. This function is used to quantify the bias in model predictions. Its calculation expression is: ; in, The number of matrices output by the neural network; For the first A matrix of the true values ​​of each variable This is the prediction matrix of the neural network; and Each is a matrix The number of rows and columns. During training, the network parameters are continuously adjusted iteratively using the training set through backpropagation and gradient descent algorithms, with the goal of minimizing the loss value calculated by the loss function L.

[0027] Using the training set, the network parameters are iteratively adjusted through backpropagation and gradient descent algorithms until the loss function L converges to its minimum. The generalization performance of the network is then tested using the test set, ultimately yielding the optimal simulated prediction model with its four parameters fixed.

[0028] In the formal calculation phase of urban flood simulation, the four traditional numerical calculation modules implemented based on CUDA are replaced by four simulation prediction models trained and solidified in the previous step. At each time step of the simulation, the calculation of surface runoff no longer performs the traditional finite volume method numerical solution, but directly calls these four neural network models, taking the current water level, momentum, and other state matrices as input, and quickly obtaining the updated flux for the next time step through a single forward inference, thus completing the rapid solution of the surface runoff process.

[0029] Preferably, the construction of the physical information neural network in step S22 includes: The physical information neural network that determines the water level matrix, water depth matrix, elevation matrix and momentum matrix of the receiving unit in the reconstruction calculation step outputs the updated water flow characteristic matrix; When the value in the water depth matrix is ​​lower than the preset water depth threshold, the calculation unit dedicated to shallow water treatment is activated. When there are obstacles such as buildings in the calculation area, adjust the calculation parameters of the corresponding grid cells.

[0030] In this embodiment of the invention, a dedicated physical information neural network is constructed for the reconstruction calculation step. The input layer of this network is designed to receive multiple parallel data matrices, specifically including the water level matrix, water depth matrix, elevation matrix, longitudinal momentum matrix, and lateral momentum matrix at the cell center point, as well as the water level matrix, water depth matrix, elevation matrix, momentum matrix, and sum of these at the cell vertices. The output layer of the network outputs 14 updated flow characteristic matrices, covering the water level, water depth, elevation, momentum, and sum of these at the cell edge center points, as well as the updated physical quantities at the cell center points and vertices.

[0031] A wet / dry boundary handling mechanism is integrated into the neural network construction. A specific water depth threshold is set, for example, 0.001 meters. In each computation step, a parallel comparison operation is first performed on the water depth matrix of all grid cells, generating a Boolean mask matrix. For grid cells marked as true in this mask matrix, their computation is directed to a computation module dedicated to shallow water treatment. This module uses simplified physical equations to ensure numerical stability, while cells with water depths higher than the threshold continue to be computed by the main neural network.

[0032] During the model initialization phase, all triangular mesh cells falling within the building outlines are identified in the computational domain based on urban building vector data. For these identified mesh cells, parameter adjustments are performed in their corresponding computational parameter matrices. Specifically, the values ​​in the Manning coefficient matrix of these cells are set to a maximum value, such as 1000, to simulate the strong obstruction of water flow by impermeable barriers. This adjusted Manning coefficient matrix will serve as a fixed input feature for the physical information neural network, enabling it to automatically handle the specific water flow dynamics of building areas during training and inference.

[0033] Preferably, the training process of the physical information neural network in step S22 includes: The sample data was divided into a first dataset for training and a second dataset for validation in a 7:3 ratio. Numerical standardization is performed on the first and second datasets to make the numerical ranges of different physical quantities consistent. The physical information neural network parameters are updated in batches. When the error value calculated using the second dataset decreases by less than the preset reduction threshold multiple times, the current physical information neural network parameters are saved.

[0034] In this embodiment of the invention, the entire 1.2 million sets of input-output samples are deterministically divided into two mutually exclusive datasets using a fixed random seed: a first dataset containing 840,000 samples, used for parameter training of the physical information neural network; and a second dataset containing 360,000 samples, used to verify the generalization ability of the model during training.

[0035] Z-score numerical standardization is performed on all input and output matrices containing physical quantities in both the first and second datasets. Specifically, the mean and standard deviation of each physical quantity matrix in the first dataset are calculated, and then this fixed set of mean and standard deviation is used to transform all corresponding matrices in both the first and second datasets. This operation uniformly scales the values ​​of different physical quantities (such as water level and momentum) to a similar distribution range, thereby improving the convergence speed and stability of neural network training.

[0036] The parameters of the physical information neural network are iteratively updated using mini-batch gradient descent, with each batch processing 512 samples. After completing one full traversal of the first dataset (one training cycle), the error value of the current network is immediately evaluated using the second dataset. A "patience" counter with a value of 10 is set during training. If no new minimum error value is found in the error value calculated using the second dataset within 10 consecutive training cycles, the model is considered to have reached optimal convergence and training is terminated. Finally, the physical information neural network parameters corresponding to the lowest error value on the second dataset during the entire training process are saved as the final, fixed model.

[0037] Preferably, step S23 includes: The error value between the output matrix of the physical information neural network and the actual calculated matrix is ​​calculated. Adjust the parameters of the physical information neural network based on the error value; The performance of the physical information neural network was tested using a second dataset, and training was terminated when the error value fell below a pre-set accuracy threshold.

[0038] In this embodiment of the invention, the training iteration process is performed according to the loss function L defined above. In each iteration, the loss value of the current training batch data is first calculated using the loss function L. Based on this loss value, the gradient of the loss function L with respect to each weight and bias parameter in the neural network is calculated using the backpropagation algorithm, and the Adam optimizer performs parameter updates, with the goal of gradually reducing the subsequently calculated loss value.

[0039] After each training epoch, the network performance is immediately evaluated using a second dataset and the same loss function L, and its validation loss value is calculated. A global accuracy threshold, such as 0.05, is preset before training begins. Training terminates immediately when the validation loss value calculated on the second dataset first falls below this threshold, and the current network parameters are saved.

[0040] Preferably, step S3 includes the following steps: Step S31: Obtain the location coordinates, geometric dimensions, and catchment area of ​​the rainwater well; Step S32: Calculate the outflow from the rainwater grate based on the water depth around the rainwater well; Step S33: Calculate the outflow of rainwater wells using a drainage calculation model to couple the surface runoff process with the urban pipe network drainage process; Step S34: Use the calculated rainwater well outflow as the reduction in surface water flow and the increase in the pipe network system to complete the two-way water exchange.

[0041] In this embodiment of the invention, the precise geographic coordinates of all storm drains within the study area are obtained using Geographic Information System (GIS) data. Each coordinate point is associated with a record containing its physical attributes, which explicitly records the geometric dimensions of the storm drain, including the specific model of the storm drain grate used (e.g., type X1 in national standard drawing 16S518) and the diameter of the connecting pipe. , well deep And the sum of the circumferences of each orifice, determined by the model. and the cross-sectional area of ​​the connecting pipe .

[0042] Within each time step of the simulation, the system traverses all grid cells containing stormwater wells in parallel. The surface water depth matrix at the current time is accessed directly via indexing. Extract the water depth value at the center point of each rainwater well unit. The water depth value h is used as the core dynamic input parameter to trigger and drive subsequent storm drain outflow calculations.

[0043] Construct a generalized model of urban pipe network drainage, which incorporates water depth-based... The conditional logic is used to calculate the outflow of each rainwater well. When the water is deep When the storm drain is shallow and the grate is not completely submerged, the weir flow formula is used for calculation. The expression for the weir flow formula is: ; When the water depth When the flow rate is large and the storm drain grate is completely submerged, the flow rate is calculated using the nozzle flow formula. Its calculation expression is: ; in, The comprehensive flow coefficient of the nozzle flow; This refers to the cross-sectional area of ​​the connecting pipe; It is the acceleration due to gravity; The water depth is located 1 meter upstream of the rain grate. This refers to the depth of the rainwater well. The diameter of the connecting pipe is [value]. This achieves dynamic coupling between surface runoff and urban drainage processes.

[0044] The outflow rate of each rainwater well calculated in the previous step Multiply by the current calculation time step This yields the amount of water discharged through storm drains within that time step. This water volume is treated as a negative source term in the surface runoff model, meaning it is subtracted from the water volume of the corresponding grid cell. Simultaneously, conceptually, this water volume serves as a source term for water entering the underground pipe network system, thus completing the exchange of surface water flow to the pipe network system and achieving bidirectional water balance.

[0045] Preferably, step S32 includes: Obtain the surface water depth and pipe network water level values ​​around the rainwater well; Compare the surface water depth value with the pre-set first water depth judgment value and the second water depth judgment value; When the surface water depth is less than the first water depth judgment value, the rainwater well outflow is calculated using a linear proportional relationship; When the surface water depth is greater than or equal to the first water depth judgment value and less than the second water depth judgment value, the outflow of rainwater wells is calculated using a nonlinear relationship. When the surface water depth is greater than or equal to the second water depth judgment value, the rainwater well outflow is calculated based on the head difference at the wellhead.

[0046] In this embodiment of the invention, at each computation time step, the system acquires the surface water depth values ​​of all grid cells containing rainwater wells in parallel. Simultaneously, the water level values ​​in the underground pipe network connected to each rainwater well are obtained. This value serves as the basis for calculating the head difference.

[0047] Two fixed water depth judgment values ​​are preset: the first water depth judgment value. For example, 0.01 meters is used to define extremely shallow water flow; the second water depth judgment value Its value is equal to the height of the storm drain inlet, used to determine whether the drain opening is completely submerged. In the calculation, the obtained surface water depth value is used. and and Parallel comparisons are performed to determine the specific discharge status of the current rainwater well.

[0048] Local surface water depth Less than the first water depth judgment value To ensure the stability of the numerical calculations, a linear proportional relationship was used to calculate the flow rate. Its calculation expression is: The proportionality coefficient The value is determined by The conditions for equal flow values ​​for linear and nonlinear relationships are determined.

[0049] Local surface water depth Greater than or equal to the first water depth judgment value And less than the second water depth judgment value At that time, the storm drain grate was in a free weir flow state, and the flow rate was calculated using a nonlinear weir flow formula. Its calculation expression is: ; in The comprehensive flow coefficient of the weir is... It is the sum of the circumferences of all the openings of the grate.

[0050] When the surface water depth h is greater than or equal to the second water depth judgment value At this time, the rainwater grate is in a state of submerged flow at the orifice, and the flow rate is calculated based on the head difference at the wellhead. Its calculation expression is: ; in The comprehensive flow coefficient of the nozzle flow. The cross-sectional area of ​​the connecting pipe is... This is the acceleration due to gravity.

[0051] Preferably, step S4 includes the following steps: Step S41: Obtain the number of grid cells, vertices, and edges in the computational domain; Step S42: Merge the mesh vertices to generate a multi-layered mesh structure; Step S43: Perform computational domain partitioning on the multi-level mesh structure; Step S44: Map the segmentation results back to the original mesh; Step S45: Determine the sub-computation domain boundary cells and the data exchange area.

[0052] Obtain the topological information of the computation domain, confirming that it contains 200,000 triangular mesh cells, 129,772 vertices, and 102,887 edges. Establish a globally unique index for all mesh cells, vertices, and edges, serving as the basis for subsequent computation domain partitioning and data management.

[0053] Iteratively merge mesh vertices to generate a multi-level mesh structure. Initialize all vertex weights to 1. Visit non-sparse vertices in random order. Calculate its relationship with all non-sparse neighboring vertices. The weights are summed, and the option that maximizes the sum is chosen. and The vertices are merged into a single supernode, with the supernode's weight being the sum of the weights of the two vertices. This process is repeated iteratively, generating a series of multi-level mesh structures with decreasing size, until the number of vertices drops to a preset threshold.

[0054] On the coarsest level of the mesh structure, initial computational domain partitioning is performed. A starting vertex is randomly selected for the first subdomain, and the subdomain is expanded by continuously adding its unassigned neighboring vertices until its cumulative weight reaches one-quarter of the total weight. Then, a new starting vertex is selected from the boundary of the assigned subdomains, and this expansion process is repeated until all vertices are assigned to one of the four subdomains, thus ensuring that the subdomains are load-balanced and physically topologically continuous.

[0055] The partitioning results of the coarsest level mesh are mapped back to the original fine mesh level by level. In each level of mapping, the subdomain affiliation information of the supernode is directly assigned to all the original nodes before the merging at the previous level. This process is executed in reverse from the coarsest level to the original mesh, ultimately resulting in a four-subdomain partitioning scheme for the original computational domain.

[0056] At the boundaries where the four sub-computation domains are adjacent, a data exchange area is defined. An immersion unit is added outside the boundary unit of each sub-domain. The immersion unit of each sub-domain corresponds strictly one-to-one with the communication unit of its neighboring sub-domain in the topology. The communication unit participates in numerical computation as an internal unit of its sub-domain, while the immersion unit does not participate in computation but is only used to receive state data updates from the communication unit of the neighboring sub-domain at each time step.

[0057] Preferably, the merging of mesh vertices in step S42 includes: Assign initial vertex weights to each grid vertex; Calculate the connectivity degree between each vertex and its adjacent vertices; Select the pair of vertices with the highest degree of connection and merge them into a new vertex; Update the vertex weights and connectivity of the new vertices; Repeat the selection and merging operations until the grid simplification reaches the predetermined amount.

[0058] In this embodiment of the invention, the newly generated supernode The weights and connectivity relationships need to be updated. The supernode weight is calculated as the sum of the original vertex weights: The connection update involves three steps: First, merge. and All adjacent vertices are Adjacent vertex set Secondly, regarding Each vertex in Calculate its relationship with New connection correlation ,in and The original correlation degree, As the overlap factor, when At the same time with and Adjacent ,otherwise Finally, update the max heap and remove all heaps containing... or Add all vertex pairs containing A new pair of vertices. Supernode Inheritance is still required and Hydrological parameters, such as roughness coefficient and permeability coefficient, are calculated using an area-weighted average method. This update strategy ensures that supernodes retain the geometric and physical properties of the original vertices while establishing reasonable new topological relationships.

[0059] Preferably, step S43 includes: Select a vertex as the starting vertex of the first sub-computation domain; The starting vertex and its adjacent vertices are gradually added to the sub-computation domain until the number of vertices contained in the sub-computation domain reaches the preset number. Select the vertex that is adjacent to the already divided sub-computation domain from the remaining vertices as the starting vertex of the next sub-computation domain; Repeat the above addition process until all vertices are assigned to the sub-computation domain; Check the number of vertices in each sub-computation domain and balance them by adjusting the affiliation of boundary vertices.

[0060] In this embodiment of the invention, a supernode is randomly selected as the first sub-computation domain on the coarsest level of the mesh structure. The starting point is determined using a breadth-first region growth algorithm, which gradually adds the starting point and its unassigned neighboring supernodes to the subdomain. In the middle, and accumulate their weights until... The total weight reaches or exceeds the preset target weight of 32443 (total weight 129772 divided by 4). Subsequently, from the allocated subdomains... At the boundary, select an unassigned adjacent supernode as the second sub-computation domain. The starting point. Repeat this region growth process to generate subdomains sequentially. and Finally, assign all remaining supernodes to the last subdomain. This completes the initial partitioning of all vertices.

[0061] After the initial partitioning, the final weights of the four sub-computation domains are checked. If the weight deviation between sub-domains exceeds the preset tolerance of 5%, a boundary adjustment procedure is initiated. This procedure iteratively optimizes the partitioning scheme by moving the boundary supernodes of overloaded sub-domains to adjacent lightly loaded sub-domains until the weights of all sub-domains are within the tolerance range of the target weight values, thereby ensuring the final computational load balance.

[0062] Preferably, step S5 includes the following steps: Step S51: Allocate independent computing resources to each sub-computing domain and establish communication relationships between sub-computing domains; Step S52: Deploy the simulation prediction model and drainage calculation model on each sub-computation domain, and perform internal calculations simultaneously; Step S53: After the calculation is completed, adjacent sub-computation domains exchange boundary data; Step S54: Each sub-computation domain determines its own time step based on the calculation results; Step S55: Determine the global minimum time step by comparing the time steps of all sub-computation domains; Step S56: When the preset simulation duration is reached or the water depth change is less than the preset threshold, the results of each sub-computation domain are integrated to form a complete urban flood simulation result.

[0063] In this embodiment of the invention, four sub-computation domains are deterministically allocated to four independent GPU computing resources. The NCCL communicator is initialized, assigning each GPU a unique rank identifier from 0 to 3. The NCCL automatically establishes an optimized communication path based on the underlying PCIe or NVLink hardware topology, forming a communication group containing four processes for subsequent data exchange.

[0064] The same simulation prediction model (PINN) and drainage calculation model are loaded and deployed in parallel on four GPUs. Each GPU independently performs an internal calculation for all grid cells within its sub-computation domain once per time step, performing surface runoff evolution by calling the PINN model and processing stormwater well source and sink terms using the drainage calculation model.

[0065] After internal calculations are completed, each GPU packages the conserved data at the center of its communication unit into a transmit buffer of size 4 × 19802. Then, an NCCL is initiated. The collective communication operation asynchronously distributes the transmit buffer data of each GPU to its corresponding neighboring GPUs and receives data from neighboring GPUs to update the immersion cell state of the local domain.

[0066] Within each sub-computational domain, based on the maximum wave velocity matrix obtained from flux calculation and according to the CFL stability condition, a local minimum time step is calculated. ,in Let k be the rank of the GPU (0≤k≤3).

[0067] Start an NCCL The collective communication operation is set to the minimum value calculation. The four GPUs will each compute their own local minimum time step. As input, the operation efficiently computes the globally unique minimum time step across all GPUs and returns the result to all four GPUs to unify the time progression across the entire computation domain.

[0068] After each time step update, check whether the current cumulative simulation duration has reached the preset 6 hours, or whether the maximum change in global water depth is less than 6 hours. Meters. When any condition is met, all GPU processes terminate the computation loop. Finally, the result data matrices from the four sub-computation domains are transferred and aggregated onto the rank-0 GPU, and stitched together according to the domain partitioning scheme to form a complete urban flood simulation result map.

[0069] Please see Figure 2 This is a schematic diagram of the rapid simulation calculation process for urban flooding. The process begins with the CPU main process, first initializing the computational domain, including dividing the simulation area into triangular meshes and establishing data matrices for water level, depth, and momentum (corresponding to step S1). Then, the computational domain is divided into several subdomains and bound to independent GPU processes. Each GPU process copies the data and numerical calculation algorithms to its memory and executes core calculations in parallel—based on PINN, sequentially performing reconstruction calculations, flux calculations, slope and friction source term calculations, and flux updates (corresponding to step S2). After each round of local calculations, the boundary data of adjacent subdomains is updated through the NCCL communication mechanism (corresponding to step S53). The process iterates until the simulation time t reaches a preset duration timl or the water depth change is less than the convergence threshold. Finally, the calculation results from each GPU are copied to memory, all subdomain outputs are merged, and the results are saved and output (corresponding to step S56).

[0070] Please see Figure 3 This is a schematic diagram of the physical information neural network structure for solving the finite volume equation of a two-dimensional shallow water equation. The left side of the diagram clearly shows the governing equations of the two-dimensional shallow water equation in the form of... ,in It is a vector of conserved variables (including physical quantities such as water level, water depth, longitudinal and lateral momentum). It is the flux vector. As the gradient operator, this equation provides the core physical constraints (PDE constraints) for PINN; the intermediate module NN(w,b) is the main body of the PINN network, where w and b represent the network weights and bias parameters, respectively, and the network input layer receives... The corresponding water level matrix, water depth matrix, elevation matrix, and momentum matrix (corresponding to the input parameters in step S22) are activated by the activation function. Feature mapping and nonlinear calculation are completed; on the right, the error between the network prediction and the actual numerical calculation result is quantified by the Loss function. The network parameters are optimized iteratively through backpropagation (corresponding to the training process in step S23) when the error E is less than the preset threshold or the maximum number of iterations maxit is reached as the termination condition. Finally, a simulation prediction model that can replace traditional numerical calculation is formed.

[0071] Please see Figure 4 This diagram illustrates the sub-computation domain segmentation for urban flood simulation. It demonstrates the computation domain segmentation process based on the principle of "balanced load + topology consistency" (corresponding to step S4): First, initial weights are assigned to the vertices of the triangular mesh in the original computation domain. Then, by calculating the connectivity between vertices and merging the pairs of vertices with the highest connectivity, a multi-level mesh structure from fine to coarse is generated (corresponding to step S42). On the coarsest level mesh, a region growth method is used, gradually adding adjacent vertices starting from a given vertex until the number of vertices in each sub-computation domain meets the load balancing requirements (corresponding to step S43). Finally, the segmentation result is mapped back to the original fine mesh. Different marked areas in the diagram represent several sub-computation domains after the division. Boundary cells and data exchange areas (including immersion cells and communication cells) are marked at the boundaries of each sub-computation domain, ensuring physical topological continuity between sub-domains and laying the foundation for boundary data interaction in subsequent multi-GPU parallel computing (corresponding to step S45).

[0072] Please see Figure 5This is a schematic diagram of the NCCL communication mechanism for GPU data between sub-computation domains, which is divided into two parts: (a) point-to-point communication (all_to_all operation) and (b) global reduction communication (all_reduce operation). In the figure, (a) corresponds to the boundary data exchange in step S53: GPU0~GPU3 are bound to 4 independent sub-computation domains respectively. Each GPU distributes the conserved data of the local sub-domain boundary communication unit (such as A0 of GPU0, B0 of GPU1, etc.) asynchronously to the adjacent GPU through NCCL, and at the same time receives the corresponding data of other GPUs (such as A0, A2, A3 of GPU0), realizing the boundary data interaction between sub-computation domains, which is used to update the state of the local immersion unit; (b) corresponds to the time step unification in step S55: Each GPU first calculates the local minimum time step of the local sub-domain based on the CFL stability condition (such as T0 of GPU0, T1 of GPU1, etc.), summarizes all local time steps through the all_reduce (minimum value) operation of NCCL, calculates and synchronizes the global minimum time step to all GPUs, ensures the consistency of the time advancement of the entire computing domain, and avoids numerical instability problems.

[0073] Therefore, the embodiments should be considered as exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of the equivalents of the application are intended to be included within the invention.

[0074] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features of the invention herein.

Claims

1. A city flood simulation method based on physical information neural network and multi-GPU computing, characterized in that, The method includes the following steps: Step S1: Divide the computational domain in the urban flood simulation into a triangular mesh and establish a data matrix. Divide the solution process into reconstruction calculation, flux calculation, slope and friction source term calculation and flux update, and then construct the finite volume solution process of the two-dimensional shallow water equation. Step S2: Use a physical information neural network to replace the numerical calculation steps in the finite volume solution process of the two-dimensional shallow water equation. Obtain a simulation prediction model through training the physical information neural network, and apply the simulation prediction model to quickly calculate the surface runoff process. Step S3: Couple the urban pipe network drainage process with the surface runoff process in the urban flood simulation, construct a drainage calculation model, and use the drainage calculation model to calculate the water exchange between rainwater wells, the surface, and the pipe network; Step S4: Construct a computing domain partitioning scheme according to the principles of load balancing and topology consistency, dividing the overall modeling area into several sub-computing domains; Step S4 includes the following steps: Step S41: Obtain the number of grid cells, vertices, and edges in the computational domain; Step S42: Merge the mesh vertices to generate a multi-layered mesh structure; The merging of mesh vertices in step S42 includes: Assign initial vertex weights to each grid vertex; Calculate the connectivity degree between each vertex and its adjacent vertices; Select the pair of vertices with the highest degree of connection and merge them into a new vertex; Update the vertex weights and connectivity of the new vertices; Repeat the selection and merging operation until the grid simplification reaches the predetermined number; Step S43: Perform computational domain partitioning on the multi-level mesh structure; Step S43 includes: Select a vertex as the starting vertex of the first sub-computation domain; The starting vertex and its adjacent vertices are gradually added to the sub-computation domain until the number of vertices contained in the sub-computation domain reaches the preset number. Select the vertex that is adjacent to the already divided sub-computation domain from the remaining vertices as the starting vertex of the next sub-computation domain; Repeat the above addition process until all vertices are assigned to the sub-computation domain; Check the number of vertices in each sub-computation domain and balance them by adjusting the ownership of boundary vertices; Step S44: Map the segmentation results back to the original mesh; Step S45: Determine the sub-computation domain boundary cells and the data exchange area; Step S5: Construct a data communication method between sub-computing domains, and integrate the simulation prediction model and the drainage calculation model to achieve multi-processor parallel computing in each sub-computing domain.

2. The urban flood simulation method based on physical information neural network and multi-GPU computing according to claim 1, characterized in that, Step S1 includes the following steps: Step S11: Divide the computational domain in the urban flood simulation into triangular mesh cells; Step S12: Establish a data matrix representing water level, water depth, elevation, and momentum; Step S13: Construct a cell adjacency matrix and record the adjacent cell indices and boundary information; Step S14: The four calculation steps of reconstruction calculation, flux calculation, bottom slope and friction source term calculation and flux update are constructed into batch matrix operations to form a finite volume solution process for the two-dimensional shallow water equation.

3. The urban flood simulation method based on physical information neural network and multi-GPU computing according to claim 1, characterized in that, Step S2 includes the following steps: Step S21: Collect simulation data under different rainfall conditions, and obtain a sample set of input parameters and their corresponding output results, including water level matrix, water depth matrix, elevation matrix and momentum matrix; Step S22: Construct physical information neural networks for the four calculation steps: reconstruction calculation, flux calculation, slope and friction source term calculation, and flux update. Step S23: Reduce the difference between the predicted value and the true value by adjusting the parameters of the physical information neural network to obtain a simulation prediction model; Step S24: Apply the simulation prediction model to urban flood simulation calculations to replace traditional numerical calculation methods for rapid solution of surface runoff processes.

4. The urban flood simulation method based on physical information neural network and multi-GPU computing according to claim 3, characterized in that, The construction of the physical information neural network in step S22 includes: The physical information neural network that determines the water level matrix, water depth matrix, elevation matrix and momentum matrix of the receiving unit in the reconstruction calculation step outputs the updated water flow characteristic matrix; When the value in the water depth matrix is ​​lower than the preset water depth threshold, the calculation unit dedicated to shallow water treatment is activated. When buildings exist within the computational area, adjust the computational parameters of the corresponding grid cells.

5. The urban flood simulation method based on physical information neural network and multi-GPU computing according to claim 1, characterized in that, Step S3 includes the following steps: Step S31: Obtain the location coordinates, geometric dimensions, and catchment area of ​​the rainwater well; Step S32: Calculate the outflow from the rainwater grate based on the water depth around the rainwater well; Step S33: Calculate the outflow of rainwater wells using a drainage calculation model to couple the surface runoff process with the urban pipe network drainage process; Step S34: Use the calculated rainwater well outflow as the reduction in surface water flow and the increase in the pipe network system to complete the two-way water exchange.

6. The urban flood simulation method based on physical information neural network and multi-GPU computing according to claim 5, characterized in that, Step S32 includes: Obtain the surface water depth and pipe network water level values ​​around the rainwater well; Compare the surface water depth value with the pre-set first water depth judgment value and the second water depth judgment value; When the surface water depth is less than the first water depth judgment value, the rainwater well outflow is calculated using a linear proportional relationship; When the surface water depth is greater than or equal to the first water depth judgment value and less than the second water depth judgment value, the outflow of rainwater wells is calculated using a nonlinear relationship. When the surface water depth is greater than or equal to the second water depth judgment value, the rainwater well outflow is calculated based on the head difference at the wellhead.

7. The urban flood simulation method based on physical information neural network and multi-GPU computing according to claim 1, characterized in that, Step S5 includes the following steps: Step S51: Allocate independent computing resources to each sub-computing domain and establish communication relationships between sub-computing domains; Step S52: Deploy the simulation prediction model and drainage calculation model on each sub-computation domain, and perform internal calculations simultaneously; Step S53: After the calculation is completed, adjacent sub-computation domains exchange boundary data; Step S54: Each sub-computation domain determines its own time step based on the calculation results; Step S55: Determine the global minimum time step by comparing the time steps of all sub-computation domains; Step S56: When the preset simulation duration is reached or the water depth change is less than the preset threshold, the results of each sub-computation domain are integrated to form a complete urban flood simulation result.