Unsteady aerodynamic force rapid calculation method based on attention mechanism

Through the timing neural network based on the attention mechanism, the non -fixed constant dynamic power data is processed and trained, and the problem of low efficiency of complex and non -regular flow and flow coupling in existing technologies is solved. Essence

CN119337768AActive Publication Date: 2025-01-21NORTHWESTERN POLYTECHNICAL UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411422728.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2025-01-21
Estimated Expiration
2044-10-12

AI Technical Summary

Technical Problem

When solving complex unstable flow and flow-solid coupling problems, the prior art has a long calculation cycle and high computing power requirements, making it difficult to obtain reliable data within a limited time, and is suitable for engineering and research.

Method used

Adopt the timing neural network based on the attention mechanism. By constructing a database, the motion information of the research objects is organized with the non -frequent power power data, and the training set, verification set, and prediction set are Fast calculation of pneumatic power.

Benefits of technology

It significantly shortens the research cycle of unsteady aerodynamic solutions, improves calculation efficiency, and can quickly and accurately solve complex unsteady flow and fluid-structure coupling problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119337768A_ABST
    Figure CN119337768A_ABST
Patent Text Reader

Abstract

The invention discloses an unsteady aerodynamic force rapid calculation method based on an attention mechanism. The method comprises the following steps: firstly, calculating an unsteady aerodynamic force of a research object in a given motion law based on an unsteady flow solving method; then motion information of a given research object and the unsteady aerodynamic force obtained through calculation of the unsteady solver are summarized and arranged, and a database is constructed; next, the corresponding database is further divided into a training set, a verification set and a prediction set, and the training set, the verification set and the prediction set are loaded to a time sequence neural network based on an attention mechanism; performing parameter training on the time sequence neural network by using the training set, and checking the network training condition according to the verification set until the obtained network precision meets the actual engineering application requirement; and testing the trained network by using the prediction set, and selecting to store or regenerate the network according to the test result of the prediction set. The method can provide a reference for an unsteady aerodynamic force solving module for aircraft design, flow control and other problems, and the research period of the corresponding problems is shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of aerodynamics, and in particular relates to a method for fast calculation of unsteady aerodynamic forces based on an attention mechanism. Background Art

[0002] In the research of modern fluid and aerospace fields, unsteady aerodynamics is an important part, and the solution of unsteady aerodynamics is the main research content of unsteady aerodynamics. On the one hand, the solution of unsteady aerodynamics is the core of unsteady flow problems and fluid-solid coupling problems, and is an indispensable part of the corresponding problems; on the other hand, in the problems of flow mechanism analysis, aerodynamic shape optimization and unsteady flow control, the solution results of unsteady aerodynamics will directly guide the research of subsequent problems and play a vital guiding role. Therefore, in the research process, the accuracy and efficiency of the solution of unsteady aerodynamics have always been one of the key focuses of researchers.

[0003] In current research, the main solution to the unsteady aerodynamics of aerodynamic problems and fluid-solid coupling problems is still the traditional CFD calculation or CFD / CSD coupling calculation. The main advantage of this method being widely used is that it has strong adaptability to complex unsteady flow problems and can achieve solution accuracy that meets engineering and research requirements by selecting high-order formats; however, with the increasing complexity of engineering and research objects in recent years, the disadvantages of traditional numerical simulation technology have become increasingly apparent: for complex unsteady flow and fluid-solid coupling problems, due to the doubling of the difficulty of discretization pre-processing and the extension of the single-step operation time during iterative calculations, the calculation cycle of the numerical simulation method is greatly extended compared to the simple model. In a limited time, the demand for computing power is also greatly increased, and the cost of obtaining reliable data is too high, making it difficult to use in engineering and research. Summary of the invention

[0004] In order to overcome the shortcomings of the prior art, the present invention provides a method for fast calculation of unsteady aerodynamics based on an attention mechanism. First, the unsteady aerodynamics of the research object in a given motion law is calculated based on the unsteady flow solution method; then the motion information of the given research object and the unsteady aerodynamics calculated by the unsteady solver are summarized and collated to construct a database; next, the corresponding database is further divided into a training set, a validation set, and a prediction set, and loaded into a time series neural network based on an attention mechanism; the training set is used to train the parameters of the time series neural network, and the network training is tested according to the validation set until the accuracy of the obtained network reaches the requirements of actual engineering applications; then the trained network is tested using the prediction set, and the network is selected to be saved or regenerated according to the prediction set test results. The method of the present invention can provide a reference for the unsteady aerodynamic solution module for problems such as aircraft design, flow control, and aerodynamic optimization, greatly shortening the research cycle of the corresponding problems.

