A data pool-based non-steady flow field neural network prediction method

By using a convolutional neural network model with data pooling and attention mechanisms, the problems of high computational cost and cumulative error in unsteady flow field prediction are solved, and fast and accurate flow field prediction is achieved.

CN119740626BActive Publication Date: 2025-12-05SICHUAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411652531.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-12-05
Estimated Expiration
2044-11-19

AI Technical Summary

Technical Problem

Traditional methods suffer from high computational costs and accumulated errors in predicting unsteady flow fields. The lack of scientific methods for hyperparameter selection makes neural network training difficult and time-consuming.

Method used

An unsteady flow field neural network prediction method based on a data pool is adopted. Data processing is performed through a data access module, a time memory unit, and a reset recording unit. Combined with a convolutional neural network model with an attention mechanism, the number of training iterations is reduced and the cumulative error is decreased, thereby improving the prediction accuracy.

Benefits of technology

It enables rapid prediction of unsteady flow fields, reduces training time overhead, improves the prediction accuracy and robustness of neural networks, and reduces dependence on noise hyperparameters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119740626B_ABST
    Figure CN119740626B_ABST
Patent Text Reader

Abstract

The application discloses a kind of unsteady flow field neural network prediction methods based on data pool, specific steps are as follows: initialization is carried out based on the data access module of data pool, the module includes training data pool, time memory unit and reset record unit, training data set is pretreated, and flow field data is extracted;Initialize the convolutional neural network model based on attention mechanism and train the model, output the flow field data of next time step, and the neural network carries out back propagation;The output of the neural network is returned to the module and put back into the data pool, and the module extracts data from the data pool or training data set according to the reset record unit for the next round of training;Self-recurrence flow field prediction is carried out using the trained model.The application eliminates noise super parameter compared with traditional neural network based on unsteady algorithm, reduces cumulative error, and speeds up the iteration speed of industrial design.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of machine learning simulation, and relates to a neural network prediction method for fluid simulation, in particular to a neural network prediction method for unsteady flow field based on a data pool. BACKGROUND

[0002] Computational fluid dynamics is one of the important technologies in the field of fluid dynamics in the 21st century. It solves the control equations of fluid dynamics in the computer by using numerical methods, so as to realize the analysis, prediction and control of flow. Traditional finite element method (FEM) and finite difference method (FDM) have complex simulation processes (physical modeling, meshing, numerical discretization, iterative solving, etc.) and high calculation cost. For example, for the analysis of transonic buffeting problems, due to the involvement of high-resolution numerical simulation, nonlinear problems, multi-scale characteristics, etc., a large amount of computing resources is often required, and the simulation accuracy is also challenged.

[0003] In recent years, with the rapid development of neural network methods, as a traditional solution alternative, neural network solution of unsteady flow field is usually observed and learned directly from a large amount of data set; however, this end-to-end learning method has many problems to be solved for unsteady flow field with large state space and complex dynamic mode, such as cumulative error problem. In recent years, many neural network methods based on deep learning framework have been used to solve flow field control equations, such as unsteady incompressible N-S equation, etc. These methods rely on using noise as a hyperparameter to reduce the cumulative error of neural network in the autoregressive process; however, the hyperparameter is difficult to set in the training process of neural network. Due to the sensitivity of neural network to hyperparameters, different hyperparameters have a great influence on the results of neural network, and the hyperparameter even determines whether the training of neural network is successful to some extent. However, there is no scientific method for selecting hyperparameters in the academic field, and most of the time it is based on experience and experiment, so the hyperparameter is a direction to be improved in the neural network method.

[0004] Some methods for reducing the cumulative error of neural network without hyperparameters have also been proposed, such as multi-time step binding, two-step forward, etc. However, multi-time step binding essentially reduces the cumulative error of neural network by reducing the inference times of neural network, and the two-step forward method is difficult to produce effect on solving the complex control equation of flow field. In summary, it is urgent to solve the problems of eliminating the hyperparameters of unsteady flow field prediction and reducing the cumulative error in the autoregressive model. SUMMARY

