Water body rendering method, system and equipment of reservoir and medium

By constructing a reservoir simulation domain grid and calculating water flow, the water rendering method was optimized, solving the problems of large computational load and inaccurate visualization in large-scale reservoir simulation domains, and achieving high-precision and fast water rendering effects.

CN121767531APending Publication Date: 2026-03-31GUANGZHOU SOUTH INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-21
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing reservoir hydraulic simulation methods involve huge computational loads in large-scale reservoir simulation domains, making it difficult to achieve real-time interaction on the web. Furthermore, traditional visualization methods cannot accurately reproduce the dynamic morphology of the water surface, resulting in inaccurate display of the water surface evolution morphology, which affects the reliability of the simulation output and the real-time visualization capabilities of the browser.

Method used

By constructing a reservoir simulation domain grid, the ground height and initial water surface depth of each grid cell are obtained, the water surface height difference and water flow rate are calculated, the water volume change is calculated in combination with preset pipeline parameters, and the target water surface depth is rendered onto the surface of the triangular grid. The rendering process is optimized to reduce the water "climbing wall" phenomenon and achieve high-precision water rendering.

Benefits of technology

It improves the accuracy of water flow evolution and the expressiveness of water surface changes, reduces data pressure, enhances computing efficiency and rendering performance in the browser environment, and realizes fast water rendering and dynamic simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121767531A_ABST
    Figure CN121767531A_ABST
Patent Text Reader

Abstract

The invention discloses a water body rendering method, system and device for a reservoir and a medium, and the method is characterized in that the method comprises the steps: obtaining the ground height and initial water surface depth of each grid unit in a simulation domain grid of the reservoir; determining a water surface height difference value corresponding to each grid unit on the basis of the ground height and the initial water surface depth, determining an adjacent height difference value between each grid unit and a plurality of adjacent grid units on the basis of each water surface height difference value, and determining a water surface height difference value between each grid unit and the plurality of adjacent grid units on the basis of the adjacent height difference value and a preset pipeline parameter, according to the initial water surface depth, calculating to obtain water flow flux, obtaining a water body volume variation corresponding to each grid unit in a preset time period based on the water flow flux, calculating to obtain an update value based on the water body volume variation, and determining a target water surface depth based on the update value and the initial water surface depth; and rendering the target water surface depth to the surface of the triangular mesh to obtain a water body rendering result of the reservoir. According to the method and the device, rapid water body rendering can be realized at the Web end.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of hydraulic simulation, and in particular to a method, system, equipment and medium for rendering water bodies in a reservoir. Background Technology

[0002] With the acceleration of urbanization and the frequent occurrence of extreme rainfall events, reservoirs play a vital role in regulating floods, reducing flood peaks, and ensuring the safety of people and property in downstream areas. During periods of continuous heavy rainfall or a surge in upstream water flow, reservoirs need to dynamically regulate water level changes to maintain operational safety and prevent serious accidents such as dam overflows and overtopping. To assess the impact of water level evolution on downstream river channels, roads near reservoirs, and residential areas in advance, reservoir hydraulic simulation technology has gradually become a key technical means in flood control planning, watershed management, and emergency response plan development. By monitoring real-time changes in water surface morphology, management departments can implement scientific scheduling and optimize operational strategies, thereby improving disaster prevention and mitigation capabilities.

[0003] However, existing reservoir hydraulic simulation methods mainly rely on numerical solutions for shallow flow equations, such as finite difference, finite volume, or finite element methods. In large-scale reservoir simulation domains exceeding one million square meters, the computational workload is enormous, requiring calculations of water height, velocity changes, and flow exchange between adjacent units, making real-time interaction on a web-based platform difficult. Furthermore, during the visualization phase, traditional methods commonly employ triangular mesh rendering models aligned with grid unit boundaries. This can easily lead to phenomena such as water "climbing walls" or water adhering to dam surfaces, which contradict physical laws and result in inaccurate display of water surface evolution, affecting the reliability of the simulation output. In addition, due to the complex shoreline structure and dramatic topographic changes of reservoirs, traditional visualization methods struggle to accurately reproduce dynamic water surface morphology, thus limiting the real-time visualization capabilities of large-scale water surface morphology on a web browser. Summary of the Invention

[0004] This invention provides a method, system, device, and medium for rendering water bodies in a reservoir, enabling rapid water body rendering on a web platform.

[0005] In a first aspect, embodiments of the present invention provide a method for rendering water bodies in a reservoir, comprising: The ground elevation and initial water surface depth of each grid cell in the reservoir simulation domain grid are obtained, wherein the reservoir simulation domain grid is constructed based on the topographic distribution parameters of the reservoir; Based on the ground height and the initial water surface depth, the water surface height difference corresponding to each grid cell is determined, and based on the water surface height difference, the adjacent height difference between each grid cell and several adjacent grid cells is determined. Based on the adjacent height difference and preset pipe parameters, the water flow rate is calculated. Based on the water flow rate, the water volume change of each grid cell in a preset time period is obtained. Based on the water volume change, an updated value is calculated, and based on the updated value and the initial water surface depth, the target water surface depth is determined. The target water surface depth is rendered onto the surface of a triangular mesh to obtain the water body rendering result of the reservoir, wherein the triangular mesh is determined by the reservoir simulation domain mesh.