[0005] The technical solution adopted by the present invention to solve the technical problem is as follows:

[0006] Step 1: According to the research object, for a given flow condition, design and record the motion law of the research object; calculate the unsteady aerodynamic force of the research object in the given motion law based on the unsteady flow solution method;

[0007] Step 2: Summarize and organize the motion information of the given research object and the unsteady aerodynamic force calculated by the unsteady solver to build a database;

[0008] Step 3: The corresponding database is further divided into training set, validation set and prediction set, and loaded into the time series neural network based on the attention mechanism;

[0009] Step 4: Use the training set to train the parameters of the time series neural network, and verify the network training status according to the verification set until the accuracy of the obtained network meets the requirements of actual engineering applications;

[0010] Step 5: Use the prediction set to test the trained network, and choose to save or regenerate the network based on the prediction set test results;

[0011] Step 6: Save the network that passes the prediction set test, and then use it to calculate the unsteady aerodynamic force.

[0012] Preferably, the given flow condition refers to the environmental parameters of the corresponding unsteady flow, including Mach number, Reynolds number, temperature, density and pressure.

[0013] Preferably, the motion law of the research object refers to the displacement, generalized displacement, velocity, and generalized velocity of the research object when it remains stationary or performs rigid body motion according to certain motion laws.

[0014] Preferably, the unsteady aerodynamic force includes lift, drag, torque, other generalized forces and their corresponding coefficients.

[0015] Preferably, the specific form of the database is as follows: the displacement and aerodynamic force of the research object at each moment present a one-to-one correspondence, and in the subsequent network training and testing process, the displacement is the input data and the aerodynamic force is the output data.

[0016] Preferably, the training set, validation set, and test set are divided in a ratio of 7:2:1 or 8:1:1.

[0017] Preferably, the method of performing parameter training on the time series neural network using the training set and checking the network training status according to the validation set refers to continuously introducing training set displacements into the network, updating the internal parameters of the network, and continuously introducing the validation set to check the network training status in real time until the validation set is introduced into the current network and the error between the aerodynamic force output by the corresponding network and the actual aerodynamic force is less than a threshold.

[0018] Preferably, the network is selected to be retained or retrained according to the prediction set test results, specifically: an error threshold is given in advance according to experience or actual application requirements, and then the displacement corresponding to the prediction set is input into the trained network, the aerodynamic results output by the network are collected, and the error is compared with the actual aerodynamic force calculated by the previous solver. If the error is less than the threshold, the network is saved; otherwise, the network needs to be regenerated.

[0019] Preferably, the attention mechanism-based temporal neural network is an L-Transformer, comprising:

[0020] Dataset loading series modules are used to load data into the network in batches, as well as train and test the network;

[0021] PositionalEncoding is a module used to inject position information into the data loaded into the network.

[0022] The MultiHeadAttention module with mask function is used to integrate the internal features of the data after adding the position encoding and extract the internal relationship features of the data. The mask function is used to eliminate the influence of future data on previous data during the network learning process.

[0023] The residual connection and layer normalization module AddNorm is used to regularize the data processed by the attention mechanism, accelerate the training process, and improve network performance;

[0024] Position-wise feedforward network module PositionWiseFFN is used to capture long-distance dependencies between data after feature reorganization;

[0025] The basic unit block of the encoder, EncoderBlock, includes several multi-head attention series modules, residual connection and layer normalization modules, and position-based feedforward network modules, which are used to summarize and learn the features of the input data;

[0026] The basic unit block of the decoder DncoderBlock includes a multi-head attention series module with a mask function, several multi-head attention series modules, a residual connection and layer normalization module, and a position-based feedforward network module, which is used to integrate the input data information and the information processed by the encoder to realize time series data recognition and prediction;

