Lake water flow efficient simulation method based on multi-GPU parallel computing

Through multi-GPU parallel computing technology and unstructured triangular mesh generation, the problem of low computational efficiency in large-scale lake flow simulations is solved, efficient simulation of lake flow processes is achieved, and support for watershed management and water resources planning is achieved.

CN120688387APending Publication Date: 2025-09-23NORTH CHINA ELECTRIC POWER UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510747074.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-05
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

Existing technologies have low computational efficiency when dealing with large-scale lakes with complex terrain, and are unable to meet the simulation and prediction needs of long time series and multiple scenario scenarios.

Method used

Multi-GPU parallel computing technology is adopted, combined with the finite volume method and unstructured triangular mesh generation, the Roe format is used to calculate the normal flux, and upstream and downstream boundary conditions are set. The CUDA programming framework is used to achieve parallel computing and optimize memory management and data communication.

Benefits of technology

It has achieved efficient simulation of water flow processes in large-scale lakes, improved computing efficiency, and can accurately simulate the alternating changes of river and lake phases in lakes within a year, providing basic data for river basin management and water resources planning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120688387A_ABST
    Figure CN120688387A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of lake water power simulation, and discloses a lake water flow efficient simulation method based on multi-GPU parallel computing, which comprises the following steps: establishing a two-dimensional shallow water control equation according to lake water flow data, discretizing the two-dimensional shallow water control equation by adopting a finite volume method, and subdividing a lake computational domain by adopting an unstructured triangular mesh; calculating the normal flux of the two-dimensional shallow water control interface by adopting a Roe format, and performing source item processing; upstream and downstream corresponding boundary conditions are set, and a minimum water depth method is adopted to process dry and wet boundaries; and solving the two-dimensional shallow water control equation in combination with a multi-GPU parallel computing technology to obtain a lake water flow simulation result. The lake water flow high-efficiency simulation method based on multi-GPU parallel computing can accurately simulate the alternation change of the river and lake phases in the lake year, and provides basic hydrodynamic factors for supporting drainage basin management, water resource planning and other aspects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of lake hydrodynamic simulation, and in particular to an efficient lake water flow simulation method based on multi-GPU parallel computing. Background Art

[0002] Numerical simulations overcome limitations such as complex terrain and outflow conditions, providing a basis for obtaining detailed hydrological and hydrodynamic information. Two-dimensional hydrodynamic models can provide instantaneous state variables such as water depth and flow velocity, accurately depicting spatiotemporal variations at high resolution and continuous time scales, making them a key tool for studying the evolution of river and lake flows. However, with the improvement of simulation accuracy and the increasing complexity of the terrain in the study area, the number of spatially discrete grids must be significantly increased to accurately represent the complex terrain and underlying surface conditions. This puts enormous computational pressure on the solution process, significantly prolongs model simulation time, and significantly reduces the model's practical application value. Summary of the Invention

[0003] In response to the above-mentioned deficiencies in the prior art, the present invention provides an efficient lake flow simulation method based on multi-GPU parallel computing. This method effectively adapts to complex terrain conditions and inlet and outlet boundaries, performs well in scenarios with large water areas, large water surface drops and strong hydrodynamic effects, and realizes efficient simulation of long-term series of large-scale lake hydrodynamic processes.

[0004] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is:

[0005] An efficient lake flow simulation method based on multi-GPU parallel computing includes the following steps:

[0006] The two-dimensional shallow water governing equations were established based on lake flow data, the finite volume method was used to discretize the two-dimensional shallow water governing equations, and the lake computational domain was divided using an unstructured triangular mesh.

[0007] The normal flux of the two-dimensional shallow water control interface is calculated using the Roe scheme and source term processing is performed;

[0008] Set corresponding upstream and downstream boundary conditions and use the minimum water depth method to deal with the dry and wet boundaries;

[0009] The two-dimensional shallow water control equations are solved by combining multi-GPU parallel computing technology to obtain lake flow simulation results.

[0010] Furthermore, the two-dimensional shallow water control equation is established based on the lake flow data:

[0011]

[0012] in,

[0013]

[0014] S=S o +S f +S w +S e

