Search

CN-121998825-A - Ultra-high time resolution flow field reconstruction method based on time sequence-space joint coding ViT

CN121998825ACN 121998825 ACN121998825 ACN 121998825ACN-121998825-A

Abstract

The invention discloses a super-high time resolution flow field reconstruction method based on time sequence-space joint coding ViT, belongs to the field of hydrodynamic flow field prediction and reconstruction, and aims to solve the problems of insufficient modeling of traditional flow field reconstruction time sequence characteristics, limited precision of key areas and poor dynamics consistency. The method comprises the steps of firstly collecting multi-time-period sparse pressure field data, constructing in a time sequence mode, carrying out mask weighting pretreatment on key areas, constructing ViT models integrating time sequence and space two-dimensional position codes, extracting time sequence dependent features and space local features in a synergistic mode, designing a multi-component loss function containing key area weighted MSE, flow field continuity constraint and structural similarity, guaranteeing numerical consistency, dynamics rationality and visual structural integrity of a reconstructed flow field, and finally improving the capturing capability of high-frequency flow field features through output layer optimization combining hierarchical attention aggregation and convolution projection. The method can reconstruct complete ultrahigh time resolution flow field data, and is suitable for high-precision flow field prediction and engineering fluid mechanics analysis scenes.

Inventors

  • CHEN WENLI
  • JIN XIAOWEI
  • LIU YUNCHAO
  • LI HUI

Assignees

  • 哈尔滨工业大学

Dates

Publication Date
20260508
Application Date
20260119