[0027] The encoder module TransformerEncoder, which includes a linear layer, a position encoding module, and several encoder basic unit blocks, is used to summarize the characteristic information of the displacement data and guide the decoder to perform aerodynamic force identification;

[0028] The decoder module TransformerDecoder, which includes a linear layer linear, a position encoding module, several decoder basic unit blocks and a hidden state initialization module, is used to obtain aerodynamic force using input displacement information under the guidance of the encoder;

[0029] The encoder-decoder combination module EncoderDecoder is used to combine the encoder module and the decoder module to build a complete network framework for engineering applications;

[0030] The training series module is used to load the training set and validation set data in the database to update the network parameters;

[0031] Gradient clipping module grad_clipping is used to prevent gradient explosion during training and improve the network's adaptability to data;

[0032] The prediction module predict_seq2seq is used to load the test set to verify whether the network training is complete;

[0033] In the dataset loading series modules, a continuous truncation mechanism is used to process the original data to minimize the loss of input data information and prevent the loss of training efficiency caused by the network processing too much data at one time;

[0034] In the dataset loading series module, for the aerodynamic force input used in the training phase, an additional pre-condition aerodynamic force is added for mandatory teaching during training to improve the training effect;

[0035] In the basic unit block of the encoder, the original mask mechanism in the encoder is removed to ensure the complete extraction of input data features;

[0036] In the encoder module and decoder module, the linear layer is used to replace the original embedding layer, which is suitable for the dimensionality conversion of sequence data;

[0037] In the training series module, the exponential mean square error expMSEloss is used to replace the original mean square error MSEloss to improve training efficiency and network performance;

[0038] In the prediction module, a sliding window mechanism is added to adjust the encoder input according to the hysteresis of the input data, and the corresponding adjustment parameters are set, so that the network can be better applied to unsteady flow problems with hysteresis characteristics such as hysteresis loops;

[0039] In the prediction module, a long-tail truncation mechanism is introduced and corresponding adjustment parameters are set. Based on the premise that the time delay effect of most unsteady aerodynamic forces is limited, the influence of earlier output data is removed when updating the hidden state of the decoder at the current moment to prevent the prediction efficiency of long sequence prediction from decreasing with the sequence length.

[0040] Preferably, the error between the aerodynamic force output by the corresponding network and the actual aerodynamic force is less than the error in the threshold and an evaluation error is adopted, including mean square error MSEloss, mean absolute error MAEloss, relative error REloss, and exponential mean square error expMSEloss.

[0041] The beneficial effects of the present invention are as follows:

[0042] The method of the present invention can be directly used for the rapid solution of unsteady aerodynamic forces in aerospace, civil engineering, wind engineering and other related problems. It can also provide a reference for the unsteady aerodynamic force solution module for aircraft design, flow control, aerodynamic optimization and other problems, greatly shortening the research cycle of the corresponding problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 A schematic diagram of the process flow of the fast calculation method proposed by the present invention;

[0044] Figure 2 A schematic diagram of a flow field grid according to an embodiment of the present invention;

[0045] Figure 3 This is an architecture diagram of the attention-based temporal neural network L-Transformer of the present invention. DETAILED DESCRIPTION

[0046] The present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0047] The purpose of the present invention is to solve the problems in the prior art and provide a method for fast calculation of unsteady aerodynamics based on an attention mechanism. The method obtains training data by means of fluid dynamics simulation, trains a neural network based on an attention mechanism as a proxy model, and realizes its engineering application. For unsteady flow problems, the model can quickly solve the unsteady aerodynamics in the problem of the research object being stationary or in rigid motion by only given the known motion information of the research object.

[0048] Example:

[0049] The embodiment of the present invention selects a single degree of freedom oscillation condition of a NACA0012 airfoil under a certain transonic speed condition, and the corresponding flow field grid node distribution is as follows: Figure 2 The specific details of this working condition are as follows:

[0050] Airfoil geometric parameters: airfoil chord length 1, airfoil initial angle of attack 0°, training set and validation set oscillation amplitude [0°, 6°], training set and validation set oscillation reduction frequency [0.06, 0.12], predicted operating condition oscillation amplitude 1°, predicted operating condition oscillation reduction frequency 0.09;

[0051] The uniform incoming flow Mach number is 0.755, the temperature is 300K, and the pressure is 101325Pa.