[0015] Where U is the conserved variable vector; F and G are the flux vectors in the x and y directions respectively; x and y are the horizontal coordinates in space; h is the water depth; u and v are the average flow velocities in the x and y directions respectively; g is the acceleration of gravity; S o 、S f are the bottom slope term and the friction slope respectively; S w 、S e are wind stress and Coriolis force source terms respectively; t is time; S is the source term vector.

[0016] Furthermore, the finite volume method is used to discretize the two-dimensional shallow water governing equations, including:

[0017] The entire computational domain is divided into several interconnected but non-overlapping control volumes, and the basic equations are integrated over each control volume to obtain a set of algebraic equations with the physical quantities at the computational nodes as unknowns to be solved.

[0018] Furthermore, the finite volume method is used to discretize the two-dimensional shallow water control equation as follows:

[0019]

[0020] Where U is the conserved variable vector; Δt is the discrete time step; Δs k is the area of ​​the control volume; E ki , n ki and Δl ki They correspond to the numerical flux, unit external normal vector and edge length of the j-th edge of control volume i respectively; is the integral value of the bottom slope term in the grid unit; S f S is the friction slope; w 、S e are wind stress and Coriolis force source terms, respectively.

[0021] Furthermore, performing source item processing includes:

[0022] The bottom slope characteristic decomposition method is used to deal with the bottom slope source term, the Large-Pon wind stress drag coefficient method is used to deal with the wind stress term, and the semi-implicit format is used to deal with the friction term and the Coriolis force term.

[0023] Furthermore, the multi-GPU parallel computing technology is used to solve the two-dimensional shallow water control equations, including:

[0024] Use C++ and CUDA programming framework to implement multi-GPU parallel computing process; the CPU controls the model logic relationship, and the GPU is responsible for parallel computing tasks;

[0025] According to the number of GPUs used, the large-scale computing domain is equally divided into a corresponding number of computing subdomains; at the same time, a public communication area is set up between the subdomains to realize the acquisition and transmission of computing results.

[0026] Furthermore, the multi-GPU parallel computing technology is used to solve the two-dimensional shallow water control equations, including:

[0027] The CPU thread on the host side reads the grid unit and node division, elevation information, initial water flow state, upstream flow boundary and downstream water level boundary data required for model calculation, and sets the Manning friction coefficient and minimum water depth parameters to initialize the model;

[0028] Set the Manning roughness coefficient, gravity acceleration, minimum water depth, wind direction, and wind speed variables as constant types. Set the grid properties, water depth, velocity calculation results, and boundary types as global variables. Use the cudaMalloc() function on the host to perform global dynamic declarations and copy them to the global memory pool of the graphics card memory using the cudaMemcpy() function.

[0029] The triangle mesh is used as the basic task unit of parallel computing, and the one-dimensional thread block structure is used to allocate the mesh units; in CUDA, threads are in Kernel<<<grid,block> In the >>() function declaration, grid is the size of the grid, block is the size of the thread block, and the product of the number of grid and block is set to be greater than or equal to the number of grid cells;

[0030] During model calculation, the total number of calculation steps is first determined based on the simulated physical time and the single-step time step. The Kernel function is started through a for loop to execute the calculation task. Each thread corresponds to a calculation task within a grid unit, and is responsible for processing the flux and source term calculations within a calculation task unit, and starts a separate kernel function to summarize the results and update the grid boundary type; after all threads complete the calculation, the calculation results are summarized in the video memory to provide a basis for the next calculation; the calculation process is controlled on the host side. After all calculation steps are completed, the cudaDeviceSynchronize() function is called to explicitly synchronize the asynchronous operations of the CPU and GPU to ensure that the GPU completes all calculation tasks and obtains the correct model calculation results; finally, the CUDA memory copy function is called to transfer the model calculation results from the graphics card to the host side and complete the output of the calculation results.

[0031] Furthermore, the multi-GPU parallel computing technology is used to solve the two-dimensional shallow water control equations, including:

[0032] The storage types of various variables are distinguished according to their specific logical connections in the simulation calculations. At the same time, a two-dimensional array is used in the CPU to store the transmitted water level and flow time series. A one-dimensional thread block structure is used to allocate units at the thread design level, and the two-dimensional array is converted into one-dimensional, which is then addressed and accessed in the GPU by calculating the subscript.

[0033] Furthermore, the multi-GPU parallel computing technology is used to solve the two-dimensional shallow water control equations, including:

