CN-122021293-A - Flow field prediction method and system based on wavelet alignment cross attention
Abstract
The invention discloses a flow field prediction method and a flow field prediction system based on wavelet alignment cross attention, the flow field prediction method constructs the calculated domain structure grid coordinates and working condition parameters into multi-channel input tensors, and constructs a flow field prediction model to realize end-to-end regression of flow field variables. The method comprises the steps of generating keys/values in a bottleneck layer of a flow field prediction model by a first branch based on a high-frequency subband of which input features are subjected to discrete wavelet transformation, generating queries by a second branch based on a linear self-attention aggregation result of the input features, executing linear cross attention by a fusion branch, applying a band-by-band soft mask and light residual correction to the high-frequency subband based on the linear cross attention, introducing a layered cross attention refinement module into a decoding sub-module, generating the queries, the keys and the values based on high-frequency coding features and high-frequency decoding features respectively, carrying out band-by-band enhancement and inverse transformation reconstruction according to the coefficient domain cross attention, and fusing jump connection features through symmetrical gating.
Inventors
- XIAO ZHOUFANG
- CAI JINGJING
- WANG ZENAN
Assignees
- 杭州电子科技大学
Dates
- Publication Date
- 20260512
- Application Date
- 20260127
Claims (10)
- 1. A flow field prediction method based on wavelet alignment cross attention is characterized by comprising the following steps: constructing a data set by using coordinate tensors of different wing profiles on the grid and corresponding working condition Reynolds numbers; The method comprises the steps of constructing a flow field prediction model, wherein the flow field prediction model comprises an encoder, a bottleneck layer and a decoder, the encoder comprises a plurality of layers of sub-coding modules which are sequentially connected, the decoder comprises a plurality of layers of sub-decoding modules, the plurality of layers of sub-coding modules correspond to each other one by one, the input of a first layer of sub-decoding module comprises bottleneck characteristics, same-layer coding characteristics and high-layer coding characteristics, the input of a last layer of sub-decoding module comprises high-layer decoding characteristics and same-layer coding characteristics, and the input of the other sub-decoding modules comprises high-layer decoding characteristics, same-layer coding characteristics and high-layer coding characteristics; The bottleneck characteristic is the characteristic of the last layer of sub-coding module after being subjected to bottleneck layer and up-sampling treatment, the same-layer coding characteristic is the output characteristic of the sub-coding module corresponding to the sub-decoding module, the high-layer coding characteristic is the output characteristic of the last layer of sub-coding module corresponding to the sub-decoding module, and the high-layer decoding characteristic is the characteristic of the output of the last layer of sub-decoding module after being subjected to up-sampling treatment; Training a flow field prediction model by using the data set, and predicting the fluid of the tested airfoil by using the trained flow field prediction model.
- 2. The method for predicting a flow field based on wavelet alignment cross attention as claimed in claim 1, wherein the remaining sub-decoding modules except the last layer of sub-decoding module comprise a layered cross attention refinement module and a convolution block which are connected in series; In the layered cross attention refinement module, wavelet transformation is carried out on high-level coding features to obtain low-frequency sub-bands and high-frequency sub-bands, the high-frequency sub-bands are spliced and projected to form key vectors and value vectors, linear cross attention is carried out on query vectors formed by projection of the key vectors and the value vectors and high-level decoding features or bottleneck features to obtain attention features, sub-band-by-sub-band soft mask and correction are sequentially carried out on the high-frequency sub-bands based on the attention features to obtain refined high-frequency sub-bands, inverse wavelet transformation is carried out on the refined high-frequency sub-bands and original low-frequency sub-bands to obtain reconstruction residual errors, symmetrical gating fusion is carried out on the basis of the reconstruction residual errors and the same-layer coding features to obtain fusion features, and the fusion features are spliced with the high-level decoding features to obtain output features of the layered cross attention refinement module.
- 3. The flow field prediction method based on wavelet alignment cross attention as claimed in claim 2 is characterized in that the method for correcting the high-frequency sub-band is that attention features are processed through a lightweight operator stack to generate residual errors, and correction amplitude is controlled according to the residual errors and corresponding coefficients to obtain the refined high-frequency sub-band.
- 4. The method for predicting a flow field based on wavelet alignment cross-attention as set forth in claim 2, wherein the soft masking of the high frequency sub-bands is performed as follows: Wherein, the And Respectively the high-frequency sub-bands before and after the soft mask; Is the upper gain coefficient; is an activation function; Is the attention characteristic after convolution processing.
- 5. The flow field prediction method based on wavelet alignment cross attention as set forth in claim 1, wherein the bottleneck layer comprises a first branch, a second branch and a fusion branch, wherein in the first branch, wavelet transformation processing is performed on input features to obtain low-frequency sub-bands and high-frequency sub-bands, linear projection is performed on the spliced high-frequency sub-bands to generate key vectors Sum vector Sequentially performing group normalization and linear self-attention operation on the input features to obtain enhanced features in the second branch, projecting the enhanced features as query vectors, and using key vectors in the fusion branch Vector of values And query vectors Performing linear cross attention to obtain task related detail response characteristics, performing sub-band-by-sub-band soft mask and correction on the high-frequency sub-band by using the task related detail response characteristics to obtain refined high-frequency sub-band, and performing inverse wavelet transform reconstruction on the original low-frequency sub-band and the refined high-frequency sub-band to obtain a characteristic To characteristics of And carrying out downsampling and channel projection processing, fusing the processing result and the enhancement feature into a fusion feature, and adding the linear mapping of the fusion feature and the input feature of the bottleneck layer to obtain the output feature of the bottleneck layer.
- 6. The flow field prediction method based on wavelet alignment cross attention as claimed in claim 1, wherein the sub-coding module comprises a first branch and a second branch, the first branch comprises a first convolution layer, a first group of normalization layers, an activation function, a second convolution layer and a second group of normalization layers which are sequentially connected, the second branch comprises the convolution layer and the group of normalization layers which are connected in series, and the fusion result of the output characteristics of the first branch and the second branch is used as the output characteristic of the sub-coding module.
- 7. The flow field prediction method based on wavelet alignment cross attention as claimed in claim 1, wherein in the training process, model parameters are optimized by adopting a supervised learning mode, and a loss function is constructed to guide the model parameter optimization by using a mean square error between a predicted value and a true value.
- 8. The flow field prediction system based on the wavelet alignment cross attention is characterized by being used for executing the flow field prediction method based on the wavelet alignment cross attention, and comprises a data acquisition module, a flow field prediction module and a visualization module, wherein the data acquisition module is used for acquiring structural grid coordinate information and working condition parameters and constructing an input tensor, the flow field prediction module is used for outputting a corresponding flow field prediction result according to the input tensor, and the visualization module is used for carrying out visual display on the flow field prediction result.
- 9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the memory stores the computer program and wherein the processor performs the flow field prediction method according to any one of claims 1-7.
- 10. A readable storage medium storing a computer program, wherein the computer program is configured to implement the flow field prediction method according to any one of claims 1-7 when executed by a processor.
Description
Flow field prediction method and system based on wavelet alignment cross attention Technical Field The invention belongs to the technical field of computational fluid mechanics and deep learning agent modeling, and particularly relates to a flow field prediction method based on wavelet alignment cross attention. Background Computational fluid dynamics is widely applied to airfoil design and aerodynamic performance analysis, and flow field distribution is often obtained by solving the Raynaud's average Navistos equation. However, for the flow problem under the conditions of complex geometry and high-resolution grids, the numerical simulation is large in calculation amount and long in time consumption, and the requirements of rapid prediction and multiple iterations in the engineering design process are difficult to meet. In order to reduce the calculation cost, the prior art provides a plurality of flow field rapid prediction methods, including a proxy model based on a reduced order model, a statistical regression model and deep learning. The method for reducing the order based on modal decomposition can reduce the calculated amount to a certain extent, but has limited stability and application range under complex flow conditions, and the statistical model based on Gaussian process can reduce the high-fidelity data requirement, but has high calculation complexity and is difficult to expand to high-resolution flow field prediction. In recent years, a neural network-based proxy model is gradually applied to flow field prediction, wherein a method represented by a neural operator and a U-Net structure can realize end-to-end mapping between geometric information and flow field results, and has certain advantages in the aspect of overall prediction efficiency. However, the prior art still has the following defects that firstly, even if global context modeling is introduced, prediction errors are still easy to concentrate in high gradient areas such as a leading edge, a trailing edge, a shear layer, a boundary layer and the like, and secondly, full-resolution global operators (such as full-self-attention and dense spectrum operators) bring significant calculation and storage burden on a high-resolution grid, and the available grid scale is limited. Therefore, how to introduce an effective global information modeling mechanism and improve the prediction accuracy of a flow field high gradient region on the premise of ensuring the calculation efficiency and the expandability is still a technical problem to be solved in the prior art. Disclosure of Invention The invention aims to provide a flow field prediction method and system based on wavelet alignment cross attention. In a first aspect, the present invention provides a method for flow field prediction based on wavelet alignment cross-attention, the method comprising: constructing a data set by using coordinate tensors of different wing profiles on the grid and corresponding working condition Reynolds numbers; The method comprises the steps of constructing a flow field prediction model, wherein the flow field prediction model comprises an encoder, a bottleneck layer and a decoder, the encoder comprises a plurality of layers of sub-coding modules which are sequentially connected, the decoder comprises a plurality of layers of sub-decoding modules, the plurality of layers of sub-coding modules correspond to each other one by one, the input of a first layer of sub-decoding module comprises bottleneck characteristics, same-layer coding characteristics and high-layer coding characteristics, the input of a last layer of sub-decoding module comprises high-layer decoding characteristics and same-layer coding characteristics, and the input of the other sub-decoding modules comprises high-layer decoding characteristics, same-layer coding characteristics and high-layer coding characteristics; The bottleneck characteristic is the characteristic of the last layer of sub-coding module after being subjected to bottleneck layer and up-sampling treatment, the same-layer coding characteristic is the output characteristic of the sub-coding module corresponding to the sub-decoding module, the high-layer coding characteristic is the output characteristic of the last layer of sub-coding module corresponding to the sub-decoding module, and the high-layer decoding characteristic is the characteristic of the output of the last layer of sub-decoding module after being subjected to up-sampling treatment; Training a flow field prediction model by using the data set, and predicting the fluid of the tested airfoil by using the trained flow field prediction model. Preferably, the other sub-decoding modules except the last layer of sub-decoding module comprise a layered cross attention refinement module and a convolution block which are connected in series; In the layered cross attention refinement module, wavelet transformation is carried out on high-level coding features to obtain low-frequency