[0006] This invention obtains the ground height and initial water surface depth of each grid cell in the reservoir simulation domain grid, and constructs the simulation domain grid based on the reservoir's topographic distribution parameters. This enables the system to accurately depict the real topographic features of the reservoir area, providing a reliable data foundation for subsequent hydrodynamic calculations and improving the accuracy of the water flow evolution process. The system calculates the water flow rate based on the water surface height difference between each grid cell and its adjacent cells, as well as the geometric parameters of the preset virtual pipe. Based on this, it obtains the water volume change of each grid cell within a preset time period, derives the updated water surface depth value from the volume change, and achieves dynamic tracking of the water flow process, effectively improving the physical reliability of water diffusion and convergence calculations. The calculated target water surface depth is rendered onto the surface of a triangular grid determined by the center point position and size of the grid cells. The optimized grid structure improves unrealistic phenomena such as water "climbing walls" in traditional rendering methods, enhancing the expressiveness of water surface changes and rendering visual quality. This reduces the data pressure during large-scale water body calculations and rendering, improves computational efficiency and rendering performance in a browser environment, and enables fast water body rendering on the Web.

[0007] Furthermore, the calculation of water flow rate based on the adjacent height difference and preset pipe parameters includes: Based on the adjacent height differences, the water level gradient of the current grid cell in each direction is determined; Based on the water level gradients and preset pipe parameters, the instantaneous outflow flux in each direction is calculated, wherein the preset pipe parameters are determined according to the size parameters of each grid cell. The instantaneous outflow fluxes are accumulated to obtain an accumulated value, and the accumulated value is subjected to non-negative constraint processing to obtain the water flow rate.

[0008] This invention calculates the water level gradient based on the height difference between adjacent grid cells and calculates the instantaneous outflow flux in each direction by combining preset pipe parameters. After accumulation and non-negative constraint processing, the water flow of each cell is obtained, which can accurately reflect the flow of water in each direction, effectively avoid negative values ​​or non-physical phenomena in flow calculation, improve the stability and accuracy of numerical solution, and thus realize the real flow simulation of large-area water bodies.

[0009] Furthermore, obtaining the water volume change of each grid cell within a preset time period based on the water flow includes: Perform flux mapping processing on each of the aforementioned water flows to determine the inflow flux set and outflow flux set of the current grid cell; The inflow flux set and the outflow flux set are summed respectively to obtain the total inflow flux and the total outflow flux. The difference between the total inflow flux and the total outflow flux is calculated to obtain the net flux value of the current grid cell. The net flow rate value is integrated within a preset time period to obtain the change in water volume of the current grid cell.

[0010] This invention, through mapping, summing, and integrating the water flow of each grid cell, obtains the water volume change of each cell within a preset time period. This achieves accurate quantification of volume changes during water flow, precisely reflecting the inflow, outflow, and net changes of water over a large area. It improves the accuracy of water depth updates and the realism of simulation results, while ensuring the stability of numerical calculations.

[0011] Furthermore, the step of calculating the updated value based on the change in water volume includes: calculating the bottom area of ​​each grid cell, and normalizing the change in water volume based on the bottom area to obtain the updated value.

[0012] This invention normalizes the water volume change based on the bottom area of ​​the grid cells to calculate the updated water depth value for each cell. This achieves precise adjustment of water height as volume changes, accurately reflects the water surface changes between cells, improves the accuracy of water depth updates and the realism of simulation results, and ensures the numerical stability of large-scale water flow calculations.

[0013] Furthermore, the step of rendering the target water surface depth onto the surface of the triangular mesh to obtain the water body rendering result of the reservoir includes: Bind the target water surface depth to the triangular mesh using vertex attributes to obtain the target vertex set; The target vertex set is spatially transformed using a vertex shader to obtain the screen vertex coordinate set; The set of screen vertex coordinates is rasterized to obtain a set of pixel segments; The pixel color attribute array of the pixel fragment set is calculated by the fragment shader, and the color value of each pixel in the pixel color attribute array is written into the corresponding pixel position of the frame buffer to generate the rendering image of the corresponding frame. The water body rendering result of the reservoir is obtained based on each rendering image.

[0014] This invention achieves high-precision rendering of water bodies on the screen by binding the target water surface depth to the vertices of a triangular mesh and using vertex shaders and fragment shaders to complete spatial transformation and rasterization processing. This can realistically reflect changes in water surface height and water body morphology, effectively reduce the phenomenon of water "climbing the wall", improve the realism and interactive experience of large-scale water area visualization, and at the same time ensure the computational efficiency and stability of the rendering process.

[0015] Furthermore, the step of binding the target water surface depth to the triangular mesh to obtain the target vertex set includes: Based on the center position of each grid cell in the reservoir simulation domain grid, the center coordinate set of each grid cell is determined, and the center coordinate set is aligned with each vertex of the triangular grid to obtain the triangular grid vertex set. Based on the triangular grid vertex set and the target water surface depth, an initial vertex set is determined. The initial vertex set is compared with the water surface height difference of several adjacent grid cells. When a preset threshold is met, the target vertex set is determined.

