Hydrodynamic field prediction method and system based on physical constraints and dual attention
Patent Information
- Application Number
- CN202611145198.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-30
- Publication Date
- 2026-10-20
AI Technical Summary
(1)不可压缩性物理约束缺失导致质量守恒失效:常规深度学习代理模型采用纯黑箱端到端重构,无法约束预测速度场满足流体质量守恒定律(即速度场散度为零的无散条件)
1.高精度近壁流动特征表征:相较于传统二值掩码输入,本发明采用Tanh非线性压缩的连续带符号距离函数(SDF)作为水翼几何特征通道,为网络提供了固液界面的连续空间距离梯度信息。SDF特征与CBAM多维度自适应注意力机制的协同作用,使网络能够精准捕捉前缘高负压吸力峰、近壁边界层高速梯度及尾流流动分离点等关键高梯度流动细节,显著提升了压力场与速度场的局部预测精度。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention belongs to the interdisciplinary field of computational fluid dynamics and artificial intelligence, and specifically relates to a method and system for predicting hydrodynamic fields of hydrofoils based on physical constraints and dual attention. Background Technology
[0002] Hydrofoils are core physical components in ships and marine engineering, hydraulic and marine energy utilization equipment (such as hydroelectric turbines, tidal turbines, and tidal turbine blades), and underwater propulsion systems (such as propeller blades) that convert energy, generate lift, or provide thrust. The distribution of the flow field around the hydrofoil and its hydrodynamic performance directly determine the energy capture efficiency, navigation efficiency, operational stability, and fatigue life of hydrodynamic equipment.
[0003] Water, as a flowing medium, has a high density (approximately 998 kg / m³). 3 The hydrofoil exhibits strong nonlinear characteristics in terms of pressure distribution, shear stress, and flow separation. Under high dynamic load conditions on turbine blades or ship hydrofoils, traditional hydrodynamic performance evaluation relies heavily on computational fluid dynamics (CFD) numerical simulations (such as solving Reynolds-averaged Navier-Stokes (RANS) using the finite volume method). However, in the iterative design phase of modern turbine blade profile optimization or underwater equipment design, CFD simulations face significant bottlenecks, including long computation cycles and high costs for large-scale calculations under multiple operating conditions, making it difficult to meet the rapid iterative needs of engineering design.
[0004] In recent years, machine learning technology has made significant progress in the field of computational fluid dynamics (CFD). By training neural network models, efficient flow field prediction models can be built using existing numerical simulation or experimental data, thereby reducing computational costs. However, existing data-driven flow field prediction methods face the following severe technical challenges in aqueous media and hydrofoil applications: (1) Lack of incompressible physical constraints leads to failure of mass conservation: Conventional deep learning surrogate models use pure black box end-to-end reconstruction, which cannot constrain the predicted velocity field to satisfy the fluid mass conservation law (i.e., the divergence-free condition where the velocity field divergence is zero). In strongly incompressible water flow, even small velocity divergence deviations can cause severe numerical drift in the coupled pressure field, making the calculation results of key hydrodynamic indicators such as lift coefficient and drag coefficient completely invalid.
[0005] (2) Rough representation of near-wall high gradient flow characteristics: Traditional methods usually use binary image masks as the geometric input features of hydrofoils. This method only provides the positional information of the solid-liquid interface and completely loses the spatial distance gradient information from the grid nodes to the solid wall, resulting in severe blurring and distortion in the prediction of flow details in the high curvature and high load region of the hydrofoil leading edge and the high gradient region of the near-wall boundary layer.
[0006] (3) Non-physical flow leakage exists at the solid-liquid interface: In viscous water flow, the solid wall of the hydrofoil must meet strict no-slip and non-penetration physical boundary conditions (i.e., the velocity at the wall is absolutely zero). However, the initial flow field prediction value directly output by the neural network often has non-zero residual velocity inside the solid hydrofoil and at the wall, resulting in non-physical flow leakage and destroying the physical reality of the flow field at the solid-liquid interface. Summary of the Invention
[0007] To address the shortcomings of existing technologies, this invention provides a hydrodynamic field prediction method and system for hydrofoils based on physical constraints and dual attention. By introducing continuous SDF geometric feature representation, CBAM dual attention enhancement, solid wall no-slip hard projection, and incompressible divergence physical loss constraints, the prediction accuracy of the surrogate model in capturing strongly nonlinear flow features, applying strict solid wall boundary physical conditions, and conserving the incompressible mass of high-density water media is effectively improved.
[0008] The objective of this invention is achieved through the following technical solution: A hydrofoil hydrodynamic field prediction system based on physical constraints and dual attention includes a data preparation module, a feature extraction and tensor reconstruction module, an attention-enhanced prediction module, a hybrid physical loss training module, and a hydrodynamic coefficient evaluation module. The data preparation module is used to perform NACA four-digit parametric geometric modeling and angle-of-attack rotation transformation on the target hydrofoil, and to call the mesh generation software to perform structured mesh generation on the target hydrofoil watershed. It also calls the computational fluid simulation software to set boundary conditions and perform iterative calculations, and outputs a full-domain ASCII data file containing the spatial coordinates, pressure, X-axis velocity and Y-axis velocity of each mesh node. The feature extraction and tensor reconstruction module is used to extract the spatial and physical features of the flow field around the hydrofoil and reconstruct the standardized input tensor to form a six-channel standardized tensor dataset including the normalized X-direction inlet flow velocity, Y-direction inlet velocity channel, continuous band signed distance function geometric space feature map, orthogonal pressure field, orthogonal X-direction velocity field and orthogonal Y-direction velocity field. The attention enhancement prediction module is used to construct a convolutional neural network generator based on a symmetric U-Net architecture. This generator includes an eight-level deep convolutional encoder, a seven-level transposed convolutional decoder, and a convolutional block attention module embedded at the end of the decoder, consisting of a channel attention submodule and a spatial attention submodule connected in series. This module performs adaptive multi-dimensional feature weighting on high flow gradient regions and high load feature regions. Furthermore, a binary fluid indicator mask is applied to the velocity prediction field at the network output layer. M fluid The hard projection forces the solid wall no-slip boundary condition, resulting in the final flow field output that satisfies the solid wall boundary condition; The hybrid physical loss training module is used to linearly weight the L1 data reconstruction loss and the incompressible continuous divergence physical loss calculated based on the second-order central finite difference scheme according to the weight coefficients to construct a hybrid loss function, which drives the optimizer to perform backpropagation training on the network parameters of the convolutional neural network generator until convergence, thereby obtaining a hydrodynamic field prediction surrogate model that satisfies the incompressible hydrodynamic constraints. The hydrodynamic coefficient evaluation module is used to receive the target hydrofoil's geometric parameters and flow conditions, call the trained hydrodynamic field prediction proxy model to output the full-field pressure and velocity prediction map, extract the surface pressure distribution on the closed profile of the hydrofoil, perform closed curve path integration and dimensionless conversion, and output the hydrofoil's lift coefficient and drag coefficient.
[0009] Furthermore, each convolutional block of the eight-level depth convolutional encoder includes a 4×4 convolutional layer with a stride of 2, a batch normalization layer, and a LeakyReLU activation function.
[0010] Furthermore, the seven-level transposed convolutional decoder is composed of seven levels of transposed convolutional blocks. The output of each level of transposed convolutional block is concatenated with the output of the corresponding coding layer and used as the input of the next decoding level, forming a cross-layer feature skip connection.
[0011] Furthermore, the input of the channel attention submodule is the deep feature merging tensor output by the decoder. Adaptive global average pooling and global max pooling are performed simultaneously on the deep feature merging tensor to extract spatial global statistical features. The results of the two pooling are input into a shared two-layer fully connected neural network to calculate the flow correlation weights between channels. After Sigmoid activation, the obtained channel attention matrix is multiplied with the original deep feature merging tensor channel by channel to achieve adaptive enhancement of flow field features in the channel dimension.
[0012] Furthermore, the input to the spatial attention submodule is the channel-enhanced feature map. The mean and maximum feature maps of each spatial location are calculated along the channel axis to obtain the spatial distribution of the physical boundary. The two are concatenated and fed into a large kernel convolutional layer with a receptive field of 7×7 to extract the spatial adaptive weights of the high gradient flow separation region, the leading edge pressure jump region, and the wake shedding region. After Sigmoid activation, the weights are multiplied element-wise with the channel-enhanced feature map to output the final deep feature map enhanced by both channel and spatial attention.
[0013] Furthermore, the network output layer is... SDF final A binary fluid indicator mask matrix representing the fluid flow region is constructed using ≤0 as the criterion. M fluid And the initial velocity prediction component U init and Vinit respectively with M fluid Perform element-wise Hadamard product calculations, force the velocity prediction values of all nodes inside the hydrofoil solid and at the wall to be zero, apply no-slip wall physical hard constraints, and obtain the final flow field output that satisfies the solid wall boundary conditions.
[0014] A hydrodynamic field prediction method for hydrofoils based on physical constraints and dual attention, comprising the following steps: S1: Perform parametric geometric modeling and angle-of-attack rotation transformation on the target hydrofoil to obtain the discrete coordinates of the hydrofoil wall under the working angle of attack; use mesh generation software to divide the target hydrofoil watershed into a structured mesh, and use computational fluid simulation software to set boundary conditions and perform iterative calculations to obtain a global ASCII format original node data file, which includes the spatial coordinates, pressure, X-axis velocity and Y-axis velocity of each mesh node; S2: Extract the raw node data file in ASCII format and establish a uniform orthogonal two-dimensional grid covering the main flow region around the hydrofoil in Cartesian coordinates; use two-dimensional linear interpolation to map and project the pressure, X-axis velocity, and Y-axis velocity values on the spatially distributed discrete grid nodes onto a uniform orthogonal physical plane to obtain the orthogonal pressure field. P target Orthogonal X-axis velocity field U target and orthogonal Y-axis velocity field V target Based on the discrete point coordinates of the hydrofoil wall profile, the shortest signed distance from each orthogonal grid node to the hydrofoil solid wall is calculated using the fast Euclidean distance transformation algorithm on a uniform orthogonal two-dimensional grid. SDF raw The values are negative inside the solid region, positive in the external fluid region, and zero at the boundary; then... SDF raw A Gaussian filter is applied to eliminate geometric singularity noise at sharp corners, and then a hyperbolic tangent function is used to nonlinearly scale the smoothed range field to generate a continuous signed distance function geometric space feature map with a range of [-1,1]. SDF final The normalized inlet flow velocity, Y-axis inlet velocity, SDF final ,as well as P target , U target and V target Perform matrix concatenation along the feature channel axis to reconstruct a six-channel standardized tensor dataset; S3: Construct a convolutional neural network generator based on a symmetric U-Net architecture. The convolutional neural network generator includes an eight-level deep convolutional encoder, a seven-level transposed convolutional decoder, a convolutional block attention module embedded at the end of the decoder consisting of channel attention submodules and spatial attention submodules connected in series, and a network output layer. The input of the convolutional neural network generator is a six-channel normalized tensor dataset, and the output is a flow field pressure and velocity prediction map that satisfies the solid wall boundary conditions. S4: Construct a hybrid loss function obtained by linearly weighting the L1 data reconstruction loss and the incompressible continuous divergence physical loss calculated based on the second-order central finite difference scheme according to the weight coefficients, and train the convolutional neural network generator to obtain a hydrodynamic field prediction surrogate model that satisfies the incompressible hydrodynamic constraints. S5: Receives the target hydrofoil's geometric parameters and flow conditions, calls the trained hydrodynamic field prediction proxy model to output the full-field pressure and velocity prediction map, extracts the surface pressure distribution on the hydrofoil's closed profile, performs closed curve path integration and dimensionless conversion, and outputs the hydrofoil's lift coefficient and drag coefficient.
[0015] The beneficial effects of this invention are as follows: 1. High-precision near-wall flow feature characterization: Compared to traditional binary mask input, this invention uses a Tanh nonlinear compressed continuous-band signed distance function (SDF) as the hydrofoil geometric feature channel, providing the network with continuous spatial distance gradient information of the solid-liquid interface. The synergistic effect of the SDF feature and the CBAM multi-dimensional adaptive attention mechanism enables the network to accurately capture key high-gradient flow details such as the leading-edge high negative pressure suction peak, the near-wall boundary layer high-speed gradient, and the wake flow separation point, significantly improving the local prediction accuracy of the pressure and velocity fields.
[0016] 2. Solid-wall no-slip hard constraint eliminates flow leakage: Addressing the no-slip physical boundary condition that must be satisfied by the solid-liquid wall of a hydrofoil in viscous water flow, this invention directly embeds a binary fluid indicator mask hard projection into the network forward propagation computation graph. Compared to the traditional "soft constraint" method that only applies a penalty term through the loss function, this invention mathematically guarantees that the predicted velocity values inside the solid and at the interface are always zero, completely eliminating non-physical boundary flow leakage without the need for additional hyperparameter adjustment.
[0017] 3. Incompressible mass conservation physical constraint: Water is extremely incompressible under normal operating conditions. This invention applies a discrete divergence continuity loss based on a second-order central finite difference scheme to a uniform orthogonal physical grid. This approach incorporates a physical information mechanism into the model training. This constraint significantly suppresses the common defects of local fluid volume non-conservation and velocity field divergence in pure data-driven network predictions, effectively improving the reliability of downstream lift and drag coefficient calculations.
[0018] 4. End-to-End Rapid Hydrodynamic Assessment: This invention establishes a complete end-to-end process from geometric parametric modeling, automatic batch generation of CFD datasets, neural network training to hydrodynamic coefficient inference. By completely eliminating the time-consuming iterative process of traditional CFD, the surrogate model can output physically consistent, high-fidelity full-field predictions within milliseconds and calculate hydrofoil lift and drag coefficients with high accuracy, demonstrating significant engineering practical value. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of the hydrofoil flow area according to an embodiment of the present invention.
[0020] Figure 2 This is a schematic diagram of TurbNetG, a convolutional neural network generator based on the symmetric U-Net architecture.
[0021] Figure 3 This is a flowchart of a hydrofoil hydrodynamic field prediction method based on physical constraints and dual attention, according to an embodiment of the present invention.
[0022] Figure 4 This is a scatter plot showing the regression fit between the predicted values and the actual CFD values obtained in the embodiments of the present invention on the pressure and velocity fields.
[0023] Figure 5 This is a convergence curve of data reconstruction loss, validation set loss, and physical continuity residual during model training in an embodiment of the present invention.
[0024] Figure 6 The diagram shows a comparison of the actual fluid, predicted flow field, and absolute error under operating condition 1 of this invention. The left diagram represents the actual flow field, the middle diagram represents the predicted flow field, and the right diagram represents a schematic diagram of the absolute error between the two.
[0025] Figure 7 The diagram shows a comparison of the actual fluid, the predicted flow field, and the absolute error under condition 2 of this invention. The left diagram represents the actual flow field, the middle diagram represents the predicted flow field, and the right diagram represents the absolute error of both.
[0026] Figure 8 The diagram shows a comparison of the actual fluid, predicted flow field, and absolute error under operating condition 3 of this embodiment of the invention. The left diagram represents the actual flow field, the middle diagram represents the predicted flow field, and the right diagram represents a schematic diagram of the absolute error between the two.
[0027] Figure 9 The diagram shows a comparison of the actual fluid, predicted flow field, and absolute error under condition 4 of this invention. The left diagram represents the actual flow field, the middle diagram represents the predicted flow field, and the right diagram represents the absolute error of both. Detailed Implementation
[0028] The present invention will be described in detail below with reference to the accompanying drawings and preferred embodiments. The purpose and effects of the present invention will become clearer. It should be understood that the specific embodiments described herein are merely for explaining the present invention and are not intended to limit the present invention.
[0029] like Figure 1 As shown, the hydrofoil hydrodynamic field prediction system based on physical constraints and dual attention in this embodiment includes a data preparation module, a feature extraction and tensor reconstruction module, an attention-enhanced prediction module, a hybrid physical loss training module, and a hydrodynamic coefficient evaluation module.
[0030] 1. Data Preparation Module The data preparation module is used to perform NACA four-digit parametric geometric modeling and angle-of-attack rotation transformation on the target hydrofoil, and calls the mesh generation software to perform structured mesh generation on the target hydrofoil watershed. It also calls the computational fluid simulation software to set boundary conditions and perform iterative calculations, and outputs a global ASCII data file containing the spatial coordinates, pressure, X-axis velocity and Y-axis velocity of each mesh node.
[0031] Data preparation specifically includes: (1.1) Using the NACA four-digit airfoil formula, calculate the camber parameter m and camber position parameter. and thickness parameters The scattered coordinates of the closed profiles of the upper and lower surfaces of the hydrofoil at zero angle of attack are obtained; and a two-dimensional rotation matrix transformation is performed on the scattered coordinates based on the set angle of attack α to obtain the discrete coordinates of the hydrofoil wall at the working angle of attack.
[0032] Let the design chord length of the hydrofoil be c, and the discrete coordinate distribution of the hydrofoil surface in the chord direction be: x ∈[0,c]. Cosine encryption distribution is used. (θ∈[0,π]) Generate chord-oriented discrete points to enhance the geometric resolution of the leading and trailing edge regions.
[0033] Half-thickness distribution along the chord y t It satisfies the following equation (1): (1) In the formula, x These are chordal coordinates, in meters; y t (x) coordinates x Half thickness of the airfoil, in meters (m); c τ represents the hydrofoil chord length in meters; τ is a dimensionless constant representing the ratio of the maximum hydrofoil thickness to the chord length. a 0 ~ a 4The thickness distribution coefficients for NACA are a0=0.2969, a1=-0.1260, a2=-0.3516, a3=0.2843, and a4=-0.1036. The coordinates are dimensionless chordal coordinates; The mid-curve profile of the hydrofoil y c Distribution depends on maximum camber parameter m ( and the location parameters of maximum curvature ξ m ( Its piecewise function is defined as shown in equation (2): (2) To obtain the actual working angle of attack in the water medium α The geometric shape of the rotating hydrofoil is designed, and the two-dimensional coordinate rotation matrix transformation is calculated as shown in equation (3): (3) In the formula, t and These are the coordinates of the upper and lower surfaces of the airfoil after rotation; "+" indicates the upper surface, and "-" indicates the lower surface. x For the chord coordinates before rotation; y c (x) The coordinates are those of the mid-arc line; y t (x) It is half the thickness; (x 0 ,y 0 ) Center of rotation; α For the angle of attack; (1.2) The target hydrofoil's flow domain was structured using mesh generation software. The outer boundary of the flow domain was set as a circular arc with radius R centered at the midpoint of the chord, plus a wake extension segment, to fully encompass the fluid physical field, such as... Figure 1 As shown, a super-limit mapping algorithm is used to force quadrilateral mesh recombination, generating a high-quality fully quadrilateral structured CGNS mesh.
[0034] In this embodiment, the design chord length of the hydrofoil is c=0.1m, and the number of grid points on the hydrofoil profile on one side is... N f =101, number of normal boundary layers N n =129, number of wake flow grids N w =61, the stretching growth rate of the normal and wake curves is set to... r=1.04. Radius R = 2.0m, length of the wake extension segment L w =3.0m. This embodiment presents simulation results for the following four operating conditions: Operating condition 1: Angle of attack 5.68°, inlet velocity 7.99m / s; Operating Condition 2: Angle of attack 6.10°, inlet velocity 5.43 m / s; Operating condition 3: Angle of attack -1.86°, inlet velocity 7.71m / s; Operating condition 4: Angle of attack 2.6°, inlet flow velocity 9.67m / s.
[0035] Computational fluid dynamics simulation software was used to merge the discrete wall boundaries into a hydrofoil wall region, and the outer boundary was set as the velocity inlet and pressure outlet. The water density constant was set to... The Spalart-Allmaras (SA) single-equation turbulence model was selected. Pressure-velocity coupling was performed using the SIMPLEC format. After 200 iterations, a global ASCII data file was automatically exported, containing the spatial coordinates (x, y) of each grid node, pressure, and other parameters. p X-axis velocity u and Y-axis velocity v .
[0036] 2. Feature Extraction and Tensor Reconstruction Module The feature extraction and tensor reconstruction module is used to extract the spatial and physical features of the flow field around the hydrofoil and reconstruct the normalized input tensor.
[0037] Feature extraction and tensor reconstruction specifically include: (2.1) Read the ASCII node data and establish a uniform orthogonal two-dimensional grid covering the main flow region of the hydrofoil in the Cartesian coordinate system; use two-dimensional linear interpolation to map and project the pressure values, X-axis velocity values and Y-axis velocity values on the spatially distributed discrete grid nodes onto the uniform orthogonal physical plane, thereby obtaining a high-fidelity orthogonal pressure field. P target Orthogonal X-axis velocity field U target and orthogonal Y-axis velocity field V target .
[0038] In orthogonal grid projection, in this embodiment, the grid image resolution is set to 256×256. Scattered CFD data is mapped to the orthogonal grid using piecewise linear interpolation based on the centroid coordinates of the Delaunay triangle, as shown in equation (4): (4) In the formula, q Indicates pressure p lateral velocityu or longitudinal velocity v Any physical quantity in; q k For the original mesh number k The physical quantity of each node; The interpolation result at the target regular grid node (i, j); T ij w is the set of vertices of the Delaunay triangle containing the target node; k,ij The corresponding centroid interpolation weights are ; i and j are the x and y direction indices of the regular grid, respectively.
[0039] (2.2) Based on the discrete point coordinates of the hydrofoil wall profile, the shortest signed distance from each orthogonal grid node to the hydrofoil solid wall is calculated using the Fast Euclidean Distance Transform (EDT) algorithm on a uniform orthogonal two-dimensional grid. SDF raw The values are negative inside the solid region, positive in the external fluid region, and zero at the boundary; then... SDF raw A Gaussian filter is applied to eliminate geometric singularity noise at sharp corners, and then a hyperbolic tangent function is used to nonlinearly scale the smoothed range field to generate a continuous signed distance function geometric space feature map with a range of [-1,1]. SDF final .
[0040] In this embodiment, the distance from the outer solid node to the nearest solid boundary in the orthogonal mesh is represented as dist_out, and the distance from the inner solid node to the nearest solid boundary is dist_in, thus synthesizing a signed original distance field. SDF raw (Negative values are taken inside solids, positive values are taken outside fluids, and zero values are taken at the boundary).
[0041] Using standard deviation σ =0.5 Gaussian filter pair SDF raw After smoothing, a hyperbolic tangent function (Tanh) is designed for nonlinear amplitude scaling, and the calculation formula is shown in equation (5): (5) In the formula, SDF final ( i , j )∈(-1,1) is the generated geometric feature map of the continuous symbolic distance function. β =15.0 is the amplitude nonlinear adjustment coefficient, which is used to nonlinearly compress the large range of distance values in the broad background area to the saturation region, while preserving the continuous distance gradient characteristics of the hydrofoil near the wall, focusing the network's ability to learn the features of the high gradient flow region near the wall.
[0042] (2.3) The normalized X-direction inlet flow velocity U in Y-direction inlet speed channel V in Geometric spatial characteristic map of continuous signed distance function SDF final and orthogonal pressure target field P target Orthogonal transverse velocity target field U target and orthogonal longitudinal velocity target field V target Perform matrix concatenation along the feature channel axis to reconstruct a standardized tensor dataset with six channels.
[0043] In this embodiment, the standardized tensor data is represented as A. array ∈R 6×256×256 The stacking order of its feature channels on the spatial axis is shown in equation (6):
[0044] (6) Among them, the first three channels ( U in , V in , SDF final As network input, the last three channels ( P target , U target , V target () as a network supervision label.
[0045] 3. Attention Enhancement Prediction Module The attention-enhanced prediction module is used to build a convolutional neural network generator, TurbNetG, based on the symmetric U-Net architecture, such as... Figure 3 As shown, the convolutional neural network generator includes an eight-level deep convolutional encoder, a seven-level transposed convolutional decoder, and a convolutional block attention module (CBAM) embedded at the end of the decoder, which is composed of channel attention submodules and spatial attention submodules connected in series. This CBAM performs adaptive multi-dimensional feature weighting on high flow gradient regions and high load feature regions. Furthermore, a binary fluid indicator mask is applied to the velocity prediction field at the network output layer. M fluid The hard projection of the forced solid wall with no slip boundary conditions.
[0046] Each convolutional block of the eight-level deep convolutional encoder contains a 4×4 convolutional layer with a stride of 2, a batch normalization layer, and a LeakyReLU activation function; the seven-level transposed convolutional decoder consists of seven transposed convolutional blocks. The output of each level of transposed convolutional block is concatenated with the output of the corresponding encoding layer and used as the input of the next decoding level, forming a cross-layer feature skip connection.
[0047] The input to the convolutional neural network generator is a standardized tensor dataset A. array The first three channels [ U in , V in , SDF final The system extracts multi-scale water flow physical features through an eight-level deep convolutional encoder, and then concatenates and fuses low-order geometric boundary information with high-order semantic physical features through cross-layer skip connections. These features are then reconstructed through a seven-level transposed convolutional decoder via progressive upsampling, outputting a deep feature merging tensor Y. init =[ P init , U init , V init ].
[0048] Let the input feature map of a single standard two-dimensional convolutional layer be... The output feature map is The convolution mapping process is shown in equation (7): (7) In the formula, I Input feature map; O The convolution outputs a feature map; C in Input the number of channels; c i For input channel index; c o For output channel index; K The kernel size; r , s This is the internal index of the convolution kernel; d The convolution stride; p 0 To fill the width; W These are the kernel weights; For the first c o The bias of each output channel; i , j For spatial location index.
[0049] Batch normalization is introduced within the network to normalize and constrain the features of any intermediate layer. Its algebraic calculation is shown in equations (8) and (9): (8) (9) In the formula, This represents the original feature values input to the Batch Normalization layer. Representing network characteristics; This represents the mean of the channel to which the feature belongs; This indicates the variance of the channel to which the feature belongs; This indicates a positive number set to prevent the denominator from being zero; This represents the standardized eigenvalues obtained after mean shifting and variance scaling. y This represents the output feature value of the BatchNormalization layer; γ This represents the learnable scaling parameter used in the Batch Normalization layer to adjust the magnitude of the normalized features; This represents the learnable translation parameter used in the Batch Normalization layer to adjust the normalized feature offset; The input to the channel attention submodule is the deep feature merging tensor output by the decoder. Adaptive global average pooling and global max pooling are performed on the deep feature merging tensor simultaneously to extract spatial global statistical features. The results of the two pooling are input into a shared two-layer fully connected neural network to calculate the flow correlation weights between channels. After Sigmoid activation, the resulting channel attention matrix is multiplied with the original deep feature merging tensor channel by channel to achieve adaptive enhancement of flow field features in the channel dimension.
[0050] Channel attention weight M c (F) ∈R C×1×1 The calculation is shown in equation (10): (10) In the formula, The input features are defined by C, H, and W, which represent the number of channels, height, and width, respectively. and These represent the layer weights of the first layer (compressed features) and the second layer (expanded restoration) in the MLP, respectively. and These are the channel description feature vectors obtained after average pooling and max pooling, respectively.
[0051] Intermediate layer channel redistribution feature map The calculation is shown in equation (11): (11) In the formula, This indicates element-wise multiplication broadcast via a channel; F These are the original input features; M c (F) Channel attention weights; These are features enhanced by channel attention.
[0052] The input to the Spatial Attention submodule is the channel-enhanced feature map. The mean and maximum feature maps of each spatial location are calculated along the channel axis to obtain the spatial distribution of the physical boundary. The two are concatenated and fed into a large kernel convolutional layer with a receptive field of 7×7 to extract the spatial adaptive weights of the high gradient flow separation region, the leading edge pressure jump region, and the wake shedding region. After Sigmoid activation, the weights are multiplied element-wise with the channel-enhanced feature map to output the final deep feature map enhanced by both channel and spatial attention.
[0053] Spatial attention map The calculation process is shown in equation (12): (12) In the formula, This represents a convolution operation with a kernel size of 7×7; This indicates the channel stitching operation performed on the spatial average and maximum plots along the channel axis.
[0054] The final output feature after sequential processing through channel attention and spatial attention The expression is shown in equation (13): (13) To ensure the absolute physical accuracy of the predicted flow velocity at the hydrofoil solid-liquid interface and within the solid, and to prevent non-physical velocity leakage from the black-box network in the solid region, the network output layer uses... SDF final A binary fluid indicator mask matrix M is constructed to characterize the fluid flow region using ≤0 as the criterion. fluid And the initial velocity prediction component U init and V init respectively with M fluid Perform element-wise Hadamard product calculations, force the velocity prediction values of all nodes inside the hydrofoil solid and at the wall to be zero, apply no-slip wall physical hard constraints, and obtain the final flow field output that satisfies the solid wall boundary conditions.
[0055] based on SDF final Feature map constructs a binary fluid indicator mask matrix M fluid The discrimination process is shown in equation (14): (14) In the velocity output channel layer of the model forward propagation, the initially inferred X-direction velocity U... init and Y-axis velocity V init With indicator mask M fluid The element-wise hard projection is performed, and the mapping process is shown in equations (15) and (16). (15) (16) In the formula, in the formula, i and j These represent regular grids in x direction and y Position index in the direction; U init (i,j) Indicates the model's position on the grid. (i,j) The initial prediction obtained X Directional velocity component; V init (i,j) Indicates the model's position on the grid. (i,j) The initial prediction obtained Y Directional velocity component; M fluid (i,j) Indicates grid position (i,j) The fluid domain indicator mask is located at a point where the value of the fluid domain is 1 and the value of the hydrofoil solid domain is 0. and These represent the positions at the grid locations after hard projection through the fluid domain indicator mask. (i,j) Obtained from X direction and Y Directional prediction of velocity components; The above formula directly shields the velocity value leakage introduced by boundary extraction ambiguity in the calculation diagram, mathematically guaranteeing the strict satisfaction of the hydrodynamic no-slip boundary condition for solid walls. Pressure prediction channel. P pred Then directly use the initial network output. P init No hard projection is applied because the internal pressure of a solid is not always zero in a physical sense.
[0056] 4. Hybrid Physical Loss Training Module The hybrid physical loss training module is used to linearly weight the L1 data reconstruction loss and the incompressible continuous divergence physical loss calculated based on the second-order central finite difference scheme according to the weight coefficients, construct a hybrid loss function, drive the Adam optimizer to perform backpropagation training on the network parameters of the convolutional neural network generator until convergence, and obtain a hydrodynamic field prediction surrogate model that satisfies the incompressible hydrodynamic constraints.
[0057] The process of constructing the hybrid loss function is as follows: S401: Utilizing the physical space step size characteristics of orthogonal uniform meshes A spatially centered finite difference operator is introduced into the model computation diagram to directly predict the velocity field on a uniform orthogonal grid. U pred , V pred ) Calculate the first-order spatial partial derivative of incompressible water flow, and thus calculate the local volumetric divergence of the fluid grid points.
[0058] Water is an extremely incompressible medium during the operation of a water turbine and its surrounding flow. It must satisfy the partial differential equation of mass conservation in the entire physical flow field, that is, its divergence should always be zero, as shown in equation (17): (17) in, u for x Directional velocity component; v for y Directional velocity component; x , y Spatial coordinates; ▽ Let be the velocity field divergence.
[0059] S402: [Fluid region] N fluid The mean of the absolute values of the local divergence residuals at all grid points is used as the incompressible continuity physical loss. L PDE The prediction field is constrained to satisfy the mass conservation equation.
[0060] To apply the core mass conservation physics mechanism of this invention during network training, in an orthogonal uniform grid space (physical spacing step size set to...),... Under the condition that the first-order spatial partial derivative is approximated using a second-order central finite difference scheme, a continuous physical divergence loss term is constructed. As shown in equation (18): (18) In the formula, N fluid Indicates the total number of effective grid points in the fluid region; Ω fluid Indicates the fluid flow region. , For predicting velocity; first-order central space partial derivative , The approximate calculation formulas are shown in equations (19) and (20), respectively: (19) (20) in, i , j They are respectively x , y Orientation grid index; These represent the grid spacing in two directions; To predict speed in x direction and y Components in direction.
[0061] The second-order central finite difference scheme has second-order spatial accuracy and can significantly reduce discretization truncation error compared to the first-order forward difference scheme.
[0062] In this embodiment, All speeds are based on reference speeds. Dimensionless transformation is performed, and the spatial coordinates are dimensionless using the hydrofoil chord length c. Therefore, equations (19) and (20) use a dimensionless mesh step size. In this embodiment, the physical mesh step size is... The chord length is c = 0.1 m, therefore the dimensionless grid step size is... .
[0063] S403: Loss from data reconstruction L data With continuous physical divergence loss L PDE A total mixed loss function is constructed by linearly weighting the parameters with weight coefficient γ. The Adam optimizer is used to perform backpropagation iterative updates on the parameters of all convolutional and fully connected layers in the neural network until the network converges, thus obtaining a hydrodynamic field prediction surrogate model that satisfies incompressible fluid dynamics constraints.
[0064] Define the L1 data reconstruction loss for each physical channel. As shown in equation (21): (twenty one) In the formula, q The output physical quantity channel indexes correspond to pressure, lateral velocity, and longitudinal velocity, respectively; N x 、N y This refers to the grid size; Standardized physical quantities for network prediction; This corresponds to the standardized true value.
[0065] The overall hybrid optimization loss function is constructed as shown in equation (22): (twenty two) in, Total loss; For continuous loss weights.
[0066] In this embodiment, the physical constraint weight hyperparameter γ =0.1, the training optimizer uses Adam (learning rate lr=0.001, momentum parameter =0.1). β 1 =0.5, β 2 =0.999), batch size=128. The Adam optimizer performs backpropagation iterative updates on the weight parameters of all convolutional layers to collaboratively converge the data reconstruction error and physical divergence residuals.
[0067] 5. Hydrodynamic Coefficient Evaluation Module The hydrodynamic coefficient evaluation module receives the target hydrofoil's geometric parameters and flow conditions, calls the trained hydrodynamic field prediction proxy model to output full-field pressure and velocity prediction maps, extracts the surface pressure distribution on the hydrofoil's closed profile, performs closed curve path integration and dimensionless transformation, and outputs the hydrofoil's lift coefficient. C L With drag coefficient C D .
[0068] After the model training is completed, the hydrodynamic field prediction proxy model receives the target hydrofoil's geometric parameters. m , ξ m , τ , α and inlet velocity V ∞ As input, it outputs a full-field predicted stress image within milliseconds. P pred ∈R 256×256 Extract the set of discrete surface coordinate points {(x) of the closed hydrofoil on an orthogonal physical grid. k , y k )},k∈[1, N foil ], from P by bilinear interpolation pred Extract the pressure values at each surface node. P pred (x k y k ).
[0069] The resultant force of fluid pressure on the solid wall of the hydrofoil in the X-axis direction (drag direction) and Y-axis direction (lift direction) is calculated by numerical closed integral of the broken line segment, as shown in equations (23) and (24): (twenty three) (twenty four) In the formula, The pressure generated respectively x , y directional unit spanning force; This represents the number of line segments in the closed hydrofoil profile. The average physical pressure on the kth contour line segment; , The coordinate increments of the contour line segments are represented by the coordinate increments; the contour points are arranged in a counter-clockwise direction; the last contour point is connected to the first contour point end to end.
[0070] Since the global x-axis of this invention is consistent with the direction of the incoming flow, i.e. the direction of drag, and the global y-axis is consistent with the direction of lift, the pressure lift L and pressure drag D of the hydrofoil are calculated according to Equation (25) and Equation (26), respectively.
[0071] (25) (26) in, The pressure generated respectively x , y directional unit spanning force; D , L These are the drag along the direction of the incoming flow and the lift perpendicular to the direction of the incoming flow, respectively.
[0072] Lift coefficient of hydrofoil hydrodynamic performance C L and drag coefficient C D The dimensionless calculation process is shown in equations (27) and (28): (27) (28) in, C L,p , C D,p These are the pressure lift coefficient and pressure drag coefficient, respectively; water density. =998.0kg / m 3 The chord length is c = 0.1 m. This is the extracted inlet flow rate value.
[0073] This invention also provides a hydrofoil hydrodynamic field prediction method based on physical constraints and dual attention, such as... Figure 4 As shown, the method includes the following steps: Step 1: Perform parametric geometric modeling and angle-of-attack rotation transformation on the target hydrofoil to obtain the discrete coordinates of the hydrofoil wall at the working angle of attack; use mesh generation software to divide the target hydrofoil flow domain into a structured mesh, and use computational fluid dynamics simulation software to set boundary conditions and perform iterative calculations to obtain a global ASCII format original node data file, which includes the spatial coordinates, pressure, X-axis velocity, and Y-axis velocity of each mesh node.
[0074] Step 2: Extract the original node data file in ASCII format and establish a uniform orthogonal two-dimensional grid covering the main flow region around the hydrofoil in a Cartesian coordinate system; using two-dimensional linear interpolation, map and project the pressure values, X-axis velocity values, and Y-axis velocity values on the spatially distributed discrete grid nodes onto a uniform orthogonal physical plane to obtain the orthogonal pressure field. P target Orthogonal X-axis velocity field U target and orthogonal Y-axis velocity field V target Based on the discrete point coordinates of the hydrofoil wall profile, the shortest signed distance from each orthogonal grid node to the hydrofoil solid wall is calculated using the fast Euclidean distance transformation algorithm on a uniform orthogonal two-dimensional grid. SDF raw The values are negative inside the solid region, positive in the external fluid region, and zero at the boundary; then... SDF raw A Gaussian filter is applied to eliminate geometric singularity noise at sharp corners, and then a hyperbolic tangent function is used to nonlinearly scale the smoothed range field to generate a continuous signed distance function geometric space feature map with a range of [-1,1]. SDF final The normalized inlet flow velocity, Y-axis inlet velocity, SDF final ,as well as P target , U target and V target Perform matrix concatenation along the feature channel axis to reconstruct a standardized tensor dataset with six channels.
[0075] Step 3: Construct a convolutional neural network generator based on the symmetric U-Net architecture. The convolutional neural network generator includes an eight-level deep convolutional encoder, a seven-level transposed convolutional decoder, a convolutional block attention module embedded at the end of the decoder consisting of channel attention submodules and spatial attention submodules connected in series, and a network output layer. The input of the convolutional neural network generator is a six-channel normalized tensor dataset, and the output is a flow field pressure and velocity prediction map that satisfies the solid wall boundary conditions.
[0076] Step 4: Construct a hybrid loss function obtained by linearly weighting the L1 data reconstruction loss and the incompressible continuous divergence physical loss calculated based on the second-order central finite difference scheme with weight coefficients, and train the convolutional neural network generator to obtain a hydrodynamic field prediction surrogate model that satisfies the incompressible hydrodynamic constraints.
[0077] Step 5: Receive the target hydrofoil's geometric parameters and flow conditions, call the trained hydrodynamic field prediction proxy model to output the full-field pressure and velocity prediction map, extract the surface pressure distribution on the closed profile of the hydrofoil, perform closed curve path integration and dimensionless conversion, and output the hydrofoil's lift coefficient and drag coefficient.
[0078] The regression fitting scatter plots of the predicted values of velocity and pressure and the actual CFD values obtained under four working conditions in this embodiment of the invention are shown below. Figure 4 As shown; the data reconstruction loss during the training process of the hydrodynamic field prediction surrogate model ( L data ), validation set loss ( L val and physical continuity residuals ( L PDE The convergence curve of ) is as follows Figure 5 As shown in the figure, the model has high prediction accuracy, but its residual curve drops to 10 when training converges. -2 The following values are all greater than 0.99.
[0079] The actual flow field under four operating conditions in this embodiment of the invention and the predicted velocity field obtained by the method of this invention, as well as the comparison of the absolute error between the two, are shown in the figure below. Figures 6-9 As shown in the figure, the actual flow field cloud map and the model prediction cloud map of each working condition have a high degree of consistency, and the overall error level is low; however, due to the influence of the original flow field noise, there are large single-point errors in the positions of some measuring points.
[0080] The hydrodynamic field proxy prediction model established by this invention, which features SDF continuous geometric feature representation, CBAM dual cross-attention mechanism, solid wall no-slip hard mask projection, and discrete incompressible divergence physical constraints, can output physically consistent high-fidelity full-field flow field predictions in milliseconds, while completely eliminating the time-consuming iteration process of traditional CFD, and can evaluate key hydrodynamic macroscopic coefficients of underwater equipment and turbine blades with high accuracy.
[0081] It will be understood by those skilled in the art that the above descriptions are merely preferred examples of the invention and are not intended to limit the invention. Although the invention has been described in detail with reference to the foregoing examples, those skilled in the art can still modify the technical solutions described in the foregoing examples or make equivalent substitutions for some of the technical features. All modifications and equivalent substitutions made within the spirit and principles of the invention should be included within the scope of protection of the invention.
Claims
1. A hydrofoil hydrodynamic field prediction system based on physical constraints and dual attention, characterized in that, It includes a data preparation module, a feature extraction and tensor reconstruction module, an attention-enhanced prediction module, a hybrid physical loss training module, and a hydrodynamic coefficient evaluation module; The data preparation module is used to perform NACA four-digit parametric geometric modeling and angle-of-attack rotation transformation on the target hydrofoil, and to call the mesh generation software to perform structured mesh generation on the target hydrofoil watershed. It also calls the computational fluid simulation software to set boundary conditions and perform iterative calculations, and outputs a full-domain ASCII data file containing the spatial coordinates, pressure, X-axis velocity and Y-axis velocity of each mesh node. The feature extraction and tensor reconstruction module is used to extract the spatial and physical features of the flow field around the hydrofoil and reconstruct the standardized input tensor to form a six-channel standardized tensor dataset including the normalized X-direction inlet flow velocity, Y-direction inlet velocity channel, continuous band signed distance function geometric space feature map, orthogonal pressure field, orthogonal X-direction velocity field and orthogonal Y-direction velocity field. The attention enhancement prediction module is used to construct a convolutional neural network generator based on the symmetric U-Net architecture. The convolutional neural network generator includes an eight-level deep convolutional encoder, a seven-level transposed convolutional decoder, and a convolutional block attention module embedded at the end of the decoder, which is composed of a channel attention submodule and a spatial attention submodule connected in series. It implements adaptive multi-dimensional feature weighting for high flow gradient regions and high load feature regions. Furthermore, a binary fluid indication mask is applied to the velocity prediction field at the network output layer. M fluid The hard projection forces the solid wall no-slip boundary condition, resulting in the final flow field output that satisfies the solid wall boundary condition; The hybrid physical loss training module is used to linearly weight the L1 data reconstruction loss and the incompressible continuous divergence physical loss calculated based on the second-order central finite difference scheme according to the weight coefficients to construct a hybrid loss function, which drives the optimizer to perform backpropagation training on the network parameters of the convolutional neural network generator until convergence, thereby obtaining a hydrodynamic field prediction surrogate model that satisfies the incompressible hydrodynamic constraints. The hydrodynamic coefficient evaluation module is used to receive the target hydrofoil's geometric parameters and flow conditions, call the trained hydrodynamic field prediction proxy model to output the full-field pressure and velocity prediction map, extract the surface pressure distribution on the closed profile of the hydrofoil, perform closed curve path integration and dimensionless conversion, and output the hydrofoil's lift coefficient and drag coefficient.
2. The hydrofoil hydrodynamic field prediction system based on physical constraints and dual attention as described in claim 1, characterized in that, Each convolutional block of the eight-level depth convolutional encoder contains a 4×4 convolutional layer with a stride of 2, a batch normalization layer, and a LeakyReLU activation function.
3. The hydrofoil hydrodynamic field prediction system based on physical constraints and dual attention as described in claim 1, characterized in that, The seven-level transposed convolutional decoder consists of seven levels of transposed convolutional blocks. The output of each level of transposed convolutional block is concatenated with the output of the corresponding coding layer and used as the input of the next decoding level, forming a cross-layer feature skip connection.
4. The hydrofoil hydrodynamic field prediction system based on physical constraints and dual attention as described in claim 1, characterized in that, The input to the channel attention submodule is the deep feature merging tensor output by the decoder. Adaptive global average pooling and global max pooling are performed simultaneously on the deep feature merging tensor to extract spatial global statistical features. The results of the two pooling are input into a shared two-layer fully connected neural network to calculate the flow correlation weights between channels. After Sigmoid activation, the obtained channel attention matrix is multiplied with the original deep feature merging tensor channel by channel to achieve adaptive enhancement of flow field features in the channel dimension.
5. The hydrofoil hydrodynamic field prediction system based on physical constraints and dual attention as described in claim 4, characterized in that, The input to the spatial attention submodule is the channel-enhanced feature map. The mean and maximum feature maps of each spatial location are calculated along the channel axis to obtain the spatial distribution of the physical boundary. The two are concatenated and fed into a large kernel convolutional layer with a receptive field of 7×7 to extract the spatial adaptive weights of the high gradient flow separation region, the leading edge pressure jump region, and the wake shedding region. After Sigmoid activation, the weights are multiplied element-wise with the channel-enhanced feature map to output the final deep feature map enhanced by both channel and spatial attention.
6. The hydrofoil hydrodynamic field prediction system based on physical constraints and dual attention as described in claim 5, characterized in that, The network output layer is SDF final A binary fluid indicator mask matrix representing the fluid flow region is constructed using ≤0 as the criterion. M fluid And the initial velocity prediction component U init and V init respectively with M fluid Perform element-wise Hadamard product calculations, force the velocity prediction values of all nodes inside the hydrofoil solid and at the wall to be zero, apply no-slip wall physical hard constraints, and obtain the final flow field output that satisfies the solid wall boundary conditions.
7. A hydrodynamic field prediction method for hydrofoils based on physical constraints and dual attention, characterized in that, The method includes the following steps: S1: Perform parametric geometric modeling and angle-of-attack rotation transformation on the target hydrofoil to obtain the discrete coordinates of the hydrofoil wall under the working angle of attack; use mesh generation software to divide the target hydrofoil watershed into a structured mesh, and use computational fluid simulation software to set boundary conditions and perform iterative calculations to obtain a global ASCII format original node data file, which includes the spatial coordinates, pressure, X-axis velocity and Y-axis velocity of each mesh node; S2: Extract the raw node data file in ASCII format and establish a uniform orthogonal two-dimensional grid covering the main flow region around the hydrofoil in Cartesian coordinates; use two-dimensional linear interpolation to map and project the pressure, X-axis velocity, and Y-axis velocity values on the spatially distributed discrete grid nodes onto a uniform orthogonal physical plane to obtain the orthogonal pressure field. P target Orthogonal X-axis velocity field U target and orthogonal Y-axis velocity field V target Based on the discrete point coordinates of the hydrofoil wall profile, the shortest signed distance from each orthogonal grid node to the hydrofoil solid wall is calculated using the fast Euclidean distance transformation algorithm on a uniform orthogonal two-dimensional grid. SDF raw The values are negative inside the solid region, positive in the external fluid region, and zero at the boundary; then... SDF raw A Gaussian filter is applied to eliminate geometric singularity noise at sharp corners, and then a hyperbolic tangent function is used to nonlinearly scale the smoothed range field to generate a continuous signed distance function geometric space feature map with a range of [-1,1]. SDF final The normalized inlet flow velocity, Y-axis inlet velocity, SDF final ,as well as P target , U target and V target Perform matrix concatenation along the feature channel axis to reconstruct a six-channel standardized tensor dataset; S3: Construct a convolutional neural network generator based on a symmetric U-Net architecture. The convolutional neural network generator includes an eight-level deep convolutional encoder, a seven-level transposed convolutional decoder, a convolutional block attention module embedded at the end of the decoder consisting of channel attention submodules and spatial attention submodules connected in series, and a network output layer. The input of the convolutional neural network generator is a six-channel normalized tensor dataset, and the output is a flow field pressure and velocity prediction map that satisfies the solid wall boundary conditions. S4: Construct a hybrid loss function obtained by linearly weighting the L1 data reconstruction loss and the incompressible continuous divergence physical loss calculated based on the second-order central finite difference scheme according to the weight coefficients, and train the convolutional neural network generator to obtain a hydrodynamic field prediction surrogate model that satisfies the incompressible hydrodynamic constraints. S5: Receives the target hydrofoil's geometric parameters and flow conditions, calls the trained hydrodynamic field prediction proxy model to output the full-field pressure and velocity prediction map, extracts the surface pressure distribution on the hydrofoil's closed profile, performs closed curve path integration and dimensionless conversion, and outputs the hydrofoil's lift coefficient and drag coefficient.