[0052] See also Figure 1 , the specific process details of a fast calculation method of unsteady aerodynamics based on attention mechanism are as follows:

[0053] Firstly, the angle of attack at each moment under the single degree of freedom oscillation of the airfoil is selected as the generalized displacement. Random signals with a certain amplitude and reduced frequency, as well as sinusoidal signals under the prediction conditions are designed as training signals and prediction signals respectively. The unsteady aerodynamic force under the corresponding signal is solved by an unsteady solver based on the pressure basis, and the lift coefficient and moment coefficient at each moment are extracted as the generalized aerodynamic force to be modeled.

[0054] Then, each generalized displacement is matched one by one with the generalized aerodynamic force corresponding to the displacement at the current moment, and the database required by the network is constructed.

[0055] Among them, the training signal and its corresponding generalized aerodynamic force are divided into 8:2 as the data source of the training set and the validation set. Furthermore, for the data in the training set and the validation set, the corresponding generalized displacement-generalized aerodynamic force pairs are continuously truncated according to adjacent moments, and the length of each segment is a hyperparameter. At the same time, in order to further improve the training effect of the network, for the generalized aerodynamic force part, another precondition is constructed to store the generalized aerodynamic force at the previous moment at each breakpoint, and it is paired one by one with the original generalized displacement-generalized aerodynamic force data pair to form a generalized displacement-generalized aerodynamic force-precondition aerodynamic force data pair for subsequent teaching training. The prediction signal and its corresponding generalized aerodynamic force are used as the data source of the prediction set. Then, the divided training set is loaded into the L-Transformer time series neural network.

[0056] The specific internal architecture of the L-transformer neural network can be found in Figure 3 , the flow after the training set is loaded into the network is as follows:

[0057] First, the training set is unpacked into three parts: generalized displacement, generalized aerodynamic force, and pre-term aerodynamic force before being input into the network in batches.

[0058] Among them, the generalized displacement is loaded into the network's encoder module TransformerEncoder in batches as an input item during training, and is used to extract internal features to guide the prediction of generalized aerodynamic forces in the decoder. After the generalized displacement item is input into the encoder module, it first passes through the transformed linear layer linear to deconstruct the underlying features inside the time series data; then, the deconstructed data passes through the positional encoding module PositionalEncoding, adding positional encoding to its various feature dimensions, giving position information to the parallel input data for subsequent learning of time series characteristics, where the positional encoding can be a trigonometric function type:

[0059]

[0060] Where i is the time sequence of the data at the current position in the current batch, 2j and 2j+1 are the feature sequences of the data at the current position in the current batch for even items and odd items respectively, d is the total number of features of the data in the current batch, and p is the position encoding value of the data at the current position.

[0061] Then, for the data after adding the position encoding, the underlying features are summarized and extracted in turn through several encoder basic unit blocks EncoderBlock. Among them, the number of encoder basic unit blocks is a hyperparameter. In theory, the more blocks there are, the stronger the encoder's ability to extract the underlying features of the data. Therefore, it is necessary to make reasonable settings according to the amount of data during use.

[0062] The data entering the basic unit block of the encoder is processed in four steps. First, the data passes through the multi-head attention series module MultiHeadAttention without a mask mechanism. This module uses a multi-head self-attention mechanism to self-reorganize the temporal dimension of the input data. Taking a single batch as an example, its expression can be expressed as:

[0063] y i =f(x i ,(x1,x1),...(x n ,x n )) (2)

[0064] In the formula, x1.....x n represents an input sequence with d feature dimensions, n represents the sequence length, and f represents the attention aggregation function. Its general expression can be expressed as:

[0065]

[0066] In the formula, q, k, v represent query, key and value respectively. The three are q, k, v-dimensional vectors respectively. They are the core part of the attention mechanism. Its working mechanism is to obtain the weight coefficient by solving the similarity between the query and the key, so as to determine the weighted sum of the value. Furthermore, α can be expressed as a function of the attention score function a:

[0067]

[0068] In the commonly used Transformer series networks based on the attention mechanism, scaled dot product attention is usually used as the scoring function. Its essence is to directly perform inner product operations on the query and the key, and use feature dimension normalization to obtain the corresponding weights. Its expression is:

[0069]