[0016] This invention aligns the vertices of the triangular mesh based on the center position of the mesh cells and uses the water surface height difference for threshold judgment to generate a target vertex set. This achieves accurate mapping and smooth transition of water surface height on the mesh, effectively reducing the phenomenon of water "climbing the wall", enhancing the realism and continuity of water body visualization, and ensuring the accuracy and stability of large-scale water area rendering.

[0017] Furthermore, after obtaining the water body rendering results of the reservoir, the process also includes: Dynamic boundary conditions are determined based on simulated scenario information from external input, wherein the simulated scenario information includes rainfall input parameters and gate operation parameters; The water body rendering result is dynamically updated based on the dynamic boundary conditions to generate an updated water body rendering result.

[0018] This invention introduces dynamic boundary conditions based on simulated scene information such as rainfall and gate operation from external inputs to update the water body rendering results in real time, realizing dynamic simulation of water flow. This accurately reflects the impact of environmental changes on reservoir water level and flow, improving the realism and interactivity of the simulation, while ensuring the continuity and stability of large-scale water body rendering.

[0019] Secondly, embodiments of the present invention provide a water rendering system for a reservoir, the system comprising: an acquisition module, a calculation module, and a rendering module; The acquisition module is used to acquire the ground height and initial water surface depth of each grid cell in the reservoir simulation domain grid, wherein the reservoir simulation domain grid is constructed based on the topographic distribution parameters of the reservoir; The calculation module is used to determine the water surface height difference corresponding to each grid cell based on the ground height and the initial water surface depth, and to determine the adjacent height difference between each grid cell and several adjacent grid cells based on the water surface height difference, to calculate the water flow rate based on the adjacent height difference and preset pipe parameters, to obtain the water volume change of each grid cell in a preset time period based on the water flow rate, to calculate the update value based on the water volume change, and to determine the target water surface depth based on the update value and the initial water surface depth. The rendering module is used to render the target water surface depth onto the surface of a triangular mesh to obtain the water body rendering result of the reservoir, wherein the triangular mesh is determined by the reservoir simulation domain mesh.

[0020] This invention constructs a reservoir simulation domain grid and obtains the ground height and initial water surface depth of each unit. By combining the height difference between adjacent units and pipe parameters, the water flow rate is calculated. The volume change of water and the updated water depth of each grid unit are further determined. Finally, the target water surface depth is accurately rendered onto the triangular grid, achieving high-precision simulation and visualization of the water flow process in the reservoir. This system can realistically reflect the confluence, diffusion, and flow direction changes of water in a large area of ​​water, improving simulation accuracy and rendering effect, while ensuring the stability and efficiency of the numerical calculation and rendering process.

[0021] Thirdly, embodiments of the present invention provide a terminal device, including: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus; The memory is used to store at least one executable instruction that causes the processor to perform an operation as described in this application: a water body rendering method for a reservoir.

[0022] Fourthly, embodiments of the present invention provide a computer-readable storage medium comprising a stored computer program, wherein, when the computer program is executed, it controls the device or system where the computer-readable storage medium is located to perform a water body rendering method for a reservoir as described in this application.

[0023] The above description is merely an overview of the technical solutions of the embodiments of the present invention. In order to better understand the technical means of the embodiments of the present invention and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0024] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0025] Figure 1 This is a flowchart illustrating an embodiment of a water body rendering method for a reservoir provided in this application; Figure 2 This is a flowchart illustrating steps S201 to S203 provided in this application; Figure 3 This is a flowchart illustrating steps S301 to S303 provided in this application; Figure 4 This is a visual diagram of the water body height provided in this application; Figure 5 This is a flowchart illustrating steps S501 to S504 provided in this application; Figure 6 This is a large-scale water flow simulation diagram provided in this application; Figure 7 This is a schematic diagram of the vertex distribution of the triangular mesh provided in this application; Figure 8 This is a schematic diagram of the structure of one embodiment of a water rendering method for a reservoir provided in this application. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0027] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0028] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.

[0029] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0030] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0031] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).

[0032] In the description of the embodiments of this application, unless otherwise expressly specified and limited, technical terms such as "installation," "connection," "joining," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.

[0033] With the acceleration of urbanization and the frequent occurrence of extreme rainfall events, reservoirs play a vital role in regulating floods, reducing flood peaks, and ensuring the safety of people and property in downstream areas. During periods of continuous heavy rainfall or a surge in upstream water flow, reservoirs need to dynamically regulate water level changes to maintain operational safety and prevent accidents such as dam overflow and overtopping. To assess the impact of water level evolution on downstream river channels, roads around reservoirs, and residential areas, reservoir hydraulic simulation technology has gradually become a key tool in flood control planning, watershed management, and emergency response planning. However, existing hydraulic simulation methods mainly rely on numerical solutions to shallow flow equations such as finite difference, finite volume, or finite element methods. In large-scale reservoir simulation domains exceeding one million square meters, it is necessary to calculate water height, velocity changes, and flow exchange between adjacent units, resulting in a massive computational load that is difficult to implement in real-time on a web platform. Furthermore, traditional visualization stages commonly use triangular mesh rendering models aligned with grid unit boundaries, which can easily lead to water "climbing" or adhering to the dam surface, causing the water surface evolution morphology to deviate from physical laws and affecting the reliability of the simulation. Due to the complex shoreline structure and dramatic topographic changes of reservoirs, traditional visualization methods struggle to accurately reproduce the dynamic morphology of the water surface, limiting the real-time visualization capabilities of large-scale water surface scenes on the browser side.