[0034] First, GPU0 and GPU1 simulate computational subdomains 0 and 1, respectively. After the simulation, synchronization is performed to ensure that the video memory data is fully updated. Subsequently, data is transferred between GPUs, and the computational results of communication domains 0 and 1 are updated to communication domain 10 and communication domain 01, respectively, providing data support for the simulation of each subdomain in the next computational time step.

[0035] The present invention has the following beneficial effects:

[0036] The efficient lake flow simulation method developed in this paper, based on multi-GPU parallel computing, can accurately simulate the alternating river and lake phases within a lake during the year, providing fundamental hydrodynamic factors for supporting watershed management and water resources planning. This method demonstrates high computational efficiency when dealing with large lakes with complex terrain, meeting the needs of simulation and forecasting scenarios involving large water areas and intense hydrodynamic forces. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 A flow chart of an efficient lake flow simulation method based on multi-GPU parallel computing.

[0038] Figure 2 Schematic diagram of the finite volume method solution for a two-dimensional model.

[0039] Figure 3 This is a flow chart of the hydrodynamic model based on GPU parallel computing based on CUDA architecture.

[0040] Figure 4 Schematic diagram of unstructured grid subdomain division and data communication.

[0041] Figure 5 This is the periodic result of water level rate of the two-dimensional hydrodynamic model of Poyang Lake.

[0042] Figure 6 These are the results of the water level validation period for the two-dimensional hydrodynamic model of Poyang Lake. DETAILED DESCRIPTION

[0043] The specific embodiments of the present invention are described below to facilitate understanding of the present invention by those skilled in the art. However, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the appended claims, these changes are obvious, and all inventions and creations utilizing the concepts of the present invention are protected.

[0044] Traditional lake flow simulation methods suffer from low computational efficiency when dealing with large-scale lakes with complex terrain, making it difficult to meet the needs of long-term series and multi-scenario simulation and prediction. This paper proposes an efficient lake flow simulation method based on multi-GPU parallel computing. The method mainly includes two parts: two-dimensional hydrodynamic model construction and multi-GPU parallel acceleration method based on CUDA architecture. In terms of two-dimensional hydrodynamic model construction, the interface numerical flux calculation, source term processing, boundary conditions, dry-wet boundaries, and stability conditions are comprehensively considered. In terms of multi-GPU parallel acceleration based on CUDA architecture, C++ and CUDA programming framework are used to implement multi-GPU parallel computing process to improve computational efficiency.

[0045] like Figure 1 As shown, an embodiment of the present invention provides an efficient lake water flow simulation method based on multi-GPU parallel computing, including the following steps S1 to S4:

[0046] S1. Establish a two-dimensional shallow water governing equation based on lake flow data, discretize the two-dimensional shallow water governing equation using the finite volume method, and use an unstructured triangular mesh to divide the lake computational domain;

[0047] In an optional embodiment of the present invention, the control equation in step S1 adopts a two-dimensional shallow water equation with average water depth, which is suitable for characterizing the width and shallowness characteristics of the lake; the control equation is discretized using the finite volume method, that is, the entire calculation domain is divided into a number of interconnected but non-overlapping control volumes, and the basic equation is integrated for each control volume to obtain a set of algebraic equations with physical quantities on the calculation nodes as unknowns to be solved.

[0048] Figure 2 This is a schematic diagram of the finite volume method solution for a two-dimensional model. A single cell is used as the control volume, and an unstructured triangular mesh is used to divide the computational domain. The specific steps for model construction and finite volume discretization are:

[0049] (1) In view of the wide and shallow characteristics of lakes, a two-dimensional shallow water equation with average water depth is adopted. The conservation form of the two-dimensional shallow water control equation is shown in formula (1):

[0050]

[0051] in,

[0052]

[0053] S=S o +S f +S w +S e

[0054] Where U is the conserved variable vector; F and G are the flux vectors in the x and y directions respectively; x and y are the horizontal coordinates in space; h is the water depth; u and v are the average flow velocities in the x and y directions respectively; g is the acceleration of gravity; S o 、S f are the bottom slope term and the friction slope respectively; S w 、S e are wind stress and Coriolis force source terms respectively; t is time; S is the source term vector.

[0055] The expressions of each source term are:

[0056]