[0005] In view of the above deficiencies of the prior art, the present application provides a data pool-based neural network prediction method for unsteady flow field, which can run on different neural network architectures, improve neural network prediction accuracy, eliminate noise hyperparameters, and reduce the cumulative error of neural networks; meanwhile, the introduction of the data pool can greatly reduce the training time of the graph neural network, thereby alleviating the problem of large time consumption in unsteady flow field calculation, and realizing fast prediction of unsteady flow field.

[0006] To solve the above technical problems, the present application is realized by the following means:

[0007] A data pool-based neural network prediction method for unsteady flow field, the specific steps of which are as follows:

[0008] S1, initialize the data access module based on the data pool, which includes a training data pool, a time memory unit and a reset recording unit, preprocess the training data set, and take out the flow field data;

[0009] S2, initialize the convolutional neural network model based on the attention mechanism and train the model, output the flow field data at the next time step, and the neural network performs back propagation;

[0010] S3, return the output of the neural network to the module, and the module takes data from the data pool or the training data set according to the reset recording unit for the next round of training;

[0011] S4, use the trained model for autoregressive flow field prediction.

[0012] Further, the specific steps of step S1 are as follows:

[0013] S11, initialize the training data pool, the time memory unit and the reset recording unit, wherein the training data pool is initialized as a tensor with shape [N, C, H, W], N represents the number of samples, C represents the number of sample features, including X, Y direction velocity and flow field pressure, H represents the height of the sample, and W represents the width of the sample;

[0014] S12, the time memory unit is used to store the time step of the data in the training data pool, and the time memory unit is initialized as a tensor with shape [N], wherein the time step is randomly initialized as a random integer from 0 to train_data_set_step (wherein train_data_set_step is the time sequence length of the training data set); the reset recording unit is used to record the sample time step that has been reset, and the record is True, indicating that it has been reset, and the record is False, indicating that it has not been reset, wherein all records are True at initialization;

[0015] S13, pre-process the time step data of the reset record unit, if the corresponding sample reset record is True, the data of the corresponding time step is taken out from the data set, if the corresponding sample reset record is False, the corresponding training data and the next time step true value are taken out from the training data pool.

[0016] Further, the specific sub-steps of step S2 are as follows:

[0017] S21, in the training data Attention Unet network, a multi-channel input feature map is received through an input layer, a series of feature extraction modules are used for down-sampling to obtain a down-sampled feature map, the down-sampled feature map passes through an attention mechanism module and a feature fusion module, and finally a flow field data of a next time step is obtained through an output module, and a loss is calculated with a true value of the next time step to return and optimize the neural network;

[0018] S22, the specific structure of the Attention Unet network used when outputting the flow field data of the next time step is as follows:

[0019] 1) the input layer receives a multi-channel input feature map, the input feature map has a size of 4x128x128, and contains flow field information of a time step length n;

[0020] 2) the feature extraction module: a 3x3 convolution layer is combined with a GroupNorm normalization and a ReLU activation function to perform feature extraction, the feature extraction process uses a convolution layer with a step of 2 to perform multi-scale feature extraction of 4x4, 8x8, 16x16, 32x32 and 64x64;

[0021] 3) the attention mechanism module: different scale feature maps are processed by an attention mechanism to generate attention weights, and the feature maps are multiplied by the corresponding attention weights to highlight key information;

[0022] 4) the feature fusion module: different scale feature maps are up-sampled to obtain a feature map, and the feature map is spliced with the feature map in the channel dimension in the down-sampling process to obtain a fused feature map;

[0023] 5) the output module: a 1x1 convolution layer is used to generate a final output feature map, and the output feature map has a size of 3x128x128, and the flow field data of a time step n+1 is output;

[0024] The attention mechanism module has the following specific structure:

[0025] 1) the input layer receives a multi-channel input feature map, and the input feature map has a size of 64x128x128;

[0026] 2) The input feature map is subjected to a 1x1 convolution layer, the number of convolution kernels is the same as the number of output channels, and the feature map after convolution is subjected to normalization processing in a normalization layer;

[0027] 3) The normalized feature map is subjected to feature fusion processing, the feature maps of different inputs are spliced in the channel dimension to obtain a fused feature map with a size of 128x128x128;

[0028] 4) The fused feature map is subjected to the following processing:

[0029] The first branch: the fused feature map is subjected to an adaptive average pooling layer, the feature map size is changed to 128x1x1, then subjected to a full connection layer, a ReLU activation function layer, and then another full connection layer, and finally subjected to a Sigmoid activation function, outputting a set of weight coefficients, which are multiplied with the original fused feature map element by element to obtain a first corrected feature map;

[0030] The second branch: the fused feature map is subjected to a 1x1 convolution layer, and then subjected to a Sigmoid activation function, outputting another set of weight coefficients, which are multiplied with the original fused feature map element by element to obtain a second corrected feature map;

[0031] The first corrected feature map and the second corrected feature map are added in the channel dimension to obtain a final output feature map, and the output feature map size is 128x128x128.

[0032] Further, the specific sub-steps of step S3 are as follows:

[0033] S31, put the flow field data generated by the model in the S2 process into the training data pool, and replace the flow field data of the last time step;

[0034] S32, the time memory unit updates the time step after each epoch of the neural network, increases the time step of each sample by one, accumulates the current number of samples into the counter count, calculates the reset sample number, and finally updates the counter count to the result of taking the modulus of per_train_data_time_step, per_train_data_time_step is the length of the average continuous training of each sample;

[0035] S33, according to the calculated reset sample number, check the reset order list, if it is empty, generate a sequence list from 0 to the number of samples, randomly shuffle, take an index from the reset order list, and reset the corresponding file according to the index.

[0036] Further, the specific execution of step S33 is as follows:

[0037] S331, randomly assign the time memory unit of the index position to an integer between 0 and train_data_set_steps-per_train_data_time_step, wherein train_data_set_steps is the length of the time series of the training data set, and mark the data at the index position as reset;

[0038] S332, use the mask to filter out data with a time step greater than the training sample time step length, reset the time step of the data to 0, and mark the reset record unit of the data as reset.

[0039] Further, the specific sub-steps of step S4 are as follows:

[0040] S41, use the model trained by steps S2-S3 to predict the unsteady flow field, take the data at the initial time step t=0 from the data set and input it into the trained neural network to predict the flow field data at the next time step t=1;

[0041] S42, input the last time step flow field data predicted by the model into the trained neural network, and predict the flow field data at the next step again;

[0042] S43, repeat step S42 until the set number of time steps is reached.

[0043] Compared with the prior art, the present application has the beneficial effects:

[0044] The neural network data processing module of the present application introduces a data pool, which greatly reduces the training time overhead of training graph neural networks, thereby alleviating the problem of large time consumption in unsteady flow field calculation, and realizing fast prediction of unsteady flow field; running on different neural network architectures improves the prediction accuracy of the neural network, eliminates noise hyperparameters, and reduces the cumulative error of the neural network; at the same time, the method successfully enhances the robustness of the model by improving the training strategy of the neural network, without relying on the injection of additional noise, and can be integrated into existing graph neural network (GNN) and convolutional neural network models. BRIEF DESCRIPTION OF DRAWINGS

[0045] Fig. 1 is a training flowchart of the present application;

[0046] Fig. 2 is a prediction flowchart of the present application.

[0047] Fig. 3 is an Attention Unet architecture diagram of the present application;

[0048] Fig. 4 is an Attention module diagram of the present application; DETAILED DESCRIPTION

[0049] The specific embodiments of the present application will be further described in detail below with reference to the accompanying drawings and specific examples.

[0050] As shown in the figure, a data pool-based unsteady flow field neural network prediction method, the specific steps are as follows: Figs. 1-4

[0051] S1, initialize the data access module based on the data pool, the module includes the training data pool, the time memory unit and the reset recording unit, preprocess the training data set, take out the flow field data, the specific steps are as follows:

[0052] S11, initialize the training data pool, the time memory unit and the reset recording unit, wherein the training data pool is initialized as a tensor with shape [N, C, H, W], N represents the number of samples, which is used to support the method of one-step prediction and multi-step prediction in neural network, and the default is 1; C represents the number of sample features, including the velocity in X and Y directions and the pressure of flow field, H represents the height of sample, and W represents the width of sample;