[0034] See Figure 1 To achieve fast water body rendering on the Web, an embodiment of the present invention provides a water body rendering method for a reservoir, including steps S101 to S103. Step S101: Obtain the ground height and initial water surface depth of each grid cell in the reservoir simulation domain grid, wherein the reservoir simulation domain grid is constructed based on the topographic distribution parameters of the reservoir; In some embodiments, topographic distribution parameters of the reservoir area are obtained based on measured topographic data, digital elevation models (DEMs), or lidar mapping results. These parameters include ground elevation, shoreline boundaries, and local geomorphic features. The entire simulated area is then divided into several grid cells with fixed length and width dimensions on a two-dimensional plane based on these topographic distribution parameters. The base dimensions of each grid cell are as follows: and This forms a reservoir simulation domain mesh. In this embodiment, the reservoir simulation domain mesh is organized using a GPU texture storage structure, where each mesh cell corresponds to a pixel cell in the texture and is used to store the ground height of that mesh cell. With water surface depth The ground height The topographic elevation representing the bottom surface of the grid cell, in meters (m); the water surface depth The depth of the water above the unit is represented in meters (m). Specifically, the ground height and the initial water depth are respectively written into the first mesh texture. In the different channels, the first mesh texture uses a 32-bit floating-point data type to ensure the numerical accuracy and stability of water depth calculation in large-scale scenes.

[0035] It should be noted that the initial water surface depth The determination methods include: when rendering a static scene, calculating the initial water depth of each unit based on the preset initial reservoir water level and ground height difference; when simulating a dynamic scene, calculating the initial water depth distribution using linear interpolation or bilinear interpolation based on the input water level boundary conditions, rainfall, or tributary flow data, in order to ensure the continuity and smoothness of the water surface in the initial state.

[0036] Through the above steps, a reservoir simulation domain grid can be constructed based on accurate terrain distribution parameters, and the ground height and initial water surface depth of each grid cell can be obtained, achieving a high-precision representation of the initial state of the reservoir water body. This ensures the numerical accuracy and stability of water depth data in large-scale scenarios, while interpolation processing achieves the continuity and smoothness of the initial water surface, providing reliable basic data for subsequent water flow simulation and visualization, and improving the realism and precision of the simulation results.

[0037] Step S102: Based on the ground height and the initial water surface depth, determine the water surface height difference corresponding to each grid cell, and based on the water surface height difference, determine the adjacent height difference between each grid cell and several adjacent grid cells. Based on the adjacent height difference and preset pipe parameters, calculate the water flow rate, and based on the water flow rate, obtain the water volume change of each grid cell in a preset time period. Based on the water volume change, calculate the updated value, and based on the updated value and the initial water surface depth, determine the target water surface depth.

[0038] Please refer to Figure 2 In some embodiments, the step of calculating the water flow rate based on the adjacent height difference and preset pipe parameters includes: steps S201 to S203; Step S201: Based on the adjacent height differences, determine the water level gradient of the current grid cell in each direction; In some embodiments, for a location in the reservoir simulation domain that is Get the ground height of the current grid cell. and water surface depth To obtain the total water level of the current unit Simultaneously, the water heights of the four adjacent units in the left, right, up, and down directions are obtained and represented as follows: , , , Calculate the water level difference in each direction: ; Step S202: Based on the water level gradients and preset pipe parameters, the instantaneous outflow flux in each direction is calculated, wherein the preset pipe parameters are determined according to the size parameters of each grid cell; In some embodiments, to simulate water flow exchange between cells, the water flow channels between adjacent grid cells are abstracted as virtual pipe models. Assume the bottom surface dimensions of each grid cell are... The effective length of the virtual pipe Defined as: ; The cross-sectional area of ​​a virtual pipe is defined as: ; Then in time step Within the interior, the instantaneous outflow flux in any direction can be expressed as: ; in, This represents the outflow flux at time 𝑡; This represents the water level difference in the current direction. This represents the instantaneous outflow flux updated after a time step. It is the acceleration due to gravity. .

[0039] Step S203: The instantaneous outflow fluxes are accumulated to obtain the accumulated value, and the accumulated value is subjected to non-negative constraint processing to obtain the water flow rate.