[0070] In the L-Transformer network encoder, a multi-head self-attention module is used to extract the internal relational features of the data only from the generalized displacement of the input itself.

[0071] Then, the data integrated by multi-head self-attention passes through the residual connection and layer normalization module AddNorm, which can further regularize the data processed by the functional layer to assist in building an effective deep architecture and improve network performance.

[0072] The regularized data then passes through the position-based feedforward network module PositionWiseFFN, which can be regarded as a two-layer feedforward neural network layer for capturing long-distance dependencies in the data. This module determines that the architecture can be naturally extended to long sequence recognition or prediction problems.

[0073] Subsequently, the data processed by position feedforward is further regularized through residual connection and layer normalization module AddNorm. At this point, the processing of a single encoder basic unit module is completed, and the output of this module can be further used to input the next basic unit block, or directly introduced into the multi-head attention layer of the decoder module TransformerDecoder to guide the decoder to identify or predict the generalized aerodynamic force.

[0074] Different from the parallel features of the encoder, the decoder of L-Transformer is a temporal mechanism constructed by attention, which has the typical sequence characteristics of the temporal network. In use, the generalized aerodynamic force and the preceding aerodynamic force are used as input items of the decoder module TransformerDecoder. In order to further improve the training efficiency and accuracy of the network, the decoder of the L-Transformer network is trained by teacher forcing. Among them, for a single batch of data, the input generalized aerodynamic force is truncated to the last item of the temporal dimension, and the preceding aerodynamic force is added to the beginning of its dimension, and the generalized aerodynamic force is used as the output item. The purpose of this operation is to enable the decoder to learn the ability to infer the next item based on the information of the previous several items in the sequence.

[0075] Similar to the encoder part, the decoder input items after splicing pass through the linear layer linear and are processed by the positional encoding module PositionalEncoding in sequence, which are used to deconstruct the underlying features and add position information respectively.

[0076] Then, for the data with position encoding added, it passes through several decoder basic unit blocks DecoderBlock in turn. This module realizes the prediction of generalized aerodynamic force under the guidance of the generalized displacement feature information input by the encoder. Compared with the encoder basic unit block, this part mainly has two distinguishing units, the multi-head attention series module MultiHeadAttention with mask mechanism and the multi-head attention series module MultiHeadAttention with external input. To avoid repetition, only one of them is introduced here. The functions of other parts are the same as those of the encoder, so they will not be repeated.

[0077] The first is the MultiHeadAttention module with a mask mechanism. Compared with the unmasked module, this module adds a mask mechanism, which is mainly reflected in the training stage. When training, the MultiHeadAttention module only calculates the weight of the data at a certain moment with the previous moments, that is, when calculating the attention at the future moment, the weight is reset to zero. This mechanism can ensure that the decoder conforms to the actual physical mechanism when predicting, and only considers the feature information of the data that has been obtained.

[0078] The other is the MultiHeadAttention module with external input. Different from other self-attention mechanism modules based on the current input sequence itself, this module receives the generalized displacement feature information from the encoder as a key-value pair, and uses the features of the encoder's previous input data as a query. It can introduce encoder information, thereby achieving the role of experience guidance and information fusion.

[0079] The input data of the decoder is processed by several basic unit blocks of the decoder, DecoderBlock, and then output through the linear layer linear. At this time, the output dimension is set to 1 to obtain the generalized aerodynamic force predicted by the network. The error is calculated between it and the real generalized aerodynamic force of the current batch, and the relationship with the threshold is used to determine whether it is necessary to continue to input the next batch of data for network training. At the same time, according to the error calculation results, the deviation is updated through the time-series reverse gradient propagation mechanism (BPTT) to update the gradient of each network parameter. Here, the training speed can be adjusted by adjusting hyperparameters such as the learning rate, batch size, and number of training iterations to obtain the final desired network model.

[0080] After training for a period of time, the validation set can be loaded into the network. The data transmission process in the network is exactly the same as the training set data. Its function is to determine whether the network training is complete. If the error calculated by the validation set is less than the threshold, the update of the network parameters can be stopped immediately, and the obtained network is the required proxy model.