[0053] S12, the time memory unit is used to store the time step of the data in the training data pool, and the time memory unit is initialized as a tensor with shape [N], wherein the time step is randomly initialized as a random integer from 0 to train_data_set_step (wherein train_data_set_step is the time sequence length of the training data set); the reset recording unit is used to record the sample time step that has been reset, and the record is True, indicating that it has been reset, and the record is False, indicating that it has not been reset, wherein all records are True at initialization;

[0054] S13, preprocess the time step data of the reset recording unit, if the corresponding sample reset record is True, take out the data of the corresponding time step from the data set; if the corresponding sample reset record is False, take out the corresponding training data and the next time step true value from the training data pool.

[0055] S2, initialize the convolutional neural network model based on attention mechanism and train the model, the model takes the data taken from the data pool or the training data set in the module as input, performs down-sampling through a series of convolutional layers, normalization layers and ReLU layers, then outputs the next time step data through a series of up-sampling layers and attention modules, and the neural network performs back propagation, the specific steps are as follows:

[0056] ​S21, the training data AttentionUnet network receives multi-channel input feature map through the input layer, obtains down-sampling feature map through a series of feature extraction modules, the down-sampling feature map passes through attention mechanism module, feature fusion module, and finally obtains the next time step flow field data of the forward process through the output module, and the loss is calculated with the next time step true value, and the neural network is optimized; the neural network training steps are as follows:

[0057] fort=1,2,3,...,N do:

[0058] Start timing

[0059] Set the network Net to training mode

[0060] For input, data_target, data_idx in a batch of data

[0061] The learning rate decay formula is:

[0062] learning rate=0.0001*γ current_epoch

[0063] Update the learning rate of the optimizer optimizerG

[0064] Make the gradient of Net zero

[0065] Generate output gen as the output of Net to input

[0066] Calculate the mean square error MSE_loss, and the mean square error calculation formula is:

[0067] MSE_loss=1 / n∑(data_target-gen) 2

[0068] Backpropagation MSE_loss

[0069] Update the step number of the optimizer optimizerG

[0070] After each batch of data

[0071] Dataset updates the training data pool

[0072] Reset the time data pool

[0073] Stop timing

[0074] S22, the specific structure of the AttentionUnet network used when outputting the next time step flow field data is as follows:

[0075] 1) The input layer receives a multi-channel input feature map, and the input feature map has a size of 4x128x128, which contains flow field information at a time step n;

[0076] 2) The feature extraction module: a 3x3 convolution layer is combined with a GroupNorm normalization and a ReLU activation function to extract features. The feature extraction process uses a convolution layer with a step of 2 to perform multi-scale feature extraction at 4x4, 8x8, 16x16, 32x32, and 64x64;

[0077] 3) The attention mechanism module: different scale feature maps are processed by the attention mechanism to generate attention weights, and the feature maps are multiplied by the corresponding attention weights to highlight key information;

[0078] 4) The feature fusion module: the feature maps of different scales are upsampled, and the obtained feature maps are concatenated with the feature maps in the down-sampling process in the channel dimension to obtain a fused feature map;

[0079] 5) The output module: a 1x1 convolution layer is used to generate the final output feature map, and the output feature map has a size of 3x128x128, which is the flow field data at a time step n+1;

[0080] The attention mechanism module has the following specific structure:

[0081] 1) The input layer receives a multi-channel input feature map, and the input feature map has a size of 64x128x128;

[0082] 2) The input feature map is processed by a 1x1 convolution layer, and the number of convolution kernels is the same as the number of output channels. The feature map after convolution is normalized by a normalization layer;

[0083] 3) The normalized feature map is processed by feature fusion, and the feature maps of different inputs are concatenated in the channel dimension to obtain a fused feature map with a size of 128x128x128;

[0084] 4) The fused feature map is processed as follows:

[0085] First branch: the fused feature map is processed by an adaptive average pooling layer to change the feature map size to 128x1x1. Then, it is processed by a fully connected layer, a ReLU activation function layer, and another fully connected layer. Finally, it is output by a Sigmoid activation function to output a set of weight coefficients. The weight coefficients are multiplied element by element with the original fused feature map to obtain a first corrected feature map;