[0040] In some embodiments, considering that the flow of water cannot be negative in a physical sense, a non-negativity constraint operation is performed on the above instantaneous outflow flux to obtain: ; Among them, if the local water level gradient If the outflow flux in that direction is zero, then the outflow flux in that direction is set to zero. Further, the outflow fluxes in each of the four directions are summed to obtain the total outflow flux of the cell: ; Please refer to Figure 3 In some embodiments, obtaining the water volume change of each grid cell in a preset time period based on the water flow includes: steps S301 to S303. Step S301: Perform flux mapping processing on each of the water fluxes to determine the inflow flux set and outflow flux set of the current grid cell; In some embodiments, for a location in the reservoir simulation domain that is The current grid cell, based on the instantaneous outflow flux in each direction obtained in the previous step. Establish the flux mapping relationship for this unit. The outflow flux set... This indicates the water flow rate from the current unit to surrounding units, specifically including: ; The inflow flux set This represents the water flow rate flowing into the current cell from adjacent cells, calculated based on a reverse mapping of the outflow flux from adjacent cells: ; Step S302: Summate the inflow flux set and the outflow flux set respectively to obtain the total inflow flux and the total outflow flux, and calculate the difference between the total inflow flux and the total outflow flux to obtain the net flux value of the current grid cell; In some embodiments, the time step is set to The inflow flux set and outflow flux set obtained in the previous step are summed to obtain the total inflow and total outflow of the cell at the current time step. The difference between the two is the net flux value of the current cell. ; Among them, when When, it indicates that the unit is in a net inflow state; when When the time is specified, it indicates that the unit is in a net outflow state.

[0041] Step S303: Integrate the net flow rate value within a preset time period to obtain the water volume change of the current grid cell.

[0042] In some embodiments, with time step As the integration interval, the net flow rate value of each unit is integrated over time to obtain the change in water volume. : ; in, This indicates the increase or decrease in total volume within the current grid cell due to water exchange within the current time step.

[0043] In some embodiments, calculating the updated value based on the water volume change includes: calculating the bottom area of ​​each grid cell, and normalizing the water volume change based on the bottom area to obtain the updated value. Specifically, let the bottom surface size of each grid cell be... Then the base area of ​​the current cell is Dividing the volume change by the base area yields the updated water depth value. ; in, Indicates the water depth at a given time. Indicates time step The depth of the subsequent updates.

[0044] For ease of understanding, Figure 4 This application provides a visualization diagram of water body height. By representing water body height as the sum of terrain elevation and water depth (i.e., "water body height = ground height + water surface depth"), the actual position of the water surface in three-dimensional space is determined. In the diagram, blue lines represent the terrain surface, red dots are sampling points for water surface height, and red dashed lines represent the calculation relationship for water depth. In this way, water height can be dynamically calculated based on the ground elevation and corresponding water depth values ​​of different terrain units, achieving continuous changes in water surface morphology.

[0045] Through the above steps, the water level gradient and flow flux of each unit can be accurately calculated based on the reservoir simulation domain grid, thereby determining the water volume change and water depth update value of each unit within a preset time period, achieving accurate spatial representation of water surface height; it can dynamically reflect the inflow, outflow and net flow changes of water bodies in large-scale water areas, ensuring the continuity and smoothness of water depth updates, while improving the stability and accuracy of numerical calculations through time integration and bottom area normalization, thus providing reliable basic data for subsequent water body visualization, and realizing realistic, continuous and high-precision simulation of water surface morphology in large-scale water areas.

[0046] Step S103: Render the target water surface depth onto the surface of the triangular mesh to obtain the water body rendering result of the reservoir, wherein the triangular mesh is determined by the reservoir simulation domain mesh.

[0047] Please refer to Figure 5 In some embodiments, rendering the target water surface depth onto the surface of a triangular mesh to obtain the water body rendering result of the reservoir includes: steps S501 to S504. Step S501: Bind the vertex attributes of the target water surface depth to the triangular mesh to obtain the target vertex set; In some embodiments, a set of center coordinates for each grid cell is determined based on the center position of each grid cell in the reservoir simulation domain grid. This set of center coordinates is then bound one-to-one with each vertex of the triangular grid, ensuring that the vertices of the triangular grid are aligned with the center of the grid cell, rather than with its boundary, thereby constructing an initial set of triangular grid vertices. Further, the water height value of each vertex is calculated based on the terrain height and water depth of each grid cell. This water height value is the sum of the terrain elevation and water depth of the grid cell. In this embodiment, to reduce the "water climbing" phenomenon, when the water height difference between the current cell and the surrounding 8 cells is greater than a preset threshold (e.g., 0.1 meters), and the water depth of the current cell is less than this threshold, the water height of the current cell is corrected to the water height of the adjacent cell with the largest water height difference. Based on the corrected water height, the corresponding vertex height value is updated to obtain the target vertex set.

[0048] Step S502: Perform a spatial transformation on the target vertex set using a vertex shader to obtain the screen vertex coordinate set; In some embodiments, the WebGL interface is used to call the vertex shader to perform a model-view-projection (MVP) matrix transformation on the 3D coordinates of each target vertex. The model matrix is ​​used to transform the coordinates of the water model to the world coordinate system, the view matrix is ​​used to transform the world coordinates to the view coordinate system, and the projection matrix is ​​used to implement perspective transformation, thereby obtaining the vertex coordinate set in screen space. In this embodiment, to ensure the rendering stability of large-scale water scenes, floating-point depth buffering and view frustum clipping techniques can be used.

