Airfoil Flow Field Prediction Method Based on Hybrid Neural Network
By combining the hybrid neural network method of graph neural network and recurrent neural network, the problem of large error in airfoil flow field prediction in the prior art is solved, fast and accurate non-constant flow field prediction is achieved, and the resources of airfoil design are reduced and time cost.
Patent Information
- Application Number
- CN202410350711.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-26
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2044-03-26
AI Technical Summary
The existing airfoil flow field prediction method based on a single neural network has a large error in long-time series prediction tasks and insufficient accuracy for non-stable flow field prediction tasks, resulting in frequent iterative calculations and large resource consumption during the airfoil design process. High time cost.
Using a hybrid neural network-based method, combined with the graph neural network module and the recurrent neural network module, the node features are extracted and timing prediction is performed by building a flow field structure data set, and a multi-layer perceptron is used for channel separation, combining Adam optimization algorithm and stagnation. The period-decreasing learning rate decay strategy is used to train the model to achieve efficient and accurate flow field prediction.
Fast and accurate non-stable airfoil flow field prediction is achieved, with high generalization ability and long-time series prediction accuracy, reducing iterative calculations in the airfoil design process, saving time and resource costs.
Smart Images

Figure BDA0004759848300000021 
Figure BDA0004759848300000032 
Figure BDA0004759848300000039
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of computational fluid dynamics and artificial intelligence, and specifically relates to an airfoil flow field prediction method based on a hybrid neural network. Background Art
[0002] Airfoils play an important role in aerospace, energy and power, and other fields. In order to improve the performance of airfoils, people usually use methods such as wind tunnel tests and computational fluid dynamics (CFD) simulation calculations to evaluate the aerodynamic performance of airfoils under different working conditions and optimize their appearance through multiple iterations. Although wind tunnel tests have been widely used in the past, their high cost has become a major obstacle. With the development of computing technology, CFD has become the main choice, but its complex operating procedures and large amounts of time and labor investment remain challenges. In recent years, artificial intelligence technology has made significant progress in the solution of traditional computational fluid dynamics problems, especially in simplifying models and improving the accuracy of flow field prediction. Compared with traditional CFD methods, these technologies usually have significant advantages. The development of this emerging field provides a more efficient and economical way to solve airfoil optimization design problems.
[0003] At present, GN and POD are combined with RNN structure to predict airfoil flow field. However, the methods based on single neural network (GN and RNN) are proposed for short-term flow field prediction tasks. The model structure is too simple and the fitting ability is insufficient. It is greatly disturbed by random noise and the error is too large in the later stage of long-term series prediction tasks. However, for unsteady flow field prediction tasks, it is necessary to ensure the accuracy of the later flow field structure and pursue more efficient model training to achieve the purpose of fast and accurate flow field prediction. Summary of the invention
[0004] The technical problem to be solved by the present invention is a method for predicting airfoil flow field based on a hybrid neural network, which overcomes the shortcomings of the prior art and can quickly and accurately predict the airfoil flow field, thereby reducing a large number of iterative calculations in the airfoil design process, reducing resource consumption and saving time costs.
[0005] In order to solve the above technical problems, the present invention is implemented in the following ways:
[0006] The airfoil flow field prediction method based on hybrid neural network includes the following steps:
[0007] S1: Construct the flow field structure data set based on the airfoil geometry description and inlet boundary conditions;
[0008] S2: Build a hybrid neural network based on the graph neural network module GN and the recurrent neural network module GRU, and train the model;
[0009] S3: Use the trained model to predict the flow field.
[0010] Furthermore, the steps of constructing the flow field structure data set in step S1 are as follows:
[0011] S11. The airfoil is placed horizontally, the magnitude and direction of the velocity at the entrance of the computational domain boundary are changed, the Reynolds number and angle of attack of the airfoil are accurately controlled within a certain range, a certain number of Reynolds number and angle of attack combinations are sampled using a uniform sampling method within the selected Reynolds number and angle of attack range, and the velocity at the entrance is calculated based on this combination to form an airfoil calculation case library;
[0012] S12. Based on the airfoil calculation case library, meshing and CFD calculation are performed to obtain the airfoil flow field database;
[0013] S13. Sample the grid node type and the four-layer channels at the node to obtain a flow field structure database, use special values to identify the grid node type, and the four-layer channels represent the pressure field (P), velocity field (X, Y) and density field (D).
[0014] Furthermore, the specific sub-steps of step S2 are as follows:
[0015] S21. First, the original flow field structure data of three adjacent moments are extracted from the flow field structure data set, and the data is reorganized to obtain a grid graph representation; then the graph neural network module GN is used to extract node features in stages to control the calculation amount of the model; finally, a multi-layer recurrent neural network module is used for time series prediction, and a multi-layer perceptron (MLP) is used for channel separation to output the velocity field (X, Y), density field (D) increment and pressure field (P) true value of the corresponding airfoil;
[0016] The graph neural network module includes an encoder module, a feature extraction module, a decoder module and a jump connection. The encoder module and the decoder module are two multi-layer perceptrons. After preprocessing, the given grid node n and grid edge encoding e are normalized to the maximum and minimum (0 to 1), and mapped to high-dimensional node feature vectors v and edge feature vectors u through the encoder module. The expressions are as follows:
[0017] n=Norm(node_type,v x ,v y ,ρ (1)
[0018] e=Norm(|(pos s ,pos r )|,(pos s ,pos r )) (2)
[0019] v=MLP ev (n) (3)
[0020] u=MLP ee (e) (4)
[0021] Among them, pos s and pos r They represent the starting point and end point of the mesh edge code e respectively;
[0022] The feature extraction module is composed of multiple GNBlocks connected in sequence, where GNBlock includes two multi-layer perceptrons using the ReLU activation function, which reshape the node feature vector v and the edge feature vector u into a hidden feature dimension H. GNBlock is used to extract features from the high-dimensional node feature vector v. For a given edge feature vector u, the features need to be updated based on the adjacent endpoints. The expression is as follows:
[0023] u i+1 =LayerNorm(MLP e (u i ,v s ,v r )) (5)
[0024] Among them, LayerNorm represents layer normalization, v s ,v r Represents the vector representation of the starting endpoint and the ending endpoint respectively, i represents the GNBlock number;
[0025] The message passing of the node feature vector v is calculated at each grid node, and its expression is as follows:
[0026]
[0027] Among them, Comcat represents the concatenation of vectors;
[0028] Use a separate multi-layer perceptron (MLP) to update node features and perform layer normalization, as shown below:
[0029] v i+1 =LayerNorm(MLP v (Message(v i ,v i )) (7)
[0030] Repeat n GNBlocks until v n Reach the target receptive field; then introduce skip connections and use the decoder module to reduce the feature dimension, with the activation layer being ReLU, to obtain high-dimensional node features that retain key information The expression is as follows:
[0031]
[0032] Combine the node features of three adjacent moments into a time series And as the input of the first recurrent neural network module GRU, the process of the single recurrent neural network module is described as follows:
[0033]
[0034]
[0035]
[0036]
[0037] Among them, W r ,W z ,W h represents the reset gate, update gate and candidate gate weight matrix, b r ,b z ,b h represents the reset gate, update gate and candidate gate bias, r t and z t represents the reset gate and update gate scale factor vector, h t Represents the hidden state of a single GRU module, Represents the candidate hidden state, initialize h0 to h3 output by the previous GRU module. The first GRU module has no preceding module, so its h0 is initialized to a vector of all zeros;
[0038] The outputs h1, h2, h3 of the first recurrent neural network module are regarded as a new time series and used as the input of the second recurrent neural network module. This step is repeated n times, and finally a four-layer multilayer perceptron is used for channel separation. The expression is as follows:
[0039] flow = MLP(h3) (13)
[0040] Among them, flow represents the predicted velocity field (X, Y), density field (D) increment and pressure field (P) true value.
[0041] S22. Use the second norm as the loss function, and then use the Adam optimization algorithm to iteratively optimize the model. Use the learning rate decay strategy (ReduceLROnPlateau) with a stagnation period. After the learning rate drops to the threshold, save the optimal model according to the loss function.
[0042] The loss function is divided into three parts: velocity field loss function, pressure field loss function and density field loss function. The loss function of the velocity field only calculates the internal nodes of the flow field, and its expression is as follows:
[0043]
[0044] The loss functions of the pressure field and density field are calculated for all nodes in the same way, and their expressions are as follows:
[0045]
[0046] Among them, CFDflow represents the CFD calculation result, j represents the node number;
[0047] The total loss function is the average of the two parts, and its expression is as follows:
[0048]
[0049] Furthermore, the specific implementation method of step S3 is as follows:
[0050] Prepare the initial 5 frames of airfoil flow field data, use the trained model and take the 3 adjacent frames of data as input, and generate the predicted data for the 4th to 6th frames in sequence; use these predicted data as the latest input of the model, and use the autoregressive method to predict the subsequent flow field data. Based on the flow field structure, evaluate the performance of the airfoil under specific working conditions, and analyze the influence of the incoming flow conditions on the aerodynamic performance of the airfoil.
[0051] Compared with the prior art, the present invention has the following beneficial effects:
[0052] The method of the present invention can quickly and accurately predict unsteady airfoil flow fields, has a certain generalization ability, and achieves high accuracy in long-term series prediction tasks, providing flow field reference and guidance for subsequent airfoil design optimization and other applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 It is a flow chart of the airfoil flow field prediction method based on hybrid neural network of the present invention;
[0054] Figure 2 is a schematic diagram of an airfoil according to an embodiment of the present invention;
[0055] Figure 3 A schematic diagram of a CFD grid and key areas in an embodiment of the present invention;
[0056] Figure 4 This is a schematic diagram of the graph neural network feature extraction stage of an embodiment of the present invention;
[0057] Figure 5 A schematic diagram of a hybrid neural network according to an embodiment of the present invention;
[0058] Figure 6 This is a test diagram of a small angle of attack condition of an embodiment of the present invention;
[0059] Figure 7 This is a test diagram of a high angle of attack condition of an embodiment of the present invention. DETAILED DESCRIPTION
[0060] The specific implementation of the present invention is further described in detail below with reference to the accompanying drawings and specific examples.
[0061] like Figure 1 As shown, the airfoil flow field prediction method based on the hybrid neural network includes the following steps:
[0062] S1: Construct the flow field structure data set based on the airfoil geometry description and inlet boundary conditions. The specific steps are as follows:
[0063] S11. The airfoil is placed horizontally, the magnitude and direction of the velocity at the entrance of the computational domain boundary are changed, the Reynolds number and angle of attack of the airfoil are accurately controlled within a certain range, a certain number of Reynolds number and angle of attack combinations are sampled using a uniform sampling method within the selected Reynolds number and angle of attack range, and the velocity at the entrance is calculated based on this combination to form an airfoil calculation case library;
[0064] like Figure 2 As shown in , the upper and lower airfoils contain curves with 20 control points. The leading edge of the airfoil is used as the coordinate origin to divide a circular calculation domain with a radius of 20, and then divide the unstructured grid in the calculation domain; Figure 3 As shown in the figure, the Reynolds number and angle of attack of the airfoil are adjusted by changing the speed magnitude and direction. The boundary condition of the example is described as x=(Re,AoA); and the initial velocities of 50 points on the boundary of the calculation domain are selected as variable parameters. 400 boundary conditions are uniformly sampled in the range of Reynolds number from 6000 to 20000 and the range of angle of attack from -35° to 35° as the example library.
[0065] S12. Based on the airfoil calculation case library, meshing and CFD calculation are performed to obtain the airfoil flow field database;
[0066] S13. Sample the grid node type and the four-layer channel at the node to obtain the flow field structure database, use special values to identify the grid node type, such as the special value (0) identifies the internal node of the flow field, the special value (1) identifies the airfoil surface node, and the special value (2) identifies the inlet boundary node. As in Formula 1 and Formula 14 for calculating the loss function, node_type is the special value here; the four-layer channel represents the pressure field (P), the velocity field (X, Y) and the density field (D), respectively, P represents absolute pressure, X represents the velocity in the x-axis direction, Y represents the velocity in the y-axis direction, and D represents density. The four-layer channel is related to the input and output of the entire model. The input of the hybrid neural network is the velocity field and the density field, and the output is the velocity field, the density field increment and the true value of the pressure field.
[0067] S2: Build a hybrid neural network based on the graph neural network module GN and the recurrent neural network module GRU, and train the model. The specific steps are as follows:
[0068] S21, such as Figure 5 As shown, the hybrid neural network uses two stages. First, the original flow field structure data of three adjacent moments are extracted from the flow field structure data set, and the data is reorganized to obtain a grid graph representation. In this embodiment, the high-dimensional vector length is 96; then the graph neural network module GN is used to extract node features in stages to control the calculation amount of the model; finally, a multi-layer recurrent neural network module is used for time series prediction, and a multi-layer perceptron (MLP) is used for channel separation to output the velocity field (X, Y), density field (D) increment and pressure field (P) true value of the corresponding airfoil;
[0069] The graph neural network module includes an encoder module, a feature extraction module, a decoder module and a jump connection. The encoder module and the decoder module are two multi-layer perceptrons. Data amplification is performed in the previous stage, and data dimension reduction is performed in the final stage to reduce the amount of data and retain key information. The feature extraction module is composed of multiple GNBlocks connected in sequence, and the number is adjusted according to the amount of calculation and the magnitude of the model parameters, such as Figure 4 As shown, GNBlock includes two multi-layer perceptrons (MLPs) using ReLU activation functions, which are used to update the edge features and node features of the graph respectively; the encoded node features are organized into time series in the time domain and used as the input of the first recurrent neural network module GRU, and the output of the first module is used as the input of the second module, and this step is repeated. In this embodiment, the hidden features of the recurrent neural network are 128, 15 GNBlocks are used in the first stage, and 3 GRUs are used in the second stage.
[0070] After preprocessing, the given grid node n and grid edge encoding e are normalized to the maximum and minimum (0 to 1), and mapped to the high-dimensional node feature vector v and edge feature vector u through the encoder module. The expressions are as follows:
[0071] n=Norm(node_type,v x ,v y ,ρ) (1)
[0072] e=Norm(|(pos s ,pos r )|,(pos s ,pos r )) (2)
[0073] v=MLP ev (n) (3)
[0074] u=MLP ee (e) (4)
[0075] Among them, pos s and pos r They represent the starting point and end point of the mesh edge code e respectively;
[0076] The feature extraction module is composed of multiple GN Blocks connected in sequence, where GN Block includes two multi-layer perceptrons using the ReLU activation function, which reshapes the node feature vector v and the edge feature vector u into a hidden feature dimension H. GNBlock is used to extract features from the high-dimensional node feature vector v. For a given edge feature vector u, the feature needs to be updated based on the adjacent endpoints. The expression is as follows:
[0077] u i+1 =LayerNorm(MLP e (u i ,v s ,v i )) (5)
[0078] Among them, LayerNorm represents layer normalization, v s ,v r Respectively represent the vector representation of the starting endpoint and the ending endpoint, i represents the GN Block in which;
[0079] The message passing of the node feature vector v is calculated at each grid node, and its expression is as follows:
[0080]
[0081] Among them, Concat represents the concatenation of vectors;
[0082] Use a separate multi-layer perceptron (MLP) to update node features and perform layer normalization, as shown below:
[0083] v i+1 =LayerNorm(MLP v (Message(v i ,v i )) (7)
[0084] Repeat n GNBlocks until v n Reach the target receptive field; then introduce skip connection and use decoder module to reduce feature dimension, with ReLU as activation layer, to obtain high-dimensional node features that retain key information (flow field structure information near grid nodes, including spatial and temporal information). The expression is as follows:
[0085]
[0086] Combine the node features of three adjacent moments into a time series And as the input of the first recurrent neural network module GRU, the process of the single recurrent neural network module is described as follows:
[0087]
[0088]
[0089]
[0090]
[0091] Among them, W r ,W z ,W h represents the reset gate, update gate and candidate gate weight matrix, b r ,b z ,b h represents the reset gate, update gate and candidate gate bias, r t and z t Represents the reset gate and update gate scale factor vector, whose value is between 0-1; h t Represents the hidden state of a single GRU module, which is a high-dimensional vector; Represents the candidate hidden state, initialize h0 to h3 output by the previous GRU module. The first GRU module has no preceding module, and initializes its h0 to a zero vector, that is, the input and h0, the output is h1; then input and h1, output h2; then input And h2, output h3, its single input or output is implemented as formula 9 to 12.
[0092] The output [h1, h2, h3] of the first recurrent neural network module is regarded as a new time series and used as the input of the second recurrent neural network module. This step is repeated n times, and finally a four-layer multilayer perceptron is used for channel separation. The expression is as follows:
[0093] flow = MLP(h3) (13)
[0094] Among them, flow represents the predicted velocity field (X, Y), density field (D) increment and pressure field (P) true value.
[0095] S22. Use the second norm as the loss function, and then use the Adam optimization algorithm to iteratively optimize the model. Use the learning rate decay strategy (ReduceLROnPlateau) with a stagnation period. After the learning rate drops to the threshold, save the optimal model according to the loss function. In the present invention, the learning rate threshold is set to 1e-6.
[0096] The loss function is divided into three parts: velocity field loss function, pressure field loss function and density field loss function. The loss function of the velocity field only calculates the internal nodes of the flow field, and its expression is as follows:
[0097]
[0098] The loss functions of the pressure field and density field are calculated for all nodes in the same way, and their expressions are as follows:
[0099]
[0100] Among them, CFDflow represents the CFD calculation result, j represents the node number;
[0101] The total loss function is the average of the two parts, and its expression is as follows:
[0102]
[0103] S3: Use the trained model to predict the flow field. The specific implementation method is as follows:
[0104] First, the initial 5 frames of airfoil flow field data are prepared. Then, the trained model is used with the 3 adjacent frames of data as input to generate the predicted data for the 4th to 6th frames in sequence. These predicted data are used as the latest input of the model, and the subsequent flow field data are predicted through the autoregressive method. Based on the flow field structure, the performance of the airfoil under specific working conditions is evaluated, and the influence of the incoming flow conditions on the aerodynamic performance of the airfoil is analyzed.
[0105] In this example, x1 = {11000, 9°}, x2 = {12500, 23°}, and the autoregressive method is used to infer 600 steps to test the accuracy of the model in the long time series prediction task. Figure 6 As shown in the figure, the inference result of x1, the prediction time gradually increases from left to right, and the flow field gradually develops. GRNet is the model prediction result, and CFD is the actual calculation result. From the relative error graph, it can be seen that the prediction accuracy is high, that is, the wing surface pressure distribution curve inferred at the 600th step is also consistent with the CFD result. Figure 7 As shown in the figure, corresponding to x2, due to the large angle of attack of the airfoil, the CFD calculation results show unpredictable vortex shedding at the trailing edge of the airfoil, so the prediction results have a large error compared with the CFD results.
[0106] The above description is only an implementation mode of the present invention. It is stated again that for ordinary technicians in this technical field, several improvements can be made to the present invention without departing from the principle of the present invention. These improvements are also included in the protection scope of the claims of the present invention.
Claims
1. Airfoil flow field prediction method based on hybrid neural network, Features: The following steps are involved: S1: Construct the flow field structure data set based on the airfoil geometry description and inlet boundary conditions; S2: Build a hybrid neural network based on the graph neural network module GN and the recurrent neural network module GRU, and train the model; S3: Use the trained model to predict the flow field; The specific steps of constructing the flow field structure data set in step S1 are as follows: S11. The airfoil is placed horizontally, the magnitude and direction of the velocity at the entrance of the computational domain boundary are changed, the Reynolds number and angle of attack of the airfoil are accurately controlled within a certain range, a certain number of Reynolds number and angle of attack combinations are sampled using a uniform sampling method within the selected Reynolds number and angle of attack range, and the velocity at the entrance is calculated based on this combination to form an airfoil calculation case library; S12. Based on the airfoil calculation case library, meshing and CFD calculation are performed to obtain the airfoil flow field database; S13, sampling the grid node type and the four-layer channels at the node to obtain a flow field structure database, using a special value to identify the grid node type, and the four-layer channels represent the pressure field (P), the velocity field (X, Y) and the density field (D); The specific sub-steps of step S2 are as follows: S21. First, extract the original flow field structure data of three adjacent moments from the flow field structure data set, and reorganize the data to obtain a grid graph representation; then use the graph neural network module GN to extract node features in stages to control the calculation amount of the model; finally, use a multi-layer recurrent neural network module for time series prediction, and use a multi-layer perceptron for channel separation, and output the velocity field (X, Y), density field (D) increment and pressure field (P) true value of the corresponding airfoil; S22, using the second norm as the loss function, and then using the Adam optimization algorithm to iteratively optimize the model, using the learning rate decay strategy with a stagnation period, and saving the optimal model according to the loss function after the learning rate drops to the threshold; The graph neural network module includes an encoder module, a feature extraction module, a decoder module and a jump connection. The encoder module and the decoder module are two multi-layer perceptrons. After preprocessing, the given grid node n and grid edge encoding e are normalized to the maximum and minimum, and mapped to high-dimensional node feature vectors v and edge feature vectors u through the encoder module. The expressions are as follows: n=Norm(node_type,v x ,v y ,p) (1) and=Norm(|(pos s ,pos r )|,(pos s ,pos r )) (2) v=MLP ev (n) (3) u=MLP ee (e) (4) Among them, pos s and pos r They represent the starting point and end point of the mesh edge code e respectively; The feature extraction module is composed of multiple GN Blocks connected in sequence, where GN Block includes two multi-layer perceptrons using the ReLU activation function, which reshapes the node feature vector v and the edge feature vector u into a hidden feature dimension H. GN Block is used to extract features from the high-dimensional node feature vector v. For a given edge feature vector u, the feature is updated based on the adjacent endpoints. The expression is as follows: u i+1 =LayerNorm(MLP e (u i ,v s ,v r )) (5) Among them, LayerNorm represents layer normalization, v s , v r Respectively represent the vector representation of the starting endpoint and the ending endpoint, i represents the GN Block in which; The message passing of the high-dimensional vector v is calculated at each grid node, and its expression is as follows: Among them, Concat represents the concatenation of vectors; Use a separate multi-layer perceptron to update node features and perform layer normalization, as expressed below: v i+1 =LayerNorm(MLP v (Message(v i ),v i )) (7) Repeat n GN Blocks until v n Reach the target receptive field; then introduce skip connections and use the decoder module to reduce the feature dimension, with the activation layer being ReLU, to obtain high-dimensional node features that retain key information The expression is as follows: Combine the node features of three adjacent moments into a time series And as the input of the first recurrent neural network module GRU, the process of the single recurrent neural network module is described as follows: Among them, W r , W z , W h represents the reset gate, update gate and candidate gate weight matrix, b r , b z , b h represents the reset gate, update gate and candidate gate bias, r t and Z t represents the reset gate and update gate scale factor vector, h t Represents the hidden state of a single GRU module, represents the candidate hidden state; The output of the first recurrent neural network module [h 1 ,h 2 ,h 3 ] is regarded as a new time series and used as the input of the second recurrent neural network module. This step is repeated n times, and finally a four-layer multi-layer perceptron is used for channel separation. The expression is as follows: flow=MLP(h 3 ) (13) Among them, flow represents the predicted velocity field (X, Y), density field (D) increment and pressure field (P) true value.
2. The airfoil flow field prediction method based on hybrid neural network according to claim 1, Features: The specific implementation method of step S3 is as follows: Prepare the initial 5 frames of airfoil flow field data, use the trained model and take the 3 adjacent frames of data as input, and generate the predicted data for the 4th to 6th frames in sequence; use these predicted data as the latest input of the model, and use the autoregressive method to predict the subsequent flow field data. Based on the flow field structure, evaluate the performance of the airfoil under specific working conditions, and analyze the influence of the incoming flow conditions on the aerodynamic performance of the airfoil.
3. The airfoil flow field prediction method based on hybrid neural network according to claim 1, Features: The loss function is divided into three parts: velocity field loss function, pressure field loss function and density field loss function. The velocity field loss function only calculates the internal nodes of the flow field, and its expression is as follows: The loss functions of the pressure field and density field are calculated for all nodes in the same way, and their expressions are as follows: Among them, CFDflow represents the CFD calculation result, j represents the node number; The total loss function is the average of the two parts, and its expression is as follows:
