Two-dimensional O-shaped grid automatic generation method based on deep learning model

The automatic generation of two-dimensional O-type grids through deep learning models solves the problems of low automation and difficult to guarantee grid quality in traditional methods, and realizes efficient and high-quality grid generation, which is suitable for computational fluid dynamics analysis of complex appearances.

CN120277803APending Publication Date: 2025-07-08BEIJING SPACEFLIGHT TUOPUGAO SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510331534.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

Traditional O-type grid generation methods are low in automation, time-consuming and difficult to guarantee the grid quality when dealing with complex geometric shapes, making it difficult to meet the needs of computational fluid dynamics analysis.

Method used

Deep learning models, especially CNN, U-Net or ViT, are used to train and optimize grid coordinate information to generate efficient and high-quality two-dimensional O-mesh, and use deep learning models to automatically process wing profile data to generate grids that comply with CFD analysis.

Benefits of technology

It realizes efficient and automated grid generation, improves grid quality, and is suitable for various two-dimensional complex appearances, meeting the needs of computational fluid dynamics analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120277803A_ABST
    Figure CN120277803A_ABST
Patent Text Reader

Abstract

The invention discloses a two-dimensional O-shaped grid automatic generation method based on a deep learning model, and the method comprises the following steps: S1, selecting wing shape data, and constructing an O-shaped grid data set; s2, performing coordinate transformation on the O-shaped grid data set to obtain a first tensor; s3, constructing a label tensor and a first input tensor according to the first tensor; s4, taking the label tensor and the first input tensor as a training data set to train a deep learning model; s5, performing coordinate transformation on the target wing contour information to obtain a second tensor, and performing expansion operation to obtain a second input tensor; and S6, inputting the second input tensor into the trained deep learning model to obtain a prediction tensor of the contour coordinate information of the target wing. According to the method, automatic generation of the grids is achieved by training the deep learning model, manual intervention is reduced, the grid generation efficiency and quality are improved, meanwhile, the method is suitable for generation of grids of various two-dimensional complex shapes, and the method has wide application prospects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical fields of computational fluid dynamics and machine learning, and particularly relates to a method for automatically generating a two-dimensional O-type grid based on a deep learning model. Background Art

[0002] The O-type grid is a commonly used grid type in specific computational fluid dynamics (CFD) problems, especially suitable for dealing with flow regions with circular or annular boundaries. The O-type grid is an annular grid layout around a central point, shaped like the letter "O", usually composed of a series of concentric circles (or ellipses) and radial lines, used to capture the complex flow characteristics in the flow region, and has a wide range of applications in the CFD field.

[0003] Traditional grid generation methods rely on manual construction, and there are problems such as low automation, long time consumption, and difficult-to-guarantee grid quality when dealing with complex geometries. In recent years, with the development of deep learning technology, it has shown powerful capabilities in fields such as image processing and pattern recognition, providing new ideas for grid generation. And how to use deep learning technology to achieve efficient, automatic and high-precision O-type grid generation to replace manual grid construction is a technical problem that urgently needs to be solved at present. Summary of the Invention

[0004] The purpose of the present invention is to provide a method for automatically generating a two-dimensional O-type grid based on a deep learning model to solve the above technical problems.

[0005] To achieve the above purpose, the present invention provides the following technical solutions: The present invention discloses a method for automatically generating a two-dimensional O-type grid based on a deep learning model, including the following steps: Step S1: Select wing shape data, use grid processing software to perform O-type grid division on the wing shape data, and construct an O-type grid dataset, where the O-type grid dataset includes the coordinate information of the O-type grid in the curvilinear coordinate system; Step S2: After performing coordinate transformation on the O-type grid dataset constructed in Step S1, obtain the first tensor; The coordinate transformation process is as follows: Save the coordinate information of the O-type grid into the tensor in a specific order. Specifically, for the points on each circle, arrange them in the counterclockwise direction, and then traverse each circle in turn. During the traversal process, index the coordinates of the points on each circle respectively and store them in the corresponding positions of the pre-prepared horizontal and vertical coordinate tensors in order; Step S3: Copy the first tensor obtained in Step S2 to obtain two identical first tensors; one of the first tensors is used as the label tensor, and the other first tensor is processed by coordinates and used as the first input tensor; The coordinate processing process is as follows: retain the coordinate information of the innermost circle in the O-grid dataset, that is, the wing profile coordinate information, and set all other coordinate information to "0". Step S4: Use the label tensor and the first input tensor obtained in step S3 as the training dataset to train the deep learning model. During the training process, use the first input tensor as the model input and the label tensor as the model output to train the model until the model training is completed. Step S5: For the target wing profile coordinate information of the O-grid to be generated, after performing the coordinate transformation as described in step S2, obtain the second tensor, and then perform an expansion operation on the second tensor to obtain the second input tensor, that is: use the target wing profile coordinate information as the innermost layer, and fill the remaining positions with "0". The second input tensor has the same format and order as the first input tensor. Step S6: Input the second input tensor obtained in step S5 into the trained deep learning model obtained in step S4, and after calculation, obtain the prediction tensor of the target wing profile coordinate information of the O-grid to be generated.