[0057] Among them, S ox 、S oy are the bottom slopes in the x and y directions respectively, and the calculation formula is:

[0058]

[0059] Among them, Z b is the bottom bed elevation.

[0060] The water flow resistance is calculated using the Manning formula:

[0061]

[0062] Where n is the Manning roughness coefficient.

[0063] The lake water body is driven by wind, and the flow velocity and direction change accordingly. The expression of the wind stress on the lake surface is:

[0064]

[0065] Among them, ρ a is the air density, approximated by ρ a =1.205kg / m 3 (20℃ standard atmospheric pressure); ρ w is the water density, take 1.0×10 3 kg / m 3 ;u w and v w is the x- and y-direction components of the wind stress at a height of 10 m above the water surface; C w is the wind stress drag coefficient.

[0066] The Coriolis force reflects the influence of the Earth's rotation on water bodies and is related to the water flow velocity, the angular velocity of the Earth's rotation, and the latitude of the calculation domain. The calculation formula for the Coriolis force coefficient f is:

[0067]

[0068] Where ω is the average angular velocity of the Earth's rotation, which is 7.29×10 -5 rad / s; is the latitude of the study area, with positive direction in the northern hemisphere and negative direction in the southern hemisphere.

[0069] (2) The control equations are discretized using the finite volume method, that is, the entire computational domain is divided into several interconnected but non-overlapping control volumes, and the basic equations are integrated over each control volume to obtain a set of algebraic equations with the physical quantities at the computational nodes as unknowns to be solved.

[0070] Integrating the two-dimensional shallow water control equations on any control volume Ω yields:

[0071]

[0072] Where E = [F, G].

[0073] Using Gauss's formula to transform the volume integral into a line integral along the control volume boundary, we can obtain:

[0074]

[0075] Among them, ΔU k is the mean of the control body; Δs k is the area of ​​the control volume; Δt is the discrete time step; n is the unit vector in the direction of the external normal; l k is the kth control volume Ω k the border.

[0076] Under unstructured grid, expand the spatial integral term and sort it out to get:

[0077]

[0078] in, is the source term approximation, which represents the integral value of the source term within the grid cell.

[0079] They represent the integral values ​​of bottom slope term, friction term, wind stress source term and Coriolis force term in the grid unit respectively.

[0080] The above formula can be simplified as:

[0081]

[0082] Where U is the conserved variable vector; Δt is the discrete time step; Δs k is the area of ​​the control volume; E ki , n ki and Δl ki They correspond to the numerical flux, unit external normal vector and edge length of the j-th edge of control volume i respectively; is the integral value of the bottom slope term in the grid cell; S f S is the friction slope; w 、S e are wind stress and Coriolis force source terms, respectively.

[0083] It can be seen from the above formula that the numerical solution of the two-dimensional shallow water equation involves the calculation of interface numerical flux and source term processing (bottom slope source term, friction source term, wind stress source term and Coriolis force term processing).

[0084] S2. Calculate the normal flux of the two-dimensional shallow water control interface using the Roe format and perform source term processing;

[0085] In an optional embodiment of the present invention, step S2 uses the Roe format to calculate the normal flux of the control unit interface; the source term processing includes: bottom slope source term, friction term, wind stress source term and Coriolis force term;

[0086] The source item processing in this embodiment includes:

[0087] The bottom slope characteristic decomposition method is used to deal with the bottom slope source term, the Large-Pon wind stress drag coefficient method is used to deal with the wind stress term, and the semi-implicit format is used to deal with the friction term and the Coriolis force term.

[0088] S3. Set the corresponding upstream and downstream boundary conditions and use the minimum water depth method to deal with the dry and wet boundaries;

[0089] In an optional embodiment of the present invention, in step S3, a flow boundary or a single-width flow boundary is set upstream, and a water level boundary is set downstream; and the minimum water depth method is used to process the dry-wet boundary.

[0090] S4. Combine multi-GPU parallel computing technology to solve the two-dimensional shallow water control equations and obtain lake flow simulation results.

[0091] In an optional embodiment of the present invention, step S4 uses C++ and CUDA programming framework to implement multi-GPU parallel computing process to improve computing efficiency, wherein the CPU controls the model logic relationship and the GPU is responsible for parallel computing tasks.