[0049] Step S503: Rasterize the screen vertex coordinate set to obtain a set of pixel segments; In some embodiments, the WebGL graphics pipeline is used to perform triangle segmentation and interpolation calculations on the aforementioned vertex set, dividing each triangular region into several pixel segments. Each pixel segment corresponds to a pixel position on the screen and inherits the corresponding vertex attribute information, including water height, normal vector, water flow direction, and reflection parameters. In this embodiment, depth testing and backface culling are enabled to avoid repeatedly drawing or drawing unseen segments.

[0050] Step S504: Calculate the pixel color attribute array of the pixel fragment set using the fragment shader, and write the color value of each pixel in the pixel color attribute array into the corresponding pixel position in the frame buffer to generate the rendering image of the corresponding frame. Based on each rendering image, obtain the water body rendering result of the reservoir.

[0051] In some embodiments, the fragment shader calculates the reflected and refracted light intensity of the water surface based on the water height value, normal vector, and light source direction of the pixel fragment; and determines the pixel color attribute array based on a water color map (such as a blue-green gradient). Subsequently, the WebGL rendering pipeline writes the pixel color attribute array to the corresponding pixel position in the frame buffer, forming the rendering result of the current frame. In this embodiment, the frame buffer is an image cache unit in the GPU's video memory, and is ultimately output to the screen through the display interface to achieve real-time dynamic visualization of water in continuous frames. Furthermore, in this embodiment, the rendering pipeline can also perform screen post-processing operations, including water surface reflection blurring, ripple disturbance, and brightness correction, achieving interactive visualization of water flow by continuously outputting the rendering result at a frame rate of 60 frames per second on the browser side.

[0052] For ease of understanding, Figure 6 This application provides a large-scale water flow simulation effect diagram. The different colors or heights of the surfaces in the diagram reflect the water surface height distribution within the simulation area. Through the numerical solution method of this invention, the water body flows according to the terrain height and water surface height difference, and the flow rate is updated by calculating the flow rate through virtual pipes. In the visualization stage, an improved water height setting method and vertex distribution strategy are adopted to reduce the phenomenon of water "climbing the wall", making the water body shape more realistic and clearly showing the confluence, diffusion and flow direction changes of the water body in a large area.

[0053] In some embodiments, binding the target water surface depth to the triangular mesh to obtain a target vertex set includes: determining the center coordinate set of each mesh cell based on the center position of each mesh cell in the reservoir simulation domain mesh; aligning the center coordinate set with each vertex of the triangular mesh to obtain a triangular mesh vertex set; determining an initial vertex set based on the triangular mesh vertex set and the target water surface depth; comparing the initial vertex set with the water surface height difference of several adjacent mesh cells; and determining the target vertex set when a preset threshold is met.

[0054] In some embodiments, based on the center position of each grid cell in the reservoir simulation domain grid, a set of center coordinates for each grid cell is determined. This set of center coordinates is then aligned with the vertices of the triangular grid to obtain a set of triangular grid vertices. An initial set of vertices is then determined based on the set of triangular grid vertices and the target water surface depth. Specifically, a two-dimensional regular grid is first set in the simulation domain, with the horizontal and vertical spacing of each grid cell being respectively... and The coordinates of the geometric center point of each unit can be expressed as: ,in , Based on this set of center coordinates, a vertex coordinate matrix is ​​generated. This is then aligned one-to-one with the vertices of the triangular mesh, so that each vertex of the triangular mesh corresponds to the center point of a mesh cell, rather than the cell boundary, thus obtaining the set of triangular mesh vertices. Further, based on the water depth distribution matrix output from the water body numerical simulation stage... With topographic elevation matrix Calculate the water level height at each vertex. The calculation formula is as follows: ; Using the water level height values ​​as the Z-axis coordinate components of the vertices, we obtain the initial vertex set. In this way, the initial vertex set can accurately reflect the water surface height distribution at the center of each grid cell.

[0055] In some embodiments, the initial vertex set is compared with the water level height difference of several adjacent grid cells. When a preset threshold is met, a target vertex set is determined. Specifically, for the current vertex... Get the set of water surface heights of its eight neighboring vertices: ; Calculate the set of water height differences between the current vertex and its surrounding vertices: ; When the current unit's water depth Less than the water depth threshold And the maximum water level difference Greater than the water level difference threshold Time (e.g.) , If the water level at the current vertex is [value], then [the water level at the current vertex will be [value]]. Corrected to the water level of the adjacent unit with the largest water level difference: ; With the revised Update the vertex height values ​​to form the final target vertex set. This correction process effectively avoids the "water climbing" phenomenon in areas of abrupt changes in water level gradient, resulting in a smoother and more natural water surface at boundaries or local elevation differences. Ultimately, the target vertex set... The data is passed as input to the vertex shader stage of the WebGL rendering pipeline to achieve a realistic and continuous water surface visualization effect.

[0056] For ease of understanding, Figure 7This is a schematic diagram of the vertex distribution of the triangular mesh provided in this application; the vertex distribution of the triangular mesh illustrates the spatial connection relationship between the center point of the mesh cell and the boundary node of the mesh in the simulation domain; the red dots in the figure represent the set of vertices that constitute the triangular mesh, and each vertex corresponds to the center point or boundary point of the original regular mesh; the blue line segments represent the connection relationship between vertices, and by connecting the center point of the adjacent mesh cell with the center point and boundary node of the surrounding mesh cell, several continuous triangular cells are formed.