[0006] Furthermore, the wing shape data in step S1 is NACA wing shape data.

[0007] Furthermore, the deep learning model in step S4 is CNN, U-Net or ViT.

[0008] Furthermore, the specific process of training the model until the model training is completed in step S4 is as follows: during the model training process, use the loss function to calculate the error between the predicted label tensor and the true label tensor, and use the backpropagation algorithm to optimize the model parameters to minimize the error between the grid coordinate information output by the model and the true grid coordinate information, which specifically includes the following steps: Step S41: Forward propagation, the input data is calculated through each layer of the neural network. The neurons in each layer receive the output of the neurons in the previous layer as input, and after weighted summation and application of the activation function, the result is passed to the next layer until the prediction tensor of the output layer is obtained through the entire neural network. Step S42: Use the mean absolute error loss function to calculate the error between the predicted label tensor and the true label tensor. The formula is: In the formula, is the mean absolute error, is the sample size, is the true value, is the predicted value; Step S43: Backward error propagation. Starting from the output layer, calculate the errors of each hidden layer layer by layer. Specifically, multiply the error of the next layer by the weight of the corresponding connection, then sum up these products, and multiply by the change rate of the activation function of this hidden layer at the weighted input to obtain the error of this hidden layer; Step S44: Calculate the gradients, that is, calculate the change rates of the loss function with respect to the weights and biases of each layer; Step S45: Update the parameters. Update the trainable parameters of the neural network according to the calculated gradients; By continuously repeating the above steps to update the trainable parameters, the value of the mean absolute error loss function becomes smaller and smaller, improving the prediction performance of the model; The cross-validation method is used to evaluate the model performance to prevent overfitting; Until the number of training times reaches the preset maximum number, or the value of the loss function is less than the set threshold, the model training is completed.

[0009] The beneficial effects of the present invention include the following aspects: (1) High efficiency and automation: The automatic generation of grids is realized through the deep learning model, reducing manual intervention and improving the efficiency of grid generation.

[0010] (2) High grid quality: The deep learning model can learn the complex relationship between the geometric shape and the grid division, generate high-quality grids, and meet the requirements of CFD analysis.

[0011] (3) Strong versatility: The method described in the present invention is applicable to the grid generation of various two-dimensional complex shapes, with broad application prospects.

[0012] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. Description of the Drawings

[0013] Figure 1 is the flow chart of the method described in the present invention; Figure 2 is the schematic diagram of the process of obtaining the first tensor after coordinate transformation of the grid coordinates in the O-type grid dataset; Figure 3 is the schematic diagram of the process of obtaining the label tensor and the first input tensor from the first tensor; Figure 4 is the schematic diagram of the process of training the deep learning model using the first input tensor and the label tensor; Figure 5 is the schematic diagram of the process of obtaining the second input tensor from the second tensor of the O-type grid to be generated; Figure 6 is the schematic diagram of the process of obtaining the predicted tensor of the O-type grid to be generated using the deep learning model. Detailed Embodiments

[0014] Example 1 This embodiment provides a method for automatically generating a two-dimensional O-grid based on a deep learning model, as Figure 1 shown. The method includes the following steps: Step S1: Select wing shape data, perform O-grid division on the wing shape data using grid processing software, and construct an O-grid dataset.

[0015] To ensure the accuracy, reliability of the experimental data and its comparability with existing methods, the wings selected in the present invention are all commonly used NACA wings in the industry. NACA wings cover a variety of airfoil types, can meet different research purposes, have the convenience of parametric design, mature relevant theoretical basis, and are widely used and fully verified in the aviation field.

[0016] After collecting the basic airfoil data, grid division is carried out. To ensure the quality of the grid data, the method of manually dividing the O-grid is adopted and ICEM software is used for division to obtain the O-grid dataset. The content of this dataset includes the O-grid coordinate information described in the curvilinear coordinate system, where the radial distance (polar radius) and azimuth angle (polar angle) respectively represent the distance of the grid point from the center and its azimuth position. The curvilinear coordinate system is a mathematical description system, whose coordinate lines can be curved and can more flexibly adapt to complex geometric regions (such as cylinders, spheres or irregular boundaries). In this coordinate system, the unit vectors in each coordinate direction may change with position, and the coordinate lines usually maintain an orthogonal relationship, and are commonly used in numerical simulations in fields such as computational fluid dynamics and electromagnetics.