[0092] Figure 3 This is a flow chart of the hydrodynamic model based on GPU parallel computing based on the CUDA architecture. The specific implementation process is as follows:

[0093] (1) Environment initialization

[0094] The CPU thread on the host side reads the data required for model calculation, such as grid unit and node division, elevation information, initial water flow state, upstream flow boundary and downstream water level boundary, and sets parameters such as Manning friction coefficient and minimum water depth to initialize the model.

[0095] (2) Memory allocation

[0096] Proper memory management can greatly improve model efficiency. Prioritize register allocation for frequently used variables during calculations. Set variables such as the Manning roughness coefficient, gravity acceleration, minimum water depth, wind direction, and wind speed as constants. Set large computational data, such as mesh properties, water depth, flow velocity results, and boundary types, as global variables. Use the cudaMalloc() function on the host to dynamically declare them globally and use the cudaMemcpy() function to copy them to the global memory pool on the graphics card.

[0097] (3) Thread task allocation

[0098] The computational model uses triangular meshes as the basic task unit for parallel computing. Due to the complexity of the topology of unstructured meshes, it is impossible to map mesh units to CUDA two-dimensional thread blocks in matrix form. Therefore, a one-dimensional thread block structure is used to allocate mesh units.<grid,block> In the >>() function declaration, grid is the size of the grid and block is the size of the thread block. The product of the number of grid and the number of blocks is set to be greater than or equal to the number of grid cells.

[0099] (4) Model calculation

[0100] During model calculations, the total number of calculation steps is first determined based on the simulation physics time and the single-step time step length. A kernel function is then launched through a for loop to execute the calculation task. Each thread corresponds to a calculation task within a grid cell, responsible for processing the flux and source term calculations within that calculation task cell. A separate kernel function is also launched to aggregate the results and update the grid boundary type. After all threads complete the calculation, the results are aggregated into the graphics memory to provide a basis for the next calculation. The calculation process is controlled on the host side. After all calculation steps are completed, the cudaDeviceSynchronize() function is called to explicitly synchronize the asynchronous operations of the CPU and GPU, ensuring that the GPU completes all calculation tasks and obtains the correct model calculation results. Finally, the CUDA memory copy function is called to transfer the model calculation results from the graphics card to the host side and complete the output of the calculation results.

[0101] (5) Model optimization

[0102] Memory access is the main bottleneck of parallel model computing performance. Based on the specific logical connection of each variable in the simulation calculation, its storage type is carefully distinguished, and high-speed storage areas such as registers and constant memory are used as much as possible to avoid frequent data interaction between the host and the device, which can effectively improve computing efficiency. At the same time, the CPU uses a two-dimensional array to store the transmitted water level and flow time series. At the thread design level, a one-dimensional thread block structure is used to allocate units, converting the two-dimensional array into a one-dimensional one. The addressing and access in the GPU is performed by calculating the subscript, avoiding frequent addressing that reduces operating efficiency. In addition, the thread blocks and grids are reasonably configured to fully utilize the GPU multi-processor and thread resources to maximize parallel performance.

[0103] Figure 4 The figure is a schematic diagram of unstructured grid subdomain division and data communication. To achieve efficient simulation of large-scale computational domains, the present invention proposes a computational domain decomposition and data communication scheme for unstructured grids. Specifically, based on the number of GPUs used, the large-scale computational domain is equally divided into a corresponding number of computational subdomains. During the division process, the principle of ensuring that the number of units in each computational subdomain is as close as possible is adhered to to ensure balanced computational load on each GPU and fully unleash its computational performance. At the same time, in order to avoid frequent large-scale data communication and synchronization between some GPUs, a public communication area is set between the subdomains to achieve the acquisition and transmission of computational results with lower communication overhead.

[0104] In the multi-GPU parallel computing process, the memories of each GPU are independent of each other and lack direct continuity. Data exchange and sharing between different GPUs cannot be achieved through conventional memory address access and must rely on specific communication mechanisms. Since cross-GPU data transmission is usually accompanied by high communication overhead, designing an efficient communication strategy is the key to ensuring computing efficiency. The strategy adopted by the present invention is: by constructing a smaller communication area, the amount of data transmitted between GPUs is greatly reduced, thereby reducing data transmission overhead. Taking single-step calculation as an example, GPU0 and GPU1 first simulate the calculation subdomains 0 and 1 respectively, and perform synchronization operations after the simulation is completed to ensure that the video memory data is completely updated. Subsequently, data transmission is performed between GPUs, and the calculation results of communication domains 0 and 1 are updated to communication domain 10 and communication domain 01 respectively, providing data support for the simulation of each subdomain in the next calculation time step.

