High-precision airfoil flow field data generation method and system based on diffusion model
Through a deep learning method based on diffusion model, combined with SA single-equation turbulence model and OpenFOAM solver, noise plus noise and iterative refinement technology are used to solve the difficulty of grid design and long calculation time in high-precision airfoil flow field data generation. The problem is to achieve efficient and accurate airfoil flow field data generation, which improves the generalization ability and computing speed of the model.
Patent Information
- Application Number
- CN202410949216.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-05-30
- Filing Date
- 2024-07-16
- Publication Date
- 2024-11-08
AI Technical Summary
The prior art has problems with grid design and long calculation time when generating high-precision airfoil flow field data, making it difficult to provide detailed information on airflow velocity, pressure distribution and turbulence characteristics around the aircraft efficiently and accurately.
Using a deep learning method based on diffusion model, the conditional distribution is learned through deep neural networks, noise plus noise and iterative refinement technology are used to generate high-precision airfoil flow field data, combined with SA single-equation turbulence model and OpenFOAM solver, and use deformable Convolution, attention mechanisms and residual networks improve data generation accuracy and efficiency.
The calculation efficiency of airfoil flow field data and model generalization ability are significantly improved, the model size is reduced, and the accuracy and operating speed of flow field prediction are improved. Compared with traditional methods, the accuracy and speed are significantly improved.
Smart Images