[0017] Step S2: After performing coordinate transformation on the O-grid dataset constructed in step S1, obtain the first tensor.

[0018] Since the disorder of the grid coordinates in the curvilinear coordinate system is not suitable for machine learning model training, it is necessary to convert the data form into the form of a tensor. As Figure 2 shown, through coordinate transformation, the O-grid dataset is transformed into a tensor representation. The grid coordinate information is generated in the order of the curvilinear coordinate system and needs to be converted into the form of a common NumPy tensor. Therefore, it is extracted counterclockwise from the inside to the outside and stored in the first tensor one by one.

[0019] Specifically, the data used in the training of the present invention are all O-grid coordinate information described in a curvilinear coordinate system at the same resolution. Each data has 192 concentric circles, and 384 points are distributed on each concentric circle. To save the coordinates of these points into the first tensor in a specific order, for the points on each circle, they are arranged in a counterclockwise direction. Subsequently, each circle is traversed in turn. During the traversal process, the coordinates (Cartesian coordinates, including abscissa and ordinate) of the points on each circle are indexed in turn and stored in the corresponding positions of the pre-prepared abscissa and ordinate tensors in order. Finally, the first tensor of a single piece of data with a shape of (192, 384, 2) is obtained. That is: the original grid is 192 * 384 pairs of abscissa and ordinate. After processing, it forms the first tensor with a shape of (192, 384, 2). It is sliced into two tensors of (192, 384) from the third dimension to save the abscissa and ordinate respectively, and the coordinates correspond one by one.

[0020] Step S3: Copy one copy of the first tensor obtained in Step S2 to get two identical first tensors; one of the first tensors (including complete grid coordinate information) is used as the label tensor, and the other first tensor is processed for coordinates and used as the first input tensor. The coordinate processing process is as follows: retain the coordinate information of the innermost circle in the O-grid dataset, that is, the wing contour coordinate information, and set all other coordinate information to "0", as Figure 3 shown.

[0021] Step S4: Use the label tensor and the first input tensor obtained in Step S3 as the training dataset to train a deep learning model. The deep learning model can be CNN, U-Net, ViT, etc. As Figure 4 shown, during the training process, use the first input tensor as the model input and the label tensor as the model output to train the model until the model training is completed.

[0022] During the model training process, use a loss function (such as the mean absolute error loss function MAE) to calculate the error between the predicted label tensor and the true label tensor of the model, and use the backpropagation algorithm to optimize the model parameters to minimize the error between the grid coordinate information output by the model and the true grid coordinate information. Specifically, it includes the following steps: Step S41: Forward propagation. The input data is calculated through each layer of the neural network. The neurons in each layer receive the output of the neurons in the previous layer as input. After weighted summation and application of the activation function, the result is passed to the next layer until the predicted tensor of the output layer is obtained through the entire neural network.

[0023] Step S42: Use the mean absolute error loss function to calculate the error between the predicted label tensor and the true label tensor. The formula is: Wherein, is the mean absolute error, is the sample size, is the true value, is the predicted value.

[0024] Step S43: Backward error propagation. Starting from the output layer, calculate the errors of each hidden layer layer by layer in reverse. For each hidden layer, its error is passed from the error of the next layer. Specifically, multiply the error of the next layer by the weight of the corresponding connection, then add up these products, and then multiply by the change rate of the activation function of this hidden layer at the weighted input to obtain the error of this hidden layer.

[0025] Step S44: Calculate the gradient. After the error is calculated, calculate the change rate of the loss function with respect to the weights and biases of each layer, that is, the gradient.

[0026] Step S45: Update the parameters. Update the trainable parameters of the neural network according to the calculated gradient. Use the gradient descent algorithm to subtract a value related to the gradient (gradient multiplied by the learning rate) from the current weights and biases.

[0027] By continuously repeating the above steps, update the trainable parameters to make the value of the mean absolute error loss function smaller and smaller, improving the prediction performance of the model; use the cross-validation method to evaluate the model performance to prevent overfitting; until the number of training times reaches the preset maximum number, or the value of the loss function is less than the set threshold, the model training is completed. Thus, the deep learning model obtains the mapping relationship between the wing profile coordinate information and the label tensor.

