Pressure coefficient prediction method based on VAE-GAN and self-attention mechanism
Through the pressure coefficient prediction method of VAE-GAN and self-attention mechanism, the airfoil geometry, manifold and environmental features are extracted and integrated, which solves the problem of inaccurate prediction of airfoil pressure coefficient in the existing technology and improves the comprehensiveness of prediction. and accuracy, and speeds up the model training process.
Patent Information
- Application Number
- CN202310428156.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-20
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2043-04-20
AI Technical Summary
The existing technology is difficult to accurately predict the wing pressure coefficient, and ignores the coupling relationship between the airfoil environment and shape, resulting in inaccurate aerodynamic performance prediction.
The pressure coefficient prediction method based on VAE-GAN and self-attention mechanism is used to extract the airfoil geometric features, manifold features and environmental features, analyze their mutual influence, and generate airfoil fusion features through the feature fusion network to predict the pressure coefficient. curve.
It improves the comprehensiveness and accuracy of wing pressure coefficient prediction, enhances the convergence speed of model training and the quality of generated data, and makes up for the poor ability of VAE to generate samples.
Smart Images

Figure CN116522769B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of aerodynamics technology, and in particular to a pressure coefficient prediction method based on VAE-GAN and self-attention mechanism. Background Art
[0002] The aerodynamic performance of the wing is an important issue in aircraft design because it directly affects the aircraft's flight performance, maneuverability and stability. The pressure coefficient is a typical aerodynamic coefficient that describes the relative pressure on the wing surface. Accurate prediction of the pressure coefficient is of great significance to aircraft design.
[0003] Among them, the geometric shape of the airfoil greatly affects the aerodynamic performance of the wing. Usually, a set of airfoil geometric parameters are used to characterize the geometric shape of the airfoil, such as chord length, thickness, etc. However, whether it is manually designed parameters or polynomial characterization parameters, they can only approximately characterize the airfoil geometry, which is an urgent problem to be solved. At the same time, most aerodynamic performance studies ignore the influence of the coupling relationship between the airfoil environment and the airfoil shape on the aerodynamic performance, and simply analyze the relationship between the airfoil shape and aerodynamic performance, making the results inaccurate. Therefore, how to balance the influence of the airfoil shape and the airfoil environment on the aerodynamic prediction results is also one of the issues we study.
[0004] With the advent of the information age, data has exploded, giving rise to many excellent data analysis methods, and deep learning is the most shining new star among them. Deep learning, or DNN, designs multi-layer neural networks, continuously deepens and broadens the neurons in each layer, and can theoretically map to any function to solve very complex problems. It performs very well in areas such as image recognition and facial recognition. Similarly, in the fields of fluid mechanics and aerodynamics such as aircraft aerodynamic performance analysis and flow field prediction, deep learning has also shown amazing potential. Using deep learning for feature extraction and feature fusion is a common method for fluid mechanics analysis. However, how to design a method that can realize the feature extraction of airfoils and the prediction of pressure coefficient curves based on deep learning methods is a technical problem that needs to be solved urgently. Summary of the invention
[0005] In view of the above-mentioned deficiencies in the prior art, the technical problem to be solved by the present invention is: how to provide a pressure coefficient prediction method based on VAE-GAN and self-attention mechanism, which can extract multiple dimensional features such as airfoil geometric features, manifold features and environmental features, and can analyze the mutual influence and correlation between different features, and then better integrate the relationship between different features, so as to improve the comprehensiveness and accuracy of the wing pressure coefficient prediction, and provide a new idea for the aerodynamic prediction of the wing.
[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0007] The pressure coefficient prediction method based on VAE-GAN and self-attention mechanism is characterized by including:
[0008] S1: Obtain the two-dimensional coordinates of the airfoil to be predicted;
[0009] S2: Input the two-dimensional coordinates of the airfoil to be predicted into the trained pressure prediction model, and output the corresponding predicted pressure coefficient curve;
[0010] The pressure prediction model is built based on the VAE-GAN network;
[0011] During training, the two-dimensional coordinates of the airfoil and the true pressure coefficient curve used as training samples are used as the model input of the pressure prediction model: first, the encoder of the VAE extracts the corresponding airfoil geometric features, airfoil manifold features and airfoil environmental features based on the two-dimensional coordinates of the airfoil, and analyzes the mutual influence between the airfoil geometric features, airfoil manifold features and airfoil environmental features through the self-attention module, and then fuses the self-attention features output by the self-attention module through the feature fusion network to generate the corresponding airfoil fusion features; then, the decoder of the VAE generates the corresponding predicted pressure coefficient curve and the false pressure coefficient curve based on the airfoil fusion features and the set random noise respectively; finally, the discriminator of the GAN calculates the corresponding loss function based on the true pressure coefficient curve combined with the generated predicted pressure coefficient curve and the false pressure coefficient curve, and then updates the network parameters of the pressure prediction model based on the loss function until the model converges;
[0012] S3: Using the predicted pressure coefficient curve output by the pressure prediction model as the corresponding pressure coefficient prediction result.
[0013] Preferably, in step S2, the two-dimensional coordinates of the airfoil are encoded by a convolutional neural network, the corresponding airfoil geometric features are extracted, and the airfoil geometric features are converted into data of preset dimensions.
[0014] Preferably, in step S2, the Riemann metric and curvature of the two-dimensional coordinates of the airfoil are first extracted through the Bezier curve as the corresponding airfoil manifold features; then the airfoil manifold features are encoded through a fully connected neural network to convert the airfoil manifold features into data of preset dimensions.
[0015] Preferably, the two-dimensional coordinates of the airfoil are expressed as a plurality of polynomials using Bezier curves, and the inner product of two perpendicular vectors is calculated from the tangent space of each polynomial, thereby extracting the corresponding Riemann metric;
[0016] The formula is described as follows:
[0017]
[0018]
[0019]
[0020] Where: g vw (t) represents the Riemann metric of the airfoil at position t; represents the direction of the partial derivative; represents the partial derivative of each Bezier curve with respect to parameter t; r(D; t) represents the function of the Bezier curve; P i represents the airfoil coordinates; D represents the sample space where the airfoil coordinates are located; t represents the parameter of the Bezier curve; n represents the order of the Bezier curve;
[0021] The curvature is calculated using the following formula:
[0022]
[0023] Wherein: C represents the curvature; R represents the radius of curvature, that is, the inverse of the curvature; y′ represents the first-order derivative of the airfoil ordinate y; y″ represents the second-order derivative of the airfoil ordinate y.
[0024] Preferably, in step S2, the airfoil environmental characteristics include Mach number, airfoil angle of attack and Reynolds number; the airfoil environmental characteristics are encoded by a fully connected neural network to convert the airfoil environmental characteristics into data of preset dimensions.
[0025] Preferably, in step S2, the working logic of the self-attention module is as follows:
[0026] S201: extracting the airfoil geometry features, airfoil manifold features and airfoil environment features through a neural network as input vectors of a self-attention module;
[0027] S202: For each input vector a i , multiplied by the three coefficients w q 、w k 、w v ;
[0028] The formula is described as follows:
[0029] q i =w q ·a i
[0030] k i =w k ·a i ;
[0031] v i =w v ·a i
[0032] Where: q, k, v represent query, key and value respectively;
[0033] S203: Calculate the correlation between the two input vectors through q and k, that is, calculate the Attention value α, and the matrix composed of all α is represented as the correlation matrix A;
[0034] The formula is described as follows:
[0035]
[0036] α i,j =q i ·k j ;
[0037] S204: Perform a softmax operation or a relu operation on the correlation matrix A to obtain a corresponding relationship matrix A′;
[0038] S205: Calculate each input vector a through the relationship matrix A′ i The output vector b of the self-attention layer i , as the self-attention feature of the corresponding input vector, i.e., the corresponding feature;
[0039] The formula is described as follows:
[0040]
[0041] Where: b i Represents the input vector a i The self-attention feature that considers the mutual influence of all input vectors; i =w v ·a i , represents the product of the input vector and the weight matrix; α′ i,j Represents the elements in the relationship matrix A′.
[0042] Preferably, in step S2, the encoder and decoder of VAE are represented by the following formula:
[0043] z~Enc(x)=q(z|x),
[0044] Where: Enc(x) represents the encoder, x is its input; z represents the output of the encoder; q(z|x) represents the distribution of the encoder output; Dec(z) represents the decoder, z is its input; represents the output of the decoder; represents the distribution of the decoder output.
[0045] Preferably, in step S2, the loss function of VAE is expressed by the following formula:
[0046] L VAE =L recon +L prior ;
[0047]
[0048] L prior =D KL (q(z|x)||p(z));
[0049] Where: L VAE Represents the loss of VAE; L recon Represents the predicted pressure coefficient curve The difference between the actual pressure coefficient curve; L prior represents KL divergence; D KL (q(z|x)||p(z)) represents the KL divergence, which is used to calculate the difference between the distributions of q(z|x) and p(z); q(z|x) represents the distribution of the encoder output; p(z) specifies that the hidden variable z belongs to a Gaussian distribution.
[0050] Preferably, in step S2, the loss function of GAN is expressed by the following formula:
[0051]
[0052] Where: represents the loss of GAN; D(x) represents the input of real data x into the discriminator of GAN; Represents the random noise that will pass through the decoder Input to the GAN’s discriminator; It means that the hidden variable z passed through the decoder is input to the discriminator of GAN.
[0053] Preferably, in step S2, the model loss function of the pressure prediction model is expressed by the following formula:
[0054] L=λ0L layer +λ1L GAN +λ2L recon +λ3L prior ;
[0055]
[0056] Where: L represents the model loss of the pressure prediction model; L recon Represents the predicted pressure coefficient curve The difference between the actual pressure coefficient curve; L prior represents KL divergence; L GAN represents the loss of GAN; L layerrepresents boundary loss; D l (x) and They respectively represent the outputs of a certain layer of neural network in the discriminator; λ0, λ1, λ2, and λ3 represent the weight parameters of each loss function for the overall prediction result.
[0057] Compared with the prior art, the pressure coefficient prediction method based on VAE-GAN and self-attention mechanism in the present invention has the following beneficial effects:
[0058] The pressure prediction model of the present invention extracts airfoil geometry features, airfoil manifold features and airfoil environment features, and after analyzing the mutual influence relationship between airfoil geometry features, manifold features and environment features through a self-attention module, the airfoil fusion features are generated through a feature fusion network. On the one hand, the present invention can extract multiple dimensional features such as airfoil geometry features, manifold features and environment features to fuse and generate airfoil fusion features, and can more comprehensively mine the hidden features of the airfoil, thereby improving the comprehensiveness of the prediction of the wing pressure coefficient; on the other hand, the present invention combines the self-attention mechanism and the feature fusion network, so that the pressure prediction model can analyze the mutual influence and correlation between different features, and better fuse the mutual relationship between different features, thereby improving the accuracy of the prediction of the wing pressure coefficient, and at the same time, the self-attention mechanism can accelerate the convergence speed of the model training and reduce the amount of calculation.
[0059] The present invention constructs a pressure prediction model based on the VAE-GAN network, which can effectively combine the deep learning model VAE-GAN with fluid mechanics and aerodynamics, so as to better explore the hidden features of the airfoil to achieve accurate prediction of the airfoil pressure coefficient curve; and, by introducing the GAN discriminator to compensate for the poor sample generation ability of VAE, the convergence speed of the pressure prediction model and the quality of generated data can be improved.
[0060] When training the pressure prediction model, the present invention calculates the loss function by combining the real pressure coefficient curve with the generated predicted pressure coefficient curve and the false pressure coefficient curve, so that the influence of real samples, reconstructed samples and false samples can be considered simultaneously during the training process, thereby further improving the training effect and performance of the pressure prediction model. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to make the purpose, technical solution and advantages of the invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings, in which:
[0062] Figure 1 It is a framework diagram of the pressure coefficient prediction method and the pressure prediction model;
[0063] Figure 2It is a logic block diagram of the pressure coefficient prediction method and the pressure prediction model;
[0064] Figure 3 The two-dimensional image of the airfoil is reconstructed after extracting the airfoil manifold features;
[0065] Figure 4 This is the logic block diagram of the self-attention module and feature fusion network;
[0066] Figure 5 This is a simplified diagram of the VAE-GAN network structure. DETAILED DESCRIPTION
[0067] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but only represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the scope of protection of the present invention.
[0068] It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. In the description of the present invention, it should be noted that the orientation or position relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside", etc. is based on the orientation or position relationship shown in the drawings, or the orientation or position relationship in which the invention product is usually placed when used, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance. In addition, the terms "horizontal", "vertical", etc. do not mean that the components are required to be absolutely horizontal or suspended, but can be slightly tilted. For example, "horizontal" only means that its direction is more horizontal than "vertical", and does not mean that the structure must be completely horizontal, but can be slightly tilted. In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0069] The following is a further detailed description through specific implementation methods:
[0070] Example:
[0071] In order to better introduce the technical solution of this patent application, the following concepts are first introduced:
[0072] 1) Riemann metric: A Riemann metric g on M is a metric from Equivalently, giving the Riemannian metric g is equivalent to the tangent space T at each point p. p Specify an inner product g on M p , a differentiable manifold that specifies a Riemannian metric is called a Riemannian manifold.
[0073] 2) Curvature: The curvature of a curve is the rate of rotation of the tangent direction angle at a point on the curve to the arc length. It is defined by differentiation and indicates the degree to which the curve deviates from a straight line. Mathematically, it is a numerical value that indicates the degree of curvature of the curve at a certain point.
[0074] 3) Airfoil geometric characteristics: refers to the chord length, thickness, etc. of the airfoil in Euclidean space.
[0075] 4) Pressure coefficient: The pressure coefficient is a dimensionless number that describes the relative pressure throughout the flow field in fluid dynamics. The pressure coefficient is applied to aerodynamics and fluid mechanics. The pressure coefficient is different at each point in the fluid flow field.
[0076] 5) VAE-GAN: VAE (Variational Auto-Encoder) refers to the encoder-decoder architecture. This patent mainly uses the encoder part of VAE, and the decoder part is equivalent to the generator of the GAN (Generative Adversarial Nets) network; GAN refers to the generator and the discriminator, where the generator generates false data, and the discriminator distinguishes between false data and real data, and the two compete with each other to achieve the purpose of model convergence.
[0077] 6) Self-attention mechanism: Without considering the time dimension, the self-attention mechanism mainly solves the correlation problem between different parts of the input, and solves this problem through key, value, and query.
[0078] 7) CNN: Convolutional neural network is a type of feedforward neural network with deep structure and convolutional calculation, and is one of the representative algorithms of deep learning. Convolutional neural network has the ability of representation learning and can classify input information in a translation-invariant manner according to its hierarchical structure, so it is also called "translation-invariant artificial neural network".
[0079] This embodiment discloses a pressure coefficient prediction method based on VAE-GAN and self-attention mechanism.
[0080] The pressure coefficient prediction method based on VAE-GAN and self-attention mechanism includes:
[0081] S1: Obtain the two-dimensional coordinates of the airfoil to be predicted;
[0082] S2: Input the two-dimensional coordinates of the airfoil to be predicted into the trained pressure prediction model, and output the corresponding predicted pressure coefficient curve;
[0083] The pressure prediction model is built based on the VAE-GAN network; combined with Figure 1 As shown in the figure, the pressure prediction model mainly includes three parts: airfoil feature extraction, feature fusion and pressure coefficient curve prediction.
[0084] Combination Figure 2As shown in the figure, during training, the two-dimensional coordinates of the airfoil and the true pressure coefficient curve used as training samples are used as the model input of the pressure prediction model: first, the encoder of the VAE extracts the corresponding airfoil geometric features, airfoil manifold features and airfoil environmental features based on the two-dimensional coordinates of the airfoil, and analyzes the mutual influence between the airfoil geometric features, airfoil manifold features and airfoil environmental features through the self-attention module, and then fuses the self-attention features output by the self-attention module through the feature fusion network to generate the corresponding airfoil fusion features; then, the decoder of the VAE generates the corresponding predicted pressure coefficient curve and the false pressure coefficient curve based on the airfoil fusion features and the set random noise respectively; finally, the discriminator of the GAN calculates the corresponding loss function based on the true pressure coefficient curve combined with the generated predicted pressure coefficient curve and the false pressure coefficient curve, and then updates the network parameters of the pressure prediction model based on the loss function until the model converges;
[0085] S3: Using the predicted pressure coefficient curve output by the pressure prediction model as the corresponding pressure coefficient prediction result.
[0086] The pressure prediction model of the present invention extracts airfoil geometry features, airfoil manifold features and airfoil environment features, and after analyzing the mutual influence relationship between airfoil geometry features, manifold features and environment features through a self-attention module, the airfoil fusion features are generated through a feature fusion network. On the one hand, the present invention can extract multiple dimensional features such as airfoil geometry features, manifold features and environment features to fuse and generate airfoil fusion features, and can more comprehensively mine the hidden features of the airfoil, thereby improving the comprehensiveness of the prediction of the wing pressure coefficient; on the other hand, the present invention combines the self-attention mechanism and the feature fusion network, so that the pressure prediction model can analyze the mutual influence and correlation between different features, and better fuse the mutual relationship between different features, thereby improving the accuracy of the prediction of the wing pressure coefficient, and at the same time, the self-attention mechanism can accelerate the convergence speed of the model training and reduce the amount of calculation.
[0087] The present invention constructs a pressure prediction model based on the VAE-GAN network, which can effectively combine the deep learning model VAE-GAN with fluid mechanics and aerodynamics, so as to better explore the hidden features of the airfoil to achieve accurate prediction of the airfoil pressure coefficient curve; and, by introducing the GAN discriminator to compensate for the poor sample generation ability of VAE, the convergence speed of the pressure prediction model and the quality of generated data can be improved.
[0088] When training the pressure prediction model, the present invention calculates the loss function by combining the real pressure coefficient curve with the generated predicted pressure coefficient curve and the false pressure coefficient curve, so that the influence of real samples, reconstructed samples and false samples can be considered simultaneously during the training process, thereby further improving the training effect and performance of the pressure prediction model.
[0089] During the specific implementation process, the two-dimensional coordinates of the airfoil are encoded through a convolutional neural network (CNN), the corresponding airfoil geometric features are extracted, and the airfoil geometric features are converted into data of preset dimensions.
[0090] In this embodiment, the airfoil geometric features include the airfoil chord length, thickness, etc.
[0091] The two-dimensional coordinates of the airfoil come from the UIUC airfoil database. After data processing, there are about 1,000 airfoils that can be used. After each airfoil is processed by the Bêzier curve, 192 two-dimensional coordinate points are taken to represent the geometric shape of each airfoil, that is, the input feature size of CNN is 192*2*1. The CNN encoding of airfoil geometry features consists of multiple convolutional layers and multiple fully connected layers. Each convolutional layer is followed by a BN layer, a Relu function, and a dropout function. The kernel size of all convolutional layers is set to 4*2, and the size of the last layer is 512-dimensional data, so 512-dimensional data is used to represent the airfoil geometry features.
[0092] The present invention encodes the two-dimensional coordinates of the airfoil through CNN, and then extracts the geometric features of the airfoil. CNN is very prominent in image processing, feature extraction, dimensionality reduction, etc., and can ensure the extraction effect of the geometric features of the airfoil.
[0093] In the specific implementation process, the Bezier curve (hereinafter referred to as Curve) extracts the Riemannian metric and curvature of the two-dimensional coordinates of the airfoil as the corresponding airfoil manifold features; then the airfoil manifold features are encoded through a fully connected neural network to convert the airfoil manifold features into data of a preset dimension.
[0094] In this embodiment, the Bezier curve is Curves are a way of representing curves in parametric form. The shape of a Bezier curve is completely determined by its control points. n control points correspond to a Bezier curve of order n-1, and can be drawn recursively. A fully connected neural network is used to encode the generated Riemannian metric and curvature, and the result is used as the input of the self-attention module and the feature fusion network. The Riemannian metric and curvature consist of 192-dimensional data, and each feature is expanded to 512-dimensional data through a fully connected network.
[0095] Specific:
[0096] The two-dimensional coordinates of the airfoil are represented as multiple polynomials using Bezier curves, and the inner product of two perpendicular vectors is calculated from the tangent space of each polynomial to extract the corresponding Riemann metric.
[0097] Given a two-dimensional airfoil coordinate set D = {P i =(xi ,y i )|i=1,2,…,M}, M represents the number of coordinate points, P represents the coordinate point, (x i ,y i ) represents the horizontal and vertical coordinates. According to the actual coordinate set, D consists of 192 two-dimensional coordinates. A 3-degree curve.
[0098] The formula is described as follows:
[0099]
[0100] In this formula, n is 3, which means 3 degrees The curve is represented by 4 points. The two-dimensional airfoil is composed of 192 points, that is, 192 / 4 = 48 segments of 3 degrees. The corresponding polynomial can be obtained by adding the curves;
[0101]
[0102] This formula is the calculation formula for the inner product;
[0103] According to the constructed 3 degrees The curve can be represented by four points as a smooth curve, so the entire two-dimensional airfoil coordinate set can be represented by multiple 3-degree The curvilinear combination represents the entire airfoil, so that The airfoil curve is sensed by the control parameter t in the curve, and the Riemann metric at each t can be easily calculated. The calculation formula is as follows:
[0104]
[0105] Where: g vw (t) represents the Riemann metric of the airfoil at position t; represents the direction of the partial derivative; represents the partial derivative of each Bezier curve with respect to parameter t; r(D; t) represents the function of the Bezier curve; P i represents the airfoil coordinates; D represents the sample space where the airfoil coordinates are located; t represents the parameter of the Bezier curve; n represents the order of the Bezier curve;
[0106] Since r(D; t) is a one-dimensional manifold, v = w, that is
[0107] g vv (t), g ww (t) represents the Riemann metric of the two-dimensional airfoil in different directions in the manifold space. Since it is an analysis of a two-dimensional airfoil, the two directions are consistent and the solid phases are the same.
[0108] Riemannian metric g vw (t) represents the tangent space of r(D; t) The inner product of the two perpendicular vectors in the inner product can be regarded as the basis of any vector in the tangent space of r(D; t). Therefore, we choose g vw (t) is the geometric feature representing the tangent space characteristics of the airfoil curve, g vw (t) That is, the Riemann metric is based on the number of points, and each airfoil has 192 Riemann metrics to represent it.
[0109] The curvature is calculated using the following formula:
[0110]
[0111] In the formula: C represents curvature; R represents the radius of curvature, that is, the inverse of curvature; y′ represents the first-order derivative of the airfoil ordinate y; y″ represents the second-order derivative of the airfoil ordinate y; y″′ represents the third-order derivative of the airfoil ordinate y, where each coordinate point can take a curvature, so each airfoil has 192 curvatures that can be represented.
[0112] Combination Figure 3 As shown in the figure, the airfoil synthesized by adding the Riemann metric and curvature characteristics is smoother, only a small number of airfoils have errors, and the newly generated airfoil has better aerodynamic characteristics.
[0113] The present invention extracts the Riemann metric, curvature and other characteristics of the airfoil through the Bezier curve, so that the model can better characterize the geometric shape of the airfoil, thereby helping to improve the accuracy of the prediction of the wing pressure coefficient.
[0114] In the specific implementation process, the airfoil environmental features include Mach number, airfoil angle of attack and Reynolds number; the airfoil environmental features are encoded through a fully connected neural network to convert the airfoil environmental features into data of preset dimensions. The airfoil environmental features are encoded using a fully connected neural network to expand low-dimensional data into high-dimensional data, and the results are used as inputs for the self-attention module and feature fusion network.
[0115] In this embodiment, under real conditions, the value range of Mach number is Ma∈{0.1, 0.2, 0.3, 0.4, 0.5, 0.6}, the value range of airfoil angle of attack is AOA∈[-10°, 10°], and the value range of Reynolds number is Re∈{1e6, 6e6, 1e7}. The fully connected network encoding environmental features inputs data of three dimensions: Mach number, angle of attack, and Reynolds number, and expands the environmental feature data to 512-dimensional data.
[0116] The present invention better characterizes the environmental characteristics of the airfoil through the Mach number, the airfoil angle of attack and the Reynolds number, thereby being able to assist in improving the accuracy of the prediction of the wing pressure coefficient.
[0117] During the specific implementation process, the self-attention module calculates the relationship between different input features through the self-attention mechanism and integrates the self-attention mechanism with the fully connected network. Its main purpose is to make the network pay attention to the correlation between different parts of the entire input, so that the network can converge faster, reduce the amount of calculation and increase the accuracy of the model.
[0118] The input of the self-attention module is the airfoil geometry feature, Riemann feature, curvature and environmental feature. Let each feature be assumed to be a i , each feature is resized to keep it as a 512-dimensional data size as the input of the self-attention module. Figure 4 As shown in Figure 2, the working logic of the self-attention module is as follows:
[0119] S201: extracting the airfoil geometry features, airfoil manifold features and airfoil environment features through a neural network as input vectors of a self-attention module;
[0120] S202: For each input vector a i , multiplied by the three coefficients w q 、w k 、w v ;
[0121] The formula is described as follows:
[0122] q i =w q ·a i
[0123] k i =w k ·a i ;
[0124] v i =w v ·a i
[0125] Where: q, k, v represent query, key and value respectively;
[0126] S203: Calculate the correlation between the two input vectors through q and k, that is, calculate the Attention value α, and the matrix composed of all α is represented as the correlation matrix A;
[0127] The formula is described as follows:
[0128]
[0129] α i,j =q i ·k j ; The vector form is A = KT Q, each value in the matrix A records the attention size α of the corresponding two input vectors; K T Indicates k i =w k ·a i The set transpose of i =w q ·a i A collection of;
[0130] S204: Perform a softmax operation or a relu operation on the correlation matrix A to obtain a corresponding relationship matrix A′;
[0131] S205: Through the relationship matrix A ′ and V calculates for each input vector a i The output vector b of the self-attention layer i , as the self-attention feature of the corresponding input vector, i.e., the corresponding feature;
[0132] The formula is described as follows:
[0133] The corresponding vector form is O = V·A′;
[0134] Where: b i Represents the input vector a i The self-attention feature that considers the mutual influence of all input vectors; i =w v ·a i , represents the product of the input vector and the weight matrix; O is the combination of the output matrix of the self-attention module, which is composed of b i Composition; V represents v i A′ represents α′ i,j A collection of .
[0135] The purpose of introducing the self-attention module: The inputs received by the neural network are many vectors of different sizes, and there is a certain relationship between different vectors. However, in actual training, the relationship between these inputs cannot be fully utilized, resulting in extremely poor model training results. The problem that the fully connected neural network cannot establish correlation for multiple related inputs is solved by the self-attention mechanism. The self-attention mechanism actually allows the machine to notice the correlation between different parts of the entire input.
[0136] The working logic of the self-attention module is: for a set of vectors A with an input length of N, each input vector is represented by a i After self-attention, a set of vectors B with length N is output, and each output vector is represented by b i, that is, any output vector b i All input vectors a are considered i This is obtained through the mutual influence of.
[0137] In the specific implementation process, the feature fusion network is a fully connected network.
[0138] The self-attention features (i.e., airfoil geometry features, airfoil manifold features, and airfoil environment features) obtained through the self-attention module are used as the input of the feature fusion network, and the input features are compressed to a lower dimension through the fusion network as the input of the subsequent GAN network. Among them, the feature fusion network inputs 4 512-dimensional feature data. After the feature data passes through the feature fusion network, the output is a 256-dimensional airfoil fusion feature, which highly condenses the airfoil geometry, manifold, and environmental feature data as the input data of the GAN network.
[0139] The present invention combines the self-attention mechanism and the feature fusion network, so that the pressure prediction model can analyze the mutual influence and correlation between different features and better integrate the mutual relationship between different features, thereby further improving the accuracy of wing pressure coefficient prediction. At the same time, the self-attention mechanism can accelerate the convergence speed of model training and reduce the amount of calculation.
[0140] In the specific implementation process, the predicted pressure coefficient curve is generated through the decoder of VAE (i.e. the generator of GAN). The real data of the pressure coefficient curve of the airfoil is set as x, which is used as the input of the discriminator. The fusion network composed of the self-attention mechanism obtains the input z of the generator, and the decoder composed of the deconvolution network obtains the newly generated pressure coefficient curve As the input of the discriminator. Set the random noise And generate a fake pressure coefficient curve, which is also used as the input of the discriminator. The encoder is composed of deconvolution layers, such as Figure 5 As shown, the output is the predicted pressure coefficient curve and the false pressure coefficient curve data.
[0141] The discriminator D discriminates the predicted pressure coefficient curve and the real pressure coefficient curve. According to the predicted pressure coefficient curve and the false pressure coefficient curve, the real pressure coefficient curve is input into the discriminator at the same time, and the difference between the two is calculated respectively. The purpose of the discriminator is to identify the data generated by the generator as false as much as possible.
[0142] First, the encoder and decoder of VAE are expressed by the following formula:
[0143]
[0144] Where: Enc(x) represents the encoder, x is its input; z represents the output of the encoder; q(z|x) represents the distribution of the encoder output; Dec(z) represents the decoder, z is its input; represents the output of the decoder; represents the distribution of the decoder output.
[0145] The loss function of VAE is expressed by the following formula:
[0146] L VAE =L recon +L prior ;
[0147]
[0148] L prior =D KL (q(z|x)||p(z));
[0149] Where: L VAE Represents the loss of VAE; L recon Represents the predicted pressure coefficient curve The difference between the actual pressure coefficient curve and the mean square error (MSE) is compared; L prior represents the KL divergence, which is used to measure the difference between the encoding representation vector and the Gaussian distribution; D KL (q(z|x)||p(z)) represents the KL divergence, which is used to calculate the difference between the distributions of q(z|x) and p(z); q(z|x) represents the distribution of the encoder output; p(z) specifies that the hidden variable z belongs to a Gaussian distribution, i.e., D KL (q(z|x)||p(z)) also means that q(z|x) is fitted to the Gaussian distribution p(z).
[0150] In the specific implementation process, due to the poor ability of VAE to generate samples, the GAN discriminator is introduced to accelerate the convergence of the model and improve the quality of the data generated by the model. The generator (i.e., the encoder) attempts to generate false data to fool the discriminator D, while the discriminator D continuously sharpens its decision boundary to determine the synthetic false samples from the real samples. Its maximum-minimum game cross entropy loss function is as follows:
[0151]
[0152] GAN generates samples purely from random noise, and it is difficult to obtain an explicit mapping from the data domain to the feature domain. Therefore, we built a pressure prediction model based on VAE-GAN. That is, Figure 2 As shown, the generator is replaced by the encoder-decoder structure of VAE. Note that in VAE-GAN, the model generates a reconstruction sample (i.e., the predicted pressure coefficient curve) Given a real sample x, generate a fake sample at the same time (i.e., false pressure coefficient curve), which comes directly from random noise Reconstruction sample and fake samples Should be classified as fake by the discriminator D, only x is considered true by the discriminator, so the GAN loss function can be modified as follows:
[0153]
[0154] Where: represents the loss of GAN; D(x) represents the input of real data x into the discriminator of GAN; Represents the random noise (Gaussian distribution variable) that will pass through the decoder Input to the GAN’s discriminator; It means that the airfoil fusion feature (hidden variable) z (z = Enc (x), Dec is the decoder, expressed as the airfoil fusion feature z after the decoder) is input into the discriminator of GAN; represents a false pressure coefficient curve; Dec(Enc(x)) represents the reconstructed pressure coefficient curve after the real pressure coefficient curve passes through the encoder and then through the decoder. The difference is that the former is the data of the real pressure coefficient curve reconstructed by the encoder and the decoder, and the latter (i.e. ) Random data obtained only through Gaussian distribution, and a false pressure coefficient curve generated by the decoder.
[0155] In addition, in order to stabilize the training process and sharpen the decision boundary of the discriminator D, the loss function L is introduced layer :
[0156]
[0157] In summary, the model loss function of the pressure prediction model is expressed by the following formula:
[0158] L=λ0L layer +λ1L GAN +λ2L recon +λ3L prior ;
[0159]
[0160] Where: L represents the model loss of the pressure prediction model; L recon Represents the predicted pressure coefficient curve The difference between the actual pressure coefficient curve; L prior represents KL divergence; L GANrepresents the loss of GAN; L layer represents the boundary loss, L layer Indicates that a certain layer of neural network in the GAN network consists of x and When used as input, their distance is calculated, the purpose of which is to stabilize the training process and sharpen the decision boundary of the discriminator; D l (x) and They represent the output of a certain layer of neural network in the discriminator (the discriminator D has only one network, which consists of many layers. The real data x and Both serve as inputs to the discriminator. The structures of the two inputs in the corresponding layer are consistent, but their physical meanings are different, so they can be diverged to make the model more accurate); λ0, λ1, λ2, and λ3 represent the weight parameters of each loss function for the overall prediction result.
[0161] When training the pressure prediction model, the present invention calculates the loss function by combining the real pressure coefficient curve with the generated predicted pressure coefficient curve and the false pressure coefficient curve, so that the influence of real samples, reconstructed samples and false samples can be considered simultaneously during the training process, thereby further improving the training effect and performance of the pressure prediction model.
[0162] 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 the technical solution. Those skilled in the art should understand that those modifications or equivalent substitutions of the technical solution of the present invention that do not depart from the purpose and scope of the technical solution should be included in the scope of the claims of the present invention.
Claims
1. Pressure coefficient prediction method based on VAE-GAN and self-attention mechanism, It is characterized in that include: S1: Obtain the two-dimensional coordinates of the airfoil to be predicted; S2: Input the two-dimensional coordinates of the airfoil to be predicted into the trained pressure prediction model, and output the corresponding predicted pressure coefficient curve; The pressure prediction model is built based on the VAE-GAN network; During training, the two-dimensional coordinates of the airfoil and the true pressure coefficient curve used as training samples are used as the model input of the pressure prediction model: first, the encoder of the VAE extracts the corresponding airfoil geometric features, airfoil manifold features and airfoil environmental features based on the two-dimensional coordinates of the airfoil, and analyzes the mutual influence between the airfoil geometric features, airfoil manifold features and airfoil environmental features through the self-attention module, and then fuses the self-attention features output by the self-attention module through the feature fusion network to generate the corresponding airfoil fusion features; then, the decoder of the VAE generates the corresponding predicted pressure coefficient curve and the false pressure coefficient curve based on the airfoil fusion features and the set random noise respectively; finally, the discriminator of the GAN calculates the corresponding loss function based on the true pressure coefficient curve combined with the generated predicted pressure coefficient curve and the false pressure coefficient curve, and then updates the network parameters of the pressure prediction model based on the loss function until the model converges; In step S2, the Riemann metric and curvature of the two-dimensional coordinates of the airfoil are firstly extracted through the Bezier curve as the corresponding airfoil manifold features; Then, the airfoil manifold features are encoded through a fully connected neural network to convert the airfoil manifold features into data of a preset dimension; The two-dimensional coordinates of the airfoil are represented as multiple polynomials using Bezier curves, and the inner product of two perpendicular vectors is calculated from the tangent space of each polynomial to extract the corresponding Riemann metric. The formula is described as follows: Where: g vw (t) represents the Riemann metric of the airfoil at position t; represents the direction of the partial derivative; represents the partial derivative of each Bezier curve with respect to parameter t; r(D; t) represents the function of the Bezier curve; P i represents the airfoil coordinates; D represents the sample space where the airfoil coordinates are located; t represents the parameter of the Bezier curve; n represents the order of the Bezier curve; The curvature is calculated using the following formula: Where: C represents the curvature; R represents the radius of curvature, that is, the inverse of the curvature; y′ represents the first-order derivative of the airfoil ordinate y; y″ represents the second-order derivative of the airfoil ordinate y; In step S2, the working logic of the self-attention module is as follows: S201: extracting the airfoil geometry features, airfoil manifold features and airfoil environment features through a neural network as input vectors of a self-attention module; S202: For each input vector a i , multiplied by the three coefficients w q 、w k 、w v ; The formula is described as follows: q i =w q ·a i k i =w k ·a i ; v i =w v ·a i Where: q, k, v represent query, key and value respectively; S203: Calculate the correlation between the two input vectors through q and k, that is, calculate the Attention value α, and the matrix composed of all α is represented as the correlation matrix A; The formula is described as follows: α i,j =q i ·k j ; S204: Perform a softmax operation or a relu operation on the correlation matrix A to obtain a corresponding relationship matrix A′; S205: Calculate each input vector a through the relationship matrix A′ i The output vector b of the self-attention layer i , as the self-attention feature of the corresponding input vector, i.e., the corresponding feature; The formula is described as follows: Where: b i Represents the input vector a i The self-attention feature that considers the mutual influence of all input vectors; i =w v ·a i , represents the product of the input vector and the weight matrix; α′ i,j represents the elements in the relationship matrix A′; In step S2, the encoder and decoder of VAE are expressed by the following formula: Where: Enc(x) represents the encoder, x is its input; z represents the output of the encoder; q(z|x) represents the distribution of the encoder output; Dec(z) represents the decoder, z is its input; represents the output of the decoder; represents the distribution of decoder output; S3: Using the predicted pressure coefficient curve output by the pressure prediction model as the corresponding pressure coefficient prediction result.
2. The pressure coefficient prediction method based on VAE-GAN and self-attention mechanism as claimed in claim 1, It is characterized in that In step S2, the two-dimensional coordinates of the airfoil are encoded by a convolutional neural network, the corresponding airfoil geometric features are extracted, and the airfoil geometric features are converted into data of preset dimensions.
3. The pressure coefficient prediction method based on VAE-GAN and self-attention mechanism as claimed in claim 1, Features: In step S2, the airfoil environmental characteristics include Mach number, airfoil angle of attack and Reynolds number; the airfoil environmental characteristics are encoded by a fully connected neural network to convert the airfoil environmental characteristics into data of preset dimensions.
4. The pressure coefficient prediction method based on VAE-GAN and self-attention mechanism as claimed in claim 1, It is characterized in that In step S2, the loss function of VAE is expressed by the following formula: L VAE =L recon +L prior ; L prior =D KL (q(z|x)||p(z)); Where: L VAE Represents the loss of VAE; L recon Represents the predicted pressure coefficient curve The difference between the actual pressure coefficient curve; L prior represents KL divergence; D KL (q(z|x)||p(z)) is used to calculate the difference between the distributions of q(z|x) and p(z); q(z|x) represents the distribution of the encoder output; p(z) specifies that the hidden variable z belongs to a Gaussian distribution.
5. The pressure coefficient prediction method based on VAE-GAN and self-attention mechanism as claimed in claim 4, It is characterized in that In step S2, the loss function of GAN is expressed by the following formula: Where: represents the loss of GAN; D(x) represents the input of real data x into the discriminator of GAN; Represents the random noise that will pass through the decoder Input to the GAN’s discriminator; Indicates that the airfoil fusion feature z after the decoder is input into the discriminator of GAN; represents a false pressure coefficient curve; Dec(Enc(x)) represents the reconstructed pressure coefficient curve obtained by reconstructing the real pressure coefficient curve through the encoder and then through the decoder.
6. The pressure coefficient prediction method based on VAE-GAN and self-attention mechanism as claimed in claim 5, It is characterized in that In step S2, the model loss function of the pressure prediction model is expressed by the following formula: L=λ 0 L layer +λ 1 L GAN +λ 2 L recon +λ 3 L prior ; Where: L represents the model loss of the pressure prediction model; L recon Represents the predicted pressure coefficient curve The difference between the actual pressure coefficient curve; L prior represents KL divergence; L GAN represents the loss of GAN; L layer represents boundary loss; D l (x) and Respectively represent the output of a certain layer of neural network in the discriminator; 0 , 1 , 2 , 3 Represents the weight parameter of each loss function on the overall prediction result.
Citation Information
Patent Citations
Airfoil inverse design method based on generative adversarial network
CN111814246A
Hyperspectral image classification method based on SACVAEGAN
CN112633386A
Airfoil flow field prediction method based on Transform decoder network
CN115758891A
Flow field prediction method based on attention and convolutional neural network codec
CN115859781A
On-demand generation and personalization of video content
US20200228880A1