Figure CN118916984A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of fluid mechanics and deep learning technology, and relates to a method and system for generating high-precision airfoil flow field data based on a diffusion model. Background Art
[0002] The development of aviation technology has promoted the development of global trade and tourism, accelerated the dissemination of information and cultural exchanges, and also played an important role in the fields of national defense and security. High-precision flow field data plays a vital role in the development of aviation technology. In aviation engineering, flow field data can provide detailed information on air flow such as air velocity, pressure distribution, and turbulence characteristics around the aircraft. These data are crucial for optimizing the design of aircraft shape, improving fuel efficiency, improving flight stability, and reducing aerodynamic noise. Therefore, it is a critical issue to efficiently and accurately generate aircraft airfoil flow field data. Nowadays, high-precision airfoil flow field data calculations are usually calculated using traditional fluid mechanics software, which has problems such as difficult grid design and long calculation time.
[0003] Super-resolution reconstruction is a technology that improves image quality through algorithms. Its purpose is to generate images close to or equal to high resolution from existing low-resolution images. Super-resolution reconstruction technology is a feasible solution to the conflict between computational complexity and simulation result accuracy in CFD simulation, that is, by using super-resolution reconstruction technology based on low-precision flow field data to simulate the iterative process of the CFD solver, the error between the high-precision data calculated by super-resolution reconstruction technology and the high-precision data calculated by CFD is small or the same.
[0004] In recent years, the diffusion model has become the most advanced technology in deep generative models. The diffusion model has broken the long-standing dominance of the GAN network in image generation tasks, and has shown potential in various fields, including computer vision, natural language processing, temporal data modeling, multimodal modeling, computational chemistry, and medical image reconstruction and other interdisciplinary applications. The diffusion model belongs to a deep network and has very powerful performance in data feature learning and other aspects. The present invention aims to realize a method for generating high-precision airfoil flow field data through a diffusion model. While improving the calculation speed of high-precision airfoil flow field data, the generalization ability of the model is improved. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide a method and system for generating high-precision airfoil flow field data based on a diffusion model. The scheme applies the diffusion model to the field of airfoil flow field data generation, and uses the powerful feature characterization ability of the diffusion model in the generation of high-precision airfoil flow field data, so as to reduce the calculation time of high-precision airfoil flow field data and improve the generalization ability of the model. Experimental results show that this method can improve the calculation efficiency and generalization ability of airfoil flow field data.
[0006] In order to achieve the above object, the present invention provides the following technical solutions:
[0007] A method for generating high-precision airfoil flow field data based on a diffusion model, the method comprising the following steps:
[0008] S1. Obtaining low-precision airfoil flow field data and high-precision airfoil flow field data datasets Where x represents low-precision airfoil flow field data, and y represents high-precision airfoil flow field data;
[0009] S2, the high-precision airfoil flow field data y0 is converted into pure noise data by T times of noise addition The hidden variable sequence (y1, y2, ..., y T-1 );
[0010] S3. Under the condition of low-precision airfoil flow field data x, use the deep neural network model to learn the conditional distribution p θ (y t-1 |y t ) fitting the noise added in step S2, and training the neural network model by minimizing the noise added in step S2 and the noise predicted by the neural network model;
[0011] S4, using the neural network model trained in step S3, by T The low-precision airfoil flow field data x is iteratively refined to obtain the corresponding high-precision airfoil flow field data y0.
[0012] Furthermore, in step S1, the SA single-equation turbulence model widely used in RANs simulation is used, and the open source CFD solver OpenFOAM is used to solve it; different Cartesian grids are used to collect the computational domain, and airfoil flow field data of different resolutions are generated as low-precision flow field data and high-precision flow field data as training data, respectively, wherein the airfoil flow field data includes the pressure field, horizontal velocity field, and vertical velocity field under specific flow velocity and angle of attack.
[0013] Further, in step S2, it specifically includes:
[0014] S21, in order to enable the model to better extract the data features of the airfoil flow field data set, the high-precision airfoil flow field data y0 is used as the input of the model;
[0015] S22. Define the data noise adding process as a Markov chain. In each step of the Markov chain, the hidden variable y t-1 Add variance to β t Gaussian noise can generate new hidden variables y t , where t = 0 means adding noise to the high-precision airfoil flow field data;
[0016] S23. After T times of noise addition, the original high-precision airfoil flow field data gradually loses its original data characteristics and becomes pure noise data.
[0017] Further, in step S3, it specifically includes:
[0018] S31. The random noise added in step S22 is all Gaussian noise, so it is only necessary to predict the mean and variance of the added noise to achieve the prediction of the noise. First, a conditional distribution is defined to obtain the hidden variable y with noise. t Prediction y t-1 ;
[0019] S32, in order to further improve the accuracy of the airfoil flow field data generation, the low-precision airfoil flow field data x and the latent variable y t Use the input of the deep neural network model to predict the noise at time t;
[0020] S33. Design the structure of the neural network model based on the characteristics of airfoil flow field data, add deformable convolution to improve the model's airfoil feature extraction capability, add attention mechanism to improve the generation accuracy of flow field data, and add residual network to solve the problems of gradient vanishing and gradient exploding in the model;
[0021] S34, training the model by minimizing the difference between the predicted noise of the neural network model and the noise added in step S2.
[0022] Further, in step S4, it specifically includes:
[0023] S41, randomly generate Gaussian noise of the same size as the high-precision airfoil flow field data And y T The low-precision airfoil flow field data x is used as the input of the neural network model;
[0024] S42. Use the trained neural network model to predict the noise at time T to obtain the noise f θ (y T ,x,t);
[0025] S43, deriving through the data noise addition process in step S2 so as to obtain y T Calculate the hidden variable y T-1 ;
[0026] S44. Repeat steps S42-S43 T times to calculate and obtain the final high-precision airfoil flow field data y0.
[0027] The present invention also provides a high-precision airfoil flow field data generation system based on a diffusion model.
[0028] The beneficial effects of the present invention are:
[0029] The technical solution provided by the present invention aims at the problems existing in the prior art. It mainly applies the diffusion model to the field of airfoil flow field data generation, and uses the reinforcement learning algorithm and the improved reward function to search for the pruning rate of each layer of the deep learning model, so as to reduce the model size and improve the solution speed. The experimental results show that the compression algorithm can improve the accuracy and running speed of the flow field prediction model at the same time.
[0030] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:
[0032] Figure 1 It is a framework diagram of a method for generating high-precision airfoil flow field data based on a diffusion model of the present invention;
[0033] Figure 2 This is the network structure diagram for high-precision airfoil flow field data noise prediction based on the diffusion model;
[0034] Figure 3 This is a diagram of the deformable convolution structure in the noise prediction network;
[0035] Figure 4 Visualization of test results of pressure, horizontal and vertical velocity for the high-precision airfoil flow field data generation method based on the diffusion model. DETAILED DESCRIPTION
[0036] The technical solution of the present invention is described in detail below with reference to the accompanying drawings.
[0037] In this embodiment, three concepts are involved:
[0038] 1) Model generalization ability: The generalization ability of a model refers to its ability to perform well on unseen data. A model with good generalization ability can accurately predict or classify different data samples, not just perform well on the training set.
[0039] 2) Diffusion model: Diffusion model is an image processing model based on deep learning, which is usually used for tasks such as image super-resolution reconstruction and image denoising. Its main idea is to reconstruct the image by learning the local features and global structure of the image, thereby achieving high-quality reconstruction of the image.
[0040] 3) Deformable convolution: Deformable convolution is a special convolution operation that allows the convolution kernel to move flexibly on the input feature map to adapt to features at different positions. In traditional convolution operations, the shape and position of the convolution kernel are fixed, while deformable convolution achieves dynamic adjustment by learning the offset of each position on the input feature map.
[0041] The invention provides a method for generating high-precision airfoil flow field data based on a diffusion model, which can realize the conversion of low-precision airfoil flow field data to high-precision airfoil flow field data through learned high-precision airfoil flow field data features. Figure 1 The framework diagram of the method for generating high-precision airfoil flow field data based on the diffusion model of the present invention is as follows: Figure 1 As shown in the first part, the data sets of low-precision airfoil flow field data and high-precision airfoil flow field data are obtained. Where x represents low-precision airfoil flow field data, and y represents high-precision airfoil flow field data. In the second part, the high-precision airfoil flow field data y0 is converted into pure noise data by T times of noise addition. The hidden variable sequence (y1, y2, ..., y T-1 ). In the third part, under the condition of low-precision airfoil flow field data x, a deep neural network model is used to learn the conditional distribution p θ (y t-1 |y t ) Fit the noise added in the second part, and train the neural network model by minimizing the noise added in the second part and the noise predicted by the neural network model. In the fourth part, use the neural network model trained in the third part to fit the random noise y T The low-precision airfoil flow field data x is iteratively refined to obtain the corresponding high-precision airfoil flow field data y0.
[0042] The first part includes one of the following steps:
[0043] Step S11: Use the SA single equation turbulence model widely used in RANs simulation and solve it using the open source CFD solver OpenFOAM. Use different Cartesian grids to collect the computational domain and generate airfoil flow field data of different resolutions as low-precision flow field data and high-precision flow field data as training data. The airfoil flow field data includes the pressure field, horizontal velocity field and vertical velocity field at specific flow velocity and angle of attack.
[0044] Specifically, Reynolds-averaged NS modeling (RANS) is a commonly used method in computational fluid dynamics (CFD) to simulate turbulent flow. The Spalart-Allmaras (SA) turbulence model is a single-equation turbulence model commonly used in computational fluid dynamics (CFD). After obtaining the solution results using OpenFOAM, the computational domain is sampled using 64×64 and 256×256 Cartesian grids to represent low-precision airfoil flow field data x and high-precision airfoil flow field data y, respectively.
[0045] The final dataset is represented as
[0046] The second part includes the following three steps:
[0047] S21: In order to enable the model to better extract data features of the airfoil flow field data set, this embodiment uses high-precision airfoil flow field data y0 as input of the model so that the model can learn.
[0048] S22: The data noise process is defined as a Markov chain. In each step of the Markov chain, the hidden variable y t-1 Add variance to β t Gaussian noise can generate new hidden variables y t . When t = 0, it means adding noise to the high-precision airfoil flow field data. Specifically, in each step of the Markov chain, the hidden variable y t-1 Add variance to β t Gaussian noise can generate new hidden variables y t , as shown below:
[0049]
[0050] in, is the variance used for each time step T. In this embodiment, the closer the high-precision flow field data is to the real one, the smaller the noise level is. Therefore, β1<β2<…<β T .
[0051] S23: After T times of noise addition, the original high-precision airfoil flow field data gradually loses its original data characteristics and becomes pure noise data q(y t |y t-1 ) is a normal distribution, so the present invention converts y0 to y t The process is expressed as the following a posteriori probability:
[0052]
[0053] In order to speed up the training of the model, this embodiment uses the re-parameterization technique to directly adjust the original data y0 to any diffusion step length y t Sampling is performed, and the calculation formula is as shown in formula 3.4:
[0054]
[0055] where α t =1-β t ,
[0056] The third part includes the following four steps:
[0057] Step S31: The random noise added in S22 is Gaussian noise, so it is only necessary to predict the mean and variance of the added noise to achieve the prediction of the noise. First, define a conditional distribution to obtain the hidden variable y with noise t Prediction y t-1 .
[0058] Step S32: In order to further improve the accuracy of the airfoil flow field data generation, the low-precision airfoil flow field data x and the latent variable y t As the input of the deep neural network model, the noise at time t is predicted, so the conditional distribution described in S31 is as follows:
[0059]
[0060] This formula defines a conditional Gaussian distribution for the noisy data y t Prediction y t-1 , where μ θ (y t ,x,t) and Represents the mean and variance predicted by the neural network. The reverse denoising process is also a Markov chain, so the process can be expressed as follows:
[0061]
[0062] in The above formula defines the Gaussian noise y T The process of obtaining high-precision flow field data y0.
[0063] Step S33: Design the structure of the neural network model according to the characteristics of the airfoil flow field data, add deformable convolution to improve the airfoil feature extraction capability of the model, add attention mechanism to improve the generation accuracy of the flow field data, and add residual network to solve the problems of gradient vanishing and gradient exploding of the model.
[0064] Specifically, the basic structure of the neural network is the same as that of U-Net, which consists of two parts: encoding structure and decoding structure. The input of the neural network model is the low-precision airfoil flow field data x and the latent variable y calculated by the model at time t. t , the output is the noise predicted at that moment. In the generation of high-precision airfoil flow field data, T noise prediction models are required. In actual processing, a time embedding layer is added to encode t into the network, so that only one shared model parameter needs to be trained. The time embedding layer uses trigonometric function position encoding. The network model is as follows Figure 2 shown.
[0065] The feature extraction of deformable convolution is divided into the following steps: First, the input data is feature extracted through the traditional convolutional neural network, and the extracted features are convolved again to obtain the deformation offset of the deformable convolution. The offset is twice the size of the convolution kernel, representing the offset in the x and y directions respectively; then the sampling points are generated by calculating the offset, and the sampling points determine the location where the convolution operation is applied on the input feature map; then for each sampling point, bilinear interpolation is performed to obtain the value of the convolution kernel from the input feature map. Finally, the interpolated value is point-multiplied with the deformable convolution kernel to obtain the convolution result at that position. During model training, the convolution kernel parameters used to generate data features and the convolution kernel parameters used to calculate the offset are learned simultaneously through the back-propagation algorithm. The calculation process is as follows: Figure 3 shown.
[0066] S34: Train the model by minimizing the difference between the predicted noise of the neural network model and the noise added in S2. Specifically, in the forward diffusion process, the latent variable y at the tth moment is calculated by the reparameterization technique. t , the noise sampled at this moment is the true value of the noise. The noise predicted by the neural network model is Where θ is the neural network model parameter, so the loss function of the model training can be obtained as shown below:
[0067]
[0068] The value range of t is [1, T].
[0069] The fourth part includes the following steps:
[0070] S41: Randomly generate Gaussian noise of the same size as the high-precision airfoil flow field data And y T The low-precision airfoil flow field data x is used as the input of the neural network model.
[0071] S42: Use the trained neural network model to predict the noise at time T to obtain the noise f θ (y T ,x,t).
[0072] S43: Through the data noise addition process in S2, it can be deduced that y T Calculate the hidden variable y T-1 , the calculation method is as follows:
[0073]
[0074] To increase the randomness in the inference, we additionally add
[0075] S44: Repeat steps S42-S43 T times to calculate the final high-precision airfoil flow field data y0.
[0076] Based on the S1 step, the method generates an airfoil that does not exist in the training data set to test the performance of the model. The accuracy difference between the method of the present invention and other comparison methods is compared from three dimensions: pressure P, horizontal speed U, and vertical speed V. In this embodiment, the mean absolute error MAPE, L1, and L2 are used as the evaluation criteria of the model. The calculation of the mean absolute error is shown in the following formula:
[0077]
[0078] where y p Represents the predicted value, y t Represents the true value.
[0079] In the MAPE experimental results, the darker the color, the smaller the numerical difference between the generated result and the real CFD data, and the whiter the color, the larger the numerical difference. According to the experimental results of pressure, horizontal velocity and vertical velocity, it can be found that in the error visualization results of MAPE, the method of the present invention has almost no white area near the airfoil, indicating that the method can effectively extract the airfoil features in the airfoil flow field data, and compared with other super-resolution methods, the prediction accuracy around the airfoil is significantly higher.
[0080] Table 1 Error comparison results of high-precision airfoil flow field data generation method based on diffusion model and other methods
[0081]
[0082] From the above table, we can find that the high-precision airfoil flow data generated by the technical solution proposed by the present invention has a good average absolute error of L1 and L2 compared with the real CFD data. Compared with the interpolation method and the convolution model, the generation effect of high-precision airfoil flow field data is improved.
[0083] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.
Claims
1. A method for generating high-precision airfoil flow field data based on a diffusion model, characterized in that: The method comprises the following steps: S1. Obtaining low-precision airfoil flow field data and high-precision airfoil flow field data datasets Where x represents low-precision airfoil flow field data, and y represents high-precision airfoil flow field data; S2, the high-precision airfoil flow field data y0 is converted into pure noise data by adding noise T times The hidden variable sequence (y1, y2, ..., y T-1 ); S3. Under the condition of low-precision airfoil flow field data x, use the deep neural network model to learn the conditional distribution p θ (y t-1 |y t ) fitting the noise added in step S2, and training the neural network model by minimizing the noise added in step S2 and the noise predicted by the neural network model; S4, using the neural network model trained in step S3, by T The low-precision airfoil flow field data x is iteratively refined to obtain the corresponding high-precision airfoil flow field data y0.
2. The method for generating high-precision airfoil flow field data based on a diffusion model according to claim 1, characterized in that: In step S1, the SA single-equation turbulence model is used, and the open source CFD solver OpenFOAM is used for solving; different Cartesian grids are used to collect the computational domain, and airfoil flow field data of different resolutions are generated as low-precision flow field data and high-precision flow field data as training data, respectively, wherein the airfoil flow field data includes the pressure field, horizontal velocity field, and vertical velocity field under specific flow velocity and angle of attack.
3. The method for generating high-precision airfoil flow field data based on a diffusion model according to claim 2, characterized in that: In step S2, it specifically includes: S21, using high-precision airfoil flow field data y0 as input of the model; S22. Define the data noise adding process as a Markov chain. In each step of the Markov chain, the hidden variable y t-1 Add variance to β t Gaussian noise can generate new hidden variables y t , where t = 0 means adding noise to the high-precision airfoil flow field data; S23. After T times of noise addition, the original high-precision airfoil flow field data gradually loses its original data characteristics and becomes pure noise data.
4. The method for generating high-precision airfoil flow field data based on a diffusion model according to claim 3 is characterized in that: In step S3, it specifically includes: S31. First, define a conditional distribution to obtain the noisy latent variable y. t Prediction y t-1 ; S32, in order to further improve the accuracy of the airfoil flow field data generation, the low-precision airfoil flow field data x and the latent variable y t Use the input of the deep neural network model to predict the noise at time t; S33. Design the structure of the neural network model based on the characteristics of airfoil flow field data, add deformable convolution to improve the model's airfoil feature extraction capability, add attention mechanism to improve the generation accuracy of flow field data, and add residual network to solve the problems of gradient vanishing and gradient exploding in the model; S34, training the model by minimizing the difference between the predicted noise of the neural network model and the noise added in step S2.
5. The method for generating high-precision airfoil flow field data based on a diffusion model according to claim 4, characterized in that: In step S4, it specifically includes: S41, randomly generate Gaussian noise of the same size as the high-precision airfoil flow field data And y T The low-precision airfoil flow field data x is used as the input of the neural network model; S42. Use the trained neural network model to predict the noise at time T to obtain the noise f θ (y T ,x,t); S43, deriving through the data noise addition process in step S2 so as to obtain y T Calculate the hidden variable y T-1 ; S44. Repeat steps S42-S43 T times to calculate and obtain the final high-precision airfoil flow field data y0.
6. A high-precision airfoil flow field data generation system based on a diffusion model, characterized by: The system adopts the method as claimed in any one of claims 1 to 5.
Citation Information
Cited By
Flow field noise reduction method, system and equipment based on Koltzburg-Landao theory
CN120012624A