[0086] Second branch: the fused feature map is processed by a 1x1 convolution layer, and then output by a Sigmoid activation function to output another set of weight coefficients. The weight coefficients are multiplied element by element with the original fused feature map to obtain a second corrected feature map.

[0087] The first modified feature map and the second modified feature map are added in the channel dimension to obtain a final output feature map, and the output feature map has a size of 128x128x128.

[0088] S3, return the output of the neural network to the data pool, and the module takes data from the data pool or the training data set according to the reset record unit to perform the next round of training, and the specific steps are as follows:

[0089] S31, put the flow field data generated by the model in the S2 process into the training data pool to replace the flow field data of the previous time step;

[0090] S32, the time memory unit updates the time step after each epoch of the neural network, increases the time step of each sample by one, accumulates the current sample number into the counter count, calculates the reset sample number, and finally updates the counter count to the result of taking the modulus of per_train_data_time_step, and per_train_data_time_step is the length of the average continuous training of each sample;

[0091] S33, according to the calculated reset sample number, check the reset order list, if it is empty, generate a sequence list from 0 to the sample number, and randomly shuffle, take an index from the reset order list, and reset the corresponding file according to the index.

[0092] The specific execution of the step S33 is as follows:

[0093] S331, randomly assign the time memory unit at the index position to an integer between 0 and train_data_set_steps-per_train_data_time_step, wherein train_data_set_steps is the time sequence length of the training data set, and mark the data at the index position as reset;

[0094] S332, use the mask to screen out data with a time step greater than the training sample time step length, reset the time step of the data to 0, and mark the data as reset in the reset record unit.

[0095] S4, use the trained model to perform autoregressive flow field prediction, and the specific steps are as follows:

[0096] S41, use the model trained by steps S2-S3 to predict the unsteady flow field, take the data of the initial time step t=0 from the data set, input it into the trained neural network, and predict the flow field data of the next time step t=1;

[0097] S42, input the model-predicted last time step flow field data into the trained neural network to again predict the next step flow field data;

[0098] S43, repeat step S42 until the set number of stopping time steps.

[0099] The above only describes the embodiments of the present application, and it is declared again that those skilled in the art can make several improvements to the present application without departing from the principles of the present application, and these improvements are also included in the protection scope of the claims of the present application.

Claims

1. A data-pool-based non-stationary flow field neural network prediction method, characterized in that: The specific steps are as follows: S1, initialize the data pool-based data access module, which includes a training data pool, a time memory unit and a reset record unit, preprocess the training data set, and take out the flow field data; S2, initialize the attention mechanism-based convolutional neural network model and train the model, output the data of the next time step, and the neural network performs back propagation; S3, return the output of the neural network to the module and put it back into the data pool, and the module takes out data from the data pool or the training data set according to the reset record unit for the next round of training; S4, use the trained model to perform autoregressive flow field prediction; The specific steps of step S1 are as follows: S11, initialize the training data pool, the time memory unit and the reset record unit, wherein the training data pool is initialized as a tensor with shape [N, C, H, W], N represents the number of samples, C represents the number of features of the sample, including X and Y direction velocity and flow field pressure, H represents the height of the sample, and W represents the width of the sample; S12, the time memory unit is used to store the time step of the data in the training data pool, and the time memory unit is initialized as a tensor with shape [N], wherein the time step is randomly initialized as a random integer from 0 to train_data_set_step; the reset record unit is used to record the sample time step that has been reset, and is recorded as True to indicate that it has been reset, and is recorded as False to indicate that it has not been reset, wherein all records are True at initialization; S13, preprocess the time step data of the reset record unit, if the corresponding sample reset record is True, take out the data of the corresponding time step from the data set; if the corresponding sample reset record is False, take out the corresponding training data and the next time step true value from the training data pool; The specific steps of step S3 are as follows: S31, put the flow field data generated by the model in the S2 process into the training data pool, replacing the flow field data of the previous time step; S32, the time memory unit updates the time step after each epoch of the neural network, increases the time step of each sample by one, accumulates the current number of samples into the counter count, calculates the number of reset samples, and finally updates the counter count to the result of taking the modulus of per_train_data_time_step, per_train_data_time_step is the average length of each sample continuous training; S33, according to the calculated number of reset samples, check the reset order list, if it is empty, regenerate a sequence list from 0 to the number of samples, randomly shuffle, take out an index from the reset order list, and reset the corresponding file according to the index.