[0081] Then, for the trained network, the prediction set is used to test the network performance. The difference between the training set and the validation set is that the prediction set only has the generalized aerodynamic information at the initial moment and the generalized displacement information at each moment when passing through the network layer, and does not contain additional real generalized aerodynamic information. Therefore, when the data passes through the network layer, it is different from the training set and the validation set as follows:

[0082] On the one hand, in the prediction stage, the L-Transformer network introduces a sliding window mechanism, through which the generalized displacement at different times can be selected and the corresponding generalized aerodynamic force can be predicted. For the hysteresis loop problem selected in this example, the moment of the selected generalized displacement can be appropriately postponed to achieve the ability to better capture the hysteresis effect.

[0083] On the other hand, in the prediction stage, in order to update the hidden state of the decoder, the L-Transformer network adopts a long-tail truncation mechanism, which assumes that the impact time of unsteady effects is limited and will only affect the unsteady aerodynamic output results within a limited time. Therefore, the generalized aerodynamic data outputted in the early stage can be truncated. This strategy can effectively prevent the need to use the generalized displacement input of all previous moments to predict the generalized aerodynamic force at a newer moment during the prediction process, greatly improving the prediction efficiency of long sequences.

[0084] For networks that pass the test set verification, they can be saved and used for subsequent practical engineering applications. If the network itself fails the test, it is necessary to return to several previous moments, check various problems, and retrain. Possible problems include the accuracy of the data set, the setting of network hyperparameters, the rationality of the network structure, and whether the number of network training times is sufficient.

Claims

1. A fast calculation method of unsteady aerodynamic force based on attention mechanism, characterized in that: The steps include: Step 1: According to the research object, for a given flow condition, design and record the motion law of the research object; calculate the unsteady aerodynamic force of the research object in the given motion law based on the unsteady flow solution method; Step 2: Summarize and organize the motion information of the given research object and the unsteady aerodynamic force calculated by the unsteady solver to build a database; Step 3: The corresponding database is further divided into training set, validation set and prediction set, and loaded into the time series neural network based on the attention mechanism; Step 4: Use the training set to train the parameters of the time series neural network, and verify the network training status according to the verification set until the accuracy of the obtained network meets the requirements of actual engineering applications; Step 5: Use the prediction set to test the trained network, and choose to save or regenerate the network based on the prediction set test results; Step 6: Save the network that passes the prediction set test, and then use it to calculate the unsteady aerodynamic force.

2. According to claim 1, a fast calculation method of unsteady aerodynamic force based on attention mechanism is characterized in that: The given flow condition refers to the environmental parameters of the corresponding unsteady flow, including Mach number, Reynolds number, temperature, density, and pressure.

3. According to claim 1, a fast calculation method of unsteady aerodynamic force based on attention mechanism is characterized in that: The motion law of the research object refers to the displacement, generalized displacement, velocity, and generalized velocity when the research object remains stationary or performs rigid body motion according to certain motion laws.

4. According to claim 1, a fast calculation method of unsteady aerodynamic force based on attention mechanism is characterized in that: The unsteady aerodynamic force includes lift, drag, torque, other generalized forces and their corresponding coefficients.

5. According to claim 1, a fast calculation method of unsteady aerodynamic force based on attention mechanism is characterized in that: The specific form of the database is as follows: the displacement of the research object and the aerodynamic force at each moment present a one-to-one correspondence. In the subsequent network training and testing process, the displacement is the input data and the aerodynamic force is the output data.

6. According to claim 1, a fast calculation method of unsteady aerodynamic force based on attention mechanism is characterized in that: The training set, validation set, and test set are divided in a ratio of 7:2:1 or 8:1:

1.

7. The method for fast calculation of unsteady aerodynamic force based on attention mechanism according to claim 1, characterized in that: The method of training parameters of the time series neural network using the training set and checking the network training status according to the verification set refers to continuously introducing training set displacements into the network, updating the internal parameters of the network, and continuously introducing the verification set to check the network training status in real time until the verification set is introduced into the current network and the error between the aerodynamic force output by the corresponding network and the actual aerodynamic force is less than a threshold.

8. The method for fast calculation of unsteady aerodynamic force based on attention mechanism according to claim 1, characterized in that: According to the test results of the prediction set, the network is selected to be retained or retrained, specifically: an error threshold is given in advance according to experience or actual application requirements, and then the displacement corresponding to the prediction set is input into the trained network, the aerodynamic results output by the network are collected, and the error is compared with the actual aerodynamic force calculated by the previous solver. If the error is less than the threshold, the network is saved; otherwise, the network needs to be regenerated.

