A flow field prediction method, system, storage medium and device
By collecting and preprocessing sample data and utilizing a multi-head deep convolutional neural network coupled with OpenFOAM, we solved the problems of high computational overhead of traditional CFD methods and decreased prediction performance of data-driven methods, achieving efficient and accurate flow field prediction.
Patent Information
- Application Number
- CN202410870578.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-07-01
AI Technical Summary
Traditional CFD methods have high computational overhead and cost in flow field prediction, and data-driven methods have limitations in dealing with data distribution problems, resulting in reduced model prediction performance and failure to meet convergence constraints.
Sample data under different airfoils and flow conditions are collected, pre-processed and input into the neural network for prediction. The data are iteratively refined through the physical solver, and the flow field features are extracted using a multi-head deep convolutional neural network. It is then iteratively refined in combination with OpenFOAM to meet the convergence constraints.
It achieves high-precision and high-efficiency flow field prediction, can adapt to different flow conditions and geometric shapes, and accelerates the convergence process.
Smart Images

Figure CN118862717B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of fluid mechanics applications, and in particular to a flow field prediction method, system, storage medium, and device. Background Art
[0002] Computational fluid dynamics (CFD) plays an important role in science and engineering, such as aerospace, power generation, biomedical engineering, and marine engineering. However, numerical methods such as the finite volume method and the finite element method require extensive numerical iterations, resulting in expensive computational overhead and slow convergence. To address these challenges, it is crucial to explore efficient and accurate methods for rapid flow prediction.
[0003] Traditional CFD methods are computationally expensive and costly for flow field prediction. With the development of intelligent computing technology, data-driven deep learning methods have become an important tool for solving complex physical problems and are widely used in flow field prediction. However, due to the varying data distributions of various physical quantities, interference can occur during the prediction process. Existing methods have limitations in handling data distribution issues, resulting in reduced model prediction performance. Furthermore, most methods fail to meet convergence constraints. Summary of the Invention
[0004] The purpose of this application is to provide a flow field prediction method, system, computer-readable storage medium and electronic device that can achieve high-precision and high-efficiency flow field prediction.
[0005] To solve the above technical problems, this application provides a flow field prediction method, the specific technical solutions are as follows:
[0006] Collect sample data under different airfoils and different flow conditions;
[0007] Preprocessing the sample data;
[0008] Input the preprocessed data into the neural network for prediction to obtain the prediction results;
[0009] The prediction results are iteratively refined using a physical solver to obtain flow field prediction results that meet convergence constraints.
[0010] Optionally, the preprocessing of the data includes:
[0011] A dimensionless operation is performed on the data by normalization processing.
[0012] Optionally, the encoder includes at least one encoding block; the encoding block is used to gradually reduce the image size of the data and extract flow field features through convolution and pooling operations;
[0013] Each of the encoding blocks includes multiple main encoding branches for extracting flow field features in parallel; each of the main encoding branches includes multiple sub-encoding branches, and each of the main encoding branches and the sub-encoding branches includes at least one feature extraction module; the feature extraction module includes a convolution layer or a maximum pooling layer;
[0014] The convolution kernel size of the convolution layer is N×N, where N is an integer greater than or equal to 1;
[0015] After the preprocessed data is input into the encoder, each of the encoding blocks connects the encoding results corresponding to the multiple main encoding branches by channel and sends them to the activation function layer.
[0016] Optionally, the decoder includes at least one decoding block; the decoding block is used to reconstruct flow field features;
[0017] Each of the decoding blocks includes multiple main decoding branches for parallel reconstruction of flow field information; each of the main decoding branches includes multiple sub-decoding branches, and each of the main decoding branches and the sub-decoding branches includes at least one upsampling module; the upsampling module includes a transposed convolution layer or an interpolation layer;
[0018] For the transposed convolution layer, the convolution kernel size is N×N, where N is an integer greater than or equal to 1;
[0019] After the data passes through the multiple main decoding branches in the decoding block, the results are connected by channel and sent to the activation function layer.
[0020] Optionally, the iterative refinement of the prediction results using a physical solver includes:
[0021] The prediction results were input into OpenFOAM, and the convergence constraints were defined as the residual standards of velocity, pressure and modified eddy viscosity were all reduced to 1e-5;
[0022] When the residual error criterion is met, the iterative calculation of OpenFOAM is stopped.
[0023] Optionally, collecting sample data under different airfoils and different flow conditions includes:
[0024] Determine the sampling area;
[0025] Within the sampling area, uniform sampling is performed at preset intervals along the coordinate axis direction to determine four physical quantity values at each sampling point; the physical quantities include:
[0026] velocity component in the x-axis direction, velocity component in the y-axis direction, pressure, and modified eddy viscosity;
[0027] The four physical quantity values are connected as four channels to obtain a real image.
[0028] Optionally, the step of inputting the preprocessed data into a neural network for prediction and obtaining a prediction result further includes:
[0029] Determine the structural similarity between the predicted image and the target image based on the structural similarity formula;
[0030] Constructing a hybrid loss function based on the structural similarity; the hybrid loss function is used to evaluate prediction accuracy;
[0031] The structural similarity formula is:
[0032]
[0033] Among them, SSIM is the structural similarity, μ p and μ t Respectively represent the average values of physical quantities in the predicted flow field and the target flow field; σ pt represents the covariance of physical quantities in the predicted flow field and the target flow field; σ p and σ t represent the standard deviations of the physical quantities in the predicted flow field and the target flow field respectively; c1 and c2 are constants.
[0034] The present application also provides a flow field prediction system, comprising:
[0035] Data acquisition module, used to collect sample data under different airfoils and different flow conditions;
[0036] A data preprocessing module, used for preprocessing the sample data;
[0037] The data prediction module is used to input the preprocessed data into the neural network for prediction and obtain the prediction results;
[0038] The prediction result optimization module is used to iteratively refine the prediction result using a physical solver to obtain a flow field prediction result that meets the convergence constraint.
[0039] The present application also provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above-described method when executed by a processor.
[0040] The present application also provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above-mentioned method when calling the computer program in the memory.
[0041] The present application provides a flow field prediction method, comprising: collecting sample data under different airfoils and different flow conditions; preprocessing the sample data; inputting the preprocessed data into a neural network for prediction to obtain a prediction result; and iteratively refining the prediction result using a physical solver to obtain a flow field prediction result that meets convergence constraints.
[0042] This application applies neural networks for prediction and calls OpenFOAM as a physical solver for iterative refinement. The neural network and the physical solver are coupled and applied to obtain a new data-driven framework that can be used for flow field prediction. It fully utilizes the function approximation ability of the neural network and the characteristics of the physical solver to ensure convergence constraints, accelerates the convergence process, and can adapt to different flow conditions and geometric shapes to achieve high-precision and high-efficiency predictions.
[0043] The present application also provides a flow field prediction system, a computer-readable storage medium, and an electronic device, which have the above-mentioned beneficial effects and are not described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0045] Figure 1 A flow chart of a flow field prediction method provided in an embodiment of the present application;
[0046] Figure 2 A schematic diagram of the structure of a multi-head deep convolutional neural network provided in an embodiment of the present application;
[0047] Figure 3 A schematic diagram of the operation process of a multi-head deep convolutional neural network provided in an embodiment of the present application;
[0048] Figure 4 A flow chart of a sample data collection method provided in an embodiment of the present application;
[0049] Figure 5 A schematic diagram of an unstructured grid close to the NACA0012 airfoil wall provided in an embodiment of the present application;
[0050] Figure 6 Provided in the embodiments of this application Figure 5 Schematic diagram of interpolation mapping corresponding to unstructured grid;
[0051] Figure 7A schematic diagram of the flow field prediction system structure provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0053] This application first uses the physical solver OpenFOAM to generate samples under different airfoils and different flow conditions (angle of attack, Mach number), and divides them into training sets, test sets and validation sets; then preprocesses the data so that it can be fed into the neural network for prediction; in order to ensure that the final result meets the physical convergence constraints, the prediction results are iteratively refined using the physical solver, aiming to achieve efficient and accurate prediction of the physical quantities of the flow field.
[0054] Please refer to Figure 1 , Figure 1 A flow chart of a flow field prediction method provided in an embodiment of the present application, the method comprising:
[0055] S101: Collect sample data under different airfoils and different flow conditions;
[0056] S102: Preprocessing the sample data;
[0057] S103: Input the preprocessed data into the neural network for prediction to obtain a prediction result;
[0058] S104: Iteratively refine the prediction result using a physical solver to obtain a flow field prediction result that meets the convergence constraint.
[0059] First, sample data is collected, which includes sample data under different airfoils and different flow conditions. Specifically, the physical solver OpenFOAM can be used to generate sample data. There is no limitation on how to use the physical solver to generate sample data. Specifically, the computational domain can be spatially discretized first, and initial conditions and boundary conditions can be assigned, and then the required physical parameters can be assigned. The physical parameters include density, viscosity, and diffusion coefficient, etc. At the same time, an adaptive solver is selected, such as simpleFoam, icoFoam, pimpleFoam, pisoFoam, etc. In this process, changes in physical properties under specific temperature and pressure can be further considered, such as density, dynamic viscosity, etc. Thus, the physical field is used in the form of global variables as sample data.
[0060] After obtaining the sample data, the sample data can be further divided into a training set, a test set, and a validation set. The data ratios for dividing the training set, the test set, and the validation set are not limited and can be set by those skilled in the art.
[0061] Thereafter, a dimensionless operation may be performed on the data by applying a normalization process.
[0062] Dimensionless transformation is used to convert fluid physical quantities into universal forms. This not only reduces the number of free parameters, but also ensures that different physical quantities are on the same order of magnitude, thereby improving the learning efficiency of data in network training and the generalization ability of the model. The dimensionless physical quantities of all samples are: u / U r ,v / U r , The subscript r indicates a reference value.
[0063] In machine learning and deep learning models, data normalization can accelerate the convergence of learning algorithms, help prevent certain features from affecting the model training process due to their large numerical range, and improve model stability. For example, Min-Max normalization can be used. Min-Max normalization is a common normalization method, and its formula is as follows:
[0064]
[0065] in is the value of the ith physical quantity (ith channel) in the jth sample, max(x i ) and min(x i ) are the minimum and maximum values of the i-th physical quantity in all samples, respectively. Dimensionless transformation followed by normalization can improve the universality of physical meaning, enhance the generalization ability of the model, optimize model training, and enhance data processing consistency.
[0066] After preprocessing, the preprocessed data can be input into the neural network for prediction to obtain the prediction results. The specific structure of the neural network is not limited here. In order to further improve the prediction effect, this embodiment further optimizes the neural network:
[0067] The neural network can be a multi-head deep convolutional neural network (MH-DCNet). Figure 2 , Figure 2 This is a schematic diagram of the structure of the multi-head deep convolutional neural network provided in the embodiment of the present application. The MH-DCNet architecture can be expressed as the following function:
[0068]
[0069] The left side of the function represents the data of MH-DCNet, and the right side represents the prediction result. Among them, x and y represent the coordinates of the interpolation point; Mach and AOA represent the Mach number and angle of attack respectively; d represents the shortest distance from the interpolation point to the airfoil boundary, and the value inside the airfoil is set to 0. The prediction output is the velocity component in the x-axis direction (u), the velocity component in the y-axis direction (v), the pressure (p), and the corrected eddy viscosity.
[0070] The input size of MH-DCNet is 5×128×128 and the output size is 4×128×128.
[0071] The multi-head deep convolutional neural network consists of three encoders, four decoders and four distributors; the encoders are used to extract flow field features, the decoders are used to generate prediction results, and the distributors are used to assign corresponding weights to each encoder; the weights are used to adapt to different data distributions of physical quantities.
[0072] To further describe the structure of the multi-head deep convolutional neural network provided in this embodiment, please refer to Figure 3 , Figure 3 Schematic diagram of the operation process of the multi-head deep convolutional neural network provided in the embodiment of the present application. Figure 3 It includes encoder 1, encoder 2 and encoder 3, as well as decoder 1 and distributor 1. In addition, the specific process of encoding block and decoding block is shown, and the size changes of decoding process and encoding process are shown in detail.
[0073] The encoder includes at least one encoding block; the encoding block is used to gradually reduce the image size of the data and extract flow field features through convolution and pooling operations;
[0074] Each of the encoding blocks includes multiple main encoding branches for extracting flow field features in parallel; each of the main encoding branches includes multiple sub-encoding branches, and each of the main encoding branches and the sub-encoding branches includes at least one feature extraction module; the feature extraction module includes a convolution layer or a maximum pooling layer;
[0075] The convolution kernel size of the convolution layer is N×N, where N is an integer greater than or equal to 1;
[0076] After the preprocessed data is input into the encoder, each of the encoding blocks connects the encoding results corresponding to the multiple main encoding branches by channel and sends them to the activation function layer.
[0077] In one feasible embodiment, the encoder includes seven encoding blocks; the encoding blocks are used to gradually reduce the image size of the data and extract flow field features through convolution and pooling operations. The specific structure of the encoding block can be found in Figure 3 The structure in the top dotted box. Each coding block contains three main coding branches: the first main coding branch contains a 3×3 convolution layer, the second main coding branch contains a 1×1 convolution layer and a 3×3 convolution layer, and the third main coding branch contains a maximum pooling layer; the 3×3 convolution layer uses a convolution kernel of size 3, stride 2, and padding 1; the 1×1 convolution layer uses a convolution kernel of size 1, stride 1, and padding 0;
[0078] "Batch Normalization" refers to the batch normalization layer. Additionally, there are activation and max pooling layers. After the data passes through the three main encoding branches in the encoding block, the results are concatenated channel-wise and fed into the activation layer. Each encoding block gradually reduces the image size and extracts flow field features through convolution and pooling operations. The encoder provides the decoder with a rich and comprehensive feature representation.
[0079] The decoder includes at least one decoding block; the decoding block is used to reconstruct flow field features;
[0080] Each of the decoding blocks includes multiple main decoding branches for parallel reconstruction of flow field information; each of the main decoding branches includes multiple sub-decoding branches, and each of the main decoding branches and the sub-decoding branches includes at least one upsampling module; the upsampling module includes a transposed convolution layer or an interpolation layer;
[0081] For the transposed convolution layer, the convolution kernel size is N×N, where N is an integer greater than or equal to 1;
[0082] After the data passes through the multiple main decoding branches in the decoding block, the results are connected by channel and sent to the activation function layer.
[0083] In a feasible embodiment, the decoder is used to reconstruct the flow field features extracted by the encoder, and includes seven decoding blocks. It should be noted that there is no size or requirement between the number of decoding blocks and the number of encoding blocks. The structure of the decoding block can be found in Figure 3 As shown in the bottom dotted box. Figure 3 It can be seen that the decoding block contains the first main decoding branch and the second main decoding branch. After the data enters the bilinear interpolation layer in the first main decoding branch, it enters the first sub-decoding branch and the second sub-decoding branch; the first sub-decoding branch contains a 1×1 convolution layer and a 3×3 convolution layer; the second sub-decoding branch contains a 3×3 convolution layer.
[0084] The bilinear interpolation layer is used to keep the number of image channels of the data unchanged and expand the image size.
[0085] The second main decoding branch includes a pixel reshaping layer, which is used to reduce the number of image channels and increase the image size. For example, during the decoding block application, the bilinear interpolation layer maintains the number of channels of the input image while doubling its size, while the pixel reshaping layer reduces the number of channels to 1 / 4 of the original image while doubling the image size. The decoder's dual main branch structure effectively utilizes feature information from multiple perspectives to accurately reconstruct and predict the flow field.
[0086] After the data passes through the first main decoding branch and the second main decoding branch, the results are connected by channel and sent to the activation function layer.
[0087] In the decoder, the 3×3 convolutional layer uses a convolution kernel of size 3, stride 1, and padding 1; the 1×1 convolutional layer uses a convolution kernel of size 1, stride 1, and padding 0.
[0088] The allocator, consisting of a linear layer and a softmax layer, assigns appropriate weights to different encoders, reflecting their contribution to the prediction task. This weight allocation mechanism enhances the adaptive capabilities of MH-DCNet, enabling it to better extract flow field features and thus achieve accurate prediction of physical quantities.
[0089] Finally, the prediction results output by the neural network are iteratively refined. Specifically, the prediction results can be input into OpenFOAM, and the convergence constraint is set as the residual standard for velocity, pressure, and modified eddy viscosity is reduced to 1e-5. When the residual standard is met, the iterative calculation of OpenFOAM is stopped. 1e-5 is a commonly used convergence standard. Other convergence standards may also be used in other embodiments of the present application.
[0090] The embodiment of the present application applies a neural network for prediction and calls OpenFOAM as a physical solver for iterative refinement. The neural network and the physical solver are coupled and applied to obtain a new data-driven framework that can be used for flow field prediction. It fully utilizes the function approximation ability of the neural network and the characteristics of the physical solver to ensure convergence constraints, accelerates the convergence process, and can adapt to different flow conditions and geometric shapes to achieve high-precision and high-efficiency predictions.
[0091] The following is a further explanation of the dataset generation process:
[0092] When collecting sample data for different airfoils and different flow conditions, refer to Figure 4 , Figure 4The flowchart of a sample data collection method provided in an embodiment of the present application can be applied with the following steps:
[0093] S201: Determine the sampling area;
[0094] S202: uniformly sampling at preset intervals along the coordinate axis within the sampling area to determine four physical quantity values at each sampling point;
[0095] S203: Connect the four physical quantity values as four channels to obtain a real image.
[0096] In the practical application of this embodiment, the Spalart-Allmaras single-equation turbulence model (a method widely used in CFD) can be used to perform Reynolds Averaged Navier-Stokes (RANS) simulation. [-0.5, 1.5] × [-1.0, 1.0] is used as the sampling area to generate the image. Figure 5 and Figure 6 , Figure 5 This is a schematic diagram of an unstructured grid close to the NACA0012 airfoil wall provided in an embodiment of the present application. Figure 6 Provided in the embodiments of this application Figure 5 Schematic diagram of interpolation mapping for an unstructured grid. The interpolation mapping scheme depicted uniformly samples the x and y directions at intervals of 1 / 64, obtaining the values of four physical quantities at each sampling point. These four quantities are the x-axis velocity component, the y-axis velocity component, pressure, and the modified eddy viscosity. The four channels are then concatenated to form a 4×128×128 image, which serves as the true image.
[0097] In the practical application of this example, OpenFOAM can be used to generate two datasets: one is an airfoil dataset constructed for different airfoils with an angle of attack of 5° and a Mach number of 0.5, and the other is a flow field dataset constructed for a NACA0012 airfoil under various flow conditions. These datasets are used to explore the acceleration performance and generalization ability of MH-DCNet on unseen geometries and different flow conditions.
[0098] In addition, this application constructs a new hybrid loss function. In existing solutions, Mean Squared Error (MSE) and Mean Absolute Error (MAE) are often used for flow field prediction. The specific expressions of MSE and MAE are:
[0099]
[0100] in, and They represent the target value and predicted value of the u velocity component respectively; and They represent the target value and predicted value of the v velocity component respectively; and They represent the target value and predicted value of pressure respectively; and They represent the target value and predicted value of the modified eddy viscosity respectively. N represents the size of the output flow field.
[0101] However, MAE and MSE fail to fully capture the structural information in the image. They primarily focus on global errors while ignoring details, hindering the model's ability to effectively assess image quality and accurately predict flow characteristics. To address these shortcomings, this embodiment uses average structural similarity as part of the loss function to assist MAE and MSE in evaluating prediction performance and improving prediction accuracy.
[0102] Specifically, when the preprocessed data is input into the neural network for prediction and the prediction result is obtained, the structural similarity between the predicted image and the target image can be determined based on the structural similarity formula. Thereafter, a hybrid loss function can be constructed based on the structural similarity, and the expression is: αMAE+βMSE+γMSSIM. This hybrid loss function is used to evaluate the prediction accuracy.
[0103] The structural similarity formula is:
[0104]
[0105] Among them, SSIM is the structural similarity, μ p and μ t Respectively represent the average values of physical quantities in the predicted flow field and the target flow field; σ pt represents the covariance of physical quantities in the predicted flow field and the target flow field; σ p and σ t They represent the standard deviations of the physical quantities in the predicted flow field and the target flow field respectively; c1 and c2 are constants and can be set by those skilled in the art.
[0106] In practice, when measuring the quality of an entire image, a common approach is to calculate structural similarity for different windows and then take the average. MSSIM (Mean Structural Similarity Index) is an extension of structural similarity. It uses a Gaussian-weighted window to more comprehensively and accurately measure the overall structural similarity of an image.
[0107] MSE is a global loss used to ensure the global accuracy of the prediction results. MAE is less sensitive to outliers and helps improve the robustness of the model. MSSIM is used to evaluate the model's predictive performance for complex spatial structures of the flow field and enhance the overall smoothness of the predicted flow field. In a feasible implementation, the hybrid loss function can be MAE+MSE+0.1MSSIM. Of course, the coefficients before MAE, MSE, and MSSIM can also be determined by those skilled in the art in other embodiments of the present application.
[0108] This embodiment constructs a hybrid loss function by introducing average structural similarity, which enables MH-DCNet to capture complex structural information and distribution characteristics of the flow field more comprehensively and accurately.
[0109] A flow field prediction system provided in an embodiment of the present application is introduced below. The flow field prediction system described below and the flow field prediction method described above can be referenced to each other.
[0110] See also Figure 7 , Figure 7 This is a schematic diagram of the structure of a flow field prediction system provided in an embodiment of the present application. The present application also provides a flow field prediction system, including:
[0111] Data acquisition module, used to collect sample data under different airfoils and different flow conditions;
[0112] A data preprocessing module, used for preprocessing the sample data;
[0113] The data prediction module is used to input the preprocessed data into the neural network for prediction and obtain the prediction results;
[0114] The prediction result optimization module is used to iteratively refine the prediction result using a physical solver to obtain a flow field prediction result that meets the convergence constraint.
[0115] Based on the above embodiment, as a preferred embodiment, the data preprocessing module is a module for performing a dimensionless operation on the data by using normalization processing.
[0116] Based on the above embodiments, as a preferred embodiment, the neural network is a multi-head deep convolutional neural network, which includes three encoders, four decoders and four distributors; the encoders are used to extract flow field features, the decoders are used to generate prediction results, and the distributors are used to assign corresponding weights to each of the encoders; the weights are used to adapt to different data distributions of physical quantities.
[0117] Based on the above embodiment, as a preferred embodiment, the encoder includes at least one encoding block; the encoding block is used to gradually reduce the image size of the data and extract flow field features through convolution and pooling operations;
[0118] Each of the encoding blocks includes multiple main encoding branches for extracting flow field features in parallel; each of the main encoding branches includes multiple sub-encoding branches, and each of the main encoding branches and the sub-encoding branches includes at least one feature extraction module; the feature extraction module includes a convolution layer or a maximum pooling layer;
[0119] The convolution kernel size of the convolution layer is N×N, where N is an integer greater than or equal to 1;
[0120] After the preprocessed data is input into the encoder, each of the encoding blocks connects the encoding results corresponding to the multiple main encoding branches by channel and sends them to the activation function layer.
[0121] Based on the above embodiment, as a preferred embodiment, the decoder includes at least one decoding block; the decoding block is used to reconstruct flow field features;
[0122] Each of the decoding blocks includes multiple main decoding branches for parallel reconstruction of flow field information; each of the main decoding branches includes multiple sub-decoding branches, and each of the main decoding branches and the sub-decoding branches includes at least one upsampling module; the upsampling module includes a transposed convolution layer or an interpolation layer;
[0123] For the transposed convolution layer, the convolution kernel size is N×N, where N is an integer greater than or equal to 1;
[0124] After the data passes through the multiple main decoding branches in the decoding block, the results are connected by channel and sent to the activation function layer.
[0125] Based on the above embodiment, as a preferred embodiment, the prediction result optimization module includes:
[0126] A standard comparison unit is used to input the prediction results into OpenFOAM, set the convergence constraint definition as the residual standards of velocity, pressure and modified eddy viscosity are all reduced to 1e-5; when the residual standards are met, stop the iterative calculation of OpenFOAM.
[0127] Based on the above embodiment, as a preferred embodiment, the data acquisition module includes:
[0128] a sampling area determination unit, configured to determine a sampling area;
[0129] a physical quantity determination unit, configured to uniformly sample at preset intervals along the coordinate axis within the sampling area to determine four physical quantity values at each sampling point; the physical quantities comprising: a velocity component in the x-axis direction, a velocity component in the y-axis direction, pressure, and a modified eddy viscosity;
[0130] The physical quantity connection unit is used to connect the four physical quantity values as four channels to obtain a real image.
[0131] Based on the above embodiment, as a preferred embodiment, it also includes:
[0132] A loss function construction module is used to determine the structural similarity between the predicted image and the target image based on a structural similarity formula; construct a hybrid loss function based on the structural similarity; and the hybrid loss function is used to evaluate the prediction accuracy;
[0133] The structural similarity formula is:
[0134]
[0135] Among them, SSIM is the structural similarity, μ p and μ t Respectively represent the average values of physical quantities in the predicted flow field and the target flow field; σ pt represents the covariance of physical quantities in the predicted flow field and the target flow field; σ p and σ t represent the standard deviations of the physical quantities in the predicted flow field and the target flow field respectively; c1 and c2 are constants.
[0136] The present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed, can implement the steps provided in the above embodiments. The storage medium may include: a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, among other media capable of storing program code.
[0137] The present application also provides an electronic device that may include a memory and a processor, wherein the memory stores a computer program, and when the processor calls the computer program in the memory, the steps provided in the above embodiment can be implemented. Of course, the electronic device may also include various network interfaces, a power supply, and other components.
[0138] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the systems provided in the embodiments, since they correspond to the methods provided in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.
[0139] This document uses specific examples to illustrate the principles and implementation methods of this application. The description of the above examples is only intended to help understand the method and core ideas of this application. It should be noted that for those skilled in the art, without departing from the principles of this application, various improvements and modifications can be made to this application, and such improvements and modifications also fall within the scope of protection of the claims of this application.
[0140] It should also be noted that, in this specification, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
Claims
1. A flow field prediction method, characterized in that: include: Collect sample data under different airfoils and different flow conditions; Preprocessing the sample data; The preprocessed data is input into a neural network for prediction to obtain a prediction result; the neural network is a multi-head deep convolutional neural network, and the multi-head deep convolutional neural network includes one or more encoders, decoders and distributors; the encoder is used to extract flow field features, the decoder is used to generate prediction results, and the distributor is used to assign corresponding weights to each encoder; the weights are used to adapt to different data distributions of physical quantities; The prediction results are iteratively refined using a physical solver to obtain flow field prediction results that meet convergence constraints.
2. The flow field prediction method according to claim 1, characterized in that: The preprocessing of the sample data includes: A dimensionless operation is performed on the sample data by adopting normalization processing.
3. The flow field prediction method according to claim 1, characterized in that: The encoder includes at least one encoding block; the encoding block is used to gradually reduce the image size of the data and extract flow field features through convolution and pooling operations; Each of the encoding blocks includes multiple main encoding branches for extracting flow field features in parallel; each of the main encoding branches includes multiple sub-encoding branches, and each of the main encoding branches and the sub-encoding branches includes at least one feature extraction module; The feature extraction module includes a convolution layer or a maximum pooling layer; The convolution kernel size of the convolution layer is N×N, where N is an integer greater than or equal to 1; After the preprocessed data is input into the encoder, each of the encoding blocks connects the encoding results corresponding to the multiple main encoding branches by channel and sends them to the activation function layer.
4. The flow field prediction method according to claim 1, characterized in that: The decoder comprises at least one decoding block; the decoding block is used to reconstruct flow field features; Each of the decoding blocks includes multiple main decoding branches for parallel reconstruction of flow field information; each of the main decoding branches includes multiple sub-decoding branches, and each of the main decoding branches and the sub-decoding branches includes at least one upsampling module; the upsampling module includes a transposed convolution layer or an interpolation layer; For the transposed convolution layer, the convolution kernel size is N×N, where N is an integer greater than or equal to 1; After the data passes through the multiple main decoding branches in the decoding block, the results are connected by channel and sent to the activation function layer.
5. The flow field prediction method according to claim 1, characterized in that: The iterative refinement of the prediction results using a physical solver includes: The prediction results were input into OpenFOAM, and the convergence constraints were defined as the residual standards of velocity, pressure and modified eddy viscosity were all reduced to 1e-5; When the residual error criterion is met, the iterative calculation of OpenFOAM is stopped.
6. The flow field prediction method according to claim 1, characterized in that: The collecting of sample data under different airfoils and different flow conditions includes: Determine the sampling area; Within the sampling area, uniform sampling is performed at preset intervals along the coordinate axis direction to determine four physical quantity values at each sampling point; the physical quantities include: The velocity component in the axial direction, Velocity components, pressure and modified eddy viscosity in the axial direction; The four physical quantity values are connected as four channels to obtain a real image.
7. The flow field prediction method according to claim 1, characterized in that: The step of inputting the pre-processed data into the neural network for prediction and obtaining the prediction result further includes: Determine the structural similarity between the predicted image and the target image based on the structural similarity formula; Constructing a hybrid loss function based on the structural similarity; the hybrid loss function is used to evaluate prediction accuracy; The structural similarity formula is: ; Among them, SSIM is the structural similarity, and Represent the average values of physical quantities in the predicted flow field and the target flow field respectively; Represents the covariance of physical quantities in the predicted flow field and the target flow field; and represent the standard deviations of the physical quantities in the predicted flow field and the target flow field respectively; and is a constant.
8. A flow field prediction system, characterized in that: include: Data acquisition module, used to collect sample data under different airfoils and different flow conditions; A data preprocessing module, used for preprocessing the sample data; A data prediction module is used to input the preprocessed data into a neural network for prediction to obtain a prediction result; the neural network is a multi-head deep convolutional neural network, which includes one or more encoders, decoders and distributors; the encoder is used to extract flow field features, the decoder is used to generate prediction results, and the distributor is used to assign corresponding weights to each encoder; the weights are used to adapt to different data distributions of physical quantities; The prediction result optimization module is used to iteratively refine the prediction result using a physical solver to obtain a flow field prediction result that meets the convergence constraint.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps of the method according to any one of claims 1 to 7 are implemented.