2. The non-steady flow field neural network prediction method based on data pool according to claim 1, wherein: The specific steps of step S2 are as follows: S21, the Attention Unet network trained in step S2 is used to predict the flow field at the next time step. The input feature map is input into the input layer of the Attention Unet network, and a series of feature extraction modules are used to downsample the input feature map to obtain a downsampled feature map. The downsampled feature map is then input into the attention mechanism module and the feature fusion module, and finally the output module is used to obtain the flow field data at the next time step. The loss is calculated by comparing the flow field data at the next time step with the ground truth, and the neural network is optimized by backpropagation. S22, the specific structure of the Attention Unet network used to output the flow field data at the next time step is as follows: 1) The input layer receives a multi-channel input feature map, and the input feature map has a size of 4x128x128, which contains flow field information at time step n; 2) The feature extraction module uses a combination of 3x3 convolution layers, GroupNorm normalization, and ReLU activation functions to extract features. The feature extraction process uses convolution layers with a step size of 2 to extract multi-scale features at scales of 4x4, 8x8, 16x16, 32x32, and 64x64; 3) The attention mechanism module processes the feature maps at different scales to generate attention weights, and then multiplies the feature maps with the corresponding attention weights; 4) The feature fusion module upsamples the feature maps at different scales, and then concatenates the upsampled feature maps with the feature maps obtained in the downsampling process in the channel dimension to obtain a fused feature map; 5) The output module uses a 1x1 convolution layer to generate the final output feature map, which outputs the flow field data at time step n+1 with a size of 3x128x128.

3. The unsteady flow field neural network prediction method based on a data pool according to claim 1, wherein the specific steps of step S4 are as follows: S41, using the model trained in steps S2-S3 to predict the unsteady flow field, taking the data at the initial time step t=0 from the data set and inputting it into the trained neural network to predict the flow field data at the next time step t=1; S42, inputting the flow field data at the previous time step predicted by the model into the trained neural network to predict the flow field data at the next step again; S43, repeating step S42 until the set number of time steps is reached.

4. The unsteady flow field neural network prediction method based on a data pool according to claim 2, wherein the specific structure of the attention mechanism module is as follows: 1) The input layer receives a multi-channel input feature map, and the input feature map has a size of 64x128x128; 2) The input feature map is input into a 1x1 convolution layer, and the number of convolution kernels is the same as the number of output channels. The feature map after convolution is input into a normalization layer for normalization; 3) The normalized feature map is subjected to feature fusion processing, and the feature maps at different input channels are concatenated in the channel dimension to obtain a fused feature map with a size of 128x128x128; 4) The fused feature map is subjected to the following processing: ​ ​ The first branch: the fused feature map passes through an adaptive average pooling layer, the size of the feature map is changed to 128x1x1, then passes through a full connection layer, a ReLU activation function layer, and another full connection layer, and finally passes through a Sigmoid activation function, outputs a set of weight coefficients, multiplies the weight coefficients with the original fused feature map element by element, and obtains a first corrected feature map; The second branch: the fused feature map passes through a 1x1 convolution layer, then passes through a Sigmoid activation function, outputs another set of weight coefficients, multiplies the weight coefficients with the original fused feature map element by element, and obtains a second corrected feature map; The first corrected feature map and the second corrected feature map are added in the channel dimension to obtain a final output feature map, and the output feature map has a size of 128x128x128.

5. The unsteady flow field neural network prediction method based on a data pool according to claim 1, wherein: The specific implementation of the step S33 is as follows: S331, randomly assigning the time memory unit at the index position to an integer between 0 and train_data_set_steps-per_train_data_time_step, wherein train_data_set_steps is the time series length of the training data set, and marking the data at the index position as having been reset; S332, screening out data with a time step greater than the training sample time step length using a mask, resetting the time step of the data to 0, and marking the data in the reset record unit as having been reset.

Citation Information

Patent Citations

  • Airfoil profile transonic buffeting flow field rapid prediction method based on deep neural network

    CN116306206A

  • Flow field prediction method based on dense convolutional network

    CN118332684A