9. The method for fast calculation of unsteady aerodynamic force based on attention mechanism according to claim 1, characterized in that: The temporal neural network based on the attention mechanism is L-Transformer, including: Dataset loading series modules are used to load data into the network in batches, as well as train and test the network; PositionalEncoding is a module used to inject position information into the data loaded into the network. The MultiHeadAttention module with mask function is used to integrate the internal features of the data after adding the position encoding and extract the internal relationship features of the data. The mask function is used to eliminate the influence of future data on previous data during the network learning process. The residual connection and layer normalization module AddNorm is used to regularize the data processed by the attention mechanism, accelerate the training process, and improve network performance; Position-wise feedforward network module PositionWiseFFN is used to capture long-distance dependencies between data after feature reorganization; The basic unit block of the encoder, EncoderBlock, includes several multi-head attention series modules, residual connection and layer normalization modules, and position-based feedforward network modules, which are used to summarize and learn the features of the input data; The basic unit block of the decoder DncoderBlock includes a multi-head attention series module with a mask function, several multi-head attention series modules, a residual connection and layer normalization module, and a position-based feedforward network module, which is used to integrate the input data information and the information processed by the encoder to realize time series data recognition and prediction; The encoder module TransformerEncoder, which includes a linear layer, a position encoding module, and several encoder basic unit blocks, is used to summarize the characteristic information of the displacement data and guide the decoder to perform aerodynamic force identification; The decoder module TransformerDecoder, which includes a linear layer linear, a position encoding module, several decoder basic unit blocks and a hidden state initialization module, is used to obtain aerodynamic force using input displacement information under the guidance of the encoder; The encoder-decoder combination module EncoderDecoder is used to combine the encoder module and the decoder module to build a complete network framework for engineering applications; The training series module is used to load the training set and validation set data in the database to update the network parameters; Gradient clipping module grad_clipping is used to prevent gradient explosion during training and improve the network's adaptability to data; The prediction module predict_seq2seq is used to load the test set to verify whether the network training is complete; In the dataset loading series modules, a continuous truncation mechanism is used to process the original data to minimize the loss of input data information and prevent the loss of training efficiency caused by the network processing too much data at one time; In the dataset loading series module, for the aerodynamic force input used in the training phase, an additional pre-condition aerodynamic force is added for mandatory teaching during training to improve the training effect; In the basic unit block of the encoder, the original mask mechanism in the encoder is removed to ensure the complete extraction of input data features; In the encoder module and decoder module, the linear layer is used to replace the original embedding layer, which is suitable for the dimensionality conversion of sequence data; In the training series module, the exponential mean square error expMSEloss is used to replace the original mean square error MSEloss to improve training efficiency and network performance; In the prediction module, a sliding window mechanism is added to adjust the encoder input according to the hysteresis of the input data, and the corresponding adjustment parameters are set, so that the network can be better applied to unsteady flow problems with hysteresis characteristics such as hysteresis loops; In the prediction module, a long-tail truncation mechanism is introduced and corresponding adjustment parameters are set. Based on the premise that the time delay effect of most unsteady aerodynamic forces is limited, the influence of earlier output data is removed when updating the hidden state of the decoder at the current moment to prevent the prediction efficiency of long sequence prediction from decreasing with the sequence length.

10. The method for fast calculation of unsteady aerodynamic force based on attention mechanism according to claim 7, characterized in that: The error between the aerodynamic force output by the corresponding network and the actual aerodynamic force is less than the error in the threshold and the evaluation error is adopted, including mean square error MSEloss, mean absolute error MAEloss, relative error REloss, and exponential mean square error expMSEloss.

Citation Information

Patent Citations

  • Method and system for predicting flight state parameters of unmanned aerial vehicle

    CN115469679A

  • Intention-based aircraft trajectory prediction method

    CN117349594A

  • High-speed double-spin projectile unsteady aerodynamic force prediction method based on machine learning

    CN117708985A

  • Generation of CFD-based structurally independent aerodynamic influence coefficient matrix

    US20240068903A1