[0105] The present invention will be explained in detail below by applying the above method to a two-dimensional hydrodynamic model of Poyang Lake. Using 2010 Poyang Lake basin topography data and the historical flood inundation range as revealed by remote sensing imagery of Poyang Lake, the model's computational domain boundaries were determined using ArcGIS tools. An unstructured triangular mesh was employed to better fit the irregular shoreline of Poyang Lake, with a spatial step size of 20-1000 meters. The resulting mesh contained 145,506 nodes and 269,355 cells.

[0106] The runoff into the lake from seven flow stations in the "Five Rivers" basin, namely Waizhou, Lijiadu, Meigang, Hushan, Wanjiabu, Qiujin, and Dufengkeng, was used as the upstream inlet boundary condition of the hydrodynamic model; the water level process line of Hukou Station, the outlet of Poyang Lake, was used as the downstream outlet boundary condition to characterize the interaction between the lake and the Yangtze River; the remaining boundary ranges were set as closed boundaries, that is, land boundaries.

[0107] Poyang Lake wind data are derived from monthly wind speed and direction observations at Xingzi and Duchang stations from 1961 to 2010. Poyang Lake is vast and its water regime is complex, so wind stresses vary across the lake. However, due to the limited availability of monitoring stations and measured wind data, numerical simulations assume a uniform spatial distribution of wind across the lake. The measured wind data from Xingzi and Duchang stations are used to represent the wind forcing acting on Poyang Lake.

[0108] Figure 5 It is the regular result of the water level rate of the two-dimensional hydrodynamic model of Poyang Lake. It is calibrated using the measured water level values ​​of five stations in the lake area, namely Xingzi, Duchang, Tangyin, Kangshan and Wucheng, from 2018 to 2019. Figure 6 This is the result of the water level validation period of the two-dimensional hydrodynamic model of Poyang Lake, which is verified by the measured water level values ​​from 2020 to 2021. Table 1 shows the quantitative statistical results of the water level errors at five stations in the lake area, including the RE and R 2 , NSE were -2.08~1.70%, 0.93~1.00, 0.89~1.00 respectively; RE, R 2 The NSE values ​​are -1.72-1.85%, 0.96-1.00, and 0.92-1.00, respectively. The results show that the simulation accuracy of the water level during the regular and validation periods is high, and the annual water level variation of Poyang Lake is well presented.

[0109] Table 1 Calibration and verification accuracy of the water level of the Poyang Lake two-dimensional hydrodynamic model

[0110]

[0111] To better verify the reliability and accuracy of the results from the constructed two-dimensional hydrodynamic model of Poyang Lake, particularly the correspondence between the simulated lake surface and the actual lake surface, remote sensing imagery was used to compare the simulated inundation area. The statistical results in Table 2 indicate that the relative error in the simulated water surface area is within 10%, and the simulated inundation area is highly consistent with the remote sensing imagery in terms of temporal and spatial variations. The model effectively captures the dynamic changes in the lake's inundation area.

[0112] Table 2 Statistics of simulation errors of Poyang Lake water surface area

[0113]

[0114] MIKE21 is widely used in the simulation of water flow evolution in Poyang Lake. Therefore, the present invention uses the Poyang Lake MIKE21 hydrodynamic model to simulate the water flow evolution process under the same conditions, and compares its acceleration effect with the parallel acceleration effect of the two-dimensional hydrodynamic GPU model constructed by the present invention to evaluate the improvement effect of GPU parallel acceleration performance.

[0115] In the parallel efficiency test, the ratio of physical time to program running time R is used. T , as an evaluation index of model parallel efficiency to measure the acceleration effect of the model, R T The larger the value of R, the better the parallel computing efficiency. T The expression is:

[0116]

[0117] Where T is the time of the actual water flow process simulated, that is, physical time, which is numerically equal to the product of the calculation time step and the total number of calculation steps in the program settings; T n The running time of the two-dimensional hydrodynamic GPU parallel acceleration model or the MIKE21 model constructed by the present invention.

[0118] The evaluation results of parallel acceleration efficiency are shown in Table 3. When the actual water flow process is simulated for 7 days, the simulation time required by MIKE21 is about 88 minutes, and R T The value is 115; the constructed two-dimensional hydrodynamic GPU parallel acceleration model takes about 6 minutes, R T The value is 1680; compared with the MIKE21 model, the speedup ratio can be increased by about 14.6 times. The results show that the two-dimensional hydrodynamic GPU parallel acceleration model constructed in this paper has higher applicability in the long-term series simulation of Poyang Lake.

[0119] Table 3 Computational efficiency evaluation of parallel acceleration model

[0120]

[0121] Based on the finite volume method unstructured grid, a GPU-accelerated two-dimensional hydrodynamic model of the Poyang Lake area was constructed. The model water level and water surface area were verified using measured data. The calculation results show that the water level rate |RE| of the five stations in the lake area during the regular and verification periods is less than 2.1%, and R 2are all greater than 0.93, and the NSE are all greater than 0.9; compared with the flooded area of ​​remote sensing images, the relative error of the water surface area is within 10%, and the constructed model has a good ability to capture the spatiotemporal dynamic changes of the flooded area of ​​lakes; compared with MIKE21 which also uses GPU parallel computing, the acceleration ratio of the GPU parallel computing model constructed by the present invention can be increased by about 14.6 times, indicating that the constructed two-dimensional hydrodynamic model has high applicability in terms of computing speed and accuracy.

[0122] The highly efficient lake flow simulation method developed in this paper, based on multi-GPU parallel computing, can accurately simulate the alternating river and lake phases within a lake during the year, providing fundamental hydrodynamic factors to support watershed management and water resources planning. This method demonstrates high computational efficiency when dealing with large lakes with complex terrain, meeting the demands of simulation and forecasting scenarios involving large water areas and intense hydrodynamic forces, providing strong technical support for lake water resource management and ecological and environmental protection.

[0123] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0124] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0125] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0126] Specific embodiments are used in the present invention to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present invention.

[0127] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and it should be understood that the scope of protection of the present invention is not limited to such specific descriptions and embodiments. Those skilled in the art can make various other specific variations and combinations based on the technical teachings disclosed in the present invention without departing from the essence of the present invention, and such variations and combinations are still within the scope of protection of the present invention.

Claims

1. An efficient lake flow simulation method based on multi-GPU parallel computing, characterized by: The following steps are involved: The two-dimensional shallow water governing equations were established based on lake flow data, the finite volume method was used to discretize the two-dimensional shallow water governing equations, and the lake computational domain was divided using an unstructured triangular mesh. The normal flux of the two-dimensional shallow water control interface is calculated using the Roe scheme and source term processing is performed; Set corresponding upstream and downstream boundary conditions and use the minimum water depth method to deal with the dry and wet boundaries; The two-dimensional shallow water control equations are solved by combining multi-GPU parallel computing technology to obtain lake flow simulation results.

2. The method for efficiently simulating lake water flow based on multi-GPU parallel computing according to claim 1 is characterized in that: The two-dimensional shallow water control equation is established based on lake flow data: in, S=S o +S f +S w +S e Where U is the conserved variable vector; F and G are the flux vectors in the x and y directions respectively; x and y are the horizontal coordinates in space; h is the water depth; u and v are the average flow velocities in the x and y directions respectively; g is the acceleration of gravity; S o 、S f are the bottom slope term and the friction slope respectively; S w 、S e are wind stress and Coriolis force source terms respectively; t is time; S is the source term vector.

3. The method for efficiently simulating lake water flow based on multi-GPU parallel computing according to claim 1 is characterized in that: The two-dimensional shallow water governing equations discretized using the finite volume method include: The entire computational domain is divided into several interconnected but non-overlapping control volumes, and the basic equations are integrated over each control volume to obtain a set of algebraic equations with the physical quantities at the computational nodes as unknowns to be solved.

4. The method for efficiently simulating lake water flow based on multi-GPU parallel computing according to claim 1 is characterized in that: The finite volume method is used to discretize the two-dimensional shallow water control equation as follows: Where U is the conserved variable vector; Δt is the discrete time step; Δs k is the area of ​​the control volume; E ki , n ki and Δl ki are the numerical flux, unit external normal vector and edge length of the j-th edge of control volume i respectively; is the integral value of the bottom slope term in the grid unit; S f S is the friction slope; w 、S e are wind stress and Coriolis force source terms, respectively.

