Underground flow field prediction method and device based on convolutional neural network, and electronic equipment
By predicting the downhole flow field based on a convolutional neural network, the problem of long-term calculation of downhole flow field prediction in the existing technology is solved, more efficient flow field prediction is achieved, and powerful generalization capabilities are provided.
Patent Information
- Application Number
- CN202411543841.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-07
AI Technical Summary
The prior art takes longer to calculate in downhole flow field prediction, resulting in lower computing efficiency.
Using a method based on convolutional neural network, the tunnels to predict the flow field are meshed, and the initial boundary condition matrix and geometric boundary matrix of the flow field are constructed. Feature extraction and data processing are performed through the convolution module and the deconvolution module to obtain the prediction. result.
The efficiency of downhole flow field prediction is improved. The flow field prediction model has strong generalization ability and is adapted to different locations and different sizes of wind window models in any tunnel.
Smart Images

Figure CN119397955A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a flow field prediction method, and specifically to a downhole flow field prediction method, device and electronic equipment based on a convolutional neural network. Background Art
[0002] Understanding the underground flow field is the basis for studying the prevention and control measures of mine gas, dust, toxic and harmful gases, and plays an important role in mine safety production. Similar experimental methods are a better way to obtain the state of underground gas flow. At present, the experimental instruments with high velocity measurement accuracy include laser Doppler velocimeter, tracer particle image velocimeter, hot wire anemometer, etc., but this type of experimental equipment is very expensive and has very strict operating requirements.
[0003] Therefore, the current existing technology for studying downhole flow fields mostly uses computational fluid dynamics (CFD) numerical simulation methods. However, numerical simulation methods also have the disadvantages of large amount of calculation, long calculation time, high grid accuracy requirements, and large memory requirements. For complex geometric figures, it usually takes several hours or even days to obtain results. Once the geometric figure changes, the CFD method must re-model and divide the grid, and calculate the results on the new grid. This is a very time-consuming method, which makes the calculation efficiency of downhole flow field prediction low.
[0004] The Lattice Boltzmann Method (LBM) is another effective means of solving flow fields in the existing technology. It regards the flow field as a large number of discrete particles. The particles in the grid can be calculated separately, which has natural parallel characteristics, and the LBM method can handle complex calculation boundaries. However, the LBM method is also a slow iterative process. Different geometric figures still need to be remodeled and meshed. It still takes a long time for dense grids to converge. It also takes a long time to predict the downhole flow field. Summary of the invention
[0005] The technical problem to be solved by the present invention is that the calculation of downhole flow field prediction by the above-mentioned method commonly used in the prior art takes a long time, resulting in low calculation efficiency of downhole flow field prediction. In order to solve the above-mentioned problem, the present invention provides a downhole flow field prediction method, device and electronic device based on a convolutional neural network.
[0006] The content of the present invention includes:
[0007] In a first aspect, an embodiment of the present invention provides a downhole flow field prediction method based on a convolutional neural network, comprising:
[0008] Meshing the lanes for which the flow field is to be predicted, and obtaining an initial matrix based on the meshing result, wherein each element of the initial matrix corresponds to a mesh;
[0009] constructing a flow field initial boundary condition matrix based on the initial matrix, and constructing a geometric boundary matrix based on the initial matrix;
[0010] Inputting the flow field initial boundary condition matrix and the geometric boundary matrix into a flow field prediction model to perform flow field prediction and obtain a prediction result;
[0011] Among them, the flow field prediction model includes a convolution module and a deconvolution module. The convolution module is used to perform feature extraction on the flow field initial boundary condition matrix and the geometric boundary matrix to obtain extraction results. The deconvolution module is used to perform data processing on the extraction results to obtain the prediction results. The size of the prediction results is the same as the size of the initial matrix.
[0012] Optionally, constructing an initial boundary condition matrix of the flow field based on the initial matrix includes:
[0013] Acquiring flow field parameters of the lane of the flow field to be predicted;
[0014] The values of the flow field parameters in the grid are used as the values of the corresponding elements in the initial matrix to obtain the initial boundary condition matrix of the flow field.
[0015] Optionally, the flow field parameters are determined based on at least one of inlet velocity, pressure and Reynolds number.
[0016] Optionally, the flow field parameter is an inlet velocity, and the value of the flow field parameter in the grid is used as the value of the corresponding element in the initial matrix to obtain the initial boundary condition matrix of the flow field, including:
[0017] The value of the first column in the initial matrix is determined as the inlet velocity, and the values of other positions of the initial matrix except the first column are determined as 0, so as to obtain the initial boundary condition matrix of the flow field.
[0018] Optionally, constructing a geometric boundary matrix based on the initial matrix includes:
[0019] When the grid corresponds to the flow field area, the value of the element corresponding to the grid in the initial matrix is determined to be 0. When the grid corresponds to the solid boundary, the value of the element corresponding to the grid in the initial matrix is determined to be 1 to obtain the geometric boundary matrix.
[0020] Optionally, the convolution module includes a first convolution layer, a second convolution layer and a third convolution layer connected in sequence, the number of convolution kernels of the first convolution layer is 100, and the convolution kernel size is 5×20, the number of convolution kernels of the second convolution layer is 400, and the convolution kernel size is 4×5, and the number of convolution kernels of the third convolution layer is 1600, and the convolution kernel size is 5×5;
[0021] The deconvolution module includes a first deconvolution layer, a second deconvolution layer, a third deconvolution layer and a fourth deconvolution layer connected in sequence, the number of convolution kernels of the first deconvolution layer is 400, and the convolution kernel size is 5×25, the number of convolution kernels of the second deconvolution layer is 100, and the convolution kernel size is 2×2, the number of convolution kernels of the third deconvolution layer is 50, and the convolution kernel size is 2×2, the number of convolution kernels of the fourth deconvolution layer is 2, and the convolution kernel size is 5×5.
[0022] Optionally, the method further comprises:
[0023] Constructing a plurality of training samples, each of the training samples comprising a sample flow field initial boundary condition matrix and a sample geometric boundary matrix;
[0024] Using the lattice Boltzmann method, a simulated flow field is calculated based on the sample flow field initial boundary condition matrix and the sample geometric boundary matrix;
[0025] The multiple training samples are used as training data, the simulated flow fields corresponding to the training samples are used as real labels, and the flow field prediction model to be trained is iteratively trained to obtain the flow field prediction model.
[0026] In a second aspect, an embodiment of the present invention provides a downhole flow field prediction device based on a convolutional neural network, comprising:
[0027] A grid division module is used to perform grid division on the lanes of the flow field to be predicted, and obtain an initial matrix based on the grid division result, wherein each element of the initial matrix corresponds to a grid;
[0028] A construction module, used to construct a flow field initial boundary condition matrix based on the initial matrix, and to construct a geometric boundary matrix based on the initial matrix;
[0029] A prediction module, used for inputting the flow field initial boundary condition matrix and the geometric boundary matrix into a flow field prediction model to perform flow field prediction and obtain a prediction result;
[0030] Among them, the flow field prediction model includes a convolution module and a deconvolution module. The convolution module is used to perform feature extraction on the flow field initial boundary condition matrix and the geometric boundary matrix to obtain extraction results. The deconvolution module is used to perform data processing on the extraction results to obtain the prediction results. The size of the prediction results is the same as the size of the initial matrix.
[0031] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a program stored in the memory and executable on the processor; the processor is used to read the program in the memory to implement the steps in the downhole flow field prediction method based on a convolutional neural network as described in the first aspect.
[0032] In a fourth aspect, an embodiment of the present invention provides a readable storage medium for storing a program, which, when executed by a processor, implements the steps in the downhole flow field prediction method based on a convolutional neural network as described in the first aspect.
[0033] The beneficial effect of the present invention is that, in an embodiment of the present invention, by gridding the lanes for predicting the flow field, the initial boundary condition matrix and the geometric boundary matrix of the flow field are obtained. The initial boundary condition matrix and the geometric boundary matrix of the flow field are used as input, and the flow field prediction model established based on the convolutional neural network is used to predict the downhole flow field to obtain the prediction result. Among them, the flow field prediction model includes a convolution module and a deconvolution module, the convolution module is used to extract features from the initial boundary condition matrix and the geometric boundary matrix of the flow field to obtain the extraction result, and the deconvolution module is used to perform data processing on the extraction result to obtain the prediction result, and the size of the prediction result is the same as the size of the initial matrix. The flow field prediction model provided by this method can adapt to wind window models of different positions and sizes in any lane, has a strong generalization ability, and improves the efficiency of downhole flow field prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Attached Figure 1 A flow chart of a downhole flow field prediction method based on a convolutional neural network provided in an embodiment of the present invention;
[0035] Attached Figure 2 A schematic diagram of constructing a flow field initial boundary condition matrix provided by an embodiment of the present invention;
[0036] Attached Figure 3 A schematic diagram of constructing a geometric boundary matrix provided in an embodiment of the present invention;
[0037] Attached Figure 4 A schematic diagram of a flow field prediction model provided by an embodiment of the present invention;
[0038] Attached Figure 5 An example diagram of sample geometric boundaries provided by an embodiment of the present invention;
[0039] Attached Figure 6 An example diagram of the geometric boundary of a test set provided by an embodiment of the present invention;
[0040] Attached Figure 7 This is a schematic diagram of the error analysis of the prediction results;
[0041] Attached Figure 8 It is a schematic diagram of the comparison of the velocity field scatter plots of the predicted value and the simulated value;
[0042] Attached Fig. 9 Schematic diagram of velocity distribution of the predicted results and numerical simulation results of the section x=250;
[0043] Attached Fig.10a Velocity cloud diagram and vector diagram for PIV test flow field;
[0044] Attached Fig.10b The velocity cloud map and vector map of the predicted flow field obtained by the downhole flow field prediction method based on convolutional neural network;
[0045] Attached Fig.11 The diagram shows the prediction results of the downhole flow field prediction method based on convolutional neural network and the cross-sectional velocity distribution of the PIV experimental results;
[0046] Attached Fig.12a This is the streamline diagram of the PIV experimental results;
[0047] Attached Figure 12b This is the streamline diagram of the prediction results obtained by the downhole flow field prediction method based on convolutional neural network;
[0048] Attached Fig.13 A schematic diagram of a downhole flow field prediction device based on a convolutional neural network provided in an embodiment of the present invention;
[0049] Attached Fig.14 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0050] In the embodiments of the present application, the term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In the embodiments of the present application, the term "multiple" refers to two or more, and other quantifiers are similar. The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first" and "second" are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more.
[0051] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0052] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0053] First, some nouns involved in this application are analyzed:
[0054] Convolutional Neural Network (CNN): CNN is one of the representative algorithms of deep learning. CNN is a feedforward neural network with a deep structure. The convolution layer has fewer parameters and shares a convolution kernel, which can handle high-dimensional problems well. The essence of CNN is a multilayer perceptron (MLP). Unlike MLP, two-dimensional or even higher-dimensional matrices can be directly used as network input, avoiding the complex feature extraction and data reconstruction process in traditional recognition algorithms, and will not lose the spatial position information of the matrix. It has great advantages in the processing of two-dimensional images. For example, the network can extract image features including color, texture, shape and topological structure of the image by itself, especially in the application of recognizing displacement, scaling and other forms of distortion invariance, with good robustness and computational efficiency.
[0055] Lattice Boltzmann Method (LBM): LBM is derived from lattice gas automata. It discretizes the Boltzmann equation in time and space and describes fluid flow through a large number of discrete particles. It is a mesoscopic model between the microscopic molecular dynamics model and the macroscopic continuous model of the fluid. This algorithm has low complexity. Simple linear operations plus a relaxation process can simulate various complex nonlinear macroscopic phenomena. It can also handle complex geometric boundaries. It is very simple to write programs and has high parallelism.
[0056] Based on this, the present application embodiment provides a downhole flow field prediction method, device and electronic device based on convolutional neural network. Figure 1 , Figure 1 A flow chart of a downhole flow field prediction method based on a convolutional neural network provided in an embodiment of the present invention, wherein the method specifically comprises the following steps:
[0057] Step 101 , meshing the lanes of the flow field to be predicted, and obtaining an initial matrix based on the meshing result, wherein each element of the initial matrix corresponds to a mesh.
[0058] Step 102: constructing a flow field initial boundary condition matrix based on the initial matrix, and constructing a geometric boundary matrix based on the initial matrix.
[0059] Step 103, inputting the flow field initial boundary condition matrix and the geometric boundary matrix into a flow field prediction model to perform flow field prediction and obtain a prediction result;
[0060] Among them, the flow field prediction model includes a convolution module and a deconvolution module. The convolution module is used to perform feature extraction on the flow field initial boundary condition matrix and the geometric boundary matrix to obtain extraction results. The deconvolution module is used to perform data processing on the extraction results to obtain the prediction results. The size of the prediction results is the same as the size of the initial matrix.
[0061] The underground flow field prediction method based on convolutional neural network provided in this embodiment can be used for flow field morphology prediction, wherein the input of the flow field prediction model is the flow field initial boundary condition matrix and the geometric boundary matrix, and the output prediction result is a flow field of the same size as the input, represented by the x-direction velocity field and the y-direction velocity field. In the mine ventilation system, the installation position and opening size of the wind window are inconsistent, and it is difficult to construct a mapping relationship between the physical model and the flow field. The method provided in the embodiment of the present application can be applied to the mine ventilation system, adapting to wind window models of different positions and sizes in any tunnel, and has a strong generalization ability.
[0062] In step 101, in the scenario of downhole flow field prediction, the lane of the flow field to be predicted can be a lane, the lane is gridded, and an initial matrix is suggested according to the grid structure obtained by the division. The size of the matrix is the same as the grid size, and each matrix element corresponds to a grid. In specific implementation, the starting value of the initial matrix can be 0 or other preset values, which are not specifically limited here.
[0063] Optionally, in some embodiments, constructing the flow field initial boundary condition matrix based on the initial matrix includes:
[0064] Acquiring flow field parameters of the lane of the flow field to be predicted;
[0065] The values of the flow field parameters in the grid are used as the values of the corresponding elements in the initial matrix to obtain the initial boundary condition matrix of the flow field.
[0066] The flow field parameters are determined based on at least one of the inlet velocity, pressure and Reynolds number. For example, the flow field parameters are any one of the inlet velocity, pressure and Reynolds number, or the flow field parameters are determined based on at least one of the inlet velocity, pressure and Reynolds number.
[0067] In some embodiments, the inlet velocity is used as a flow field parameter, the flow field parameters of the lane (such as the lane) of the flow field to be predicted are obtained, the inlet velocity corresponding to each grid area is determined, and the inlet velocity is used as the value of the corresponding element of the grid in the initial matrix. By successively determining the inlet velocity corresponding to each grid, the value of each element in the initial matrix can be obtained, thereby obtaining the initial boundary condition matrix of the flow field. The initial boundary of the flow field is represented by a matrix, which is recorded as M c , M c [:,0]=v inlet (i.e. M c The first column of values is equal to the inlet velocity, and the rest of the values are 0).
[0068] Optionally, in some embodiments, the flow field parameter is an inlet velocity, and the step of taking the values of the flow field parameters in the grid as the values of corresponding elements in the initial matrix to obtain the flow field initial boundary condition matrix includes:
[0069] The value of the first column in the initial matrix is determined as the inlet velocity, and the values of other positions of the initial matrix except the first column are determined as 0, so as to obtain the initial boundary condition matrix of the flow field.
[0070] For example, see Figure 2Suppose there is a tunnel with a length of 10m and a height of 5m, and the entrance wind speed is 3m / s. The tunnel is gridded, and the ratio of grid rows and columns needs to match the actual size. The actual size is 5:10, so the grid can be divided into 5×10, that is, an initial matrix of size 5×10 is obtained. Assuming the tunnel wind speed is 3m / s, the first column of the grid corresponds to the tunnel entrance, so the first column of the grid is assigned a value of 3, and the values of other positions are all 0.
[0071] Optionally, in some embodiments, constructing a geometric boundary matrix based on the initial matrix includes:
[0072] When the grid corresponds to the flow field area, the value of the element corresponding to the grid in the initial matrix is determined to be 0. When the grid corresponds to the solid boundary, the value of the element corresponding to the grid in the initial matrix is determined to be 1 to obtain the geometric boundary matrix.
[0073] In this embodiment, the geometric boundary matrix is represented by a binary matrix. When there is an obstacle in the tunnel, it can be considered that the grid at this position corresponds to a fixed boundary, and the remaining positions are fluid areas. The geometric boundary matrix can be obtained by representing the solid boundary with 1 and the flow field area with 0.
[0074] For example, see Figure 3 , assuming there is a lane with a length of 10m and a height of 5m, the grid size is divided into 5×10, and there is a square obstacle in the middle of the lane. The geometric boundary matrix of the lane is as follows Figure 3 In this embodiment, the geometric boundary is represented by a binary matrix, which can not only characterize the tunnel structure, but also make the representation more concise, so that the calculation amount is smaller.
[0075] It should be understood that the size of the grid division can be set according to actual needs. In specific implementation, the density of the grid division can be adjusted according to actual needs, so as to adjust the matrix size of the input fluid prediction model accordingly.
[0076] In this embodiment, the flow field initial boundary condition matrix and the geometric boundary matrix are input into the flow field prediction model to perform flow field prediction and obtain prediction results; wherein, the flow field prediction model is pre-trained, and the flow field prediction model is constructed based on the CNN model.
[0077] The flow field prediction model includes a convolution module, which is used to extract different features of the input data through a convolution kernel. In some embodiments, the convolution module includes multiple convolution layers, and the first convolution layer may only extract some low-level features such as edges, lines, and corners. More layers of the network can iteratively extract more complex features from low-level features. Conventionally, the convolution module also includes an excitation layer, which non-linearly maps the output of the convolution layer through an excitation function, which will not be described in detail here.
[0078] The pooling layer can compress data, and its main function is to reduce the amount of calculation by reducing the parameters of the network, and can control overfitting to a certain extent. In some embodiments, each convolutional layer included in the convolution module is periodically connected to a pooling layer.
[0079] Since this method is used to predict flow field morphology, its output is not individual parameters, but a flow field of the same size as the input grid. Therefore, after extracting features through convolution calculation, the flow field prediction model is not connected to the fully connected layer, but the reduced-dimensional data is restored to the input grid size through the deconvolution module, where the deconvolution module includes multiple layers of deconvolution layers, and its specific structure is not limited here.
[0080] As a specific example, see Figure 4 . The flow field prediction model includes a convolution module and a deconvolution module. Specifically, in some embodiments, the convolution module includes a first convolution layer, a second convolution layer, and a third convolution layer connected in sequence, the number of convolution kernels of the first convolution layer is 100, and the convolution kernel size is 5×20, the number of convolution kernels of the second convolution layer is 400, and the convolution kernel size is 4×5, the number of convolution kernels of the third convolution layer is 1600, and the convolution kernel size is 5×5.
[0081] Specifically, in some embodiments, the deconvolution module includes a first deconvolution layer, a second deconvolution layer, a third deconvolution layer and a fourth deconvolution layer connected in sequence, the number of convolution kernels of the first deconvolution layer is 400, and the convolution kernel size is 5×25, the number of convolution kernels of the second deconvolution layer is 100, and the convolution kernel size is 2×2, the number of convolution kernels of the third deconvolution layer is 50, and the convolution kernel size is 2×2, and the number of convolution kernels of the fourth deconvolution layer is 2, and the convolution kernel size is 5×5.
[0082] like Figure 4As shown in the figure, the input of the flow field prediction model includes the flow field initial boundary condition matrix and the geometric boundary matrix, and the output is the prediction result composed of the x-direction velocity field (xvelocity) and the y-direction velocity field (y velocity). The flow field prediction model has a total of 7 hidden layers (Hiddenlayer), the first 3 layers are convolution modules composed of convolution layers (Conv), and layers 4-7 are deconvolution modules composed of deconvolution layers (Deconv).
[0083] It should be understood that the excitation function of the flow field prediction model is not limited here. As a specific embodiment, the excitation function in the flow field prediction model is a Tanh function, which is specifically expressed as:
[0084]
[0085] Since the x-direction velocity component and the y-direction velocity component of the flow field contain many negative values, the activation function must be centered on 0 to ensure that the negative values of the output are not affected. The Tanh function output is centered on 0, and has low computational cost and fast convergence speed. Through the above settings, the computational efficiency and accuracy of the flow field prediction model can be further improved.
[0086] In this embodiment, the flow field prediction model is obtained by iteratively training the flow field prediction model to be trained in advance. Optionally, in some embodiments, the method further includes:
[0087] Constructing a plurality of training samples, each of the training samples comprising a sample flow field initial boundary condition matrix and a sample geometric boundary matrix;
[0088] Using the lattice Boltzmann method, a simulated flow field is calculated based on the sample flow field initial boundary condition matrix and the sample geometric boundary matrix;
[0089] The multiple training samples are used as training data, the simulated flow fields corresponding to the training samples are used as real labels, and the flow field prediction model to be trained is iteratively trained to obtain the flow field prediction model.
[0090] The sample geometric boundary is a two-dimensional lane with irregular obstacles, where the obstacles are randomly composed of triangles, rectangles and circles of different sizes. In the constructed sample geometric boundary matrix, element 1 represents obstacles and walls, element 0 represents the fluid flow area, the matrix size is 100×500, and a total of 100 sample geometric boundaries are generated. Figure 5 Example diagrams of several sample geometric boundaries.
[0091] The sample flow field initial boundary condition uses the inlet velocity as the flow field parameter, and the 100 geometric boundaries use the inlet velocity of 1.0m / s, 1.5m / s, 2.0m / s, 2.5m / s, 4.0m / s, 5.0m / s, and 6.0m / s as the initial boundary conditions, and the sample flow field initial boundary condition matrix with the same size as the sample geometric boundary matrix is obtained. For example, when 1.0m / s is used as the initial boundary condition, the elements of the first column of the matrix are set to 1, and the element values of the remaining columns are all 0.
[0092] After obtaining the sample flow field initial boundary conditions and sample geometric boundaries, 700 groups of training samples are obtained by combining different sample flow field initial boundary conditions and sample geometric boundaries. For each group of training samples, LBM calculates the simulated flow field according to the sample flow field initial boundary conditions and sample geometric boundaries. As a specific embodiment, when performing LBM simulation, the tunnel wall and obstacle boundary conditions are set to no-slip boundaries, which are called standard rebound boundaries in LBM. The left side of the tunnel is the velocity inlet, which is realized by the Zou-He boundary in LBM. The right side is the free outlet, which is calculated using multi-relaxation LBM, and the number of iterations is set to 10,000 times.
[0093] In some embodiments, the optimizer used in the model is the Adam optimizer, which has the advantage of fast convergence speed. The learning rate is set to 1e-3.
[0094] In some embodiments, in order to avoid the gradient saturation phenomenon of the activation function due to excessive values, the data set is processed. Data normalization is used to scale the data while maintaining the original data distribution and map the original data to the interval [-1,1]. The specific processing method is as follows:
[0095]
[0096] In the formula, y max is the maximum value of the normalized interval (equal to 1 in this embodiment), y min is the minimum value of the normalized interval (equal to -1 in this example), x max is the maximum value of the original data, x min It is also the minimum value of the original data. x is the sample to be processed, and y is the sample obtained after processing.
[0097] In this embodiment, the lattice Boltzmann method is used to generate the true labels corresponding to the training samples, which can simplify the modeling and solving process and has strong parallel characteristics, thereby greatly reducing the time required to generate training samples and the corresponding true labels, and improving the training efficiency of the model.
[0098] In an embodiment of the present invention, the initial boundary condition matrix and geometric boundary matrix of the flow field are obtained by gridding the lanes for predicting the flow field. The initial boundary condition matrix and geometric boundary matrix of the flow field are used as input, and the flow field prediction model established based on the convolutional neural network is used to predict the downhole flow field to obtain the prediction result. Among them, the flow field prediction model includes a convolution module and a deconvolution module. The convolution module is used to extract features from the initial boundary condition matrix and the geometric boundary matrix of the flow field to obtain the extraction result. The deconvolution module is used to perform data processing on the extraction result to obtain the prediction result. The size of the prediction result is the same as the size of the initial matrix. The flow field prediction model provided by this method can adapt to wind window models of different positions and sizes in any lane, has a strong generalization ability, and improves the efficiency of downhole flow field prediction.
[0099] The beneficial effects of this method will be described below in conjunction with specific experimental results.
[0100] In order to test the generalization ability of the flow field prediction model provided by this method, 10 groups of test samples were generated by randomly combining rectangles and circles in the experiment. The geometric boundary size is 100×500, and the geometric boundaries of the 10 test sets are as follows: Figure 6 As shown. The test sample was constructed with an inlet velocity of 3.0 m / s as the flow field parameter, and the size of the initial boundary condition matrix of the flow field was 100×500. On a computer equipped with an Intel core i7-8750H processor, a single-core LBM simulation of 10 sets of prediction samples took a total of 3756 seconds. The flow field prediction model provided by this method was used to predict the flow field of 10 samples, which took a total of 1.43 seconds. On the same computer, the calculation speed was increased by 3 orders of magnitude, and the flow field prediction model provided by this method eliminated the parameter setting link required for LBM simulation.
[0101] According to the experimental results, the predicted flow fields of the 10 test samples obtained by this method are almost consistent with the LBM numerical simulation results in terms of morphology. First, the absolute error between the corresponding pixel points of the predicted velocity matrix and the numerical simulation velocity matrix was calculated, and the results were evaluated by the absolute error. The maximum absolute error between the predicted results and the numerical simulation results of the 10 groups of samples reached 12, but this was only large in a few points close to the front boundary of the obstacle, and the absolute error in most other areas was basically close to 0. This is because the flow field near the obstacle area suddenly shrinks, resulting in an increase in velocity, a violent flow field, and an increased difficulty in flow field prediction.
[0102] The evaluation indicators used in this experiment include: Mean Absolute Error (MAE), Mean Square Error (MSE), Root Mean Squared Error (RMSE), Mean Absolute Percentage Error (MAPE), R 2 Coefficient, Explained Variance Score (EVS), Pearson product-moment correlation coefficient (PPMCC) and cosine similarity. The EVS indicator measures the degree of fit of the model to the changes in the data set. The closer the EVS value is to 1, the stronger the prediction ability of the model. PPMCC can be used to reflect the similarity between two variables. The closer the PPMCC is to 1, the more similar the predicted value is to the true value. Cosine similarity is a distance function that measures the similarity between two vectors by the cosine value of the angle between them. The cosine value of a 0-degree angle is 1, indicating that the two vectors overlap in space. Therefore, the closer its value is to 1, the better the prediction effect.
[0103] The error analysis of the prediction results of 10 groups of test samples is carried out, and the error statistics are as follows: Figure 7 As shown. According to the error statistics, the overall MAE of the 10 groups of samples is below 0.23, and only sample 4, sample 6, and sample 8 have higher MAE. The average MAE of the 10 groups of samples is 0.23214, and such an error is very small compared to the velocity value in the flow field. By calculating the MSE between the predicted flow field and the numerically simulated flow field, it can be seen that the MSE of the 10 groups of samples, except for samples 4, 6, and 8, is less than 0.18, which shows that the difference between the predicted flow field and the numerically simulated flow field is small, and the degree of data change is not large. Since the predicted values of some points close to the front side of the obstacle in samples 4, 6, and 8 are far from the true values, the average error of the entire flow field has increased. In order to further evaluate the similarity between the predicted results and the numerical simulation results, the R between the two was calculated. 2 Coefficient. R of 10 samples 2 The coefficients are all greater than 0.9, and the average R 2 The coefficient reached 0.97, indicating that the predicted result is very close to the true value. 2The coefficients are 0.9597, 0.9509 and 0.9536 respectively. It can be proved that the prediction errors of a small number of points for samples 4, 6 and 8 are too high, resulting in large MAE and MSE, but the predicted flow fields of samples 4, 6 and 8 are very close to the numerical simulation flow fields as a whole. The EVS of the 10 groups of samples are all above 0.95, with an average value of 0.9787, indicating that the dispersion of the predicted values is very close to that of the LBM simulation values. The PPMCC of the 10 groups of samples reached a maximum of 0.99, and the average PPMCC was 0.9872. The Cosine similarity of the predicted samples, except for samples 6 and 8, exceeded 0.99, and the average value reached 0.9947. In summary, the downhole flow field prediction method based on convolutional neural network provided in this application realizes accurate prediction of the flow field and has strong generalization ability.
[0104] In the experiment, the velocity field of the prediction results obtained by this method was further compared with that of the LBM simulation results. The velocity values of each grid in the combined velocity field of the two were plotted as scatter plots for comparison, with a total of 50,000 data. Figure 8 As shown in the figure, the red points are the true values (Target value) and the blue points are the predicted values (Predict value). It can be seen that the area covered by the red points basically overlaps with the area covered by the blue points, indicating that the prediction results obtained by this method are very close to the LBM simulation results, and there are no particularly large outliers.
[0105] Fig. 9 The velocity distribution of 10 sets of prediction results (forecast data) and numerical simulation results (raw data) on the section x = 250. It can be seen that the prediction results obtained by this method are very close to the numerical simulation values in terms of both numerical values and flow pattern distribution.
[0106] Wind windows are commonly used ventilation structures in underground mines. Wind windows adjust the air volume in the tunnel where the wind windows are located by changing the opening area of the window. The rationality of air volume regulation has a direct impact on the entire mine ventilation system. The cross-sectional area of the wind window suddenly decreases, resulting in a sharp increase in flow velocity, which means that the wind window flow field is turbulent and difficult to predict.
[0107] The following wind window flow field experiment verifies the generalization ability of the flow field prediction model provided in this embodiment and the prediction effect on complex flow fields. The experimental model and equipment are introduced as follows: a tunnel model with a wind window inside was processed and manufactured. The model material uses a transparent acrylic plate, which has good light transmittance and low refractive index, and is suitable for optical speed measurement experimental equipment such as PIV. The tunnel size is 2200mm×110mm×110mm, and a wind window with a size of 40mm×100mm is set at 1200mm away from the wind inlet. It is assumed that the tunnel wall is smooth, and the roughness of the tunnel wall is not considered.
[0108] The inlet wind speed of the experimental model is 7m / s. 400 transient flow field images are collected using a CCD camera. After operations such as Average Correlation, Vector Masking, and Average Filter, velocity cloud maps and vector maps of the wind window flow field are generated, as shown in the figure. Fig.10a and Fig.10b As shown. In order to clearly compare the PIV experimental results with the prediction results obtained by the method provided in the embodiment of the present application, the prediction results obtained by the present method are cropped, and only the flow field behind the wind window is retained to keep it consistent with the coordinates of the PIV flow field results. The white part in the figure is the wind window. It can be seen that the wind window flow field of the PIV test and the flow field of the prediction result obtained by this method, when the air passes through the wind window, the cross-sectional area suddenly decreases, the velocity surges, and the wind speed flows at a higher speed to x = 300mm and begins to decay. After passing through the wind window, the fluid flows along the upper half of the tunnel. The wind speed value in the lower half of the flow field is lower because the fluid separates under the action of viscosity when passing through the wind window. From these points of view, the prediction results obtained by this method are very close to the PIV experimental results.
[0109] In order to further compare the agreement between the PIV experimental results and the prediction results obtained by this method, the velocity distributions on the sections x = 100 mm, x = 150 mm, and x = 200 mm were compared. Fig.11 As shown (in Fig.11 In order to facilitate description, CNN is used to characterize the flow field prediction model provided in this application). It can be seen that after the fluid passes through the wind window, the wind speed on the upper side of the tunnel is relatively large, indicating that the airflow flows close to the top plate. The prediction results obtained by this method on the three sections are close to the velocity peaks of the PIV experimental results. On the sections x=50mm and x=100mm, the maximum velocities are both around 18m / s. Due to the obstruction of the wind window, the velocity values behind the wind window have all been significantly reduced.
[0110] The streamline diagram of the PIV experimental test results is shown in Fig.12a, the wind flow separates after passing through the wind window, the streamline in the upper part of the tunnel is smooth, and the wind flow direction in the upper part does not change. The wind flow in the lower part forms a narrow and long recirculation zone, which is about 300mm long. Figure 12b The streamline diagram of the prediction results obtained by this method is shown. Similar to the PIV results, the streamlines of the prediction results obtained by this method also separated after passing through the wind window. The wind flow in the upper part did not change direction and flowed along the positive x direction. The wind flow in the lower part separated due to viscosity, resulting in a recirculation zone. The length of the recirculation zone is about 270 mm, which is slightly smaller than the recirculation zone of the PIV test results. However, the flow characteristics of the prediction results obtained by this method are similar to those of the PIV experimental results.
[0111] According to the above experiments, it can be proved that, in the first aspect, the prediction results obtained by the downhole flow field prediction method based on convolutional neural network provided by the embodiment of the present application are consistent with the LBM numerical simulation results. 2 , EVC, PPMCC and Cosinesimilarity are all close to 1. On a single CPU, the time consumption of this method is reduced by 3 orders of magnitude compared to the LBM simulation calculation time consumption, which shows that the method provided by this application not only has high prediction accuracy, but also consumes less time cost. On the second aspect, the prediction results obtained by the method provided by this application in the PIV windshield test experiment are close to the PIV experimental results, which proves that the flow field prediction model provided by this application has generalization ability. Compared with the experiment, the economic cost and time cost of the flow field prediction model provided by this application are very small, thereby verifying the feasibility and accuracy of the flow field prediction model provided by this application.
[0112] See also Fig.13 The embodiment of the present invention provides a downhole flow field prediction device 1300 based on a convolutional neural network, comprising:
[0113] A grid division module 1301 is used to perform grid division on the lanes of the flow field to be predicted, and obtain an initial matrix based on the grid division result, wherein each element of the initial matrix corresponds to a grid;
[0114] A construction module 1302 is used to construct a flow field initial boundary condition matrix based on the initial matrix, and to construct a geometric boundary matrix based on the initial matrix;
[0115] Prediction module 1303, used for inputting the flow field initial boundary condition matrix and the geometric boundary matrix into the flow field prediction model to perform flow field prediction and obtain prediction results;
[0116] Among them, the flow field prediction model includes a convolution module and a deconvolution module. The convolution module is used to perform feature extraction on the flow field initial boundary condition matrix and the geometric boundary matrix to obtain extraction results. The deconvolution module is used to perform data processing on the extraction results to obtain the prediction results. The size of the prediction results is the same as the size of the initial matrix.
[0117] Optionally, the construction module 1302 includes:
[0118] An acquisition unit, used for acquiring the flow field parameters of the lane whose flow field is to be predicted;
[0119] The processing unit is used to use the values of the flow field parameters in the grid as the values of the corresponding elements in the initial matrix to obtain the initial boundary condition matrix of the flow field.
[0120] Optionally, the flow field parameters are determined based on at least one of inlet velocity, pressure and Reynolds number.
[0121] Optionally, the flow field parameter is an inlet velocity, and the processing unit is specifically used for:
[0122] The value of the first column in the initial matrix is determined as the inlet velocity, and the values of other positions of the initial matrix except the first column are determined as 0, so as to obtain the initial boundary condition matrix of the flow field.
[0123] Optionally, the construction module 1302 includes:
[0124] A determination unit is used to determine the value of the element corresponding to the grid in the initial matrix to be 0 when the grid corresponds to the flow field area, and to determine the value of the element corresponding to the grid in the initial matrix to be 1 when the grid corresponds to the solid boundary, so as to obtain the geometric boundary matrix.
[0125] Optionally, the convolution module includes a first convolution layer, a second convolution layer and a third convolution layer connected in sequence, the number of convolution kernels of the first convolution layer is 100, and the convolution kernel size is 5×20, the number of convolution kernels of the second convolution layer is 400, and the convolution kernel size is 4×5, and the number of convolution kernels of the third convolution layer is 1600, and the convolution kernel size is 5×5;
[0126] The deconvolution module includes a first deconvolution layer, a second deconvolution layer, a third deconvolution layer and a fourth deconvolution layer connected in sequence, the number of convolution kernels of the first deconvolution layer is 400, and the convolution kernel size is 5×25, the number of convolution kernels of the second deconvolution layer is 100, and the convolution kernel size is 2×2, the number of convolution kernels of the third deconvolution layer is 50, and the convolution kernel size is 2×2, the number of convolution kernels of the fourth deconvolution layer is 2, and the convolution kernel size is 5×5.
[0127] Optionally, the downhole flow field prediction device 1300 based on convolutional neural network further includes:
[0128] A sample construction module, used to construct a plurality of training samples, each of which includes a sample flow field initial boundary condition matrix and a sample geometric boundary matrix;
[0129] A calculation module, used for calculating a simulated flow field according to the sample flow field initial boundary condition matrix and the sample geometric boundary matrix using a lattice Boltzmann method;
[0130] The training module is used to use the multiple training samples as training data, use the simulated flow fields corresponding to the training samples as real labels, and iteratively train the flow field prediction model to be trained to obtain the flow field prediction model.
[0131] The downhole flow field prediction device 1300 based on convolutional neural network provided in the embodiment of the present application can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated in this embodiment.
[0132] It should be noted that the division of units in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0133] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a processor-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0134] like Fig.14As shown, an embodiment of the present application provides an electronic device 1400, including: a memory 1402, a processor 1401, and a program stored in the memory 1402 and executable on the processor 1401; the processor 1401 is used to read the program in the memory 1402 to implement the steps in the downhole flow field prediction method based on convolutional neural network as described above.
[0135] An embodiment of the present application also provides a readable storage medium, on which a program is stored. When the program is executed by a processor, the various processes of the above-mentioned embodiment of the downhole flow field prediction method based on a convolutional neural network are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here. Among them, the readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disk, hard disk, magnetic tape, magneto-optical disk (MO), etc.), optical storage (such as compact disk (CD), digital video disc (DVD), Blu-ray Disc (BD), high-definition versatile disc (HVD), etc.), and semiconductor memory (such as read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read only memory (EEPROM), non-volatile memory (NAND FLASH), solid-state drive (Solid State Disk or Solid State Drive, SSD)), etc.
[0136] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0137] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), and includes a number of instructions for a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0138] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A downhole flow field prediction method based on convolutional neural network, characterized in that: include: Meshing the lanes for which the flow field is to be predicted, and obtaining an initial matrix based on the meshing result, wherein each element of the initial matrix corresponds to a mesh; constructing a flow field initial boundary condition matrix based on the initial matrix, and constructing a geometric boundary matrix based on the initial matrix; Inputting the flow field initial boundary condition matrix and the geometric boundary matrix into a flow field prediction model to perform flow field prediction and obtain a prediction result; Among them, the flow field prediction model includes a convolution module and a deconvolution module. The convolution module is used to perform feature extraction on the flow field initial boundary condition matrix and the geometric boundary matrix to obtain extraction results. The deconvolution module is used to perform data processing on the extraction results to obtain the prediction results. The size of the prediction results is the same as the size of the initial matrix.
2. The method according to claim 1, characterized in that: The step of constructing the initial boundary condition matrix of the flow field based on the initial matrix includes: Acquiring flow field parameters of the lane whose flow field is to be predicted; The values of the flow field parameters in the grid are used as the values of the corresponding elements in the initial matrix to obtain the initial boundary condition matrix of the flow field.
3. The method according to claim 2, characterized in that: The flow field parameters are determined based on at least one of an inlet velocity, a pressure, and a Reynolds number.
4. The method according to claim 2, characterized in that: The flow field parameter is the inlet velocity, and the values of the flow field parameters in the grid are used as the values of the corresponding elements in the initial matrix to obtain the initial boundary condition matrix of the flow field, including: The value of the first column in the initial matrix is determined as the inlet velocity, and the values of other positions of the initial matrix except the first column are determined as 0, so as to obtain the initial boundary condition matrix of the flow field.
5. The method according to claim 1, characterized in that: The step of constructing a geometric boundary matrix based on the initial matrix includes: When the grid corresponds to the flow field area, the value of the element corresponding to the grid in the initial matrix is determined to be 0. When the grid corresponds to the solid boundary, the value of the element corresponding to the grid in the initial matrix is determined to be 1 to obtain the geometric boundary matrix.
6. The method according to claim 1, characterized in that: The convolution module includes a first convolution layer, a second convolution layer and a third convolution layer connected in sequence, the number of convolution kernels of the first convolution layer is 100, and the convolution kernel size is 5×20, the number of convolution kernels of the second convolution layer is 400, and the convolution kernel size is 4×5, and the number of convolution kernels of the third convolution layer is 1600, and the convolution kernel size is 5×5; The deconvolution module includes a first deconvolution layer, a second deconvolution layer, a third deconvolution layer and a fourth deconvolution layer connected in sequence, the number of convolution kernels of the first deconvolution layer is 400, and the convolution kernel size is 5×25, the number of convolution kernels of the second deconvolution layer is 100, and the convolution kernel size is 2×2, the number of convolution kernels of the third deconvolution layer is 50, and the convolution kernel size is 2×2, the number of convolution kernels of the fourth deconvolution layer is 2, and the convolution kernel size is 5×5.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Constructing a plurality of training samples, each of the training samples comprising a sample flow field initial boundary condition matrix and a sample geometric boundary matrix; Using the lattice Boltzmann method, a simulated flow field is calculated based on the sample flow field initial boundary condition matrix and the sample geometric boundary matrix; The multiple training samples are used as training data, the simulated flow fields corresponding to the training samples are used as real labels, and the flow field prediction model to be trained is iteratively trained to obtain the flow field prediction model.
8. A downhole flow field prediction device based on convolutional neural network, characterized in that: include: A grid division module is used to grid the lanes of the flow field to be predicted, and obtain an initial matrix based on the grid division result, wherein each element of the initial matrix corresponds to a grid; A construction module, used to construct a flow field initial boundary condition matrix based on the initial matrix, and to construct a geometric boundary matrix based on the initial matrix; A prediction module, used for inputting the flow field initial boundary condition matrix and the geometric boundary matrix into a flow field prediction model to perform flow field prediction and obtain a prediction result; Among them, the flow field prediction model includes a convolution module and a deconvolution module. The convolution module is used to perform feature extraction on the flow field initial boundary condition matrix and the geometric boundary matrix to obtain extraction results. The deconvolution module is used to perform data processing on the extraction results to obtain the prediction results. The size of the prediction results is the same as the size of the initial matrix.
9. An electronic device, comprising: A memory, a processor, and a program stored in the memory and executable on the processor; wherein the processor is used to read the program in the memory to implement the steps in the downhole flow field prediction method based on a convolutional neural network as described in any one of claims 1 to 7.
10. A readable storage medium for storing a program, characterized in that: When the program is executed by a processor, the steps in the downhole flow field prediction method based on a convolutional neural network as described in any one of claims 1 to 7 are implemented.