Unsteady flow field prediction method based on multi-scale training strategy
Through multi-scale training strategies and neural network models, the problem of high consumption of traditional non-steady flow field simulation computing resources is solved, and fast and accurate flow field prediction is achieved. It is suitable for aerospace, marine engineering and automobile industries, reducing costs and improving response speed and flexibility.
Patent Information
- Application Number
- CN202510922189.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-04
- Publication Date
- 2025-08-05
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The traditional non-steady flow field simulation method consumes a lot of computing resources and cannot meet the needs of efficient real-time simulation and multi-query analysis, limiting the efficiency of the optimization process and the flexibility of practical applications.
Using a multi-scale training strategy, a multi-scale progressive training is carried out by acquiring the original data set, reconstructing the training data set, and constructing a neural network model combining 3D U-Net with residual modules and attention modules, and performing multi-scale progressive training to achieve fast and accurate prediction of non-stable flow fields.
It reduces the dependence of computing resources, improves the speed and accuracy of non-stable flow field prediction, and is suitable for areas such as aerospace, marine engineering and the automotive industry that require high real-time and accuracy, reducing engineering costs and improving response speed and flexibility.
Smart Images

Figure CN120430241A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computational fluid dynamics technology, and in particular to a method for predicting unsteady flow fields based on a multi-scale training strategy. Background Art
[0002] Unsteady flow simulation technology is widely used in multiple fields, including aerospace, marine engineering, and the automotive industry. In these industries, unsteady flow simulation is of vital importance for flow field optimization, energy efficiency improvement, and noise control. In the aerospace field in particular, unsteady flow characteristics directly affect the design and performance of aircraft. Airflow, heat transfer, and pressure distribution must be accurately simulated to ensure flight safety and performance optimization. In marine engineering, flow field analysis helps optimize ship design, reduce fuel consumption, and improve ship stability and maneuverability. In the automotive industry, by optimizing the flow field, not only can fuel consumption be effectively reduced, but wind noise can also be significantly reduced, improving the driving experience.
[0003] However, despite the important application value of unsteady flow field simulation, traditional numerical simulation methods, such as simulation based on computational fluid dynamics (CFD), often face the problem of consuming a large amount of computing resources. The CFD method can describe the details of the flow in detail and provide accurate flow field distribution by numerically solving the fluid equations. However, this method has extremely high requirements on computing power, especially when dealing with complex flow problems, the required computing resources and time increase exponentially. As a result, in practical applications, when using traditional CFD methods to solve problems, the computational cost is often very expensive and cannot meet the needs of efficient real-time simulation and multi-query analysis. With the increasing complexity of engineering applications, traditional numerical simulation methods are increasingly difficult to meet the requirements of real-time and high efficiency when facing increasingly complex flow problems. This not only limits the efficiency of the optimization process, but also affects the flexibility of practical applications. Summary of the Invention
[0004] The purpose of this application is to provide an unsteady flow field prediction method based on a multi-scale training strategy to address the deficiencies in the above-mentioned technologies.
[0005] To achieve the above objectives, the technical solutions adopted in this application are as follows: This application provides an unsteady flow field prediction method based on a multi-scale training strategy, including: Obtaining the original data set: numerically simulate the unsteady flow field around the object to be measured, obtain the original data of each time step, and map it to a uniformly distributed orthogonal grid to form the original data set of the unsteady flow field; Reconstructing the training data set: The original data set is decomposed using the intrinsic orthogonal decomposition method to obtain several orthogonal modes and the energy contribution rate corresponding to each orthogonal mode. Based on different energy coverage rates, the corresponding number of orthogonal modes is selected to form multiple training data sets with different energy coverage rates. Constructing a neural network model: Based on the 3D U-Net architecture, residual module, and attention module, a neural network model for predicting unsteady flow fields is constructed. The 3D U-Net architecture includes input values, downsampling modules, upsampling modules, and output values. The attention module and residual module are embedded in the downsampling module. Constructing the neural network model includes: Downsampling the input value through a downsampling module to obtain a first output value; Performing feature enhancement on the first output value through the attention module to obtain a second output value; Performing feature extraction on the second output value through a residual module to obtain a third output value; Upsampling and feature reconstruction are performed on the third output value through an upsampling module to obtain an output value; Training the neural network model: Using a multi-scale progressive training method, the neural network model is first trained based on a training dataset with minimum energy coverage to obtain the learning weights of the neural network model in the initial stage. The learning weights obtained in the previous stage of training are then used as the initial learning weights for the next stage of training. The neural network model is then trained at multiple scales based on training datasets with gradually increasing energy coverage to obtain the trained neural network model. Predicting unsteady flow fields: Based on the trained neural network model, a recursive feedback mechanism is used to predict unsteady flow fields.
[0006] Furthermore, obtaining the original data set includes: Set the number of simulation time steps and total time, use the Reynolds time-averaged method to perform numerical simulation on the unsteady flow field around the object to be measured, and obtain the original data of each time step; Spatial interpolation is performed on the raw data at each time step to map it into a uniformly distributed orthogonal grid, forming the original dataset arranged in time order.
[0007] Furthermore, reconstructing the training dataset includes: The snapshot matrix is used to represent the original data set. The specific expression is:
[0008] in, X is the original data set, the number of columns of the original data set is equal to the number of time steps of the unsteady flow field, For the n The raw data of the time step, R is the set of real numbers,N is the time step number of the unsteady flow field, W is the number of sampling points in the horizontal direction of the unsteady flow field, H is the number of sampling points in the vertical direction of the unsteady flow field; Based on the original data set, the covariance matrix is calculated. The specific calculation formula is:
[0009] in, C is the covariance matrix, is the transpose of the original dataset; Calculate the eigenvectors and eigenvalues of the covariance matrix. The specific calculation formula is:
[0010] in, v i is the covariance matrix i feature vectors, λ i is the covariance matrix i eigenvalues; Orthogonalize the eigenvectors of the covariance matrix to obtain several orthogonal modes and the energy contribution rate corresponding to each orthogonal mode; Set energy levels with different energy coverage rates, select the corresponding number of orthogonal modes based on different energy levels, and generate multiple training data with different energy coverage rates at each time step. The specific calculation formula is:
[0011]
[0012] in, For the n The original data of the time step is i The projection coefficients of the orthogonal modes, For the i orthogonal modes, For the n training data for time steps, k is the number of orthogonal modes; The training data of different time steps with different energy coverage are arranged in chronological order to form multiple training data sets with different energy coverage. The specific expression of each training data set is:
[0013] in, is the training data set.
[0014] Furthermore, the first output value is enhanced by the attention module, and the specific calculation formula for obtaining the second output value is:
[0015] in, F c is the second output value, F is the first output value, γ is the scaling factor, Softmax(·) is the normalized exponential function, Q is the query vector, K is the key vector, V is a value vector; The residual module is used to extract features from the second output value, and the specific calculation formula for obtaining the third output value is:
[0016] in, Y is the third output value, ReLU(·) is the activation function, is the mapping function of the residual connection, is the mapping function for skip connections.
[0017] Furthermore, before downsampling the input value, constructing the neural network model also includes: normalizing the input value.
[0018] Furthermore, training the neural network model includes: Select the error evaluation metric for training the neural network model; The training data set with the minimum energy coverage is used as the input value, and the initial loss function of the neural network model is calculated based on the error evaluation index to obtain the learning weight of the neural network model in the initial stage; The learning weights obtained from the previous stage of training are used as the initial learning weights for the next stage of training, and the training data sets with gradually increasing energy coverage are used as input values in sequence. The loss functions of multiple stages of the neural network model are calculated based on the error evaluation index, and the learning weights of multiple stages of the neural network model are obtained, and finally the trained neural network model is obtained.
[0019] Furthermore, the error evaluation indicators include at least mean square error, mean absolute error, perceptual loss, and structural similarity loss. The loss function includes the weighted loss of at least any two of the mean square error, mean absolute error, perceptual loss, and structural similarity loss. The specific calculation formula of each error evaluation indicator is:
[0020] in, MAE is the mean square error, MSEis the mean absolute error, L perceptual is the perceptual loss, L SSIM is the structural similarity loss, is the first prediction of the neural network model based on the training data set. i The predicted data for the time step, For the i The raw data of the time step, represents the pre-trained network, C l 、 H l and W l The training data set is pre-trained network l After layer feature extraction, the number of channels, feature map height and feature map width of the output feature map are output. is the L2 norm, n is the total length of the sequence, and are the local means of the predicted data and the original data, respectively. and are the local variances of the predicted data and the original data, are the covariances of the predicted data and the original data, C 1 and C 2 are the first stabilization factor and the second stabilization factor, respectively, used to prevent division by zero errors. Usually set C 1=(0.01 L ) 2 , C 2=(0.03 L ) 2 ,in, L is the dynamic range of the original dataset.
[0021] Furthermore, the loss function of the neural network model includes the weighted loss of mean square error and mean absolute error, and the specific calculation formula is:
[0022] in, is the initial stage loss function of the neural network model, α 1 and β 1 are the first weight hyperparameters for mean squared error and mean absolute error, respectively.
[0023] Furthermore, the loss function of the neural network model includes the weighted loss of mean square error, mean absolute error, and perceptual loss. The specific calculation formula is:
[0024] in, is the second stage loss function of the neural network model, α 2. β 2 and γ 2 are the second weight hyperparameters of mean square error, mean absolute error and perceptual loss respectively.
[0025] Furthermore, the loss function of the neural network model includes the weighted loss of mean square error, mean absolute error, and structural similarity loss. The specific calculation formula is:
[0026] in, is the third stage loss function of the neural network model, α 3. β 3 and γ 3 are the third weight hyperparameters of mean square error, mean absolute error and structural similarity loss respectively.
[0027] The beneficial effects of this application include: The present application provides a method for predicting unsteady flow fields based on a multi-scale training strategy, which mainly includes the steps of obtaining an original data set, reconstructing a training data set, building a neural network model, training the neural network model, and performing unsteady flow field prediction. By combining 3D U-Net with a residual module and an attention module, the feature extraction capability and prediction accuracy of the neural network model are improved. Through a multi-scale progressive training strategy, the model's ability to learn detailed features in unsteady flow fields is enhanced, solving the problem of high computing resource consumption in traditional prediction methods. Ultimately, a fast and accurate prediction of unsteady flow fields is achieved, which is of great significance for flow field analysis, optimization and control in practical engineering applications, and is particularly suitable for fields with high real-time and precision requirements such as aerospace, marine engineering, and the automotive industry. In addition, by reducing dependence on computing resources, this method not only reduces engineering costs, but also improves response speed and flexibility in practical applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.
[0029] Figure 1 One of the flow charts of an unsteady flow field prediction method based on a multi-scale training strategy provided in this application; Figure 2This is the second flowchart of an unsteady flow field prediction method based on a multi-scale training strategy provided by this application; Figure 3 A schematic diagram of input and output data in the training phase of an unsteady flow field prediction method based on a multi-scale training strategy provided in this application.
[0030] Figure 4 A schematic diagram of the input and output data of the prediction phase of an unsteady flow field prediction method based on a multi-scale training strategy provided in this application. DETAILED DESCRIPTION
[0031] To make the objectives, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only some of the embodiments of this application, not all of them. Generally, the components of this application described and shown in the drawings herein can be arranged and designed in various different configurations.
[0032] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application as claimed, but merely represents selected embodiments of the present application. It should be noted that, unless there is a conflict, the various features of the embodiments of the present application may be combined with each other, and the combined embodiments are still within the scope of protection of the present application.
[0033] It should be noted that similar reference numerals and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined or explained in subsequent figures. In addition, it should be noted that in the description of this application, the terms "first", "second", etc. are used only to distinguish the description and should not be understood as indicating or implying relative importance.
[0034] The technical solution of this application is described in detail below with reference to specific embodiments.
[0035] This application provides an unsteady flow field prediction method based on a multi-scale training strategy, such as Figure 1 and Figure 2 Shown, including: S1, obtaining the original data set: numerically simulate the unsteady flow field around the object to be measured, obtain the original data of each time step, and map it to a uniformly distributed orthogonal grid to form the original data set of the unsteady flow field.
[0036] Specifically, in this step, the number of simulation time steps (such as 200 time steps, but this value can be flexibly adjusted according to actual needs) and the total simulation time should first be set. In order to obtain sufficiently detailed flow field information, computational fluid dynamics (CFD) technology is used. In this embodiment, the open source CFD platform OpenFOAM is used for simulation. Specifically, the Reynolds-Averaged Navier-Stokes (RANS) simulation method is used to numerically solve the unsteady flow field around the object to be tested (such as a cylinder or other shape). Through this technology, the unsteady flow process outside the object can be accurately modeled, and the dynamic changes of the flow field at multiple time steps can be obtained. After each time step simulation is completed, the system outputs complete flow field information, including basic physical quantities of the flow field (such as velocity, pressure, vorticity, etc.). These raw data contain detailed information about the fluid flow around the object and can effectively reflect the changing characteristics of the fluid in time and space.
[0037] On this basis, to meet the format requirements of the neural network model's input data, the raw data at each time step must be further processed. The raw data is transformed using spatial interpolation, mapping it to a uniformly distributed orthogonal grid (such as a Cartesian grid). This transformation not only ensures the spatial consistency of the data, but also the consistency of the data's dimensions and arrangement format. After spatial interpolation, the raw dataset has a more standardized and consistent spatial structure, providing standardized input data for training the neural network model. At the same time, to ensure that the model can correctly understand the dynamic evolution of the flow field in chronological order, the interpolated data is arranged in chronological order to construct a structured and time-consistent raw dataset. This dataset not only meets the requirements of neural network training but also ensures the temporal order and continuity of the data during training, helping the network learn the temporal dependencies of the flow field and its changing patterns.
[0038] S2, reconstructing the training data set: the original data set is decomposed using the intrinsic orthogonal decomposition method to obtain several orthogonal modes and the energy contribution rate corresponding to each orthogonal mode, and the corresponding number of orthogonal modes is selected based on different energy coverage rates to form multiple training data sets with different energy coverage rates.
[0039] Specifically, in this step, first, assuming that the original dataset consists of raw data of N time steps, the original dataset can be represented by a snapshot matrix as follows:
[0040] in, X is the original data set, the number of columns of the original data set is equal to the number of time steps of the unsteady flow field, For the n The raw data of the time step,R is the set of real numbers, N is the time step number of the unsteady flow field, W is the number of sampling points in the horizontal direction of the unsteady flow field, H is the number of sampling points in the vertical direction of the unsteady flow field.
[0041] Secondly, based on the original data set, the covariance matrix is calculated to quantify the correlation between each time step. The specific calculation formula is:
[0042] in, C is the covariance matrix, is the transpose of the original dataset.
[0043] Then, the covariance matrix is decomposed into eigenvalues to extract several eigenvectors and corresponding eigenvalues. The specific calculation formula is:
[0044] in, v i is the covariance matrix i feature vectors, λ i is the covariance matrix i eigenvalues.
[0045] Next, the eigenvectors of the covariance matrix are orthogonalized to obtain several orthogonal modes and their corresponding energy contribution rates. Orthogonal modes are the main variation patterns in the flow field. Each orthogonal mode corresponds to a stable spatial distribution pattern, and its corresponding eigenvalue and energy contribution rate indicate the importance of the mode. By sorting these orthogonal modes from largest to smallest according to their energy contribution rate, the most representative variation pattern in the flow field can be identified.
[0046] After obtaining several orthogonal modes and their energy contribution rates, the multi-scale flow field data is reconstructed. First, the number of energy levels is set (for example, in this embodiment, the number of energy levels is set to 3. In other embodiments, this value can also be flexibly adjusted according to needs), and the corresponding energy coverage is specified for each level, for example, the first level coverage is 70%, the second level coverage is 85%, and the third level coverage is 100% (in other embodiments, the energy proportion of each level can also be flexibly adjusted according to needs). For each level, a corresponding number of orthogonal modes are selected for truncated reconstruction to meet the required energy coverage - for example, only the first 10 modes are required for 70% energy coverage, while the first 30 modes may be required to cover 100% energy. Then, these selected modes are used to truncate and reconstruct the original data at each time step, and the original data is projected into a low-dimensional modal subspace to generate training data with three energy level characteristics. Repeating the above process for the original data of N time steps can obtain a training data set with three energy level characteristics. The specific calculation formula is:
[0047]
[0048] in, For the n The original data of the time step is i The projection coefficients of the orthogonal modes, For the i orthogonal modes, For the n training data for time steps, k is the number of orthogonal modes; The training data of different time steps with different energy coverage are arranged in chronological order to form multiple training data sets with different energy coverage. The specific expression of each training data set is:
[0049] in, is the training data set.
[0050] The training data set is divided into a training set and a test set according to the time series. In this embodiment, the training data of the first 75% of the time steps are used as the training set, and the training data of the last 25% are used as the test set (this ratio division method can be modified according to actual conditions).
[0051] The unsteady flow field training data set formed by adopting the above-mentioned multi-scale reconstruction strategy not only retains the macroscopic flow field trends represented by the high-energy mode, but also takes into account the detailed vortices and local fluctuations reflected by the low-energy mode, thereby realizing the global reconstruction of the original data of the unsteady flow field. In this way, the subsequent deep learning model can be trained separately on data of different scales, first quickly learning the overall flow field evolution law from the low-energy level, and then gradually introducing more detailed high-energy levels to enhance the ability to identify flow field details. This process significantly reduces the dimensionality of the training data, realizes the compression of redundant data while ensuring the integrity of information, and constructs a rich multi-scale sample, which not only improves the learning efficiency of the model, but also enhances its adaptability to the multi-scale characteristics in the unsteady flow field.
[0052] S3, build a neural network model: Based on the 3D U-Net architecture, residual module and attention module, build a neural network model for predicting unsteady flow fields.
[0053] The 3D U-Net architecture consists of input values, a downsampling module, an upsampling module, and an output value. An attention module and a residual module are embedded in the downsampling module to enhance the ability to extract multi-scale spatiotemporal features of unsteady flow fields. This architecture follows an encoder-decoder structure and is capable of processing flow field data with complex spatial and temporal dependencies.
[0054] Specifically, in this step, first, the training data set is used as the input value. Considering the problem of feature oversaturation during neural network training, the training data set is pre-processed using normalization. The specific calculation formula is:
[0055] in, and are the maximum and minimum values in the training data set, respectively. It is a normalized training data set used for subsequent neural network model training.
[0056] The normalization step can ensure that the data dimensions are consistent and the numerical range is appropriate during the training process, preventing different features from affecting the learning effect of the model due to scale differences.
[0057] The normalized training dataset is then fed into the encoder, whose primary task is to extract the underlying high-dimensional features of the flow data. The encoder comprises multiple downsampling modules, typically five (this number is adjustable). Each downsampling module incorporates three key operations: convolution, attention enhancement, and residual extraction.
[0058] In each downsampling module, the input value is first subjected to a 3D convolution operation to extract local spatial-temporal features and the feature map after convolution is compressed. This process can effectively capture the local variation characteristics of the unsteady flow field. Batch Normalization (Batch Normalization) and LeakyReLU The activation function normalizes the convolution output and introduces nonlinear factors to enhance the model's expressiveness. At this point, the first output value obtained then enters the attention module for further processing. The specific calculation formula is:
[0059] in, F c is the second output value, which is the result of the current input feature being enhanced by the attention module. F is the first output value, γ is a learnable scaling factor used to adjust the weight between the attention output and the residual connection. Its initial value is set to 0 and is learned through backpropagation during training. Softmax(·) is a normalized exponential function used to normalize the input value to a probability distribution, which is used here to calculate the attention weight matrix. Q is the query vector, K is the key vector, V is a value vector.
[0060] The core idea of the attention module is to enhance the model's attention to key features. In this module, the first output value first undergoes three 3D convolution operations to generate query vectors ( Query ), key vector ( Key ) and the value vector ( Value ). By calculating Query and Key The correlation between the two is calculated using the attention weight obtained by the Softmax function. Value The features are weighted and summed to generate an attention output. This process is accomplished through matrix operations, which can adjust the degree of attention to each area based on different spatiotemporal characteristics. Finally, the attention output is added to the input value to obtain a second output value with enhanced attention.
[0061] Next, the second output value enters the residual module. The design of the residual module adopts a skip connection structure, which can effectively avoid the gradient vanishing problem in deep networks and accelerate convergence. The residual module consists of a main branch and a skip connection branch, which are combined through an addition operation. ReLUThe activation function generates a third output value. This third output value is passed as input to the next downsampling module, which repeats the convolution, attention mechanism, and residual processing to extract and enhance the multi-scale spatiotemporal features of the flow field layer by layer, and finally outputs a feature representation with strong discriminability. The specific calculation formula is:
[0062] in, Y is the third output value, which is also the final output of the downsampling module. ReLU(·) is the activation function, is the mapping function of the residual connection, is the mapping function of the jump connection, which is used to achieve the identity mapping. The residual module consists of two consecutive 3D convolutional layers ( Conv 1. Conv 2), each convolutional layer is followed by Batch Normalization and ReLU Function activation, achieves identity mapping through mapping function. When the number of input and output channels is inconsistent, a 1×1×1 convolution is used to match the input dimensions.
[0063] The design of the decoder forms a symmetrical structure with the encoder, and its goal is to gradually restore the spatial and temporal resolution of the flow field. The decoder contains five upsampling modules, each of which corresponds to a downsampling module in the encoder. During the upsampling process, the third output value of the fifth downsampling module is first used as input, and the input feature map is expanded in space and time through 3D upsampling (usually using transposed convolution or trilinear interpolation) to restore the resolution of the original flow field. Next, a jump connection is used to splice the high-resolution feature map (that is, the third output value) extracted by the corresponding downsampling module in the encoder with the current decoder input feature map in the channel dimension. This operation helps to fuse local detail information with global context features, thereby reducing the information that may be lost during the upsampling process. The spliced feature map is further input into continuous 3D convolution, Batch Normalization and nonlinear activation functions such as ReLU ) to gradually refine and reconstruct multi-scale spatiotemporal features. Through layer-by-layer upsampling and feature fusion, the decoder ultimately outputs an output value that matches the input size.
[0064] In practical applications, training datasets with different energy coverage rates can be used as input to a neural network model, yielding prediction datasets at different energy levels. Specifically, the input training dataset includes training data for the current time step and the n time steps preceding it, while the model outputs prediction data for the next time step and the n time series preceding it. This multi-scale training strategy enables the neural network to predict flow field data at different levels, enabling accurate prediction of unsteady flow fields.
[0065] S4, training the neural network model: using a multi-scale progressive training method, first train the neural network model based on the training data set with the minimum energy coverage to obtain the learning weights of the initial stage of the neural network model, then use the learning weights obtained in the previous stage of training as the initial learning weights for the next stage of training, and perform multi-scale training on the neural network model based on the training data set with gradually increasing energy coverage to obtain the trained neural network model.
[0066] This method combines training datasets distributed at multiple scales to gradually guide the neural network in learning the dynamic characteristics of the flow field at different scales. As training progresses, the energy distribution of the dataset introduced at each stage gradually increases, enabling the neural network to adapt to and learn the complex changes in the flow field. This training strategy, through a progressive, stage-by-stage approach, gradually guides the neural network in learning the multi-level information structure of the flow field, thereby improving the model's learning ability at different energy levels.
[0067] Specifically, if Figure 3 As shown in the figure, the training process begins with a training dataset with low energy coverage and gradually introduces training datasets with higher energy coverage. In multi-scale progressive training, the training dataset in each training stage contains different energy levels, and the proportion of energy modes is gradually increased based on the network's perception capabilities. For example, in progressive training with three energy levels, the neural network model is first trained using the first-level training dataset with 70% energy coverage as input to obtain the initial learning weights. The weights learned in this stage are then used as the initial learning weights for the second-level training, and the neural network model is further trained using the second-level training dataset with 85% energy coverage as input. Finally, in the third-level training, the neural network model is trained using the training dataset with 100% energy coverage as input to obtain the final learning weights. Through this progressive training strategy, the model can gradually learn from coarse flow field structure to more refined flow field features, ensuring sufficient learning capability at all levels.
[0068] During the training process, to ensure the effectiveness of network learning, it is first necessary to select appropriate error evaluation indicators. These error evaluation indicators include at least mean squared error, mean absolute error, perceptual loss, and structural similarity loss. These evaluation indicators can effectively measure the prediction accuracy of the model at each stage and gradually guide network optimization during the training process at different stages. The specific calculation formulas for each error evaluation indicator are:
[0069] in, MAE is the mean square error, MSE is the mean absolute error,L perceptual is the perceptual loss, L SSIM is the structural similarity loss, is the first prediction of the neural network model based on the training data set. i The predicted data for the time step, For the i The raw data of the time step, represents the pre-trained network, C l 、 H l and W l The training data set is pre-trained network l After layer feature extraction, the number of channels, feature map height and feature map width of the output feature map are output. is the L2 norm, n is the total length of the sequence, and are the local means of the predicted data and the original data, respectively. and are the local variances of the predicted data and the original data, are the covariances of the predicted data and the original data, C 1 and C 2 are the first stabilization factor and the second stabilization factor, respectively, used to prevent division by zero errors. Usually set C 1=(0.01 L ) 2 , C 2=(0.03 L ) 2 ,in, L is the dynamic range of the original dataset.
[0070] In this embodiment, the training process starts with initial stage training, using a training dataset containing 70% energy coverage as input, an initial stage loss function calculated based on weighted loss of mean square error and mean absolute error, and the initial stage learning weights of the model are optimized using the AdamW optimizer. The specific calculation formula of the initial stage loss function of the neural network model is:
[0071] in, is the initial stage loss function of the neural network model, α 1 and β 1 are the first weight hyperparameters of mean square error and mean absolute error, respectively, which can be adjusted according to training needs.
[0072] Then, the learning weights obtained from the initial training are used as the initial weights for the second stage of training. A training dataset containing 85% energy coverage is used for training. The second stage loss function is calculated based on the weighted loss of mean square error, mean absolute error, and perceptual loss to help the network achieve better learning results in the details. The AdamW optimizer is then used to optimize the model's learning weights. The specific calculation formula for the second stage loss function of the neural network model is:
[0073] in, is the second stage loss function of the neural network model, α 2. β 2 and γ 2 are the second weight hyperparameters of mean square error, mean absolute error and perceptual loss, which can be adjusted according to training needs.
[0074] Finally, the third stage of training is carried out, using the weights learned in the second stage as the initial learning weights. Training is performed using a training data set containing 100% energy coverage. The second stage loss function is calculated based on the weighted loss of mean square error, mean absolute error, and structural similarity loss to improve the prediction accuracy of the network at the structural level. The learning weights of the model are optimized using the AdamW optimizer. The specific calculation formula for the third stage loss function of the neural network model is:
[0075] in, is the third stage loss function of the neural network model, α 3. β 3 and γ 3 are the third weight hyperparameters of mean square error, mean absolute error and structural similarity loss, which can be adjusted according to training needs.
[0076] During each training phase, an appropriate error evaluation metric is used to guide the neural network model to gradually optimize its weights, ensuring that the network effectively learns from the training data at each stage. Throughout the training process, the use of the AdamW optimizer ensures more stable and efficient weight updates. This multi-scale progressive training strategy enables the neural network to gradually learn flow field characteristics at different energy levels, resulting in higher accuracy and robustness in predicting unsteady flow fields.
[0077] S5, predicting unsteady flow fields: Based on the trained neural network model, a recursive feedback mechanism is used to predict unsteady flow fields.
[0078] Specifically, if Figure 4As shown in Figure 1, this step first selects the last n consecutive training data moments from the acquired unsteady flow field data within a given time interval as input. This data reflects the dynamic changes in the flow field over a short period of time. The trained neural network model uses this historical data to predict the flow field distribution at the next moment. In this way, the neural network can accurately predict future flow field conditions based on past flow field information, capturing the changing trends and details of the flow field.
[0079] Once the network predicts the flow field distribution at the next moment, the prediction is recursively fed back into the model as new input data. This recursive feedback mechanism constructs a new flow field state for n consecutive moments, which is then fed back into the neural network for predictions at subsequent moments. The key to this process is that through iterative updates of historical data, the network can continuously adjust its predictions, making subsequent flow field evolution predictions more accurate and stable. The new flow field state obtained from each prediction progresses over time, gradually constructing the evolution trajectory of the flow field at multiple moments in the future, thus forming a continuous flow field prediction sequence.
[0080] This iterative prediction mechanism enables the model to continuously predict the temporal behavior of unsteady flow fields based on existing data, without the need for additional observations. By recursively using the prediction results as input for the next round of predictions, the model can update its understanding of the future evolution of the flow field at each moment, thereby continuously improving prediction accuracy. Recursive prediction methods provide an effective alternative, enabling the network to make dynamic predictions of the flow field based solely on historical data, especially in scenarios where real-time observations are not possible or flow field data is difficult to obtain in real time.
[0081] The above description is merely a preferred embodiment of the present application and is not intended to limit the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application shall be included within the scope of protection of the present application.
Claims
1. A method for predicting unsteady flow fields based on a multi-scale training strategy, characterized in that: include: Obtaining a raw data set: numerically simulating the unsteady flow field around the object to be measured, obtaining raw data at each time step, and mapping the data to an orthogonal grid to form the raw data set of the unsteady flow field; Reconstructing the training data set: decomposing the original data set by using the intrinsic orthogonal decomposition method to obtain a plurality of orthogonal modes, and selecting a corresponding number of the orthogonal modes based on different energy coverages to form a plurality of training data sets with different energy coverages; Constructing a neural network model: Based on a 3D U-Net architecture, a residual module, and an attention module, constructing the neural network model for predicting unsteady flow fields, wherein the 3D U-Net architecture includes an input value, a downsampling module, an upsampling module, and an output value, and the attention module and the residual module are embedded in the downsampling module. Constructing the neural network model includes: Downsampling the input value by the downsampling module to obtain a first output value; Performing feature enhancement on the first output value by the attention module to obtain a second output value; Performing feature extraction on the second output value by the residual module to obtain a third output value; Performing upsampling and feature reconstruction on the third output value by the upsampling module to obtain the output value; Training the neural network model: using a multi-scale progressive training method, first training the neural network model based on the training data set with the minimum energy coverage to obtain the learning weights of the neural network model in the initial stage, then using the learning weights obtained in the previous stage of training as the initial learning weights for the next stage of training, and performing multi-scale training on the neural network model based on the training data set with gradually increasing energy coverage to obtain a trained neural network model; Predicting unsteady flow fields: Based on the trained neural network model, a recursive feedback mechanism is used to predict unsteady flow fields.
2. The method according to claim 1, characterized in that The obtaining of the original data set comprises: Setting the number of simulation time steps and the total time, and performing numerical simulation on the unsteady flow field around the object to be measured using the Reynolds time-averaged method to obtain the raw data at each time step; Spatial interpolation is performed on the original data at each time step to map it into a uniformly distributed orthogonal grid, thereby forming the original data set arranged in time sequence.
3. The method according to claim 1 or 2, characterized in that The reconstructed training data set includes: The snapshot matrix is used to represent the original data set, and the specific expression is: in, X is the original data set, the number of columns of the original data set is equal to the number of time steps of the unsteady flow field, For the n The raw data of time steps, R is the set of real numbers, N is the time step number of the unsteady flow field, W is the number of sampling points in the horizontal direction of the unsteady flow field, H is the number of sampling points in the vertical direction of the unsteady flow field; Based on the original data set, the covariance matrix is calculated. The specific calculation formula is: in, C is the covariance matrix, is the transpose of the original data set; Calculate the eigenvectors and eigenvalues of the covariance matrix. The specific calculation formula is: in, v i is the first covariance matrix i feature vectors, λ i is the first covariance matrix i eigenvalues; orthogonalizing the eigenvectors of the covariance matrix to obtain a plurality of orthogonal modes and an energy contribution rate corresponding to each of the orthogonal modes; Energy levels with different energy coverage rates are set, and corresponding numbers of orthogonal modes are selected based on different energy levels to generate multiple training data with different energy coverage rates at each time step. The specific calculation formula is: in, For the n The raw data of the time step is i The projection coefficients of the orthogonal modes, For the i The orthogonal modes, For the n time steps of the training data, k is the number of the orthogonal modes; The training data of different time steps with different energy coverage are arranged in chronological order to form a plurality of training data sets with different energy coverage, and the specific expression of each training data set is: in, is the training data set.
4. The method according to claim 1 or 2, characterized in that The specific calculation formula for obtaining the second output value by performing feature enhancement on the first output value through the attention module is: in, F c is the second output value, F is the first output value, γ is the scaling factor, Softmax(·) is the normalized exponential function, Q is the query vector, K is the key vector, V is a value vector; The specific calculation formula for extracting features from the second output value by the residual module to obtain the third output value is: in, Y is the third output value, ReLU(·) is the activation function, is the mapping function of the residual connection, is the mapping function for skip connections.
5. The method according to claim 1 or 2, characterized in that Before downsampling the input value, the constructing of the neural network model further includes: normalizing the input value.
6. The method according to claim 1 or 2, characterized in that The training of the neural network model comprises: Selecting an error evaluation index for training the neural network model; Using the training data set with the minimum energy coverage as the input value, calculating the initial stage loss function of the neural network model based on the error evaluation index, and obtaining the learning weight of the initial stage of the neural network model; The learning weights obtained from the previous stage of training are used as the initial learning weights for the next stage of training, and the training data sets with gradually increasing energy coverage are used as the input values in sequence. The loss functions of multiple stages of the neural network model are calculated based on the error evaluation index, and the learning weights of multiple stages of the neural network model are obtained, and finally the trained neural network model is obtained.
7. The method according to claim 6, characterized in that The error evaluation indicators include at least mean square error, mean absolute error, perceptual loss, and structural similarity loss. The loss function includes a weighted loss of at least any two of the mean square error, mean absolute error, perceptual loss, and structural similarity loss. The specific calculation formula of each error evaluation indicator is: in, MAE is the mean square error, MSE is the mean absolute error, L perceptual is the perceptual loss, L SSIM is the structural similarity loss, is the first predicted by the neural network model based on the training data set i The predicted data for the time step, For the i The raw data of the time step, represents the pre-trained network, C l 、 H l and W l The training data set is respectively l After layer feature extraction, the number of channels, feature map height and feature map width of the output feature map are output. is the L2 norm, n is the total length of the sequence, and are the local means of the predicted data and the original data respectively, and are the local variances of the predicted data and the original data respectively, are the covariances of the predicted data and the original data, C 1 and C 2 are the first stabilization factor and the second stabilization factor respectively.
8. The method according to claim 7, characterized in that The loss function of the neural network model includes the weighted loss of the mean square error and the mean absolute error, and the specific calculation formula is: in, is the initial stage loss function of the neural network model, α 1 and β 1 are the first weight hyperparameters of the mean square error and the mean absolute error respectively.
9. The method according to claim 7, characterized in that The loss function of the neural network model includes the weighted loss of the mean square error, the mean absolute error, and the perceptual loss, and the specific calculation formula is: in, is the second stage loss function of the neural network model, α 2. β 2 and γ 2 are the second weight hyperparameters of the mean square error, the mean absolute error and the perceptual loss respectively.
10. The method according to claim 7, characterized in that The loss function of the neural network model includes the weighted loss of the mean square error, the mean absolute error, and the structural similarity loss, and the specific calculation formula is: in, is the third stage loss function of the neural network model, α 3. β 3 and γ 3 are the third weight hyperparameters of the mean square error, the mean absolute error and the structural similarity loss respectively.
Citation Information
Patent Citations
Variable airfoil flow field rapid prediction method suitable for grid topology
CN114065662A
Airfoil profile transonic buffeting flow field rapid prediction method based on deep neural network
CN116306206A
Multi-scale Res2RAFT particle image velocity measurement method based on global attention mechanism optimization
CN119716136A
Unsteady flow field neural network prediction method based on data pool
CN119740626A