CN118395886A - Flow field prediction method based on token selection transducer - Google Patents
Flow field prediction method based on token selection transducer Download PDFInfo
- Publication number
- CN118395886A CN118395886A CN202410350715.3A CN202410350715A CN118395886A CN 118395886 A CN118395886 A CN 118395886A CN 202410350715 A CN202410350715 A CN 202410350715A CN 118395886 A CN118395886 A CN 118395886A
- Authority
- CN
- China
- Prior art keywords
- airfoil
- flow field
- token
- network
- follows
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 35
- 230000014509 gene expression Effects 0.000 claims abstract description 25
- 230000004927 fusion Effects 0.000 claims abstract description 13
- 238000012549 training Methods 0.000 claims abstract description 8
- 239000011159 matrix material Substances 0.000 claims description 6
- 238000010606 normalization Methods 0.000 claims description 6
- 238000012545 processing Methods 0.000 claims description 5
- 238000012360 testing method Methods 0.000 claims description 4
- 238000004364 calculation method Methods 0.000 claims description 2
- 230000001174 ascending effect Effects 0.000 claims 1
- 238000013079 data visualisation Methods 0.000 claims 1
- 239000012633 leachable Substances 0.000 claims 1
- 238000012216 screening Methods 0.000 claims 1
- 238000004458 analytical method Methods 0.000 abstract description 3
- 238000013461 design Methods 0.000 abstract description 3
- 230000007246 mechanism Effects 0.000 abstract description 3
- 238000000605 extraction Methods 0.000 abstract 1
- 230000006870 function Effects 0.000 description 8
- 238000013135 deep learning Methods 0.000 description 4
- 239000012530 fluid Substances 0.000 description 4
- 238000013528 artificial neural network Methods 0.000 description 3
- 238000005457 optimization Methods 0.000 description 3
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 2
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 2
- 238000005192 partition Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000003889 chemical engineering Methods 0.000 description 1
- 238000013527 convolutional neural network Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000013401 experimental design Methods 0.000 description 1
- 238000012804 iterative process Methods 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/20—Design optimisation, verification or simulation
- G06F30/28—Design optimisation, verification or simulation using fluid dynamics, e.g. using Navier-Stokes equations or computational fluid dynamics [CFD]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/20—Design optimisation, verification or simulation
- G06F30/27—Design optimisation, verification or simulation using machine learning, e.g. artificial intelligence, neural networks, support vector machines [SVM] or training a model
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
- G06V10/774—Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
- G06V10/80—Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2113/00—Details relating to the application field
- G06F2113/08—Fluids
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2119/00—Details relating to the type or aim of the analysis or the optimisation
- G06F2119/14—Force analysis or force optimisation, e.g. static or dynamic forces
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Evolutionary Computation (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Computing Systems (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Artificial Intelligence (AREA)
- Databases & Information Systems (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Multimedia (AREA)
- Computer Hardware Design (AREA)
- Geometry (AREA)
- General Engineering & Computer Science (AREA)
- Algebra (AREA)
- Fluid Mechanics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Mathematical Physics (AREA)
- Pure & Applied Mathematics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Aerodynamic Tests, Hydrodynamic Tests, Wind Tunnels, And Water Tanks (AREA)
Abstract
Description
技术领域Technical Field
本发明属于计算流体力学领域和人工智能技术领域,具体涉及一种基于令牌选择Transformer的流场预测方法。The present invention belongs to the fields of computational fluid dynamics and artificial intelligence technology, and specifically relates to a flow field prediction method based on token selection Transformer.
背景技术Background technique
流场预测是对流体的运动状态进行预测和模拟的过程,在化工、气候和空气动力学等领域有着广泛的应用,以空气动力学领域为例,获得飞行器翼型附近的流场数据是飞行器设计和优化过程中至关重要的环节。最初,获取翼型流场数据的主要手段是借助风洞试验,这种方法虽然结果较为准确,但实验设计需要依靠大量的先验知识,且实验周期较长,搭建风洞设备所需要的资源开销较大,因此多用于飞行器设计的后期;随着高性能计算和数值模拟方法的兴起,计算流体力学(CFD)方法逐渐成为模拟翼型附近流场的主要手段。CFD方法主要通过离散化连续的流体方程,如纳维-斯托克斯(Navier-Stokes)方程,通过数值方式近似求解这些方程从而得到流场数据。然而在复杂条件下的CFD求解需要大量的迭代过程,对CPU和内存的要求也很高。Flow field prediction is the process of predicting and simulating the motion state of a fluid. It has a wide range of applications in chemical engineering, climate, and aerodynamics. Taking aerodynamics as an example, obtaining flow field data near an aircraft airfoil is a crucial step in the design and optimization of an aircraft. Initially, the main means of obtaining airfoil flow field data was through wind tunnel testing. Although this method has relatively accurate results, the experimental design requires a lot of prior knowledge, and the experimental cycle is long. The resource overhead required to build wind tunnel equipment is large, so it is mostly used in the later stages of aircraft design. With the rise of high-performance computing and numerical simulation methods, computational fluid dynamics (CFD) methods have gradually become the main means of simulating flow fields near airfoils. CFD methods mainly discretize continuous fluid equations, such as the Navier-Stokes equations, and numerically approximate these equations to obtain flow field data. However, CFD solutions under complex conditions require a large number of iterative processes, and the requirements for CPU and memory are also high.
近年来,随着人工智能和神经网络的广泛应用,基于深度学习和数据驱动的方法成为获取流场数据的新手段。这种方法只需要在前期花费一定的时间训练网络模型,之后便可以使用训练好的模型在几秒内完成不同翼型的流场预测。但是目前现有的深度学习流场预测方法也存在一些局限性:许多基于CNN的流场预测方法将流场数据投影至均匀分布的笛卡尔网格中,这种像素化的方法会造成大量的流场细节缺失,特别是在靠近翼型表面的位置;并且现有的翼型几何参数的获取方法也无法准确地捕捉到翼型中最有效的几何特征。因此,如何更准确地提取翼型特征和预测流场细节是基于深度学习的流场预测方法需要优化的方向。In recent years, with the widespread application of artificial intelligence and neural networks, methods based on deep learning and data-driven have become a new means of obtaining flow field data. This method only requires a certain amount of time to train the network model in the early stage, and then the trained model can be used to complete the flow field prediction of different airfoils within a few seconds. However, the existing deep learning flow field prediction methods also have some limitations: many CNN-based flow field prediction methods project the flow field data into a uniformly distributed Cartesian grid. This pixelation method will cause a large amount of flow field details to be missing, especially near the airfoil surface; and the existing airfoil geometric parameter acquisition method cannot accurately capture the most effective geometric features of the airfoil. Therefore, how to more accurately extract airfoil features and predict flow field details is the direction that the flow field prediction method based on deep learning needs to be optimized.
发明内容Summary of the invention
针对现有技术存在的不足,本发明提出了一种基于令牌选择Transformer的流场预测方法,能够提取到更加准确和有效的翼型特征,并且能够提升流场预测精度,特别是在靠近翼型表面的位置。In view of the shortcomings of the prior art, the present invention proposes a flow field prediction method based on token selection Transformer, which can extract more accurate and effective airfoil features and improve the flow field prediction accuracy, especially near the airfoil surface.
为了解决上述技术问题,本发明通过以下方式来实现:In order to solve the above technical problems, the present invention is implemented in the following ways:
一种基于令牌选择Transformer的流场预测方法,包括以下步骤:A flow field prediction method based on token selection Transformer includes the following steps:
S1、获取翼型形状数据集和真实流场数据集;S1, obtaining an airfoil shape data set and a real flow field data set;
S2、通过令牌选择Transformer网络提取翼型几何参数;S2, extracting airfoil geometric parameters through token selection Transformer network;
S3、构建参数融合网络融合物理信息特征;S3, construct parameter fusion network to fuse physical information features;
S4、训练基于多层感知机的流场预测网络;S4, training a flow field prediction network based on a multi-layer perceptron;
S5、利用训练好的流场预测模型在不同翼型数据上预测压力场和速度场。S5. Use the trained flow field prediction model to predict the pressure field and velocity field on different airfoil data.
进一步地,所述步骤S1具体包括以下步骤:Furthermore, the step S1 specifically includes the following steps:
S11、从UIUC翼型数据库中选取基准翼型,通过非均匀有理B样条插值方法进行翼型拟合,并在翼型拟合曲线上选取控制点作为当前翼型新的x坐标和y坐标;S11, selecting a reference airfoil from the UIUC airfoil database, performing airfoil fitting by using a non-uniform rational B-spline interpolation method, and selecting a control point on the airfoil fitting curve as a new x-coordinate and y-coordinate of the current airfoil;
S12、对步骤S11中所有翼型新坐标进行最大最小归一化处理,其表达式如下:S12, performing maximum and minimum normalization processing on all new airfoil coordinates in step S11, and the expression is as follows:
其中,xi、yi表示当前翼型的坐标,xmin、ymin为全局最小值,xmax、ymax为全局最大值,xj、yi为归一化后的坐标;Among them, x i , y i represent the coordinates of the current airfoil, x min , y min are the global minimum values, x max , y max are the global maximum values, and x j , y i are the normalized coordinates;
S13、根据归一化后的坐标生成翼型形状灰度图,处于翼型几何曲线上的像素点值为1,不处于翼型几何曲线上的像素值为0,其他位置的像素值介于范围[0,1],得到翼型形状数据集;S13, generating an airfoil shape grayscale image according to the normalized coordinates, wherein the pixel value on the airfoil geometry curve is 1, the pixel value not on the airfoil geometry curve is 0, and the pixel values at other positions are in the range [0,1], thereby obtaining an airfoil shape data set;
S14、划分计算网格,对翼型数据集中的翼型样本进行CFD求解,得到不同翼型样本在不同流动条件下的真实数据,形成真实流场数据集。S14, dividing the computational grid, performing CFD solution on the airfoil samples in the airfoil data set, obtaining real data of different airfoil samples under different flow conditions, and forming a real flow field data set.
进一步地,所述步骤S2具体包含以下步骤:Furthermore, the step S2 specifically comprises the following steps:
S21、将步骤S1中获取的翼型形状数据集中的翼型图像进行序列化,对每张翼型图像pici进行块划分和展平,将其转换为一系列的二维令牌(token)pi,pici和pi的表达式如下:S21, serialize the airfoil images in the airfoil shape data set obtained in step S1, divide and flatten each airfoil image pic i into blocks, and convert it into a series of two-dimensional tokens pic i , where the expressions of pic i and pi are as follows:
其中,表示实数集,H、W和C分别表示翼型图像的宽、高和通道数目,P表示选取划分块的宽和高,N=H*W/P2表示划分出的二维令牌数量;in, represents a real number set, H, W and C represent the width, height and number of channels of the airfoil image respectively, P represents the width and height of the selected partition block, and N = H*W/P 2 represents the number of two-dimensional tokens divided;
S22、在获取的token序列中增加一个可学习的嵌入CLStoken,维度和其他token维度保持一致,进而得到每一张翼型图像的完整token序列表示I,其具体表达式如下:S22. Add a learnable embedding CLStoken to the acquired token sequence, with the dimension consistent with other token dimensions, and then obtain the complete token sequence representation I of each airfoil image, the specific expression of which is as follows:
其中,pcls表示CLStoken,p0,p1,...pn-1表示上述中获取的N个token,D=P2*C表示token的维度;Wherein, p cls represents CLStoken, p 0 , p 1 , ... p n-1 represent the N tokens obtained in the above, and D = P 2 *C represents the dimension of the token;
S23、将I通过多层感知机网络进行降维,使每一个token的维度从D降至得到I′,其具体表达式如下:S23, reduce the dimension of I through a multi-layer perceptron network, so that the dimension of each token is reduced from D to I' is obtained, and its specific expression is as follows:
S24、步骤S23中的p′cls作为全局特征,p′0,p′1,....p′n-1作为局部特征,将全局特征p′cls与每一个局部特征p′i进行拼接,进而得到拼接特征其表达式如下:S24, p′ cls in step S23 is used as the global feature, p′ 0 , p′ 1 , .... p′ n-1 are used as local features, and the global feature p′ cls is concatenated with each local feature p′ i to obtain the concatenated feature Its expression is as follows:
S25、将步骤S24中得到的N+1个拼接特征记为再将其输入到另一个后接归一化层的多层感知机网络,计算特征的重要性分数向量S,其表达式如下:S25. Record the N+1 splicing features obtained in step S24 as Then input it into another multi-layer perceptron network followed by a normalization layer to calculate the importance score vector S of the feature, which is expressed as follows:
其中,MLP()表示多层感知机网络的函数,Softmax()表示归一化指数函数,将MLP的输出转化为[0,1]间的概率值;Among them, MLP() represents the function of the multi-layer perceptron network, and Softmax() represents the normalized exponential function, which converts the output of MLP into a probability value between [0,1];
S26、使用重要性分数向量S筛选出所有N+1个token中重要性排在前K位的token索引M,其表达式如下:S26. Use the importance score vector S to filter out the token index M with the top K importance among all N+1 tokens. The expression is as follows:
M∈{0,1}(N+1)*K M∈{0,1} (N+1)*K
其中,M中的每个元素都是一个one-hot指示器,取值从集合{0,1}中选取;Each element in M is a one-hot indicator, and its value is selected from the set {0, 1};
S27、使用步骤S26中矩阵M的转置与I进行矩阵乘法,得到给定翼型的最重要的K个翼型参数特征 S27, use the transpose of the matrix M in step S26 and I to perform matrix multiplication to obtain the most important K airfoil parameter features of the given airfoil
进一步地,所述步骤S3具体包含以下步骤:Furthermore, the step S3 specifically comprises the following steps:
S31、对于每个网格点坐标,计算其到翼型几何曲线的最短距离d,其表达式如下:S31. For each grid point coordinate, calculate the shortest distance d to the airfoil geometry curve, which is expressed as follows:
其中,(x,y)表示网格点的X轴坐标和Y轴坐标,表示翼型几何曲线上点的X轴坐标和Y轴坐标;Where (x, y) represents the X-axis coordinate and Y-axis coordinate of the grid point. Indicates the X-axis and Y-axis coordinates of a point on the airfoil geometry curve;
S32、构建参数融合网络,将每个网格点的横纵坐标、坐标到翼型几何边界的最短距离及归一化后的雷诺系数与攻角输入到一个多层感知机网络进行特征融合与升维,最终得到物理信息特征pphy,其表达式如下:S32. Construct a parameter fusion network, input the horizontal and vertical coordinates of each grid point, the shortest distance from the coordinate to the airfoil geometric boundary, and the normalized Reynolds coefficient and angle of attack into a multi-layer perceptron network for feature fusion and dimension upgrading, and finally obtain the physical information feature p phy , which is expressed as follows:
其中,和分别表示归一化后的雷诺系数和攻角,D表示融合得到的物理信息特征的维度,与步骤S2中提取的每一个翼型特征维度保持一致。in, and They represent the normalized Reynolds coefficient and angle of attack respectively, and D represents the dimension of the fused physical information feature, which is consistent with the dimension of each airfoil feature extracted in step S2.
进一步地,所述步骤S4具体包含以下步骤:Furthermore, the step S4 specifically comprises the following steps:
S41、将重要性排名前K的翼型参数特征与物理信息特征pphy作为基于多层感知机的流场预测网络的输入,流场预测网络的输出为对应网格点坐标的流场数据,其表达式如下:S41. Rank the top K airfoil parameter features by importance The physical information feature p phy is used as the input of the flow field prediction network based on the multi-layer perceptron. The output of the flow field prediction network is the flow field data corresponding to the grid point coordinates, and its expression is as follows:
其中,fpredict()表示流场预测网络的函数,和分别表示x方向速度分量、y方向速度分量和压力的预测值;Among them, f predict () represents the function of the flow field prediction network, and They represent the predicted values of the velocity component in the x direction, the velocity component in the y direction, and the pressure, respectively;
S42、对于流场预测网络,设计损失函数LossMLP表达式如下:S42. For the flow field prediction network, the loss function Loss MLP is designed as follows:
其中,N表示样本总数,ui,vi,pi表示x方向速度分量,y方向速度分量和压力的真实值;Where N represents the total number of samples, ui , vi , pi represent the true values of the x-direction velocity component, the y-direction velocity component and the pressure;
S43、在GPU服务器上训练模型,设置不同的模型参数和迭代步数进行多轮训练,选择在测试数据上预测误差最小的模型作为最终的流场预测模型。S43. Train the model on the GPU server, set different model parameters and iteration steps for multiple rounds of training, and select the model with the smallest prediction error on the test data as the final flow field prediction model.
进一步地,所述步骤S5具体方法如下:Furthermore, the specific method of step S5 is as follows:
使用训练好的上述流场预测模型,输入不同翼型特征与雷诺数、攻角信息,输出对应翼型和流动条件下翼型附近的压力场和速度场;使用处理软件进行流场数据可视化处理,以便进行翼型优化、气动性能分析、气动噪声预测等后续工作。Using the trained flow field prediction model, different airfoil characteristics, Reynolds number, and angle of attack information are input, and the pressure field and velocity field near the airfoil under the corresponding airfoil and flow conditions are output; the flow field data is visualized using processing software to facilitate subsequent work such as airfoil optimization, aerodynamic performance analysis, and aerodynamic noise prediction.
与现有技术相比,本发明具有的有益效果:Compared with the prior art, the present invention has the following beneficial effects:
借助Transformer的自注意力机制,并通过令牌(token)选择模块,更加准确地筛选翼型特征,同时在一定程度上避免了参数冗余;为不同翼型形状提取归一化的坐标值并生成标准化图像,便于后续神经网络进行处理,将流场网格位置信息和流场参数物理信息使用神经网络进行特征融合,并与翼型参数特征保持对齐,能够在一定程度上增强模型的表达能力和泛化能力;相比现有的深度学习流场预测方法,本发明提高了流场预测的精度,特别是靠近翼型结构表面的位置。With the help of Transformer's self-attention mechanism and through the token selection module, the airfoil features can be screened more accurately, while parameter redundancy can be avoided to a certain extent; normalized coordinate values are extracted for different airfoil shapes and standardized images are generated to facilitate subsequent neural network processing; the flow field grid position information and the flow field parameter physical information are feature fused using a neural network and aligned with the airfoil parameter features, which can enhance the expression and generalization capabilities of the model to a certain extent; compared with the existing deep learning flow field prediction methods, the present invention improves the accuracy of flow field prediction, especially near the surface of the airfoil structure.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为本发明流场预测方法的流程示意图。FIG1 is a schematic flow chart of the flow field prediction method of the present invention.
具体实施方式Detailed ways
下面结合附图和具体实施例对本发明的具体实施方式作进一步详细的说明。The specific implementation of the present invention is further described in detail below with reference to the accompanying drawings and specific examples.
如图1所示,一种基于令牌选择Transformer的流场预测方法,包括以下步骤:As shown in FIG1 , a flow field prediction method based on token selection Transformer includes the following steps:
S1、获取翼型形状数据集和真实流场数据集;S1, obtaining an airfoil shape data set and a real flow field data set;
S2、通过令牌选择Transformer网络提取翼型几何参数;S2, extracting airfoil geometric parameters through token selection Transformer network;
S3、构建参数融合网络融合物理信息特征;S3, construct parameter fusion network to fuse physical information features;
S4、训练基于多层感知机的流场预测网络;S4, training a flow field prediction network based on a multi-layer perceptron;
S5、利用训练好的流场预测模型在不同翼型数据上预测压力场和速度场。S5. Use the trained flow field prediction model to predict the pressure field and velocity field on different airfoil data.
进一步地,所述步骤S1具体包括以下步骤:Furthermore, the step S1 specifically includes the following steps:
S11、从UIUC翼型数据库中选取基准翼型,通过非均匀有理B样条插值方法进行翼型拟合,并在翼型拟合曲线上选取控制点作为当前翼型新的x坐标和y坐标;S11, selecting a reference airfoil from the UIUC airfoil database, performing airfoil fitting by using a non-uniform rational B-spline interpolation method, and selecting a control point on the airfoil fitting curve as a new x-coordinate and y-coordinate of the current airfoil;
S12、对步骤S11中所有翼型新坐标进行最大最小归一化处理,其表达式如下:S12, performing maximum and minimum normalization processing on all new airfoil coordinates in step S11, and the expression is as follows:
其中,xi、yi表示当前翼型的坐标,xmin、ymin为全局最小值,xmax、ymax为全局最大值,xj、yj为归一化后的坐标;Among them, x i , y i represent the coordinates of the current airfoil, x min , y min are the global minimum values, x max , y max are the global maximum values, and x j , y j are the normalized coordinates;
S13、根据归一化后的坐标生成翼型形状灰度图,处于翼型坐标点构成光滑曲线(翼型几何曲线)上的像素点值为1,不处于翼型几何曲线上的像素值为0,其他位置的像素值介于范围[0,1],得到翼型形状数据集;S13, generating an airfoil shape grayscale image according to the normalized coordinates, wherein the pixel value on the smooth curve (airfoil geometry curve) formed by the airfoil coordinate points is 1, the pixel value not on the airfoil geometry curve is 0, and the pixel values at other positions are in the range [0,1], thereby obtaining an airfoil shape data set;
S14、划分计算网格,对翼型数据集中的翼型样本进行CFD求解,得到不同翼型样本在不同流动条件下的流场真实数据,形成真实流场数据集。S14, dividing the calculation grid, performing CFD solution on the airfoil samples in the airfoil data set, obtaining the real flow field data of different airfoil samples under different flow conditions, and forming a real flow field data set.
进一步地,所述步骤S2具体包含以下步骤:Furthermore, the step S2 specifically comprises the following steps:
S21、将步骤S1中获取的翼型形状数据集中的翼型图像进行序列化,对每张翼型图像pici进行块划分和展平,将其转换为一系列的二维令牌(token)pi,pici和pi的表达式如下:S21, serialize the airfoil images in the airfoil shape data set obtained in step S1, divide and flatten each airfoil image pic i into blocks, and convert it into a series of two-dimensional tokens pic i , where the expressions of pic i and pi are as follows:
其中,表示实数集,H、W和C分别表示翼型图像的宽、高和通道数目,P表示选取划分块的宽和高,N=H*W/P2表示划分出的二维令牌数量;in, represents a real number set, H, W and C represent the width, height and number of channels of the airfoil image respectively, P represents the width and height of the selected partition block, and N = H*W/P 2 represents the number of two-dimensional tokens divided;
S22、在步骤S21中获取的token序列中增加一个可学习的嵌入CLStoken,维度和其他token维度保持一致,进而得到每一张翼型图像的完整token序列表示I,其具体表达式如下:S22, adding a learnable embedding CLStoken to the token sequence obtained in step S21, with the dimension consistent with other token dimensions, and then obtaining a complete token sequence representation I of each airfoil image, the specific expression of which is as follows:
其中,pcls表示CLStoken,p0,p1,...pn-1表示上述中获取的N个token,D=P2*C表示token的维度;Wherein, p cls represents CLStoken, p 0 , p 1 , ... p n-1 represent the N tokens obtained in the above, and D = P 2 *C represents the dimension of the token;
S23、将I通过多层感知机网络进行降维,使每一个token的维度从D降至得到I′,其具体表达式如下:S23, reduce the dimension of I through a multi-layer perceptron network, so that the dimension of each token is reduced from D to I' is obtained, and its specific expression is as follows:
其中,p′cls,p′0,p′1,...,p′n-1为包含CLStoken在内共N+1个token降维后的表示;Among them, p′ cls , p′ 0 , p′ 1 , ..., p′ n-1 are the representations of N+1 tokens including CLStoken after dimensionality reduction;
S24、步骤S23中的p′cls作为全局特征,p′0,p′1,....p′n-1作为局部特征,将全局特征p′cls与每一个局部特征p′i进行拼接,进而得到拼接特征其表达式如下:S24, p′ cls in step S23 is used as the global feature, p′ 0 , p′ 1 , .... p′ n-1 are used as local features, and the global feature p′ cls is concatenated with each local feature p′ i to obtain the concatenated feature Its expression is as follows:
其中,i为每个局部特征的下标,取值范围为[0,N-1],全局特征p′cls与其自身拼接,共得到N+1个拼接特征;Among them, i is the subscript of each local feature, and its value range is [0, N-1]. The global feature p′ cls is concatenated with itself to obtain N+1 concatenated features in total;
S25、将步骤S24中得到的N+1个拼接特征记为再将其输入到另一个后接归一化层的多层感知机网络,计算特征的重要性分数向量S,其表达式如下:S25. Record the N+1 splicing features obtained in step S24 as Then input it into another multi-layer perceptron network followed by a normalization layer to calculate the importance score vector S of the feature, which is expressed as follows:
其中,MLP()表示多层感知机网络的函数,Softmax()表示归一化指数函数,将MLP的输出转化为[0,1]间的概率值;Among them, MLP() represents the function of the multi-layer perceptron network, and Softmax() represents the normalized exponential function, which converts the output of MLP into a probability value between [0,1];
S26、使用重要性分数向量S筛选出所有N+1个token中重要性排在前K位的token索引M,其表达式如下:S26. Use the importance score vector S to filter out the token index M with the top K importance among all N+1 tokens. The expression is as follows:
M∈{0,1}(N+1)*K M∈{0,1} (N+1)*K
其中,M中的每个元素都是一个one-hot指示器,取值从集合{0,1}中选取;Each element in M is a one-hot indicator, and its value is selected from the set {0, 1};
S27、使用步骤S26中矩阵M的转置与步骤S22中得到的token表示I进行矩阵乘法,得到给定翼型的最重要的K个翼型参数特征 S27, use the transpose of the matrix M in step S26 and the token representation I obtained in step S22 to perform matrix multiplication to obtain the most important K airfoil parameter features of the given airfoil
进一步地,所述步骤S3具体包含以下步骤:Furthermore, the step S3 specifically comprises the following steps:
S31、对于每个网格点坐标,计算其到翼型几何曲线的最短距离d,其表达式如下:S31. For each grid point coordinate, calculate the shortest distance d to the airfoil geometry curve, which is expressed as follows:
其中,(x,y)表示网格点的X轴坐标和Y轴坐标,表示翼型几何曲线上点的X轴坐标和Y轴坐标;Where (x, y) represents the X-axis coordinate and Y-axis coordinate of the grid point. Indicates the X-axis and Y-axis coordinates of a point on the airfoil geometry curve;
S32、构建参数融合网络,将每个网格点的横纵坐标、坐标到翼型几何边界的最短距离及归一化后的雷诺系数与攻角输入到一个多层感知机网络进行特征融合与升维,最终得到物理信息特征pphy,其表达式如下:S32. Construct a parameter fusion network, input the horizontal and vertical coordinates of each grid point, the shortest distance from the coordinate to the airfoil geometric boundary, and the normalized Reynolds coefficient and angle of attack into a multi-layer perceptron network for feature fusion and dimension upgrading, and finally obtain the physical information feature p phy , which is expressed as follows:
其中,和分别表示归一化后的雷诺系数和攻角,D表示融合得到的物理信息特征的维度,与步骤S2中提取的每一个翼型特征维度保持一致。in, and They represent the normalized Reynolds coefficient and angle of attack respectively, and D represents the dimension of the fused physical information feature, which is consistent with the dimension of each airfoil feature extracted in step S2.
进一步地,所述步骤S4具体包含以下步骤:Furthermore, the step S4 specifically comprises the following steps:
S41、将重要性排名前K的翼型参数特征与物理信息特征pphy作为基于多层感知机的流场预测网络的输入,流场预测网络的输出为对应网格点坐标的流场数据,其表达式如下:S41. Rank the top K airfoil parameter features by importance The physical information feature p phy is used as the input of the flow field prediction network based on the multi-layer perceptron. The output of the flow field prediction network is the flow field data corresponding to the grid point coordinates, and its expression is as follows:
其中,fpredict()表示流场预测网络的函数,和分别表示x方向速度分量、y方向速度分量和压力的预测值;Among them, f predict () represents the function of the flow field prediction network, and They represent the predicted values of the velocity component in the x direction, the velocity component in the y direction, and the pressure, respectively;
S42、对于流场预测网络,设计损失函数LossMLP表达式如下:S42. For the flow field prediction network, the loss function Loss MLP is designed as follows:
其中,N表示样本总数,ui,vi,pi表示x方向速度分量,y方向速度分量和压力的真实值;Where N represents the total number of samples, ui , vi , pi represent the true values of the x-direction velocity component, the y-direction velocity component and the pressure;
S43、在GPU服务器上训练模型,设置不同的模型参数和迭代步数进行多轮训练,选择在测试数据上预测误差最小的模型作为最终的流场预测模型。S43. Train the model on the GPU server, set different model parameters and iteration steps for multiple rounds of training, and select the model with the smallest prediction error on the test data as the final flow field prediction model.
进一步地,所述步骤S5具体方法如下:Furthermore, the specific method of step S5 is as follows:
使用训练好的上述流场预测模型,输入不同翼型特征与雷诺数、攻角信息,输出对应翼型和流动条件下翼型附近的压力场和速度场;使用处理软件进行流场数据可视化处理,以便进行翼型优化、气动性能分析、气动噪声预测等后续工作。Using the trained flow field prediction model, different airfoil characteristics, Reynolds number, and angle of attack information are input, and the pressure field and velocity field near the airfoil under the corresponding airfoil and flow conditions are output; the flow field data is visualized using processing software to facilitate subsequent work such as airfoil optimization, aerodynamic performance analysis, and aerodynamic noise prediction.
以上所述仅是本发明的实施方式,再次声明,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以对本发明进行若干改进,这些改进也列入本发明权利要求的保护范围内。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 (6)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410350715.3A CN118395886B (en) | 2024-03-26 | 2024-03-26 | A flow field prediction method based on token selection Transformer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410350715.3A CN118395886B (en) | 2024-03-26 | 2024-03-26 | A flow field prediction method based on token selection Transformer |
Publications (2)
Publication Number | Publication Date |
---|---|
CN118395886A true CN118395886A (en) | 2024-07-26 |
CN118395886B CN118395886B (en) | 2025-02-25 |
Family
ID=91993283
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410350715.3A Active CN118395886B (en) | 2024-03-26 | 2024-03-26 | A flow field prediction method based on token selection Transformer |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118395886B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119150747A (en) * | 2024-11-14 | 2024-12-17 | 齐鲁理工学院 | Semi-supervised learning flow field prediction method based on Gaussian mixture model |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113887610A (en) * | 2021-09-29 | 2022-01-04 | 内蒙古工业大学 | Pollen Image Classification Method Based on Cross-Attention Distillation Transformer |
CN115795683A (en) * | 2022-12-08 | 2023-03-14 | 四川大学 | An airfoil optimization method combining CNN and Swin Transformer network |
CN116680988A (en) * | 2023-06-21 | 2023-09-01 | 南京大学 | A Prediction Method of Porous Media Permeability Based on Transformer Network |
CN117540489A (en) * | 2023-11-13 | 2024-02-09 | 重庆大学 | An airfoil aerodynamic data calculation method and system based on multi-task learning |
-
2024
- 2024-03-26 CN CN202410350715.3A patent/CN118395886B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113887610A (en) * | 2021-09-29 | 2022-01-04 | 内蒙古工业大学 | Pollen Image Classification Method Based on Cross-Attention Distillation Transformer |
CN115795683A (en) * | 2022-12-08 | 2023-03-14 | 四川大学 | An airfoil optimization method combining CNN and Swin Transformer network |
CN116680988A (en) * | 2023-06-21 | 2023-09-01 | 南京大学 | A Prediction Method of Porous Media Permeability Based on Transformer Network |
CN117540489A (en) * | 2023-11-13 | 2024-02-09 | 重庆大学 | An airfoil aerodynamic data calculation method and system based on multi-task learning |
Non-Patent Citations (1)
Title |
---|
占哲琦;陈鹏;桑永胜;彭德中;: "融合双注意力的深度神经网络在无人机目标检测中的应用", 现代计算机, no. 11, 15 April 2020 (2020-04-15) * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119150747A (en) * | 2024-11-14 | 2024-12-17 | 齐鲁理工学院 | Semi-supervised learning flow field prediction method based on Gaussian mixture model |
Also Published As
Publication number | Publication date |
---|---|
CN118395886B (en) | 2025-02-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113378736B (en) | Semi-supervised semantic segmentation of remote sensing images based on transformation consistency regularization | |
CN113627093B (en) | Underwater mechanism trans-scale flow field characteristic prediction method based on improved Unet network | |
CN115438584B (en) | A method for predicting airfoil aerodynamic force based on deep learning | |
CN114638048A (en) | Three-dimensional spray pipe flow field rapid prediction and sensitivity parameter analysis method and device | |
Chen et al. | MVE-Net: An automatic 3-D structured mesh validity evaluation framework using deep neural networks | |
CN118350292B (en) | Airfoil flow field prediction network training method, network, prediction method and medium | |
CN112418235A (en) | Point cloud semantic segmentation method based on expansion nearest neighbor feature enhancement | |
CN119066937A (en) | Method and system for calculating mold structure strength based on digital design | |
CN118395886B (en) | A flow field prediction method based on token selection Transformer | |
CN116628854A (en) | Wing section aerodynamic characteristic prediction method, system, electronic equipment and storage medium | |
CN118886360A (en) | A method for constructing aerodynamic shape characteristics of three-dimensional aircraft and predicting aerodynamic forces based on cross-sectional area | |
Zhu et al. | Fast and high-precision compressible flowfield inference method of transonic airfoils based on attention UNet | |
CN118097162A (en) | Optimization of cloth simulation filtering algorithm based on PointNet++ network model | |
Ma et al. | Efficient aerodynamic shape optimization by using unsupervised manifold learning to filter geometric features | |
CN114693932A (en) | Large aircraft large component point cloud semantic segmentation method | |
CN117634365B (en) | Airplane aerodynamic force prediction method, electronic equipment and storage medium | |
Zhao et al. | Visual explainable convolutional neural network for aerodynamic coefficient prediction | |
CN117809038A (en) | 3D point cloud semantic segmentation method based on boundary perception and multi-scale feature fusion | |
CN116958553A (en) | Lightweight plant point cloud segmentation method based on parameter-free attention and point-level convolution | |
CN113627073A (en) | Underwater vehicle flow field result prediction method based on improved Unet + + network | |
CN118332684B (en) | Flow field prediction method based on dense convolution network | |
CN119337510B (en) | Intelligent reconstruction method for aerodynamic characteristics of aircraft based on multi-source data fusion | |
CN113761813B (en) | Dynamic Capacity Prediction Method of Transmission Lines Based on Fluid Mechanics and Meteorological Data | |
CN119830797A (en) | Method for predicting store release separation track based on small sample size | |
CN118133707A (en) | A neural network multi-precision flow field modeling method integrating boundary and physical constraints |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |