River flow field reconstruction method, system and equipment and storage medium
By using a hybrid architecture system that combines attention mechanisms and convolutional neural networks, the problems of low computational efficiency and insufficient physical constraints in river flow field simulation are solved, achieving high-precision flow field reconstruction at the second level and improving computational efficiency and emergency response capabilities.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SUZHOU UNIV OF SCI & TECH
- Filing Date
- 2025-12-18
- Publication Date
- 2026-05-19
AI Technical Summary
Existing technologies suffer from low computational efficiency and cumbersome mesh preprocessing in river flow field simulation. Furthermore, existing AI models lack physical consistency constraints and are difficult to adapt to complex boundary condition changes.
By employing a hybrid architecture system that combines attention mechanisms and convolutional neural networks, and through the deep fusion of static geometric features and dynamic boundary conditions, the system achieves second-level, high-precision reconstruction of the river flow field.
It achieves second-level reconstruction of river flow field, improves computing efficiency and emergency response capability, ensures that flow field data matches river topography, has strong generalization performance and physical constraints, and is suitable for rapid prediction under different working conditions.
Smart Images

Figure CN122065634A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the interdisciplinary field of water conservancy engineering informatics, computational fluid dynamics and artificial intelligence, and specifically relates to a method, system, device and storage medium for reconstructing river flow field. Background Technology
[0002] Accurate prediction of key physical information of river flow fields (including velocity components, flow rate, and water level) is the scientific foundation for flood control early warning, optimal water resource scheduling, waterway planning, and hydraulic structure design. The flow field of complex natural rivers is often influenced by the nonlinear coupling effects of multiple factors, including upstream inflow, riverbed topography, shoreline geometry, distributary confluence, and engineering regulation. Currently, numerical simulation based on physical governing equations (such as the Saint-Venant equations or the Navier-Stokes equations) is the mainstream method for obtaining flow field information. Although mature models such as TELEMAC-2D and MIKE21 possess high physical fidelity, they still face the following significant limitations in practical engineering applications: The computational overhead is enormous: for large-scale, high-resolution two-dimensional or three-dimensional river models, a single unsteady flow simulation often takes several hours to several days and is highly dependent on high-performance computing clusters. This makes traditional numerical simulations inadequate for scenarios with extremely high timeliness requirements, such as flood control emergency response or real-time water resource scheduling.
[0003] Mesh preprocessing is cumbersome: Traditional methods rely on high-quality unstructured meshes (such as triangular or quadrilateral meshes). Mesh generation, refinement, orthogonality checking, and dry / wet boundary processing require a lot of manual intervention and professional experience, which limits the ability of the model to be applied automatically.
[0004] Limitations of Existing AI Models: In recent years, "surrogate models" based on deep learning have begun to emerge. However, existing methods based solely on fully convolutional neural networks or U-Net architectures have significant shortcomings when processing river flow fields. First, the receptive field of convolutional operations is local, making it difficult to capture the long-range, non-local effects of upstream boundary conditions on the downstream flow field. Second, existing methods often simply use the resulting data as image channel input, failing to effectively utilize strong geometric features such as signed distance functions or topographic boundaries to constrain the land-water boundary, leading to non-physical numerical overflow or ambiguity in the prediction results at the riverbank junction.
[0005] Therefore, there is an urgent need for a hybrid architecture system that can deeply integrate dynamic boundary conditions and static geometric features and explicitly utilize physical geometric constraints to achieve second-level, high-precision reconstruction of the river flow field.
[0006] To address the shortcomings of existing technologies, this application provides a method, apparatus, device, and storage medium for reconstructing river flow fields. The main purpose is to overcome the deficiencies of existing numerical simulation methods, such as low computational efficiency, cumbersome mesh preprocessing, and the lack of physical consistency constraints and difficulty in adapting to complex boundary condition changes in existing data-driven models.
[0007] According to one aspect of this application, a method for reconstructing a river channel flow field is disclosed, the method being executed by a computer device configured with a processor, the method comprising: The raw hydrodynamic numerical simulation data of the unstructured grid is acquired and processed, and the flow field physical quantities in the unstructured data are reconstructed into two-dimensional rasterized flow field target data. The two-dimensional rasterized flow field target data covers a predefined computational domain and has a uniform spatial resolution. Based on the two-dimensional rasterized flow field target data, the riverbed topographic elevation is extracted to generate a topographic elevation map, and the water-land boundary is identified to calculate and generate a symbolic distance function map. The topographic elevation map and the symbolic distance function map are used as a set of static geometric features. The dynamic hydraulic boundary conditions are parsed from the simulation file and parameterized into a one-dimensional eigenvector. The one-dimensional feature vector is subjected to deep semantic encoding using an attention mechanism to generate a latent space feature map containing global hydraulic condition information. The static geometric feature set is spatially downsampled to match the size of the latent space feature map, and then concatenated with the latent space feature map in the channel dimension to generate a high-dimensional latent space feature map containing global influence information, thereby realizing multimodal information fusion. The high-dimensional latent space feature map containing global influence information is input into the convolutional neural network decoder. Through cascaded spatial upsampling and convolution operations, the spatial details of the flow field are restored step by step, and the predicted flow field data with the same resolution as the two-dimensional rasterized flow field target data is generated. Perform an inverse normalization operation on the predicted flow field data to restore its physical dimensions, and use the symbolic distance function graph to construct a physical mask to remove invalid values corresponding to land areas in the predicted flow field data, and output the flow field reconstruction result.
[0008] In some embodiments, the symbolic distance function graph is based on the center point of any grid cell within the computational domain. p The value of the signed distance function is calculated by the following formula: ; in, Represents the two-dimensional coordinates of any raster cell within the computational domain; It is a set of all water and land contour pixels determined by identifying invalid value boundaries in the rasterized data; The set of contour lines The coordinates of any pixel in the array; Representing coordinates With coordinates The Euclidean distance between them is calculated as follows: ; This is a binary-domain indicator function used to assign a sign to distances to distinguish between land and water. The body is defined as: ; Among them, water areas land area The division is determined based on whether there are valid physical quantity values in the rasterized data.
[0009] In some embodiments, the step of using an attention mechanism to perform deep semantic encoding on the one-dimensional feature vector to generate a latent space feature map containing global hydraulic condition information includes: The dimension of the input is eigenvectors Through a linear projection layer, it maps to the high-dimensional embedding space inside the network, generating a dimensionless embedding space. memory tensor This process can be described by the following formula: ,in and The learnable weights and biases of this projection layer; Using one dimension Learnable query tensors With a learnable position encoding tensor of the same dimension Element-wise summation is performed to generate the initial query, which serves as the input to the attention mechanism. ,in, The total number of pixels in the latent space feature map; The initial query As , the memory tensor At the same time as and It performs multi-head cross-attention calculations to capture the differentiated effects of boundary conditions on various locations in space. The core calculation process is as follows: ; in, This represents the direct output tensor calculated by the multi-head cross-attention mechanism; The function computes multiple attention heads in parallel, and the computation of each head follows the formula below: ; in, These represent the query vectors after multi-head splitting and linear transformation, respectively. Key vector Sum value vector In this step, Corresponding to the initial query The transformation is used to characterize queries of spatial location. need; and All correspond to the memory tensor The transformations are used to provide index features and content features for boundary conditions, respectively; The output of attention calculation Through residual connections, layer normalization, and a feedforward neural network for further nonlinear transformation and information extraction, the final output tensor is reshaped into a tensor with a predetermined spatial dimension. The latent space feature map .
[0010] In some embodiments, the step of spatially downsampling the static geometric feature set to match the size of the latent space feature map, and concatenating it with the latent space feature map in the channel dimension to generate a high-dimensional latent space feature map containing global influence information, thereby realizing multimodal information fusion, includes: The static geometric feature set information with an original resolution of Topographic elevation map And the symbolic distance function graph Each is processed through an adaptive average pooling layer. The spatial resolution is forcibly downsampled to match the latent space feature map. Completely consistent Subsequently, a channel-level concatenation operation is performed, defined by the following formula: ; in, This represents the splicing operator along the channel dimension; For the final generated, a channel number equal to , and A unified feature expression that includes the sum of channel numbers and encompasses both dynamic boundary conditions and static geometric constraints.
[0011] In some embodiments, the convolutional neural network decoder is composed of A cascaded upsampling decoding module with identical structure Composition, which is derived from the fusion feature map To the original predicted flow field The complete decoding process can be described by the following iterative formula: ; in, This represents the input feature map of the i-th decoding module; As a decoding module, its core is a step size. A deconvolutional layer of size 2 This layer is followed by a batch normalization layer. and a nonlinear activation function ,Right now ; The last 1x1 convolution is used to adjust the number of channels in the feature map to 1 to match the univariate flow field output.
[0012] In some embodiments, before acquiring the raw hydrodynamic numerical simulation data that processes the unstructured grid, the method further includes: All learnable parameters of the attention model and convolutional neural network decoder are iteratively adjusted using a gradient descent-based optimization algorithm. To minimize a pre-defined target loss function The loss function is defined as the masked mean square error calculated within the physical water area, and its precise mathematical expression is: ; in, Indicated by The parameters are boundary conditions. and geometric features A complete proxy model; These are the coordinates of the raster cells; The data represents real, normalized flow field target data. Indicates by The set of all determined water area grid cells; This represents the total number of elements in the set, which is the total pixel area of the water area.
[0013] In some embodiments, performing an inverse normalization operation on the predicted flow field data to restore its physical dimensions, and constructing a physical mask using the signed distance function graph to remove invalid values corresponding to land regions in the predicted flow field data, outputting the flow field reconstruction result includes: The predicted flow field data is subjected to an inverse normalization operation, which uses the maximum and minimum values of global physical quantities calculated and stored in advance on the training set to linearly map the data from the normalization interval back to the true physical dimensions. A binary physical mask is constructed using the symbolic distance function graph. After identifying and forcibly removing all invalid values in the predicted flow field that correspond to land regions, the flow field reconstruction result is output.
[0014] According to another aspect of this application, a river channel flow field reconstruction system is also disclosed, the system being deployed on one or more computing devices having a processor and non-volatile memory, the system comprising: The acquisition module is used to acquire raw hydrodynamic numerical simulation data of unstructured grids and reconstruct the flow field physical quantities in the unstructured data into two-dimensional rasterized flow field target data. The two-dimensional rasterized flow field target data covers a predefined computational domain and has a uniform spatial resolution. The static geometric feature set determination module is used to extract the riverbed topographic elevation based on the two-dimensional rasterized flow field target data to generate a topographic elevation map, and to identify the water-land boundary to calculate and generate a symbolic distance function map, and to use the topographic elevation map and the symbolic distance function map as a static geometric feature set; The one-dimensional eigenvector determination module is used to parse dynamic hydraulic boundary conditions from simulation files and parameterize them into one-dimensional eigenvectors. The latent space feature map determination module is used to perform deep semantic encoding on the one-dimensional feature vector using an attention mechanism to generate a latent space feature map containing global hydraulic condition information. The high-dimensional latent space feature map determination module is used to spatially downsample the static geometric feature set to match the size of the latent space feature map, and concatenate it with the latent space feature map in the channel dimension to generate a high-dimensional latent space feature map containing global influence information, thereby realizing multimodal information fusion. The predicted flow field data generation module is used to input the high-dimensional latent space feature map containing global influence information into the convolutional neural network decoder, and through cascaded spatial upsampling and convolution operations, restore the spatial details of the flow field step by step, and finally generate predicted flow field data with the same resolution as the two-dimensional rasterized flow field target data. The flow field reconstruction result output module is used to perform an inverse normalization operation on the predicted flow field data to restore its physical dimensions, and to construct a physical mask using the symbolic distance function graph to remove invalid values corresponding to land areas in the predicted flow field data, and output the flow field reconstruction result.
[0015] In some embodiments, an electronic device is also disclosed, characterized in that the electronic device includes a memory and at least one processor, the memory storing instructions; the at least one processor invokes the instructions in the memory to cause the electronic device to perform the various steps of the river flow field reconstruction method described in any of the preceding embodiments.
[0016] In some embodiments, a computer-readable storage medium is also disclosed, on which instructions are stored, which, when executed by a processor, implement the steps of the river flow field reconstruction method as described in any of the preceding embodiments.
[0017] The present invention includes, but is not limited to, the following beneficial effects: (1) This scheme breaks through the bottleneck of long-distance physical correlation modeling and innovatively introduces a self-attention mechanism in the flow field reconstruction task. By utilizing its global receptive field characteristics, it effectively solves the problem that traditional convolutional neural networks are difficult to capture the non-local effects of upstream boundary condition changes on downstream flow field when dealing with narrow rivers. This enables the model to accurately reflect the propagation of flow waves and the variation of water level along the course; (2) This scheme realizes deep fusion and physical constraints of multimodal data: Unlike conventional methods that rely solely on image texture learning, the present invention explicitly inputs the riverbed topography and the symbolic distance function as independent static modal inputs into the deep latent space of the network, and uses the symbolic distance function again for physical mask filtering in the post-processing stage. This mechanism ensures that the generated flow field data strictly conforms to the river topography and has clear and accurate physical boundaries at the water-land boundary; (3) Compared with the time-consuming iterative solution process of traditional numerical simulation software under complex working conditions, this system transforms the flow field solution process into a forward inference process after the model training is completed, realizing millisecond-level flow field reconstruction. This makes it possible to conduct tens of thousands of scenario simulations in flood control scheduling, sudden water pollution diffusion simulation, etc., greatly improving the timeliness of decision-making, significantly improving computational efficiency and emergency response capabilities; (4) This scheme benefits from the deep semantic encoding of boundary condition parameters, which can not only reproduce the working conditions in the training set, but also make reasonable interpolation predictions for unseen intermediate or extreme working conditions, showing strong generalization performance, and is suitable for rapid prediction of the flow field under different water levels and different flow combinations. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0019] Figure 1 This is a schematic diagram of the overall process of a river flow field reconstruction method provided in an embodiment of the present invention; Figure 2 This is a logical structure and data flow diagram of a river flow field reconstruction system provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the multimodal feature fusion mechanism provided in the embodiments of the present invention; Figure 4 This is a detailed architecture diagram of the convolutional neural network model provided in the embodiments of the present invention; Figure 5This is a schematic diagram comparing the flow field cloud map predicted by the model in an embodiment of the present invention with the actual numerical simulation results; Figure 6 This is a schematic diagram of the structure of the electronic device provided in the embodiment of the invention. Detailed Implementation
[0020] The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0021] Specifically, Figure 1 This is a schematic diagram of the overall process of the river flow field reconstruction method according to an embodiment of this application. (See attached diagram.) Figure 1 It includes the following steps: S100. Obtain the raw hydrodynamic numerical simulation data of the unstructured grid and reconstruct the flow field physical quantities in the unstructured data into two-dimensional rasterized flow field target data. The two-dimensional rasterized flow field target data covers the predefined computational domain and has a uniform spatial resolution.
[0022] For example, this example uses the prediction of a two-dimensional flow field of a large bifurcation channel as an example, and obtains TELEMAC-2D simulation results (a collection of .slf files) for 100 different working conditions. These working conditions are all based on a typical large bifurcation channel, and its hydrodynamic boundary conditions are determined by the total inflow from the upstream main stream ( The corresponding flow rates of the four main downstream branches. Common Definitions. Each file contains node coordinates, cell connectivity, riverbed elevation, and flow field data for a specific time step, defined on an unstructured triangular mesh. For subsequent processing, we first define a two-dimensional Cartesian mesh with a final target resolution of (1216, 1224). Then, a spatial interpolation algorithm is used to map the unstructured data onto this regular mesh. This embodiment preferably employs a linear interpolation method based on Delaunay triangulation. This method first constructs a Delaunay triangulation network based on the coordinates of all original nodes. Then, for each interpolation point on the target mesh, its value is determined by locating the triangle it belongs to and using the physical quantity values of the triangle vertices for linear centroid coordinate interpolation. This process ensures the continuity of the interpolation results and the smooth transition of physical quantities.
[0023] S102. Based on the two-dimensional rasterized flow field target data, extract the riverbed topographic elevation to generate a topographic elevation map, identify the water-land boundary and calculate the symbolic distance function map, and use the topographic elevation map and the symbolic distance function map as a set of static geometric features.
[0024] Specifically, this step extracts static geometric information that does not change with operating conditions, serving as strong physical constraints for the model.
[0025] The topographic elevation map can be generated by using the above interpolation method to extract the riverbed elevation BOTTOM variable from the .slf file and create a (1216, 1224) topographic map in BATHYMETRY.dat.
[0026] The symbolic distance function (SDF) map accurately encodes the land-water boundary information. In the generated .dat topographic map, pixels within the water area have numerical values, while land areas are represented by NaN (NaN). Based on this NaN distribution, the land-water boundary outline can be determined. Subsequently, the symbolic distance function value for each pixel p is calculated using the following formula to generate a (1216, 1224) SDF.dat map: ; in, Represents the two-dimensional coordinates of any raster cell within the computational domain; The set of all water and land contour pixels, determined by identifying invalid (NaN) boundaries in the rasterized data; For the set of outlines The coordinates of any pixel in the array; Representing coordinates and coordinates The Euclidean distance between them is calculated as follows: ; This is a binary indicator function used to assign a sign to distances to distinguish between land and water; its specific definition is: ; Among them, water areas land area The division is determined based on whether there are valid physical quantity values in the rasterized data.
[0027] S104. Analyze the dynamic hydraulic boundary conditions from the simulation file and parameterize them into a one-dimensional eigenvector.
[0028] Specifically, this module is responsible for transforming dynamic boundary conditions and static geometric features into a unified feature representation that can be processed by the decoder. In this embodiment, the operating condition information is obtained by parsing dynamic hydraulic parameters from a preset file naming rule. For example, for a filename like "Q_total_495_main_284_north_63_middle_67_south_88.dat", regular expressions are used to precisely extract five key values from the filename: total flow, main branch flow, north branch flow, middle branch flow, and south branch flow. These values are then combined sequentially to form a one-dimensional boundary condition feature vector. .
[0029] S106. Use the attention mechanism to perform deep semantic encoding on the one-dimensional feature vector to generate a latent space feature map containing global hydraulic condition information.
[0030] Specifically, the steps in step S106 may include: The dimension of the input is of Through a linear projection layer, it maps to the high-dimensional embedding space inside the network, generating a dimensionless embedding space. memory tensor This process can be described by the following formula: ,in and The learnable weights and biases of this projection layer; Using one dimension Learnable query tensors With a learnable position encoding tensor of the same dimension Element-wise summation is performed to generate the initial query, which serves as the input to the attention mechanism. ,in, The total number of pixels in the latent space feature map; Initial query As , memory tensor At the same time as and It performs multi-head cross-attention calculations to capture the differentiated effects of boundary conditions on various locations in space. The core calculation process is as follows: ; in The function computes multiple attention heads in parallel, and the computation of each head follows the formula below: ; in, These represent the query vectors after multi-head splitting and linear transformation, respectively. Key vector Sum value vector In this step, Corresponding to the initial query The transformation is used to characterize the query requirements for spatial location; and All correspond to memory tensors The transformations are used to provide index features and content features for boundary conditions, respectively; The output of attention calculation Through residual connections, layer normalization, and a feedforward neural network for further nonlinear transformation and information extraction, the final output tensor is reshaped into a tensor with a predetermined spatial dimension. Latent space feature map .
[0031] Specifically, in order to understand deeply To understand the inherent correlation between these five flow parameters and their nonlocal impact on the global flow field, this embodiment employs an attention mechanism decoder structure as the encoder.
[0032] Input embedding: First, Through a linear projection layer, it is mapped to a Dimensional memory tensor ,in (256 in this example) is the embedding dimension of the model.
[0033] Query and Location Encoding: The model internally defines a learnable query tensor. Its size is ,in This is the total number of pixels in the subsequent latent space feature map (e.g., 38*38). Simultaneously, a learnable positional encoding E_pos of the same size is defined.
[0034] Multi-head cross-attention: This is the core of the encoding. Initial query. As , At the same time as and Multi-head cross-attention calculation is performed. The core formula is: ; Through this mechanism, each query tag can "pay attention" to the boundary condition information carried by the memory tensor and integrate this information into itself.
[0035] Feedforward Network and Layer Stacking: The output of the attention computation is processed through residual connections, layer normalization, and a feedforward neural network for information extraction. By stacking N such decoder layers, the model can progressively build a deeper understanding of the complex boundary conditions consisting of the total incoming flow and the four branch flows. Finally, the output tensor is reshaped into a latent space feature map with 256 channels and a spatial size of 38×38. .
[0036] S108. Spatial downsampling of the static geometric feature set is performed to match the size of the latent space feature map, and the latent space feature map is concatenated with the latent space feature map in the channel dimension to generate a high-dimensional latent space feature map containing global influence information, thereby realizing multimodal information fusion.
[0037] Specifically, this step may include the following steps: The static geometric feature set information, with an original resolution of Topographic elevation map And the symbolic distance function graph Each is processed through an adaptive average pooling layer. The spatial resolution is forcibly downsampled to match the latent space feature map. Completely consistent Subsequently, a channel-level concatenation operation is performed, defined by the following formula: ; in, This represents the splicing operator along the channel dimension; For the final generated, a channel number equal to , , A unified feature expression that includes the sum of channel numbers and encompasses both dynamic boundary conditions and static geometric constraints.
[0038] In this example, this step combines dynamic and static information, and its logical principle is as follows: Figure 3 As shown.
[0039] Spatial alignment: Using an adaptive average pooling layer, high-resolution SDF maps and topographic maps are aligned. and Spatial dimensions, downsampling to the same Completely identical 38×38.
[0040] Channel concatenation: The three elements are concatenated along the channel dimension using the following formula to form a unified multimodal feature map. : ; The number of channels in the stitched hybrid feature map becomes 258 (i.e., 256 dynamic feature channels + 1 terrain channel + 1 SDF channel).
[0041] S110. Input the high-dimensional latent space feature map containing global influence information into the convolutional neural network decoder. Through cascaded spatial upsampling and convolution operations, restore the spatial details of the flow field step by step, and finally generate predicted flow field data with the same resolution as the two-dimensional rasterized flow field target data.
[0042] S112. Perform inverse normalization on the predicted flow field data to restore its physical dimensions, and construct a physical mask using the symbolic distance function graph to remove invalid values corresponding to land areas in the predicted flow field data, and output the flow field reconstruction result.
[0043] As shown in Figure 4, the convolutional neural network decoder consists of... It consists of a series of identical, cascaded upsampling decoding modules, DecBlock, which extract features from the fused feature maps. To the original predicted flow field The complete decoding process can be described by the following iterative formula: ; in, This represents the input feature map of the i-th decoding module; As a decoding module, its core is a step size. A deconvolutional layer of size 2 This layer is used to double the spatial resolution and learn how to recover fine flow field structures from coarse features. A batch normalization layer is then connected to this layer. and a nonlinear activation function (such as ReLU), that is ; The last 1x1 convolution is used to adjust the number of channels in the feature map to 1 to match the univariate flow field output.
[0044] Preferably, in this example, the deconvolutional layer kernel size is 4 and the padding is 1 to eliminate the checkerboard effect. Since there is a difference between the size after multiple upsampling (1216×1216) and the target size (1216×1224), this module uses boundary copy padding technology to fill in the pixels in the width direction to ensure accurate matching of the output size.
[0045] Furthermore, in this example, before performing step S100 to obtain the raw hydrodynamic numerical simulation data for processing the unstructured grid, the model is trained offline, including: All learnable parameters of the attention model and convolutional neural network decoder are iteratively adjusted using gradient descent-based optimization algorithms (such as Adam). To minimize a pre-defined target loss function The loss function is defined as the masked mean square error calculated within the physical water area, and its precise mathematical expression is: ; in, Indicated by The parameters are boundary conditions. and geometric features A complete proxy model; These are the coordinates of the raster cells; The data represents real, normalized flow field target data. Indicates by The set of all determined water area grid cells; This represents the total number of elements in the set, which is the total pixel area of the water area.
[0046] In this example, the global maximum value is calculated for the flow field target data of all training samples. and minimum value And linearly normalize all valid pixel values to The interval is used, and optimizers such as Adam are employed to iteratively minimize the interval using the backpropagation algorithm. To update model parameters .
[0047] Once the model is trained, it can be used for rapid prediction.
[0048] Input new working condition: The user provides a new boundary condition vector. .
[0049] Forward propagation: The trained model is fed with a static geometric graph, and a forward propagation is performed to obtain the normalized predicted flow field. .
[0050] Inverse normalization: The prediction results are restored to their true physical dimensions using the following formula: ; Physical boundary constraints: Using the SDF graph as a mask, The pixel values corresponding to the land area are set to NaN.
[0051] Output: The final high-fidelity flow field matrix is saved as a .dat file, and a visualization library is used to generate cloud maps and other data for user analysis.
[0052] In summary, this embodiment, through the close coordination of the above steps, successfully constructed and applied a method capable of rapid and high-precision prediction of complex river flow fields. This method reduces the computational tasks of traditional numerical simulations, which typically take hours, to the second level, demonstrating enormous potential for engineering applications.
[0053] In operating condition, incoming flow Main branch diversion North Branch Diversion Central branch diversion Southern branch diversion At that time, the average absolute error between the predicted and simulated values was approximately 0.04, and the prediction comparison chart is shown in Figure 5.
[0054] This solution overcomes the bottleneck of long-distance physical correlation modeling by innovatively introducing a self-attention mechanism into the flow field reconstruction task. Leveraging its global receptive field, it effectively solves the problem of traditional convolutional neural networks struggling to capture the nonlocal effects of upstream boundary condition changes on the downstream flow field when dealing with narrow rivers. This enables the model to accurately reflect the propagation of flow waves and the variation of water level along the course of the river. Furthermore, this solution achieves deep fusion and physical constraints of multimodal data: unlike conventional methods that rely solely on image texture learning, this invention explicitly inputs riverbed topography and the symbolic distance function as independent static modal inputs into the deep latent space of the network, and then uses the symbolic distance function again for physical masking in the post-processing stage. This mechanism ensures that the generated flow field data strictly conforms to the riverbed topography and has clear and accurate physical boundaries at the land-water boundary. Moreover, compared to the time-consuming iterative solution process of traditional numerical simulation software under complex conditions, this system transforms the flow field solution process into a single forward inference process after model training, achieving millisecond-level flow field reconstruction. This makes it possible to conduct tens of thousands of scenario simulations in situations such as flood control scheduling and sudden water pollution diffusion simulation, greatly improving the timeliness of decision-making and significantly enhancing computational efficiency and emergency response capabilities. Furthermore, thanks to the deep semantic encoding of boundary condition parameters, this solution can not only reproduce the working conditions in the training set, but also perform reasonable interpolation predictions for unseen intermediate or extreme working conditions, demonstrating strong generalization performance and being suitable for rapid prediction of flow fields under different working conditions and different flow combinations.
[0055] Furthermore, this application also discloses a river channel flow field reconstruction system, specifically, the system is deployed on one or more computing devices with processors and non-volatile memory, such as... Figure 2 As shown, the system includes: The acquisition module is used to acquire raw hydrodynamic numerical simulation data of unstructured grids and reconstruct the flow field physical quantities in the unstructured data into two-dimensional rasterized flow field target data. The two-dimensional rasterized flow field target data covers the predefined computational domain and has a uniform spatial resolution. The static geometric feature set determination module is used to extract the riverbed topographic elevation based on two-dimensional rasterized flow field target data to generate a topographic elevation map, and to identify the water-land boundary to calculate and generate a symbolic distance function map. The topographic elevation map and the symbolic distance function map are used as the static geometric feature set. The one-dimensional eigenvector determination module is used to parse dynamic hydraulic boundary conditions from simulation files and parameterize them into one-dimensional eigenvectors. The latent space feature map determination module is used to perform deep semantic encoding on one-dimensional feature vectors using an attention mechanism to generate a latent space feature map containing global hydraulic condition information. The high-dimensional latent space feature map determination module is used to spatially downsample the static geometric feature set to match the size of the latent space feature map, and concatenate it with the latent space feature map in the channel dimension to generate a high-dimensional latent space feature map containing global influence information, thereby realizing multimodal information fusion. The predicted flow field data generation module is used to input a high-dimensional latent space feature map containing global impact information into the convolutional neural network decoder. Through cascaded spatial upsampling and convolution operations, the spatial details of the flow field are restored step by step, and the predicted flow field data with the same resolution as the two-dimensional rasterized flow field target data is generated. The flow field reconstruction result output module is used to perform inverse normalization on the predicted flow field data to restore its physical dimensions, and to construct a physical mask using the symbolic distance function graph to remove invalid values corresponding to land areas in the predicted flow field data, and output the flow field reconstruction result.
[0056] The application of the relevant modules of the system in this example can be found in the above introduction to the principles of the method, and will not be repeated here.
[0057] above Figure 2 The apparatus in the embodiments of the present invention will be described in detail from the perspective of modular functional entities. The electronic device in the embodiments of the present invention will be described in detail from the perspective of hardware processing.
[0058] Figure 6This is a schematic diagram of the structure of an electronic device 600 provided in an embodiment of the present invention. The electronic device 600 can vary significantly due to different configurations or performance characteristics. It may include one or more central processing units (CPUs) 610 (e.g., one or more processors) and a memory 620, and one or more storage media 630 (e.g., one or more mass storage devices) for storing application programs 633 or data 632. The memory 620 and storage media 630 can be temporary or persistent storage. The program stored in the storage media 630 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the electronic device 600. Furthermore, the processor 610 may be configured to communicate with the storage media 630 and execute the series of instruction operations in the storage media 630 on the electronic device 600.
[0059] Electronic device 600 may also include one or more power supplies 640, one or more wired or wireless network interfaces 650, one or more input / output interfaces 660, and / or one or more operating systems 631, such as Windows Server, MacOSX, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 6 The illustrated electronic device structure does not constitute a limitation on electronic devices and may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0060] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the steps of a method for predicting the texture and taste properties of low-sodium myofibrillar protein gel.
[0061] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system, device, or unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0062] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0063] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for reconstructing a river channel flow field, characterized in that, The method is performed by a computer device configured with a processor, and the method includes: The raw hydrodynamic numerical simulation data of the unstructured grid is acquired and processed, and the flow field physical quantities in the unstructured data are reconstructed into two-dimensional rasterized flow field target data. The two-dimensional rasterized flow field target data covers a predefined computational domain and has a uniform spatial resolution. Based on the two-dimensional rasterized flow field target data, the riverbed topographic elevation is extracted to generate a topographic elevation map, and the water-land boundary is identified to calculate and generate a symbolic distance function map. The topographic elevation map and the symbolic distance function map are used as a set of static geometric features. The dynamic hydraulic boundary conditions are parsed from the simulation file and parameterized into a one-dimensional eigenvector. The one-dimensional feature vector is subjected to deep semantic encoding using an attention mechanism to generate a latent space feature map containing global hydraulic condition information. The static geometric feature set is spatially downsampled to match the size of the latent space feature map, and then concatenated with the latent space feature map in the channel dimension to generate a high-dimensional latent space feature map containing global influence information, thereby realizing multimodal information fusion. The high-dimensional latent space feature map containing global influence information is input into the convolutional neural network decoder. Through cascaded spatial upsampling and convolution operations, the spatial details of the flow field are restored step by step, and the predicted flow field data with the same resolution as the two-dimensional rasterized flow field target data is generated. Perform an inverse normalization operation on the predicted flow field data to restore its physical dimensions, and use the symbolic distance function graph to construct a physical mask to remove invalid values corresponding to land areas in the predicted flow field data, and output the flow field reconstruction result.
2. The river flow field reconstruction method according to claim 1, characterized in that, The symbolic distance function graph is based on the two-dimensional coordinates of any grid cell within the computational domain. The value of the signed distance function is calculated by the following formula: ; in, Represents the two-dimensional coordinates of any raster cell within the computational domain; It is a set of all water and land contour pixels determined by identifying invalid value boundaries in the rasterized data; The set of contour lines The coordinates of any pixel in the array; Representing coordinates With coordinates The Euclidean distance between them is calculated as follows: ; This is a binary indicator function used to assign a sign to distances to distinguish between land and water; its specific definition is: ; Among them, water areas land area The division is determined based on whether there are valid physical quantity values in the rasterized data.
3. The river flow field reconstruction method according to claim 1, characterized in that, The step of using an attention mechanism to perform deep semantic encoding on the one-dimensional feature vector to generate a latent space feature map containing global hydraulic condition information includes: The dimension of the input is eigenvectors Through a linear projection layer, it maps to the high-dimensional embedding space inside the network, generating a dimensionless embedding space. memory tensor This process can be described by the following formula: ,in and The learnable weights and biases of this projection layer; Using one dimension Learnable query tensors With a learnable position encoding tensor of the same dimension Element-wise summation is performed to generate the initial query, which serves as the input to the attention mechanism. ,in, The total number of pixels in the latent space feature map; The initial query As , the memory tensor At the same time as and It performs multi-head cross-attention calculations to capture the differentiated effects of boundary conditions on various locations in space. The core calculation process is as follows: ; in, This represents the direct output tensor calculated by the multi-head cross-attention mechanism; The function computes multiple attention heads in parallel, and the computation of each head follows the formula below: ; in, These represent the query vectors after multi-head splitting and linear transformation, respectively. Key vector Sum value vector In this step, Corresponding to the initial query The transformation is used to characterize queries of spatial location. need; and All correspond to the memory tensor The transformations are used to provide index features and content features for boundary conditions, respectively; The output of attention calculation Through residual connections, layer normalization, and a feedforward neural network for further nonlinear transformation and information extraction, the final output tensor is reshaped into a tensor with a predetermined spatial dimension. The latent space feature map .
4. The river flow field reconstruction method according to claim 1, characterized in that, The step of spatially downsampling the static geometric feature set to match the size of the latent space feature map, and concatenating it with the latent space feature map in the channel dimension to generate a high-dimensional latent space feature map containing global influence information, thereby realizing multimodal information fusion, includes: The static geometric feature set information with an original resolution of Topographic elevation map And the symbolic distance function graph Each is processed through an adaptive average pooling layer. The spatial resolution is forcibly downsampled to match the latent space feature map. Completely consistent Subsequently, a channel-level concatenation operation is performed, defined by the following formula: ; in, This represents the splicing operator along the channel dimension; For the final generated, a channel number equal to , and A unified feature expression that includes the sum of channel numbers and encompasses both dynamic boundary conditions and static geometric constraints.
5. The river flow field reconstruction method according to claim 1, characterized in that, The convolutional neural network decoder is composed of A cascaded upsampling decoding module with identical structure Composition, which is derived from the fusion feature map To the original predicted flow field The complete decoding process can be described by the following iterative formula: ; in, This represents the input feature map of the i-th decoding module; As a decoding module, its core is a step size. A deconvolutional layer of size 2 This layer is followed by a batch normalization layer. and a nonlinear activation function ,Right now ; The last 1x1 convolution is used to adjust the number of channels in the feature map to 1 to match the univariate flow field output.
6. The river flow field reconstruction method according to claim 1, characterized in that, Before acquiring the raw hydrodynamic numerical simulation data of the unstructured grid, the method further includes: All learnable parameters of the attention model and convolutional neural network decoder are iteratively adjusted using a gradient descent-based optimization algorithm. To minimize a pre-defined target loss function The loss function is defined as the masked mean square error calculated within the physical water area, and its precise mathematical expression is: ; in, Indicated by The parameters are boundary conditions. and geometric features A complete proxy model; These are the coordinates of the raster cells; The data represents real, normalized flow field target data. Indicates by The set of all determined water area grid cells; This represents the total number of elements in the set, which is the total pixel area of the water area.
7. The river flow field reconstruction method according to claim 1, characterized in that, The process involves performing an inverse normalization operation on the predicted flow field data to restore its physical dimensions, and constructing a physical mask using the symbolic distance function graph to remove invalid values corresponding to land regions in the predicted flow field data. The output flow field reconstruction result includes: The predicted flow field data is subjected to an inverse normalization operation, which uses the maximum and minimum values of global physical quantities calculated and stored in advance on the training set to linearly map the data from the normalization interval back to the true physical dimensions. A binary physical mask is constructed using the symbolic distance function graph. After identifying and forcibly removing all invalid values in the predicted flow field that correspond to land regions, the flow field reconstruction result is output.
8. A river flow field reconstruction system, characterized in that, The system is deployed on one or more computing devices having a processor and non-volatile memory, and the system includes: The acquisition module is used to acquire raw hydrodynamic numerical simulation data of unstructured grids and reconstruct the flow field physical quantities in the unstructured data into two-dimensional rasterized flow field target data. The two-dimensional rasterized flow field target data covers a predefined computational domain and has a uniform spatial resolution. The static geometric feature set determination module is used to extract the riverbed topographic elevation based on the two-dimensional rasterized flow field target data to generate a topographic elevation map, and to identify the water-land boundary to calculate and generate a symbolic distance function map, and to use the topographic elevation map and the symbolic distance function map as a static geometric feature set; The one-dimensional eigenvector determination module is used to parse dynamic hydraulic boundary conditions from simulation files and parameterize them into one-dimensional eigenvectors. The latent space feature map determination module is used to perform deep semantic encoding on the one-dimensional feature vector using an attention mechanism to generate a latent space feature map containing global hydraulic condition information. The high-dimensional latent space feature map determination module is used to spatially downsample the static geometric feature set to match the size of the latent space feature map, and concatenate it with the latent space feature map in the channel dimension to generate a high-dimensional latent space feature map containing global influence information, thereby realizing multimodal information fusion. The predicted flow field data generation module is used to input the high-dimensional latent space feature map containing global influence information into the convolutional neural network decoder, and through cascaded spatial upsampling and convolution operations, restore the spatial details of the flow field step by step, and finally generate predicted flow field data with the same resolution as the two-dimensional rasterized flow field target data. The flow field reconstruction result output module is used to perform an inverse normalization operation on the predicted flow field data to restore its physical dimensions, and to construct a physical mask using the symbolic distance function graph to remove invalid values corresponding to land areas in the predicted flow field data, and output the flow field reconstruction result.
9. An electronic device, characterized in that, The electronic device includes a memory and at least one processor, the memory storing instructions; the at least one processor invokes the instructions in the memory to cause the electronic device to perform the various steps of the river flow field reconstruction method as described in any one of claims 1-7.
10. A computer-readable storage medium storing instructions thereon, characterized in that, When the instructions are executed by the processor, they implement the various steps of the river flow field reconstruction method as described in any one of claims 1-7.