[0028] Step S5: For the target wing profile coordinate information for generating the O-grid (used to describe the wing shape of the O-grid to be generated), after performing the coordinate transformation according to Step S2, obtain the second tensor, and then perform an expansion operation on the second tensor to obtain the second input tensor, as Figure 5 shown, that is: use the target wing profile coordinate information as the innermost layer, and fill the remaining positions with "0" (the shape of the tensor required for model input). The second input tensor has the same format and order as the first input tensor.

[0029] Step S6: Input the second input tensor obtained in Step S5 into the trained deep learning model obtained in Step S4, and after calculation, obtain the predicted tensor of the target wing profile coordinate information for generating the O-grid, as Figure 6 shown.

[0030] Finally, it should be noted that the above is only used to illustrate the technical solution of the present invention and not to limit it. Although the present invention has been described in detail with reference to the preferred solutions, those of ordinary skill in the art should understand that the technical solution of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the present invention.

Claims

1. A method for automatically generating a two-dimensional O-shaped grid based on a deep learning model, characterized in that It includes the following steps: Step S1: Select the wing shape data, use grid processing software to perform O-type grid division on the wing shape data, and construct an O-type grid data set, where the O-type grid data set includes the coordinate information of the O-type grid in the curvilinear coordinate system; Step S2: After performing coordinate transformation on the O-type grid data set constructed in Step S1, obtain the first tensor; The coordinate transformation process is as follows: Save the coordinate information of the O-type grid into the tensor in a specific order. Specifically, for the points on each circle, arrange them in a counterclockwise direction, and then traverse each circle in turn. During the traversal process, index the coordinates of the points on each circle respectively and store them in the corresponding positions of the pre-prepared horizontal and vertical coordinate tensors in order; Step S3: Copy the first tensor obtained in Step S2 to get two identical first tensors; one of the first tensors is used as the label tensor, and the other first tensor is processed by coordinates and used as the first input tensor; The coordinate processing process is as follows: Retain the coordinate information of the innermost circle in the O-type grid data set, that is, the wing contour coordinate information, and set all other coordinate information to "0"; Step S4: Use the label tensor and the first input tensor obtained in Step S3 as the training data set to train the deep learning model. During the training process, use the first input tensor as the model input and the label tensor as the model output to train the model until the model training is completed; Step S5: For the target wing contour coordinate information of the O-type grid to be generated, after performing the coordinate transformation as described in Step S2, obtain the second tensor, and then perform an expansion operation on the second tensor to obtain the second input tensor, that is: use the target wing contour coordinate information as the innermost layer, and fill the remaining positions with "0". The second input tensor has the same format and order as the first input tensor; Step S6: Input the second input tensor obtained in Step S5 into the trained deep learning model obtained in Step S4, and after calculation, obtain the prediction tensor of the target wing contour coordinate information of the O-type grid to be generated.

2. The automatic generation method of a two-dimensional O-shaped grid based on a deep learning model according to claim 1, characterized in that, The wing shape data described in Step S1 is NACA wing shape data.

3. A two-dimensional O-grid automatic generation method based on a deep learning model according to claim 1, characterized in that The deep learning model described in Step S4 is CNN, U-Net or ViT.

4. A two-dimensional O-grid automatic generation method based on a deep learning model according to claim 1, wherein The specific process of training the model until the model training is completed in Step S4 is as follows: During the model training process, use the loss function to calculate the error between the predicted label tensor and the true label tensor, and use the backpropagation algorithm to optimize the model parameters to minimize the error between the grid coordinate information output by the model and the true grid coordinate information. Specifically, it includes the following steps: Step S41: Forward propagation. The input data is calculated through each layer of the neural network. The neurons in each layer receive the output of the neurons in the previous layer as input, and after weighted summation and application of the activation function, the result is passed to the next layer until the predicted tensor of the output layer is obtained through the entire neural network; Step S42: Use the mean absolute error loss function to calculate the error between the predicted label tensor and the true label tensor. The formula is: Wherein, is the mean absolute error, is the sample size, is the true value, is the predicted value; Step S43: Backward error propagation. Starting from the output layer, calculate the errors of each hidden layer layer by layer. Specifically, multiply the error of the next layer by the weight of the corresponding connection, then add up these products, and multiply by the change rate of the activation function of this hidden layer at the weighted input to obtain the error of this hidden layer; Step S44: Calculate the gradients, that is, calculate the change rates of the loss function with respect to the weights and biases of each layer; Step S45: Update the parameters, and update the trainable parameters of the neural network according to the calculated gradients; By continuously repeating the above steps to update the trainable parameters, the mean absolute error loss function value becomes smaller and smaller, improving the prediction performance of the model; use the cross-validation method to evaluate the model performance and prevent overfitting; until the number of training times reaches the preset maximum number or the loss function value is less than the set threshold, the model training is completed.