Claims (10)

  1. 1. The ultra-high time resolution flow field reconstruction method based on the time sequence-space joint coding ViT is characterized by comprising the following steps of: step one, multi-time-period pressure field time sequence construction and masking preprocessing, namely reading sparse pressure field data of different time periods, constructing a time sequence pressure field with four dimensions as input, wherein the four dimensions comprise the number of samples and time steps, , Simultaneously, a key area is defined based on the physical characteristics of a flow field, a two-dimensional weight mask matrix is generated, and the pressure field and the speed field data are normalized to eliminate dimension influence; Step two, constructing a time sequence-space joint coding ViT model, namely designing a ViT model comprising patch embedding, two-dimensional position coding, multi-layer attention block, weighted feature aggregation and layered output projection, and realizing collaborative extraction of pressure field time sequence dependence and space structural features; Optimizing and training the multi-component loss function, namely taking a weighted combination of the weighted MSE loss of the key region, the constraint loss of the continuity of the flow field and the structural similarity loss as a total loss function, and combining the learning rate scheduling and the early termination strategy to train the model until convergence; And step four, reconstructing a high-time-resolution flow field, namely applying the trained model to a test set or time sequence pressure field data under a brand new working condition, outputting a reconstruction speed field, and evaluating reconstruction accuracy through relative reconstruction errors.
  2. 2. The ultra-high time resolution flow field reconstruction method based on time sequence-space joint coding ViT as set forth in claim 1, wherein in the first step, the multi-period pressure field time sequence construction is specifically that each period extracts pressure data of a specified index range, and reshapes all pressure measurement points into: × And expanding the single time step pressure field data into a time series input comprising successive time steps, the number of time steps taken by multiple verifications being 41.
  3. 3. The ultra-high time resolution flow field reconstruction method based on time-space joint coding ViT as set forth in claim 1, wherein in the step one, the critical region mask generation process is as follows: defining x coordinate range (-1, 4), corresponding to 101 space points, y coordinate range (-1.5, 1.5), corresponding to 61 space points, screening the index meeting x epsilon (-1, 3) and y epsilon (-0.7,0.7) to generate a Boolean mask matrix, converting the mask matrix into a weight matrix, identifying key areas, assigning weights to 1.5, and assigning non-key area weights to 1.0, wherein the mask matrix has the following calculation formula: in the formula, Representing an outer product operation.
  4. 4. The ultra-high time resolution flow field reconstruction method based on the time-space joint coding ViT according to claim 1, wherein in the second step, the specific structure of the time-space joint coding ViT model includes: 1) The patch embedding module is used for converting the four-dimensional time sequence pressure field into a four-bitmap format with the number of samples, time steps, patch blocks and embedding dimensions, dividing 36 pressure points according to 2X 2 patches, wherein the number of patch blocks is 9, and the embedding dimension is 64; 2) The two-dimensional position coding comprises a time position coding with the shape of 1, a time step, 1 and the size of the embedded dimension, and a space patch position coding with the shape of 1, patch blocks and the size of the embedded dimension, and respectively capturing the time sequence dependence and the space patch distribution characteristics; 3) The multi-layer attention block consists of 6 attention blocks, wherein each attention block comprises LayerNorm, attention modules and an MLP module, so that the deep fusion of the features is realized; 4) Calculating attention weight of the time sequence-space patch feature through the linear layer, carrying out weighted summation after softmax normalization to obtain global feature, and replacing traditional average pooling; 5) And carrying out layered output projection, namely after global feature extraction, converting the global feature into sequence feature through sequence conversion, modeling sequence dependency relationship through an output self-attention mechanism, and finally adjusting the size of the intermediate feature map to 61 multiplied by 101 through multi-layer convolution and bilinear interpolation, and outputting a reconstruction speed field.
  5. 5. The ultra-high time resolution flow field reconstruction method based on time sequence-space joint coding ViT as set forth in claim 1, wherein in the second step, the Attention mechanism of the Attention module is as follows: Q, K, V respectively represents a Query matrix, a Key matrix and a Value matrix, wherein Softmax is layer normalization; the number of columns, i.e., vector dimensions, representing the Query matrix, the Key matrix.
  6. 6. The ultra-high time resolution flow field reconstruction method based on time-space joint coding ViT of claim 1, wherein in step three, the specific expression of the multi-component loss function is as follows: 1) Key region weighted MSE loss: in the formula, mean represents taking the average value; For predicting a velocity field; The mask is a key area weight matrix; 2) Loss of flow field continuity constraint: Wherein diff represents gradient calculation, dim=2 corresponds to x direction, dim=3 corresponds to y direction; 3) Structural similarity loss: wherein SSIM is structural similarity index, and the data range is normalized to [0,1]; 4) Total loss function: 。
  7. 7. The ultra-high time resolution flow field reconstruction method based on time sequence-space joint coding ViT as set forth in claim 1, wherein in step three, the training strategy includes employing Adam optimizer, learning rate of 0.0005, employing CosineAnnealingLR learning rate scheduler, and early termination strategy with verification set relative reconstruction error of less than 0.023.
  8. 8. The ultra-high time resolution flow field reconstruction method based on time sequence-space joint coding ViT as claimed in claim 1, wherein in the fourth step, the trained model is applied to test set or brand new working condition time sequence pressure field data, a reconstruction speed field is output, the reconstruction precision is estimated through relative reconstruction errors, the difference of the original flow field is compared, and the expression is as follows: in the formula, Relative error in the time domain for the x position; Is the average value of the relative errors of the whole flow field in the time domain; The relative error distribution of the whole flow field in the space domain is obtained; At the x position A true value of the time of day speed; At the x position N is the total time; Is the total number of positions.
  9. 9. The ultra-high time resolution flow field reconstruction method based on time sequence-space joint coding ViT comprises a data acquisition and time sequence construction module, a data set preprocessing module, a joint coding ViT model module, a multi-loss training module and a flow field reconstruction and evaluation module, and can realize the method as set forth in any one of claims 1-8, wherein: The data acquisition and time sequence construction module is used for reading the pressure field data of multiple time periods, constructing time sequence pressure field input and generating a training/testing set index; The data set preprocessing module generates a key area weight mask and performs normalization processing on the pressure field and the speed field; The joint coding ViT model module is used for realizing patch embedding, double-dimensional position coding, attention feature fusion and layered output projection; The multi-loss training module calculates the total loss of the multiple components, trains a model through an optimizer and a scheduler, and triggers an early-stopping mechanism; and the flow field reconstruction and evaluation module is used for inputting the test set pressure field data, outputting a reconstruction speed field and calculating the relative reconstruction error evaluation precision.
  10. 10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor executing the program to implement the ultra-high time resolution flow field reconstruction method based on temporal-spatial joint coding ViT as claimed in any one of claims 1 to 8.

Description

Ultra-high time resolution flow field reconstruction method based on time sequence-space joint coding ViT Technical Field The invention belongs to the technical field of hydrodynamic flow field prediction and reconstruction, and particularly relates to an ultra-high time resolution flow field reconstruction method based on time sequence-space joint coding ViT (Vision Transformer). Background In the application of fluid mechanics research and engineering, flow field reconstruction is a core technology for acquiring high-resolution flow field data, the traditional method relies on Particle Image Velocimetry (PIV) and other technologies to directly acquire a speed field, but high-frequency sampling hardware is high in cost, and massive data can increase storage and processing burden. The method for indirectly reconstructing the velocity field based on sparse pressure field data is widely focused, but the prior art has the defects that firstly, a traditional Convolutional Neural Network (CNN) is difficult to effectively capture a long time sequence dependency relationship of the pressure field, the flow field reconstruction is required to predict a current velocity field based on historical time sequence pressure data, the time sequence feature extraction is insufficient, the reconstruction precision is limited, secondly, the precision of a key region is insufficient, the dynamics importance of different regions in the flow field is different, the traditional method adopts global uniform weight, key optimization is not carried out on the key region (such as vortex shedding core region), the core region reconstruction error is larger, thirdly, a loss function is designed singly, namely, the traditional method mainly adopts simple Mean Square Error (MSE) loss, only focuses on numerical errors, physical continuity constraint and visual structure similarity of the flow field are not considered, the reconstruction flow field possibly violates a fluid dynamics rule, and visual detail distortion are generated, and fourthly, the traditional output layer design realizes size matching through large-scale interpolation, and the detail loss of the high-frequency flow field is difficult to restore the local fine structure of the flow field. Therefore, a high-precision ultra-high time resolution flow field reconstruction method capable of cooperatively capturing time sequence-space characteristics, strengthening the precision of key areas and combining physical constraint and visual consistency is needed. Disclosure of Invention The invention aims to overcome the defects of insufficient modeling of time sequence features, insufficient precision of key areas, weak capturing capability of high-frequency features and the like in the prior art, provides an ultra-high time resolution flow field reconstruction method based on time sequence-space joint coding ViT, and is suitable for flow field dynamics analysis and engineering optimization in the fields of bridge wind engineering, aerospace and the like. In order to achieve the purpose, the invention adopts the following technical scheme that the ultra-high time resolution flow field reconstruction method based on the time sequence-space joint coding ViT comprises the following steps: Step one, multi-time-period pressure field time sequence construction and masking preprocessing, namely reading sparse pressure field data of different time periods, constructing a four-dimensional time sequence pressure field as input, wherein four dimensions comprise the number of samples and time steps, ,Simultaneously, a key area is defined based on the physical characteristics of a flow field, a two-dimensional weight mask matrix is generated, and the pressure field and the speed field data are normalized to eliminate dimension influence; Step two, constructing a time sequence-space joint coding ViT model, namely designing a ViT model comprising patch embedding, two-dimensional position coding, multi-layer attention block, weighted feature aggregation and layered output projection, and realizing collaborative extraction of pressure field time sequence dependence and space structural features; Optimizing and training the multi-component loss function, namely taking a weighted combination of the weighted MSE loss of the key region, the constraint loss of the continuity of the flow field and the structural similarity loss as a total loss function, and combining the learning rate scheduling and the early termination strategy to train the model until convergence; And step four, reconstructing a high-time-resolution flow field, namely applying the trained model to a test set or time sequence pressure field data under a brand new working condition, outputting a reconstruction speed field, and evaluating reconstruction accuracy through relative reconstruction errors. In the first step, the multi-period pressure field time sequence construction is specifically that pressure data of a designated index ran