5. The method for efficiently simulating lake water flow based on multi-GPU parallel computing according to claim 1 is characterized in that: Source item processing includes: The bottom slope characteristic decomposition method is used to deal with the bottom slope source term, the Large-Pon wind stress drag coefficient method is used to deal with the wind stress term, and the semi-implicit format is used to deal with the friction term and the Coriolis force term.

6. The method for efficiently simulating lake water flow based on multi-GPU parallel computing according to claim 1, characterized in that: Combining multi-GPU parallel computing technology to solve the two-dimensional shallow water control equations includes: Use C++ and CUDA programming framework to implement multi-GPU parallel computing process; the CPU controls the model logic relationship, and the GPU is responsible for parallel computing tasks; According to the number of GPUs used, the large-scale computing domain is equally divided into a corresponding number of computing subdomains; at the same time, a public communication area is set up between the subdomains to realize the acquisition and transmission of computing results.

7. The method for efficiently simulating lake water flow based on multi-GPU parallel computing according to claim 1, characterized in that: Combining multi-GPU parallel computing technology to solve the two-dimensional shallow water control equations includes: The CPU thread on the host side reads the grid unit and node division, elevation information, initial water flow state, upstream flow boundary and downstream water level boundary data required for model calculation, and sets the Manning friction coefficient and minimum water depth parameters to initialize the model; Set the Manning roughness coefficient, gravity acceleration, minimum water depth, wind direction, and wind speed variables as constant types. Set the grid properties, water depth, velocity calculation results, and boundary types as global variables. Use the cudaMalloc() function on the host to perform global dynamic declarations and copy them to the global memory pool of the graphics card memory using the cudaMemcpy() function. The triangle mesh is used as the basic task unit of parallel computing, and the one-dimensional thread block structure is used to allocate the mesh units; in CUDA, threads are in Kernel<<<grid,block> In the >>() function declaration, grid is the size of the grid, block is the size of the thread block, and the product of the number of grid and block is set to be greater than or equal to the number of grid cells; During model calculation, the total number of calculation steps is first determined based on the simulated physical time and the single-step time step. The Kernel function is started through a for loop to execute the calculation task. Each thread corresponds to a calculation task within a grid unit, and is responsible for processing the flux and source term calculations within a calculation task unit, and starts a separate kernel function to summarize the results and update the grid boundary type; after all threads complete the calculation, the calculation results are summarized in the video memory to provide a basis for the next calculation; the calculation process is controlled on the host side. After all calculation steps are completed, the cudaDeviceSynchronize() function is called to explicitly synchronize the asynchronous operations of the CPU and GPU to ensure that the GPU completes all calculation tasks and obtains the correct model calculation results; finally, the CUDA memory copy function is called to transfer the model calculation results from the graphics card to the host side and complete the output of the calculation results.

8. The method for efficiently simulating lake water flow based on multi-GPU parallel computing according to claim 1, characterized in that: Combining multi-GPU parallel computing technology to solve the two-dimensional shallow water control equations includes: The storage types of various variables are distinguished according to their specific logical connections in the simulation calculations. At the same time, a two-dimensional array is used in the CPU to store the transmitted water level and flow time series. A one-dimensional thread block structure is used to allocate units at the thread design level, and the two-dimensional array is converted into one-dimensional, which is then addressed and accessed in the GPU by calculating the subscript.

9. The method for efficiently simulating lake water flow based on multi-GPU parallel computing according to claim 1, characterized in that: Combining multi-GPU parallel computing technology to solve the two-dimensional shallow water control equations includes: First, GPU0 and GPU1 simulate computational subdomains 0 and 1, respectively. After the simulation, synchronization is performed to ensure that the video memory data is fully updated. Subsequently, data is transferred between GPUs, and the computational results of communication domains 0 and 1 are updated to communication domain 10 and communication domain 01, respectively, providing data support for the simulation of each subdomain in the next computational time step.

Citation Information

Cited By

  • Ground surface shallow water power parallel computing method based on multiple graphics processors

    CN120874483A