[0057] In some embodiments, after obtaining the water body rendering result of the reservoir, the method further includes: determining dynamic boundary conditions based on externally input simulation scene information, wherein the simulation scene information includes rainfall input parameters and gate operation parameters; and dynamically updating the water body rendering result based on the dynamic boundary conditions to generate an updated water body rendering result.

[0058] In some embodiments, dynamic boundary conditions are determined based on externally input simulated scenario information, wherein the simulated scenario information includes rainfall input parameters and gate operation parameters. Specifically, the process involves: first, acquiring real-time rainfall monitoring and forecast data for the watershed where the reservoir is located, and constructing a rainfall spatiotemporal distribution matrix based on the spatial distribution of monitoring rain gauges and the duration of rainfall; then, projecting the rainfall spatiotemporal distribution matrix onto the digital elevation model (DEM) of the reservoir catchment area, and calculating the inflow rate of each grid cell at the current moment by combining surface runoff coefficient, infiltration coefficient, and evaporation loss parameters; based on this, rainfall inflow boundary conditions are formed in time sequence. Simultaneously, gate operation parameters input from an external scheduling system are received, including gate opening height, opening time, closing time, and the number of gates, and the equivalent opening area of ​​the outflow section at the gate is calculated based on the geometric features of the reservoir dam and the location of the gate; further, the instantaneous outflow rate is determined using weir flow or orifice flow formulas by combining the real-time difference between the downstream and upstream water levels of the gate. Therefore, a dynamic boundary condition set is constructed based on rainfall inflow and gate outflow, which is used to drive the temporal evolution of water surface morphology.

[0059] In some embodiments, the water body rendering result is dynamically updated based on the dynamic boundary conditions to generate an updated water body rendering result. Specifically, this involves: acquiring the water surface rendering grid data at the current moment; calculating the water volume increment of each grid cell based on the rainfall inflow boundary conditions; and calculating the water volume reduction of each outflow cell based on the gate outflow boundary conditions; mapping the water volume change of each cell to the grid height field; and updating the water surface height value of each vertex; then, using a time step... Frame-by-frame integration yields the updated water surface depth distribution matrix. During the update rendering phase, based on the latest water surface depth distribution, the normal vectors and vertex heights of the water body mesh are recalculated. A GPU-based real-time shading algorithm is used to dynamically render reflections, refractions, and ripple disturbances to generate a water body visualization frame corresponding to the time step. This frame data can be displayed in real-time on the browser via the WebGL interface, enabling dynamic updates of the reservoir's water level evolution, flow direction changes, and flow patterns in front of the dam, thereby improving the real-time interactivity and visual realism of large-scale reservoir scenes.

[0060] Through the above steps, the numerical simulation results of each grid cell in the reservoir simulation domain can be mapped to the vertices of the triangular grid with high precision, realizing continuous visualization of water surface height in three-dimensional space. Through vertex attribute binding, MVP matrix transformation, rasterization and fragment shader rendering, the reflection, refraction and ripple disturbance effects of the water body can be realistically presented. The "water climbing wall" phenomenon can be effectively eliminated through the water level gradient correction strategy, making the water surface smooth and natural at terrain elevation differences. At the same time, by introducing dynamic boundary conditions based on external input (such as rainfall, gate operation) to update the water surface rendering in real time, the dynamic evolution of the water body in the time series can be realized.

[0061] like Figure 8 As shown, based on the above method embodiments, corresponding apparatus embodiments are provided; An embodiment of the present invention provides a schematic diagram of the structure of a water body rendering system for a reservoir, including: an acquisition module 100, a calculation module 200, and a rendering module 300; The acquisition module 100 is used to acquire the ground height and initial water depth of each grid cell in the reservoir simulation domain grid, wherein the reservoir simulation domain grid is constructed based on the topographic distribution parameters of the reservoir. The calculation module 200 is used to determine the water surface height difference corresponding to each grid cell based on the ground height and the initial water surface depth, and to determine the adjacent height difference between each grid cell and several adjacent grid cells based on the water surface height difference, to calculate the water flow rate based on the adjacent height difference and preset pipe parameters, to obtain the water volume change of each grid cell in a preset time period based on the water flow rate, to calculate the updated value based on the water volume change, and to determine the target water surface depth based on the updated value and the initial water surface depth. The rendering module 300 is used to render the target water surface depth onto the surface of a triangular mesh to obtain the water body rendering result of the reservoir, wherein the triangular mesh is determined by the reservoir simulation domain mesh.

[0062] It is understood that the above-described apparatus embodiments correspond to the method embodiments of the present invention, and can implement the water body rendering method for a reservoir provided by any of the above-described method embodiments of the present invention. For a more detailed workflow and principle of this system, please refer to the relevant descriptions of the above methods.

[0063] It should be noted that the device embodiments described above are merely illustrative, and some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can specifically be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0064] Based on the above-described embodiment of a water body rendering method for a reservoir, another embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a water body rendering method for a reservoir according to any embodiment of the present invention.

