Method for predicting three-dimensional engine flow field based on multi-layer perceptron neural network
By training and preprocessing multilayer perceptron neural networks, the problems of data format conversion and high computational resource consumption are solved, achieving efficient and accurate 3D engine flow field prediction. It is also seamlessly integrated with OpenFOAM software, adapting to the neural network topology, and improving prediction efficiency and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NORTHWESTERN POLYTECHNICAL UNIV
- Filing Date
- 2025-04-16
- Publication Date
- 2026-04-17
AI Technical Summary
In existing technologies, multilayer perceptron neural networks suffer from problems such as complex data format conversion, high computational resource consumption, and long prediction time when predicting three-dimensional engine flow fields. They are particularly difficult to meet the requirements of efficiency and accuracy when dealing with large-scale simulations.
A multilayer perceptron neural network is used for training, and the point cloud data of the OpenFOAM file is converted into a format suitable for the neural network through data preprocessing, including the extraction, integration and normalization of spatial coordinates and environmental parameters. Batch processing is used to reduce the consumption of computing resources, so as to realize the prediction of the three-dimensional engine flow field.
It improves prediction efficiency and accuracy, reduces computational resource consumption, achieves seamless integration with OpenFOAM software, adapts to neural network topology, eliminates interference from dimensional differences, and improves prediction reliability.
Smart Images

