Machine learning three-dimensional grid adaptive method for high-precision flow field calculation
Through machine learning methods, a high-quality three-dimensional adaptive mesh is generated using multi-layer perceptrons and SOM neural networks, solving the problems of adaptive difficulty and waste of computing resources of three-dimensional grids, and achieving efficient flow field analysis and optimization.
Patent Information
- Application Number
- CN202410919454.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-11-12
AI Technical Summary
The existing three-dimensional grid adaptive methods are difficult to achieve efficient calculations in complex flow fields, and rely on manual adjustments, resulting in waste of computing resources and insufficient accuracy.
Using machine learning methods, a high-quality three-dimensional adaptive mesh is generated through multi-layer perceptron and SOM neural network training. The initial flow field data is used to predict the flow field solution and optimize the grid density distribution, reducing the adaptive difficulty and calculation amount.
The speed and accuracy of three-dimensional grid adaptation are improved, the amount of CFD calculation is reduced, manual intervention and computing resource consumption is reduced, and efficient flow field analysis optimization is achieved.
Smart Images

Figure CN118940656A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a three-dimensional grid self-adaptation technology for computational fluid dynamics, and in particular to a machine learning three-dimensional grid self-adaptation method for high-precision flow field analysis and optimization. Background Art
[0002] Computational fluid dynamics (CFD) has become an integral part of industries such as aerospace, automotive manufacturing, and energy, especially in the calculation, analysis, and optimization of complex flow fields. However, with the increase in simulation complexity, especially in three-dimensional modeling scenarios, the demand for mesh adaptation methods continues to increase. Three-dimensional mesh adaptation is one of the most challenging problems in the field of CFD, mainly because with the increase in dimension, the changes in the flow field in space become more complex and the mesh adaptation algorithm has more difficulty in processing data.
[0003] The purpose of three-dimensional mesh adaptation is to improve the calculation accuracy by dynamically adjusting the node density distribution under the premise of ensuring the rational use of computing resources. The mesh needs to be in high-gradient areas in the flow field, such as the boundary layer, shock waves, and vortices of fluid flow; while in areas where the flow characteristics change slowly, the mesh can be sparse to reduce the computational cost. This process of optimal allocation of computing resources is not only time-consuming and labor-intensive, but also highly dependent on human experience if the traditional manual adjustment method is used, especially in complex three-dimensional flow fields.
[0004] Although existing mesh adaptation methods, such as local refinement and moving mesh methods, have been initially applied in two-dimensional flow field simulation, the application of these methods in three-dimensional problems still faces great challenges. In particular, the amount of data to be processed in three-dimensional problems is huge, and the boundary conditions are more complex, making it difficult for traditional methods to be implemented efficiently. In addition, the problems of cell extrusion and topological structure changes that may occur during the three-dimensional mesh adaptation process also greatly increase the difficulty of implementing the adaptive algorithm.
[0005] In general, the current adaptive algorithm in the three-dimensional mesh adaptation process is difficult to implement and still takes up a lot of computing resources. In actual work, laboratories, research institutes, etc. usually need to build a closed server cluster on the intranet for information security reasons, and provide computing services to the personal computers (user terminals) of researchers through the intranet. This leads to insufficient computing resources in the flow field analysis research of the fluid mechanics department. Therefore, how to reduce the difficulty of mesh adaptation and thus improve the speed of adaptation while obtaining high-quality three-dimensional adaptive meshes, and also reduce the amount of CFD calculations, has become a topic that needs further research and optimization. Summary of the invention
[0006] An embodiment of the present invention provides a machine learning three-dimensional grid adaptation method for high-precision flow field analysis and optimization, which can reduce the difficulty of grid adaptation and thus improve the speed of adaptation while obtaining a high-quality three-dimensional adaptive grid, and also reduce the amount of CFD calculations.
[0007] To achieve the above object, the embodiments of the present invention adopt the following technical solutions:
[0008] A machine learning three-dimensional grid adaptive method for high-precision flow field analysis and optimization, comprising:
[0009] Step 1, the server receives the flow field data to be processed uploaded by the user terminal, and the flow field data to be processed includes: initial three-dimensional grid data and flow field condition parameters; wherein, the initial three-dimensional grid data includes the initial three-dimensional grid node coordinates, the number of nodes and the topological connection relationship between the nodes; the initial three-dimensional grid data can be various grid data commonly understood by industry insiders, including structured grids, unstructured grids, tetrahedral grids and hexahedral grids, etc.; the flow field condition parameters include the Mach number Ma, Reynolds number Re and angle of attack AOA of the flow field.
[0010] Step 2: the server generates initial flow field data according to the flow field data to be processed, and then trains a multilayer perceptron using the initial flow field data;
[0011] Step 3: construct a training data sample library of the SOM neural network, and construct the SOM neural network according to the initial three-dimensional grid node coordinates and topological connection relationship;
[0012] Among them, the SOM neural network structure is constructed according to the coordinates and topological connection relationship of the initial three-dimensional grid nodes: the initial three-dimensional grid is projected to the competition layer of the SOM neural network, the grid nodes are defined as competition layer neurons, the adjacency relationship between neurons is defined by the topological connection relationship between the initial three-dimensional grid nodes, and the topological distance between neurons is defined as follows: Where floor(·) represents the floor rounding function, S ij is the Euclidean distance from the i-th neuron to the j-th neuron; the input layer of the SOM neural network is defined as the constructed training data set sample library, the number of input layer neurons is determined by the training data dimension, and for three-dimensional grid adaptive optimization, the number of input layer neurons is 3;
[0013] The neuron weights of the competition layer of the SOM neural network correspond to the three-dimensional grid node coordinates, and the initial three-dimensional grid node coordinates X 0 Used to initialize the neuron weights ξ of the competition layer 0 , the output dimension of the competition layer is 3.
[0014] Step 4, training the SOM neural network constructed in step 3 to obtain three-dimensional grid data corresponding to the flow field data to be processed, wherein the neuron weights of the competition layer of the SOM neural network are updated during the training process;
[0015] Step 5: Send the three-dimensional grid data obtained in step 4 to the user terminal.
[0016] Specifically, the server generates initial flow field data according to the flow field conditions and the initial three-dimensional grid, and then uses the data to train a multi-layer perceptron. The generation of the initial flow field data refers to performing CFD calculations on the initial three-dimensional grid to obtain a flow field solution. The multi-layer perceptron refers to an artificial neural network, including an input and output layer and multiple hidden layers, which can accurately capture the highly nonlinear relationship between the spatial position of a three-dimensional node and the corresponding flow field solution after training. Step 2 includes: the server performs CFD simulation calculations on the initial three-dimensional grid using flow field conditions according to the initial three-dimensional grid data and flow field condition parameters, and obtains initial flow field data; the initial three-dimensional grid data and the initial flow field data are combined into an input-output sample pair, and the input-output sample pair is used to train a multi-layer perceptron for predicting flow field solutions.
[0017] The method of training a multilayer perceptron using the input-output sample pairs includes: step 101: using the initial three-dimensional grid node coordinates as the input of the multilayer perceptron, and using the initial flow field data as the label of the multilayer perceptron; step 102: initializing the network parameters of the multilayer perceptron, inputting the three-dimensional grid node coordinates for forward propagation and calculating the loss between the output layer result and the flow field data; step 103: repeating the above steps until the multilayer perceptron can accurately fit the flow field law; step 104: constructing a uniform background grid in the three-dimensional grid space, and using the trained multilayer perceptron to predict the flow field solution on all nodes in the background grid.
[0018] In step 102, the loss function used to supervise the training of the multi-layer perceptron is:
[0019] Where N is the number of initial three-dimensional grid nodes, y i is the flow field solution at the i-th node, is the predicted flow field solution at the i-th node.
[0020] Furthermore, the three-dimensional uniform background grid is generated in the initial three-dimensional grid space, and the sampling point range [x min :x max ,y min :y max ,z min :z max], where x min ,x max ,y min ,y max ,z min ,z max are the minimum and maximum values of the initial three-dimensional grid in the x, y and z directions respectively; a three-dimensional high-resolution uniform background grid is constructed within the sampling point range, and the flow field solution on all nodes in the three-dimensional uniform background grid is predicted using the trained multi-layer perceptron, and the node gradient is calculated; where, for node i, the gradient for: Among them, C i are all cells containing node i, |V| is the volume of cell V, is the gradient of cell K.
[0021] det(E) is the determinant of the edge matrix E and X1, X2, X3, X4 are the four vertices of cell K, and u1, u2, u3, u4 are the flow field solutions at the four vertices of cell K.
[0022] In step 4, the SOM neural network constructed in step 3 is trained, including:
[0023] Step 201: randomly collect a sample from the training data sample library as the input of the SOM neural network, and use the spatial position x of the input point t Select the winning neuron from the current competitive layer Where t is the current iteration step;
[0024] Step 202: Calculate the winning neighborhood based on the topological distance between the winning neuron and all neurons in the current competitive layer
[0025] Step 203: Calculate the learning rate δ of the current competitive layer neuron t ;
[0026] Step 204: According to the center position of all cells in the current three-dimensional grid Added mesh smoothness constraints for neuron weight updates;
[0027] Step 205: Update the current competitive layer neuron weights:
[0028] where λ is the smoothness rate, ξ t is the neuron weight of the current competitive layer, ξ t+1 is the updated competition layer neuron weight, and the three-dimensional grid node coordinates X of the next iteration step are obtained. t+1 =ξt+1 ;
[0029] Step 206: Repeat the above steps until the maximum number of iterations is reached.
[0030] The machine learning three-dimensional grid adaptive method for optimizing high-precision flow field analysis provided by the embodiment of the present invention is provided by the user terminal with initial three-dimensional grid data and flow field condition parameters, and the server side starts modeling analysis from flow field to adaptive grid after receiving. First, the server generates initial flow field data according to the flow field conditions and the initial three-dimensional grid, and uses the data to train the multi-layer perceptron to predict the flow field solution. On the basis of obtaining the flow field solution, the server constructs a SOM network training data sample library, and constructs the SOM neural network structure using the node coordinates and topological connection relationship of the initial three-dimensional grid. Subsequently, by training the SOM neural network and updating the weights of the competition layer neurons, the server can generate a high-quality three-dimensional grid that meets the initial flow field structure and send it to the user terminal. This scheme makes full use of the machine learning model to process and optimize the highly complex three-dimensional grid adaptive problem. Each sub-link of the model is designed to be easy to implement and can be trained efficiently, ensuring that the maximum amount of information is obtained from a large amount of flow field data. This not only provides a more reliable optimization direction for the model, but also significantly improves the prediction accuracy of the three-dimensional adaptive grid. In addition, the server side achieves fast and accurate prediction from flow field data to three-dimensional adaptive mesh, which not only improves the accuracy of CFD calculations, but also greatly reduces the time cost of mesh adaptive optimization. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0032] Figure 1 A schematic diagram of the system structure provided by an embodiment of the present invention;
[0033] Figure 2 A flow chart of a method provided by an embodiment of the present invention;
[0034] Figure 3 A flow chart for predicting flow field solutions using a multi-layer perceptron provided in an embodiment of the present invention;
[0035] Figure 4 A schematic diagram of a machine learning model provided by an embodiment of the present invention;
[0036] Figure 5 A flowchart of three-dimensional grid adaptation provided by an embodiment of the present invention;
[0037] Figure 6 A schematic diagram of the structure of a device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0038] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. The embodiments of the present invention will be described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention. It can be understood by those skilled in the art that, unless specifically stated, the singular forms "one", "one", "said" and "the" used herein may also include plural forms. It should be further understood that the term "including" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or their groups. It should be understood that when we say that an element is "connected" or "coupled" to another element, it can be directly connected or coupled to other elements, or there may also be intermediate elements. In addition, the "connection" or "coupling" used here may include wireless connection or coupling. The term "and / or" used herein includes any unit and all combinations of one or more associated listed items. It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meaning as generally understood by those of ordinary skill in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless defined as herein.
[0039] In the current research, the problem of three-dimensional mesh adaptation is solved by introducing machine learning. By utilizing the powerful data processing capabilities of the machine learning model, the complex relationship between the mesh density distribution and the flow field structure can be learned directly from the CFD calculation data, thereby predicting a more reasonable node density distribution. However, the effective application of machine learning technology to three-dimensional mesh adaptation is still a frontier field that requires in-depth research. The key lies in how to design efficient learning algorithms and strategies to obtain high-quality three-dimensional meshes. This embodiment provides a machine learning three-dimensional mesh adaptation method for high-precision flow field analysis and optimization. The flow field solution obtained by CFD calculation on the initial mesh can be used to predict a high-quality three-dimensional adaptive mesh, thereby improving the mesh adaptation speed and reducing the amount of CFD calculations.
[0040] The method flow of this embodiment can be applied to Figure 1 In the scene structure shown, the user terminal provides initial three-dimensional grid data and flow field condition parameters; the server uses the information given by the user terminal to complete the initial flow field data simulation calculation and flow field solution prediction, thereby building a sample database; the sample database is used to build a machine learning network structure, and then the machine learning model is trained; finally, the server predicts high-quality three-dimensional adaptive grid data based on the trained machine learning model and returns it to the user terminal.
[0041] The embodiment of the present invention provides a machine learning three-dimensional grid adaptive method for high-precision flow field calculation, such as Figure 2 As shown, including:
[0042] Step 1: The server receives the flow field data to be processed uploaded by the user terminal, wherein the flow field data to be processed includes: initial three-dimensional grid data and flow field condition parameters;
[0043] Step 2: The server generates initial flow field data according to the flow field data to be processed, and then uses the initial flow field data to train a multi-layer perceptron.
[0044] Step 3: Build a SOM network training data sample library and construct a SOM neural network based on the grid node coordinates and topological connection relationships of the initial three-dimensional grid data.
[0045] Among them, building a training data sample library means first building a high-resolution uniform background grid in the initial three-dimensional grid space with a node density 5 times that of the initial three-dimensional grid, and then using the trained multi-layer perceptron to predict the flow field solution on all background grid nodes, and then sampling according to the threshold. The SOM neural network structure refers to the specific component of the machine learning model.
[0046] Step 4: Train the SOM neural network constructed in step 3 to obtain a three-dimensional grid corresponding to the flow field data to be processed, wherein the neuron weights of the competition layer of the SOM neural network are updated during the training process; obtain a high-quality three-dimensional grid that conforms to the initial flow field structure and send it to the user terminal.
[0047] Step 5: sending the three-dimensional grid obtained in step 4 to the user terminal.
[0048] According to the training data sample library and the constructed SOM network structure, three-dimensional adaptive grid prediction is performed, such as Figure 5 The method for adaptive grid prediction shown is used to obtain a high-quality grid with node density distribution conforming to a smooth structure and return it to the user terminal.
[0049] In this embodiment, step 2 includes:
[0050] The server retrieves the initial three-dimensional grid data and flow field condition parameters provided by the user terminal, and uses the flow field conditions to perform CFD simulation calculations on the initial three-dimensional grid; uses the results of the CFD simulation calculations and the initial three-dimensional grid node coordinates to train a multi-layer perceptron; constructs a high-resolution uniform background grid in the initial three-dimensional grid space, and uses the trained multi-layer perceptron to predict the flow field solution on the background grid.
[0051] The sample database further includes: the initial three-dimensional grid input by the user terminal can be any specified type of grid data, including structured grid, unstructured grid, tetrahedral grid and hexahedral grid, etc. The server performs CFD simulation calculation on the initial grid according to the flow field condition parameters input by the user terminal to obtain the corresponding initial flow field data. Then, the initial flow field data and the initial three-dimensional grid node coordinates are combined into input-output sample pairs, and the sample pairs are input into the multi-layer perceptron for training, so as to predict the flow field solution in the initial three-dimensional grid space. The multi-layer perceptron training is as follows: Figure 3 Specifically, it refers to:
[0052] Step 101: defining the initial three-dimensional grid node coordinates and initial flow field data as input and labels of the multi-layer perceptron;
[0053] Step 102: Initialize the network parameters of the multilayer perceptron, input the coordinates of the three-dimensional grid nodes for forward propagation, calculate the loss between the output layer result and the flow field data, and update the network parameters through the back propagation algorithm to reduce the error;
[0054] Step 103: Repeat the above steps until the test accuracy of the multilayer perceptron reaches more than 99%, so that the flow field law can be accurately fitted;
[0055] Step 104: construct a uniform background grid in the three-dimensional grid space, and use the trained multi-layer perceptron to predict the flow field solutions at all nodes in the grid.
[0056] The loss function used to supervise the training of the multi-layer perceptron in step 102 specifically refers to
[0057]
[0058] Where N is the number of initial three-dimensional grid nodes, y i is the flow field solution at the i-th node, is the predicted flow field solution at the i-th node.
[0059] In this embodiment, in step 3, the constructed SOM neural network training data sample library includes:
[0060] Determine the sampling point range [xmin :x max ,y min :y max ,z min :z max ], where x min ,x max ,y min ,y max ,z min ,z max are the minimum and maximum values of the initial three-dimensional grid in the x, y and z directions respectively. A three-dimensional high-resolution uniform background grid is constructed within this range, and the trained multi-layer perceptron is used to predict the flow field solution at all nodes in the high-resolution background grid and calculate the node gradient. Set the threshold The training data obtained by sampling and distribution conforming to the high gradient characteristics of the flow field is input into the sample library: Among them I i is the gradient of the i-th node in the background grid, I s is the gradient of all nodes arranged from large to small, For the The gradient of each node. The gradient calculation specifically refers to:
[0061] For node i, the gradient for:
[0062]
[0063] Among them, C i are all cells containing node i, |V| is the volume of cell V, is the gradient of cell K. |V| is calculated as follows:
[0064]
[0065] Where det(E) is the determinant of the edge matrix E, which is calculated as follows:
[0066]
[0067] Among them, X1, X2, X3, and X4 are the four vertices of cell K. Cell gradient The calculation of is as follows:
[0068]
[0069] Among them, u1, u2, u3, and u4 are the flow field solutions at the four vertices of cell K.
[0070] In this embodiment, in step 3, the constructed SOM neural network structure includes:
[0071] The initial three-dimensional grid is projected onto the competitive layer of the SOM neural network. The grid nodes are defined as competitive layer neurons. The adjacency relationship between neurons is defined by the topological connection relationship between the initial three-dimensional grid nodes. The topological distance between neurons is defined as follows:
[0072]
[0073] Where floor(·) represents the floor rounding function, S ij is the Euclidean distance from the i-th neuron to the j-th neuron; the input layer of the SOM neural network is defined as the constructed training data set sample library, the number of input layer neurons is determined by the training data dimension, and for three-dimensional grid adaptive optimization, the number of input layer neurons is 3; the weights of the neurons in the competition layer of the SOM neural network correspond to the three-dimensional grid node coordinates, and the initial three-dimensional grid node coordinates X 0 Used to initialize the neuron weights ξ of the competition layer 0 , the output dimension of the competition layer is 3.
[0074] In this embodiment, in step 4, the SOM neural network is trained, the weights of the competition layer neurons are updated, and a high-quality three-dimensional adaptive grid that conforms to the flow field structure is obtained. Figure 4 As shown:
[0075] The multilayer perceptron trained by the initial three-dimensional grid data and the initial flow field data collects the SOM training data and inputs it into the sample database as the SOM input layer. The SOM neural network randomly collects a sample point from the sample database at each iteration. The SOM competition layer determines the winning neuron according to the distance from the sample point. All neurons in the competition layer determine the direction and degree of their weight update according to the distance from the winning neuron. The above steps are repeated until the competition layer neurons successfully fit the high gradient characteristics of the flow field, thereby outputting a three-dimensional adaptive grid with a node density distribution that conforms to the flow field structure.
[0076] The neuron weight update is as follows: Figure 5 As shown:
[0077] Step 201: Randomly collect a sample from the training data sample library as the input of the SOM, and use the spatial position of the input point Select the winning neuron from the current competitive layer
[0078]
[0079] Among them, t=1,...,T is the current iteration step, T is the total number of iteration steps, S is all neurons in the competition layer, is the spatial position of neuron ω.
[0080] Step 202: According to the winning neuron The winning neighborhood is calculated by the topological distance to all neurons in the current competitive layer
[0081]
[0082] in, is the topological distance from neuron i to ω, σ t is the neighborhood radius:
[0083]
[0084] Among them, σ 0 is used to scale σ t The initial neighborhood radius of is the inverse of the density of neuron i, The winning neuron ω * The inverse of the density can reflect the degree of fit of the competition layer neurons to the current input sample points.
[0085] Step 203: Calculate the learning rate δ of the current competitive layer neuron t :
[0086]
[0087] in, The winning neuron ω * The normalized flow field solution of . The above formula shows that the weights of neurons with smaller density in the competition layer will be updated to a greater extent. After continuous iterations, as the density of neurons near the winning neuron continues to increase, the corresponding learning rate will converge to a minimum value, thus ensuring the convergence of the algorithm.
[0088] Step 204: According to the center position of all cells in the current three-dimensional grid Added grid smoothness constraints to the update process of neuron weights. All cell center positions The calculation of is as follows:
[0089]
[0090] in, is the weight of neuron l directly connected to neuron i, n a is the number of neurons directly connected to neuron i.
[0091] Step 205: Update the current competitive layer neuron weight ξ t+1 , get the three-dimensional grid node coordinates of the next iteration step: X t+1 =ξ t+1 , the weight update formula of neuron i is:
[0092]
[0093] Where λ is the smoothness rate. In the process of updating the neuron weights, the input data will stimulate the neurons to gather in the high gradient area of the flow field to achieve the adaptation of the three-dimensional grid; the center position of the cell will stimulate the interaction between the neurons to maintain the smoothness of the weight adjustment and effectively prevent the cell squeezing.
[0094] Step 206: Repeat the above steps until the maximum number of iterations T is reached, and obtain a high-quality three-dimensional adaptive grid whose node density distribution conforms to the flow field structure.
[0095] This embodiment also provides a three-dimensional grid self-adaptation method and device based on machine learning. Specifically, the three-dimensional grid self-adaptation device can be run on a server in a laboratory, such as Figure 6 As shown, the adaptive device comprises:
[0096] A data interaction module is used to receive the flow field data to be processed sent by the user terminal, and return the high-quality three-dimensional adaptive grid to the user terminal, wherein the flow field data to be processed includes: initial three-dimensional grid data and flow field condition parameters; the initial three-dimensional grid data includes grid node coordinates, node quantity and topological connection relationship between nodes;
[0097] A data processing module, used to generate initial flow field data using the flow field data to be processed and an initial three-dimensional grid;
[0098] Training data construction module, used to construct SOM network training data sample library;
[0099] The grid adaptation module is used to train the SOM machine learning model using the training data sample library and output a high-quality three-dimensional adaptive grid.
[0100] This embodiment uses the data provided by the user terminal to perform high-quality three-dimensional adaptive mesh prediction on the server side. First, the initial three-dimensional mesh and initial flow field data of the simulation calculation are obtained, a training sample database suitable for machine learning is constructed, a machine learning network structure suitable for three-dimensional adaptive mesh prediction is constructed, and a machine learning model is trained. A corresponding three-dimensional adaptive mesh is generated based on the constructed sample database and the initial three-dimensional mesh provided by the user terminal user, and finally a high-quality three-dimensional mesh with a node density distribution that conforms to the flow field structure is sent to the user terminal for use.
[0101] The advantages of the implementation of the present invention are: when generating high-quality three-dimensional adaptive grids, the efficient data processing strategy of the machine learning model is fully utilized, avoiding the redundant calculations of traditional methods when facing complex three-dimensional problems. The machine learning model involved in the present invention is easy to implement, fully models the complex flow characteristics of the three-dimensional flow field, and effectively avoids problems that may appear in the three-dimensional grid during the model training process, such as negative volume cells, excessive skewness, and uneven density distribution. Once the model is trained, it can efficiently and accurately capture the complex laws of the three-dimensional flow field, thereby generating a high-quality three-dimensional adaptive grid with a node density distribution that conforms to the flow field structure, avoiding additional computing resource consumption and labor costs.
[0102] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The above is only a specific implementation method of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or replacements that can be easily thought of by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A machine learning three-dimensional grid adaptive method for high-precision flow field analysis and optimization, characterized in that: include: Step 1: The server receives the flow field data to be processed uploaded by the user terminal, wherein the flow field data to be processed includes: initial three-dimensional grid data and flow field condition parameters; Step 2: the server generates initial flow field data according to the flow field data to be processed, and then trains a multilayer perceptron using the initial flow field data; Step 3: construct a training data sample library of the SOM neural network, and construct the SOM neural network according to the initial three-dimensional grid node coordinates and topological connection relationship; Step 4, training the SOM neural network constructed in step 3 to obtain three-dimensional grid data corresponding to the flow field data to be processed, wherein the neuron weights of the competition layer of the SOM neural network are updated during the training process; Step 5: Send the three-dimensional grid data obtained in step 4 to the user terminal.
2. The method according to claim 1, characterized in that The initial three-dimensional grid data includes the initial three-dimensional grid node coordinates, the number of nodes and the topological connection relationship between the nodes; The flow field condition parameters include the Mach number Ma, the Reynolds number Re and the angle of attack AOA of the flow field.
3. The method according to claim 1 or 2, characterized in that: Step 2 includes: The server performs CFD simulation calculation on the initial three-dimensional grid using the flow field conditions according to the initial three-dimensional grid data and the flow field condition parameters, and obtains initial flow field data; The initial three-dimensional grid data and the initial flow field data are combined into an input-output sample pair, and the input-output sample pair is used to train a multilayer perceptron.
4. The method according to claim 3, characterized in that The method of training a multilayer perceptron using the input-output sample pairs comprises: Step 101: using the initial three-dimensional grid node coordinates as the input of the multi-layer perceptron, and using the initial flow field data as the label of the multi-layer perceptron; Step 102: Initialize the network parameters of the multilayer perceptron, input the coordinates of the three-dimensional grid nodes for forward propagation, and calculate the loss between the output layer result and the flow field data; Step 103: Repeat the above steps until the test accuracy of the multilayer perceptron reaches more than 99%; Step 104: construct a uniform background grid in the three-dimensional grid space, and use the trained multi-layer perceptron to predict the flow field solutions on all nodes in the background grid.
5. The method according to claim 4, characterized in that In step 102, the loss function used to supervise the training of the multi-layer perceptron is: Where N is the number of initial three-dimensional grid nodes, y i is the flow field solution at the i-th node, is the predicted flow field solution at the i-th node.
6. The method according to claim 4, characterized in that The three-dimensional uniform background grid is generated in the initial three-dimensional grid space, and the sampling point range [x min :x max ,y min :y max ,z min :z max ], where x min ,x max ,y min ,y max ,z min ,z max are the minimum and maximum values of the initial three-dimensional grid in the x, y and z directions respectively; Constructing a three-dimensional high-resolution uniform background grid within the sampling point range, using a trained multi-layer perceptron to predict the flow field solutions at all nodes in the three-dimensional uniform background grid, and calculating the node gradients; Among them, for node i, the gradient for: Among them, C i are all cells containing node i, |V| is the volume of cell V, is the gradient of cell K.
7. The method according to claim 6, characterized in that det(E) is the determinant of the edge matrix E and X1, X2, X3, X4 are the four vertices of cell K, and u1, u2, u3, u4 are the flow field solutions at the four vertices of cell K.
8. The method according to claim 1, characterized in that In step 4, the SOM neural network constructed in step 3 is trained, including: Step 201: randomly collect a sample from the training data sample library as the input of the SOM neural network, and use the spatial position x of the input point t Select the winning neuron from the current competitive layer Where t is the current iteration step; Step 202: Calculate the winning neighborhood based on the topological distance between the winning neuron and all neurons in the current competitive layer Step 203: Calculate the learning rate δ of the current competitive layer neuron t ; Step 204: According to the center position of all cells in the current three-dimensional grid Added mesh smoothness constraints to the update process of neuron weights; Step 205: Update the current competitive layer neuron weights: Step 206: Repeat the above steps until the maximum number of iterations is reached.
9. The method according to claim 1, characterized in that: Step 205 includes: where λ is the smoothness rate, ξ t is the neuron weight of the current competitive layer, ξ t+1 is the updated competition layer neuron weight, and the three-dimensional grid node coordinates X of the next iteration step are obtained. t+1 =ξ t+1 , x t Represents the sample point coordinates of the input SOM at the current iteration step.