[0065] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device.

[0066] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.

[0067] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.

[0068] Based on the above-described method embodiments, another embodiment of the present invention provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute a water body rendering method for a reservoir as described in any of the above-described method embodiments of the present invention.

[0069] The modules / units integrated in the device / terminal equipment, if implemented as software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0070] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.

Claims

1. A method of rendering a water body of a reservoir, characterized by, The method comprises the following steps: obtaining the ground height and the initial water depth of each grid cell in a reservoir simulation domain grid, wherein the reservoir simulation domain grid is constructed according to the topographic distribution parameters of the reservoir; determining the water surface height difference value corresponding to each grid cell based on the ground height and the initial water depth, determining the adjacent height difference value between each grid cell and a plurality of adjacent grid cells based on the water surface height difference value, calculating the water flow flux based on the adjacent height difference value and the preset pipe parameters, obtaining the water volume change value corresponding to each grid cell in a preset time period based on the water flow flux, calculating the update value based on the water volume change value, and determining the target water depth based on the update value and the initial water depth; rendering the target water depth to the surface of a triangular grid to obtain the water body rendering result of the reservoir, wherein the triangular grid is determined by the reservoir simulation domain grid.

2. The method of claim 1, wherein the water body is a reservoir. The method comprises the following steps: determining the water level gradient of the current grid cell in each direction based on the adjacent height difference value; calculating the instantaneous outflow flux in each direction based on the water level gradient and the preset pipe parameters, wherein the preset pipe parameters are determined according to the size parameters of each grid cell; accumulating each instantaneous outflow flux to obtain an accumulated value, and performing non-negative constraint processing on the accumulated value to obtain the water flow flux.

3. The method of claim 1, wherein the water body rendering of the reservoir is performed by a computer system. The method comprises the following steps: performing flux mapping processing on each water flow flux to determine the inflow flux set and the outflow flux set of the current grid cell; summing the inflow flux set and the outflow flux set respectively to obtain the inflow flux sum and the outflow flux sum, and calculating the difference value between the inflow flux sum and the outflow flux sum to obtain the net flow flux value of the current grid cell; integrating the net flow flux value in a preset time period to obtain the water volume change value of the current grid cell.

4. The method of claim 1, wherein the water body is a reservoir. The method comprises the following steps:

5. The method of claim 1, wherein the water body rendering of the reservoir is performed by a computer system. calculating the base area of each grid cell, and performing normalization processing on the water volume change value based on the base area to obtain the update value. The method comprises the following steps: performing vertex attribute binding on the target water depth and the triangular grid to obtain a target vertex set; performing spatial transformation on the target vertex set through a vertex shader to obtain a screen vertex coordinate set; performing rasterization on the screen vertex coordinate set to obtain a pixel fragment set; 6. The method of rendering a body of water of a reservoir of claim 5, wherein, calculating the pixel color attribute array of the pixel fragment set through a fragment shader, and writing each pixel color value in the pixel color attribute array to the corresponding pixel position in the frame buffer to generate a rendering image of the corresponding frame, and obtaining the water body rendering result of the reservoir based on each rendering image. The method comprises the following steps: Determine a center coordinate set of each grid element based on the center position of each grid element in the reservoir simulation domain grid, align the center coordinate set with each vertex of the triangular grid, obtain a triangular grid vertex set, and determine an initial vertex set based on the triangular grid vertex set and the target water depth; Compare the initial vertex set with the water surface height difference of a plurality of adjacent grid elements, and when a preset threshold is met, determine a target vertex set.

7. The method of rendering a body of water of a reservoir of claim 1, wherein, After obtaining the water body rendering result of the reservoir, further comprising: Determine a dynamic boundary condition based on externally input simulation scene information, wherein the simulation scene information includes rainfall input parameters and gate operation parameters; Dynamically update the water body rendering result based on the dynamic boundary condition to generate an updated water body rendering result.

8. A water rendering system for a reservoir, characterized in that, The system comprises an acquisition module, a calculation module and a rendering module; The acquisition module is configured to acquire the ground height and initial water depth of each grid element in the reservoir simulation domain grid, wherein the reservoir simulation domain grid is constructed according to the topographic distribution parameters of the reservoir; The calculation module is configured to determine the water surface height difference corresponding to each grid element based on the ground height and the initial water depth, determine the adjacent height difference between each grid element and a plurality of adjacent grid elements based on the water surface height difference, calculate the water flow flux based on the adjacent height difference and a preset pipeline parameter, obtain the water body volume change corresponding to each grid element in a preset time period based on the water flow flux, calculate the update value based on the water body volume change, and determine the target water depth based on the update value and the initial water depth; The rendering module is configured to render the target water depth to the surface of a triangular grid to obtain a water body rendering result of the reservoir, wherein the triangular grid is determined by the reservoir simulation domain grid.

9. A terminal device, comprising: A computer program stored in the memory and configured to be executed by the processor, when the processor executes the computer program, implements a water body rendering method of a reservoir according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, Comprise: A stored computer program, wherein when the computer program is running, the device where the computer readable storage medium is located executes a water body rendering method of a reservoir according to any one of claims 1-7.