Figure CN120430154B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computational fluid dynamics, and in particular to a method for predicting the flow field of a three-dimensional engine based on a multilayer perceptron neural network. Background Technology
[0002] In the field of computational fluid dynamics (CFD), simulation technology plays a crucial role in engine design and optimization, especially in complex applications with high precision requirements, such as wide-area combined engines. Accurate and rapid flow field simulation is essential for optimizing engine performance and efficiency. While traditional CFD methods are powerful, they are computationally complex and time-consuming, particularly when handling large-scale simulations involving millions of meshes, often requiring significant computational resources and time, leading to slow design iterations. With the increasing computational demands, the limitations of traditional CFD methods are becoming increasingly apparent, necessitating more efficient methods to reduce computational resources and accelerate computation time.
[0003] In recent years, multilayer perceptron neural networks (MPNNs) have attracted considerable attention due to their potential in accelerating flow field prediction. MPNNs can significantly shorten prediction time by learning from large amounts of computational fluid dynamics (CFD) simulation data. However, applying MPNNs to engine flow field prediction still faces many challenges, including complex data preprocessing, model architecture design, and ensuring the accuracy and reliability of predictions. Furthermore, existing technologies lack methods for converting complex data formats such as point cloud data from CFD software like OpenFOAM into formats suitable for MPNN input while maintaining data accuracy.
[0004] In summary, although multilayer perceptron neural networks have shown great potential in accelerating flow field prediction, their application still faces many technical challenges, such as the difficulty in accurately converting data. Summary of the Invention
[0005] Therefore, it is necessary to provide a method for predicting the three-dimensional engine flow field based on a multilayer perceptron neural network to address the above-mentioned technical problems. This method can significantly improve prediction efficiency, reduce computing resources, and accurately convert complex data formats such as point cloud data from OpenFOAM software into a format suitable for training multilayer perceptron neural networks.
[0006] This invention provides a method for predicting three-dimensional engine flow fields based on multilayer perceptron neural networks, comprising the following steps:
[0007] Construct a multilayer perceptron neural network and train the multilayer perceptron neural network;
[0008] The target OpenFOAM file is preprocessed to obtain normalized input data;
[0009] The predicted three-dimensional engine flow field corresponding to the target OpenFOAM file is obtained by batch processing normalized input data using a trained multilayer perceptron neural network.
[0010] The data preprocessing for the target OpenFOAM file includes:
[0011] Extract the spatial coordinates of each grid from the target OpenFOAM file;
[0012] Obtain environmental parameters of the target engine's operating conditions, including flight Mach number, total temperature, total pressure, and isolation section inlet Mach number;
[0013] The input data is formed by integrating the spatial coordinates of each grid extracted from the target OpenFOAM file and the environmental parameters of the target engine's operating conditions.
[0014] Normalize the input data.
[0015] In one embodiment, the method for predicting the three-dimensional engine flow field based on a multilayer perceptron neural network further includes converting the predicted three-dimensional engine flow field corresponding to the target OpenFOAM file into a file format compatible with OpenFOAM software.
[0016] In one embodiment, training a multilayer perceptron neural network includes the following steps:
[0017] Data preprocessing is performed on multiple training OpenFOAM files to obtain a normalized training dataset;
[0018] Based on a normalized training dataset, mean squared error is used as the loss function, Adam is used as the optimizer, and a step decay strategy is used as the learning rate to train a multilayer perceptron neural network.
[0019] In one embodiment, data preprocessing for each training OpenFOAM file includes the following steps:
[0020] Internal flow field data was extracted from the training OpenFOAM file. The target variables included in the internal flow field data were pressure, temperature, Mach number, density, CO2, H2O and OH.
[0021] Extract the spatial coordinates of each grid from the OpenFOAM training file;
[0022] Obtain environmental parameters for the target engine's operating conditions;
[0023] The training data is composed of all target variables of the internal flow field data, the spatial coordinates of each grid extracted from the OpenFOAM training file, and the environmental parameters of the target engine's operating conditions.
[0024] The training data is normalized.
[0025] In one embodiment, the multilayer perceptron neural network includes an input layer, N hidden layers, and an output layer along the data input direction to the output direction, where 3≤N≤7;
[0026] The input layer consists of multiple neurons, the same number as the number of types of input data, and the output layer consists of multiple neurons, the same number as the number of types of target variables.
[0027] Along the data input direction to the output direction, the first and last hidden layers contain 10 to 200 neurons, and the middle hidden layers contain 20 to 1000 neurons. The number of neurons in the middle hidden layers is greater than the number of neurons in the first and last hidden layers.
[0028] Each hidden layer includes a ReLU activation function.
[0029] In one embodiment, extracting internal flow field data from the training OpenFOAM file includes the following steps:
[0030] Starting from the root directory of the OpenFOAM training file, traverse each subfolder layer by layer, and for subfolders whose names are numbers, traverse the variable list and extract the numerical data of each variable.
[0031] The numerical data of all extracted variables are organized into a table and saved as a CSV file.
[0032] In one embodiment, a normalization function is used to normalize each value in the training data or input data. The normalization function is:
[0033]
[0034] In the formula, min_val and max_val represent the minimum and maximum values of each column of data in the training data or input data, respectively, normalized_value represents the normalized value, and value represents the value to be normalized.
[0035] In one embodiment, the predicted 3D engine flow field corresponding to the target OpenFOAM file is obtained by batch processing normalized input data using a trained multilayer perceptron neural network, including the following steps:
[0036] Load the trained multilayer perceptron neural network, initialize the parameters of the trained multilayer perceptron neural network, and set it to evaluation mode;
[0037] The input data is divided into multiple batches based on computing resources;
[0038] After filtering and transforming the input data for each batch, the data is fed into the trained multilayer perceptron neural network to obtain the value of the target variable for each batch.
[0039] Convert the numerical values of the target variable for each batch into numerical format;
[0040] The target variables in numerical format from all batches are integrated with the spatial coordinates of the input data to obtain the predicted three-dimensional engine flow field.
[0041] In one embodiment, the input data for each batch is filtered and transformed before being input into the trained multilayer perceptron neural network to obtain the value of the target variable for each batch, including:
[0042] Check and remove rows containing invalid values to obtain valid data for each batch;
[0043] Convert the valid data for each batch into tensor format;
[0044] The effective data of each batch in tensor format is input into the trained multilayer perceptron neural network to obtain the value of the target variable for each batch.
[0045] In one embodiment, converting the predicted 3D engine flow field corresponding to the target OpenFOAM file into an OpenFOAM software-compatible file format includes the following steps:
[0046] Read the numerical values of each variable in the predicted three-dimensional engine flow field;
[0047] The numerical values of each variable in the predicted three-dimensional engine flow field are constructed according to the target OpenFOAM file format to obtain a file format compatible with OpenFOAM software.
[0048] The beneficial effects of this invention are:
[0049] (1) This invention uses a multilayer perceptron neural network to predict the three-dimensional engine flow field. Compared with the traditional computational fluid dynamics simulation method for predicting the three-dimensional engine flow field, it has higher prediction efficiency and reliability.
[0050] (2) This invention obtains an input data format suitable for a multilayer perceptron neural network by preprocessing the target OpenFOAM file to be predicted. During the preprocessing process, the spatial coordinates and engine operating parameters are extracted, integrated, and normalized. After preprocessing, the data is input into the multilayer perceptron neural network. This collaborative input mechanism of spatial coordinates and operating parameters eliminates the interference of dimensional differences in traditional CFD discretized data on neural network training, and makes the input features deeply adapted to the topological structure of the multilayer perceptron neural network under a unified numerical dimension, thereby improving the accuracy of prediction.
[0051] (3) Using the trained multilayer perceptron neural network to batch process normalized input data can effectively reduce the consumption of computing resources. Attached Figure Description
[0052] Figure 1 This is a schematic diagram of the structure of a multilayer perceptron neural network provided in an embodiment of the present invention. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0054] In one embodiment, the method for predicting a three-dimensional engine flow field based on a multilayer perceptron neural network provided in this embodiment includes the following steps:
[0055] S101. Construct a multilayer perceptron neural network and train the multilayer perceptron neural network.
[0056] S102. Perform data preprocessing on the target OpenFOAM file to obtain normalized input data. The normalized input data is stored in CSV file format. The target OpenFOAM file provides spatial coordinates and environmental parameters, extracted from the OpenFOAM simulation software.
[0057] A multilayer perceptron neural network is used to predict the flow field of a three-dimensional engine. Compared with the traditional computational fluid dynamics simulation method, it has higher prediction efficiency and reliability.
[0058] The data preprocessing for the target OpenFOAM file includes:
[0059] S1021. Extract the spatial coordinates of each grid from the target OpenFOAM file. The spatial coordinates are three-dimensional coordinate information, including the values of each grid's X, Y, and Z coordinates, used to describe the spatial position of each grid in the flow field.
[0060] S1022. Obtain environmental parameters for the target engine's operating conditions. These parameters include flight Mach number, total temperature, total pressure, and the Mach number at the isolation section inlet. Environmental parameters describe the boundary conditions and environmental state of the flow field and are an important component of the multilayer perceptron neural network input. They are determined by the target engine's operating environment, with specific operating states having corresponding environmental parameters.
[0061] S1023. Integrate the spatial coordinates of each grid extracted from the target OpenFOAM file and the environmental parameters of the target engine's operating conditions to form the input data. This integration involves column merging of the spatial coordinates and environmental parameters.
[0062] S1024. Normalize the input data. Normalization is performed on each data point in each column of the input data to ensure that each data point is between 0 and 1.
[0063] This embodiment's data preprocessing extracts three-dimensional grid spatial coordinates from the target OpenFOAM file, constructs a multi-dimensional input feature set by combining flight Mach number, total temperature, and total pressure parameters, and then normalizes the integrated data using a column-level extremum-based normalization algorithm. This data preprocessing method, through a collaborative input mechanism of spatial coordinates and operating parameters, eliminates the interference of dimensional differences in traditional CFD discretized data on neural network training, enabling the input features to be deeply adapted to the topological structure of the multilayer perceptron neural network under a unified numerical dimension.
[0064] S103. Using the trained multilayer perceptron neural network, batch process the normalized input data to obtain the predicted three-dimensional engine flow field corresponding to the target OpenFOAM file.
[0065] Batch processing of normalized input data optimizes computational resources, which are determined by the graphics card performance and memory size of the computer performing the prediction. In this embodiment, the normalized input data is divided into multiple batches, each batch is predicted separately, and then all prediction results are merged. Predicting batch by batch avoids memory overflow caused by loading too much data at once.
[0066] In one embodiment, training a multilayer perceptron neural network includes the following steps:
[0067] S201. Perform data preprocessing on multiple training OpenFOAM files to obtain a normalized training dataset.
[0068] The OpenFOAM training file can be an open-source file or an existing OpenFOAM file obtained by yourself using the OpenFOAM software.
[0069] S202. Based on the normalized training dataset, the mean squared error is used as the loss function, Adam is used as the optimizer, and the step decay strategy is used as the learning rate to train the multilayer perceptron neural network.
[0070] In one embodiment, data preprocessing for each training OpenFOAM file includes the following steps:
[0071] S301. Extract internal flow field data from the training OpenFOAM file. The target variables in the internal flow field data are pressure, temperature, Mach number, density, CO2, H2O and OH.
[0072] Specifically, extracting internal flow field data from the OpenFOAM training file includes the following steps:
[0073] S3011. Starting from the root directory of the OpenFOAM training file, traverse each subfolder layer by layer, and for subfolders whose names are numerical values, traverse the variable list and extract the numerical data of each variable.
[0074] In this embodiment, a main function is set to traverse each subfolder of the OpenFOAM training file layer by layer. During the traversal, an auxiliary function is set to determine whether the subfolder name is an integer or a floating-point number, and a data processing function is set to call the set data extraction function to extract the numerical data of each variable.
[0075] S3012. Organize the numerical data of all extracted variables into a table and save it as a CSV file.
[0076] The main function iterates through each subfolder of the OpenFOAM training file; auxiliary functions convert subfolder names to numerical values and determine if they are valid values to ensure that the extracted variables contain actual data; the data processing function calls the data extraction function and organizes the extracted numerical data into a table format; the data extraction function extracts numerical data from subfolders named "Number," and is configured to identify the start and end positions of the data region and extract numerical data, ensuring that only valid numerical data is extracted by skipping non-data rows marked with parentheses. The function stops data extraction when it encounters the end-of-data region marker, ensuring data integrity and accuracy.
[0077] S302. Extract the spatial coordinates of each grid from the training OpenFOAM file.
[0078] S303. Obtain environmental parameters of the target engine's operating conditions. The type of environmental parameters of the target engine's operating conditions obtained in this step is the same as in step S202.
[0079] S304. Integrate all target variables of the internal flow field data, the spatial coordinates of each grid extracted from the OpenFOAM training file, and the environmental parameters of the target engine's operating conditions to form training data.
[0080] S305. Normalize the training data.
[0081] In one embodiment, the method for predicting the three-dimensional engine flow field based on a multilayer perceptron neural network further includes converting the predicted three-dimensional engine flow field corresponding to the target OpenFOAM file into a file format compatible with OpenFOAM software. This enables seamless integration of the predicted three-dimensional engine flow field with OpenFOAM software, allowing the predicted three-dimensional engine flow field to be processed by OpenFOAM software.
[0082] In one embodiment, the multilayer perceptron neural network includes an input layer, N hidden layers, and an output layer along the data input direction to the output direction, where 3 ≤ N ≤ 7.
[0083] Specifically, the number of hidden layers is determined by the number of neurons in the input or output layers. The more neurons in the input or output layers, the more hidden layers there are.
[0084] The input layer consists of multiple neurons, the same number as the number of types of input data, and the output layer consists of multiple neurons, the same number as the number of types of target variables.
[0085] Along the data input direction to the output direction, the first and last hidden layers contain 10 to 200 neurons, while the intermediate hidden layers contain 20 to 1000 neurons. The number of neurons in the intermediate hidden layers is greater than that in the first and last hidden layers. Each hidden layer includes a ReLU activation function.
[0086] Specifically, the input layer receives grid coordinates and environmental parameters and passes them to the network, with the number of neurons matching the dimension of the input features; the hidden layer performs nonlinear transformation and feature abstraction on the data through the ReLU activation function. The layered design not only extracts the higher-order correlation between flow field parameters, but also prevents overfitting by optimizing the number of neurons; the output layer maps the abstract features to target physical quantities such as pressure and temperature, with the number of neurons strictly corresponding to the predicted variables.
[0087] For example, such as Figure 1 As shown, a multilayer perceptron neural network is provided, wherein the input layer has 7 neurons, the output layer has 7 neurons, and there are 5 hidden layers with the number of neurons being 100, 360, 360, 360, and 100, respectively.
[0088] In one embodiment, a normalization function is used to normalize each value in the training data or input data. The normalization function is:
[0089]
[0090] In the formula, min_val and max_val represent the minimum and maximum values of each column of data in the training data or input data, respectively, normalized_value represents the normalized value, and value represents the value to be normalized.
[0091] In one embodiment, the predicted 3D engine flow field corresponding to the target OpenFOAM file is obtained by batch processing normalized input data using a trained multilayer perceptron neural network, including the following steps:
[0092] S501. Load the trained multilayer perceptron neural network, initialize the parameters of the trained multilayer perceptron neural network, and set it to evaluation mode.
[0093] In the evaluation mode, the multilayer perceptron neural network is used only for inference and does not perform gradient calculation, thereby improving prediction efficiency.
[0094] S502. Divide the input data into multiple batches based on computing resources.
[0095] S503. After filtering and transforming the input data for each batch, input the data into the trained multilayer perceptron neural network to obtain the value of the target variable for each batch.
[0096] Specifically, after filtering and transforming the input data for each batch, it is fed into the trained multilayer perceptron neural network to obtain the values of the target variables for each batch, including:
[0097] S5031. Check and remove rows containing invalid values to obtain valid data for each batch. Invalid values include NaN.
[0098] S5032. Convert the valid data of each batch into tensor format.
[0099] S5033. Input the valid data of each batch in tensor format into the trained multilayer perceptron neural network to obtain the value of the target variable for each batch. The value of the target variable for each batch is the predicted value.
[0100] S504. Convert the numerical values of the target variable for each batch into numerical format.
[0101] S505. Integrate the target variables in numerical format of all batches with the spatial coordinates of the input data to obtain the predicted three-dimensional engine flow field.
[0102] In one embodiment, converting the predicted 3D engine flow field corresponding to the target OpenFOAM file into an OpenFOAM software-compatible file format includes the following steps:
[0103] S601, Read the value of each variable in the predicted three-dimensional engine flow field.
[0104] S602. Construct the numerical values of each variable in the predicted three-dimensional engine flow field according to the target OpenFOAM file format to obtain a file format compatible with OpenFOAM software.
[0105] Specifically, the file formats compatible with OpenFOAM software include:
[0106] File header information: Contains the OpenFOAM file's version, format, category, location, and object information.
[0107] Dimension definition: Define the physical dimensions of a variable, for example, the dimensions of pressure are [1 -1-2 0 0 0 0].
[0108] Internal flow field data: The predicted 3D engine flow field data is formatted into a non-uniform list format required by OpenFOAM and written to a file.
[0109] Boundary conditions: Define the boundary conditions of the flow field to ensure seamless integration with CFD simulations. Boundary conditions include fixed values, zero gradients, and symmetry.
[0110] Converting the predicted 3D engine flow field into a file format compatible with OpenFOAM software enables the use of existing OpenFOAM software to process the predicted 3D engine flow field, thereby achieving flexible processing of the predicted 3D engine flow field data.
[0111] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.
Claims
1. A method for predicting the three-dimensional engine flow field based on a multilayer perceptron neural network, characterized in that, Includes the following steps: Construct a multilayer perceptron neural network and train the multilayer perceptron neural network; The target OpenFOAM file is preprocessed to obtain normalized input data; The predicted three-dimensional engine flow field corresponding to the target OpenFOAM file is obtained by batch processing normalized input data using a trained multilayer perceptron neural network. The data preprocessing for the target OpenFOAM file includes: Extract the spatial coordinates of each grid from the target OpenFOAM file; Obtain environmental parameters of the target engine's operating conditions, including flight Mach number, total temperature, total pressure, and isolation section inlet Mach number; The input data is formed by integrating the spatial coordinates of each grid extracted from the target OpenFOAM file and the environmental parameters of the target engine's operating conditions. The input data is then normalized.
2. The method for predicting three-dimensional engine flow field based on multilayer perceptron neural network according to claim 1, characterized in that, The method also includes converting the predicted three-dimensional engine flow field corresponding to the target OpenFOAM file into a file format compatible with OpenFOAM software.
3. The method for predicting three-dimensional engine flow field based on multilayer perceptron neural network according to claim 2, characterized in that, Training the multilayer perceptron neural network includes the following steps: Data preprocessing is performed on multiple training OpenFOAM files to obtain a normalized training dataset; Based on a normalized training dataset, mean squared error is used as the loss function, Adam is used as the optimizer, and a step decay strategy is used as the learning rate to train a multilayer perceptron neural network.
4. The method of claim 3, wherein, Data preprocessing for each training OpenFOAM file includes the following steps: Internal flow field data is extracted from the training OpenFOAM file, and the target variables included in the internal flow field data are pressure, temperature, Mach number, density, CO2, H2O and OH; Extract the spatial coordinates of each grid from the OpenFOAM training file; Obtain environmental parameters for the target engine's operating conditions; The training data is formed by integrating all target variables of the internal flow field data, the spatial coordinates of each grid extracted from the OpenFOAM training file, and the environmental parameters of the target engine's operating conditions. The training data is then normalized.
5. The method of claim 4, wherein, The multilayer perceptron neural network includes an input layer, N hidden layers, and an output layer along the data input direction to the output direction, where 3≤N≤7; The input layer includes multiple neurons equal to the number of types of input data, and the output layer includes multiple neurons equal to the number of types of target variables. Along the data input direction to the output direction, the first and last hidden layers contain 10 to 200 neurons, and the middle hidden layers contain 20 to 1000 neurons. The number of neurons in the middle hidden layers is greater than the number of neurons in the first and last hidden layers. Each hidden layer includes a ReLU activation function.
6. The method of claim 5, wherein the multilayer perceptron neural network is trained using a loss function that is based on a difference between a predicted value and an actual value. Extracting internal flow field data from the OpenFOAM training file includes the following steps: Starting from the root directory of the OpenFOAM training file, traverse each subfolder layer by layer, and for subfolders whose names are numbers, traverse the variable list and extract the numerical data of each variable. The numerical data of all extracted variables are organized into a table and saved as a CSV file.
7. The method for predicting three-dimensional engine flow field based on multilayer perceptron neural network according to claim 6, characterized in that, The training data or input data is normalized using a normalization function, wherein the normalization function is: In the formula, min_val and max_val represent the minimum and maximum values of each column of data in the training data or input data, respectively, normalized_value represents the normalized value, and value represents the value to be normalized.
8. The method of claim 7, wherein, The predicted 3D engine flow field corresponding to the target OpenFOAM file is obtained by batch processing normalized input data using a trained multilayer perceptron neural network, including the following steps: Load the trained multilayer perceptron neural network, initialize the parameters of the trained multilayer perceptron neural network, and set it to evaluation mode; The input data is divided into multiple batches based on computing resources; After filtering and transforming the input data for each batch, the data is fed into the trained multilayer perceptron neural network to obtain the value of the target variable for each batch. Convert the numerical values of the target variables for each batch into numerical format; The target variables in numerical format from all batches are integrated with the spatial coordinates of the input data to obtain the predicted three-dimensional engine flow field.
9. The method of claim 8, wherein, After filtering and transforming the input data for each batch, it is fed into the trained multilayer perceptron neural network to obtain the values of the target variables for each batch, including: Check and remove rows containing invalid values to obtain valid data for each batch; Convert the valid data for each batch into tensor format; The effective data of each batch in tensor format is input into the trained multilayer perceptron neural network to obtain the value of the target variable for each batch.
10. The method of claim 9, wherein, Convert the predicted 3D engine flow field corresponding to the target OpenFOAM file into a file format compatible with OpenFOAM software, including the following steps: Read the value of each variable in the predicted three-dimensional engine flow field; The values of each variable in the predicted three-dimensional engine flow field are constructed according to the target OpenFOAM file format to obtain an OpenFOAM software compatible file format.
Citation Information
Patent Citations
Deep learning-based hypersonic air inlet channel flow field rapid prediction method
CN115470726A
CFD simulation cloud picture prediction method and system, electronic equipment and medium
CN115983148A